This is a summary of points for discussion about improving the CMake build system.
- Do actually export config.
The current config is written like a find module (legacy: inspecting the system), instead of using build-time information (modern: export from the build).
- Do not build static and shared libs in the same time.
This looks familiar for users of autotools, but it comes with a price: It adds complexity, including additional user-facing variables. Users must select the matching target name even if they just build a single config. It requires a different name for MSVC import libs, currently breaking the unmodified pc files. ...
- Add aliases of the exported targets, for embedding the PCRE2 build via
add_directory.
- Document the canonical CMake config usage.
- Add a post-install usage test to CI.
- Follow widely used CMake style.
lower_case(commands). Don't repeat condition in else() and endif(). Less whitespace.
References to previous discussion:
Who uses the CMake build system?
- vcpkg. Apart from avoiding slow autotools builds on Windows, the default configurations build for release and debug, for the benefit of Visual Studio users.
- (I can add more here base on comments.)
This is a summary of points for discussion about improving the CMake build system.
The current config is written like a find module (legacy: inspecting the system), instead of using build-time information (modern: export from the build).
This looks familiar for users of autotools, but it comes with a price: It adds complexity, including additional user-facing variables. Users must select the matching target name even if they just build a single config. It requires a different name for MSVC import libs, currently breaking the unmodified pc files. ...
add_directory.lower_case(commands). Don't repeat condition inelse()andendif(). Less whitespace.References to previous discussion:
Who uses the CMake build system?