Skip to content

A clean and modern CMake build system #115

@dg0yt

Description

@dg0yt

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions