Do not set EXTERNAL_INCLUDE_COMMANDS in rsc/rst.pc.in by default
The external include commands are not needed by default and are workarounds for external problems. Additionally it doesn't work with the PKG_CONFIG_SYSROOT_DIR option of pkg-config which is useful when cross compiling packages.
#2 Updated by S. Herbrechtsmeier almost 11 years ago
Arne Nordmann wrote:
Are the external problems that you mention missing pc files of the dependencies? Or is there more?
Normally you don't need external include paths. They are only needed if you links again code with is not in the default paths. Therefore they should not be needed by default. Especially should the paths not include the current PKG_CONFIG_SYSROOT_DIR as this is add dynamically to -I and -L flags by pkg-config.
#3 Updated by S. Herbrechtsmeier over 10 years ago
I have investigated the problem more and it comes from the CMake usage of libraries. It always use absolute paths but this is not common in pc files on standard installation (/usr/lib). They should only use -L and -I for the path and -lname for the library name. Additionally pkg-config eliminate the -L and -I option for the default paths. The pkg-config tool prepends the PKG_CONFIG_SYSROOT_DIR to all -L and -I paths and thereby simplify the cross compiling on different places. CMake only supports updating of paths via find_xxx functions. Therefore it would be the best if the ProjectConfig.cmake file use find_module to determine the absolute library and include path of the depends during compile time or use find_file on all paths which allows the cross compiler to manipulate the paths.