Skip to content
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

Support more generator expressions in output directories #515

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nopey
Copy link
Contributor

@Nopey Nopey commented May 9, 2024

Allows output directories that contain a few more generator expressions than just $<CONFIG>.

Useful if your binary output path contains something like $<$<CONFIG:Debug>:dbg>, which expands to "dbg" when building for Debug, and empty string otherwise.

TODO: Add tests

# $<0:true-string> ->
string(REGEX REPLACE "\\\$<0:([^>]*)>" "" genex "${genex}")
# $<IF:1,true-string,false-string> -> true-string
string(REGEX REPLACE "\\\$<IF:1,([^>,]*),([^>]*)>" "\\1" genex "${genex}")
Copy link
Collaborator

@jschwe jschwe May 9, 2024

Choose a reason for hiding this comment

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

Perhaps we could use the cmake raw strings feature, so that you don't need all these escapes: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#bracket-argument

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.

None yet

2 participants