Skip to content

Conversation

@steve-downey
Copy link
Member

This changes the install and include directory strategy to use FILE_SETs with type HEADERS.
Moves the creation of the targets and named header file sets upward so they exist in order to add the files locally in the src and include directories. Change the installs to use components so we can install just the necessary headers and not the empty library.

Also make the option to build headers named for the project so it doesn't affect other included projects.

Exclude google from all so it doesn't get installed for the "all" component.

Remove the cmake export install, at least for now. It was not working correctly. It's probably not strictly necessary for vcpkg or conan integration.

Create named file sets and use those for installation. Exclude tests from
installation, and the empty static library. Use a project prefixed name to
enable or disable tests, and default to building tests if this is the top
level project.
Further CML lint
${PROJECT_IS_TOP_LEVEL}
)

# Build the tests if enabled via the option OPTIONAL26_ENABLE_TESTING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remind me why BUILD_TESTING is not enough/OK ?

The Beman Standard specify to have BUILD_TESTING.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't compose. Best practice for Cmake is to prefix options with the project they apply to, and to default the value to true for a top level project.

Patten documented in Professional CMake.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that it's the best practice from CMake docs, but I would expect to first make a PR in the Beman Standard.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fortunately, it's a recommendation, but I'll PR that, now that I've seen it. But since this actually breaks trying to compose this into another beman project, it would be nice to fix it now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JeffGarland should we make it a requirement?

@steve-downey
Copy link
Member Author

steve-downey commented Nov 9, 2024 via email

@steve-downey steve-downey merged commit 9847480 into bemanproject:main Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants