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

CMAKE_<BUILD_TYPE>_POSTFIX spills into consuming project #171

Open
ferkulat opened this issue Oct 6, 2023 · 1 comment
Open

CMAKE_<BUILD_TYPE>_POSTFIX spills into consuming project #171

ferkulat opened this issue Oct 6, 2023 · 1 comment

Comments

@ferkulat
Copy link

ferkulat commented Oct 6, 2023

When celero is added to a project as dependency via FetchContent and built in the consuming project build,
celeros explicit setting of CMAKE_<BUILD_TYPE>_POSTFIX spills into the consuming project.
This leads to library names added "-d" in debug mode. Which is not always wanted.

If those lines are needed, I would like to suggest putting it behind a cmake option for those who don't want this.
For example like

option(CELERO_SET_LIBRARY_POSTFIX "Set OFF to prevent celero setting cache variables for CMAKE_<BUILDTYPE>_POSTFIX." ON)

if(CELERO_SET_LIBRARY_POSTFIX)
	set(CMAKE_DEBUG_POSTFIX          "-d" CACHE STRING "add a postfix, usually d on windows")
	set(CMAKE_RELEASE_POSTFIX        "" CACHE STRING "add a postfix, usually empty on windows")
	set(CMAKE_RELWITHDEBINFO_POSTFIX "-rd" CACHE STRING "add a postfix, usually empty on windows")
	set(CMAKE_MINSIZEREL_POSTFIX     "" CACHE STRING "add a postfix, usually empty on windows")
endif()
ferkulat added a commit to ferkulat/Celero that referenced this issue Oct 6, 2023
…UILD_TYPE>_POSTFIX

setting in cache might spill it into a consuming project, when
celero is added via FetchContent.
@ferkulat
Copy link
Author

ferkulat commented Oct 6, 2023

I see v2.9.0 might contain breaking changes.
That's why I would like to see this fix in a v2.8.X version.
Shall I make a pull request to branch "develop" instead?

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

No branches or pull requests

1 participant