Skip to content

CMAKE_<BUILD_TYPE>_POSTFIX spills into consuming project #171

@ferkulat

Description

@ferkulat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions