-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the quality of the CMake build scripts #230
base: main
Are you sure you want to change the base?
Conversation
Hmm, I thought about the pkgconfig code and it's actually not quite right as it is now either. The problem with generating a pkgconfig file via CMake is that it does not fit the model of CMake. The As a clarification: the case where the user is installing with |
You are correct. The project doesn't use the normal test mechanisms for whatever reason. compile-time-regular-expressions/tests/CMakeLists.txt Lines 1 to 10 in b51d329
Note the lack of |
b3e6b6c
to
c208343
Compare
c208343
to
21cf415
Compare
I cleaned up things around the CPack config and pkgconfig. The CPack config with the project specific defaults is configured to the The .pc file now uses the configure time |
@friendlyanon Will do 💯 |
This commit does a couple changes: * Actually adheres to the declared CMake 3.8 requirement * HOMEPAGE_URL in project() was added in 3.12 * install(TARGETS) requires the DESTINATION argument * Tests' CML uses CONFIGURE_DEPENDS from CMake 3.12 * Removes unnecessary things * Looking for RPM and DEB packagers is pointless * Misc arguments to CMake commands * Improves correctness * Includes CPack and CTest modules only if top level * Assigns install rules to a project specific component to not clobber the global, `Unspecified` one * Adds a warning guard for projects that vendor ctre * CMAKE_INSTALL_PREFIX should be set at configure time if the person building wants .pc files, so attempt to detect that error * Enables the install rules to be opt-out using the CMake built-in variable * Emulates ARCH_INDEPENDENT for the version config * Installs headers to their own directory (fixes hanickadot#207) * Use CTest for testing * Small optimization * LANGUAGES can be set to NONE, because this is a header only library
The problem with generating a pkgconfig file via CMake is that it does not fit the model of CMake. The `prefix` variable has to be absolute in the .pc file, however CMake deals with paths relative to the prefix. The final prefix can change at all times, via `CMAKE_INSTALL_PREFIX`, `--prefix` parameter during install time, at CPack time and the resulting deb/rpm files can be extracted anywhere as well. If one needs a pkgconfig file for packaging purposes, both deb and rpm CPack generators allow the user to add post-install scripts that can generate it if necessary.
21cf415
to
c7270f0
Compare
This commit does a couple changes:
the global,
Unspecified
onebuilding wants .pc files, so attempt to detect that error
variable