Skip to content

Conversation

@steve-downey
Copy link
Member

Add an optional name for the header set.
Add more search paths for, e.g., "beman.optional-config.cmake.in" than just infra/cmake, like the top-level or project level cmake directories.
The infra directory is shared infrastructure, and the project "in" file isn't.

# The prefix `<PREFIX>` is the uppercased name of the library with dots
# replaced by underscores.
#
set(options "")
Copy link
Member

Choose a reason for hiding this comment

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

I think this violates our own guidelines to not set single use variables -- shouldn't we just pass this in at line #44 or am I misunderstanding (entirely possible) the cmake here. And ARGN is the only external thing here.

Copy link
Member

Choose a reason for hiding this comment

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

oh maybe these are defaults if not set by cookie cutter or something? obviously I don't understand what this is doing so a comment might be helpful

Copy link
Member Author

Choose a reason for hiding this comment

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

Stringly typed confusables. There has to be something in those positions, and without names it's a bunch of empty strings?
As an alternative, though, I could add end of line comments. Or just inline the strings.

Copy link
Member Author

Choose a reason for hiding this comment

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

Stringly typed confusables. There has to be something in those positions, and without names it's a bunch of empty strings?
As an alternative, though, I could add end of line comments. Or just inline the strings.

NAMES "${package_name}-config.cmake.in"
PATHS "${CMAKE_CURRENT_SOURCE_DIR}"
PATHS
"${CMAKE_CURRENT_SOURCE_DIR}"
Copy link
Member

Choose a reason for hiding this comment

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

I recently had to fix an issue with this in take_before repo after repo had been initialized from examplar -- which put the cmake.in file into the src/ subtree. take_before was converted to an interface (aka header only) library so src/ was removed. config.cmake.in got moved to the root directory since the packaging cmake got moved there and these other options weren't available. Should we consider standardizing the location under /cmake directory?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that's the best place for it, and that's what the two new search paths do. Although it's possible only the PROJECT one is really needed? That handles the case where the project is vendored in and added by add_subdirectory.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that's the best place for it, and that's what the two new search paths do. Although it's possible only the PROJECT one is really needed? That handles the case where the project is vendored in and added by add_subdirectory.

@ednolan
Copy link
Member

ednolan commented Jan 4, 2026

I think this pull request is obsoleted by the following changes:

9f89e81

bemanproject/exemplar@bb523cc

The new standard is that your beman.myproject-config.cmake.in file must live in myproject/cmake/beman.myproject-config.cmake.in. That lets us support both header-only and source-based repos. I don't think we need to parameterize it anymore

@JeffGarland
Copy link
Member

I think this pull request is obsoleted by the following changes:

9f89e81

bemanproject/exemplar@bb523cc

The new standard is that your beman.myproject-config.cmake.in file must live in myproject/cmake/beman.myproject-config.cmake.in. That lets us support both header-only and source-based repos. I don't think we need to parameterize it anymore

That's good, but I don't think find_package is the correct construct there -- it should just be an include. Like this one:

https://github.com/bemanproject/take_before/blob/main/CMakeLists.txt#L42-L43

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.

4 participants