1.7 KiB
1.7 KiB
GenPkgConfig.cmake
A script generating pkg-config files.
WARNING: CMake is currently merging own built-in pkgconfig generation implementation!
If you require such a new version of CMake, you probably should use the built-in impl instead.
Syntax
configure_pkg_config_file(<targetName>
NAME <name of the pkgconfig package>
VERSION <version to be written into the package>
DESCRIPTION <description to be written into the package>
URL <homepage URL to be written into the package>
COMPONENT <install as the component>
INSTALL_LIB_DIR <path to something like CMAKE_INSTALL_LIBDIR>
INSTALL_INCLUDE_DIR <path to something like CMAKE_INSTALL_INCLUDEDIR>
REQUIRES ... <list of pkg-config packages this one depends on> ...
REQUIRES ... <list of pkg-config packages this one conflicts with> ...
)
Issuees
-
For
OBJECT
targets we have run into big issues. CMake- Doesn't allow to get the list of object files at configure time
- Allows to get a list of object files as a generator exression ...
- BUT ... the path to them is full, but we need only file name!
- CMake doesn't allow to strip directory path via generator expression
- ... neither it allows string editing within generator expressions ...
so ... we have to create a custom target using a custom CMake script executed separately, but ...
-
file(GENERATE
doesn't properly register dependencies ... so we have to useadd_custom_command
to say CMake that these files are generated -
And CMake
install(FILES
doesn't mean that the targets generating these files are automatically executed,
So we have to use
ALL
inadd_custom_target
.