[CMake] Unable to set configuration name with a hyphen char

Alex Iljin piroxiljin at gmail.com
Thu Jun 18 14:19:31 EDT 2015


Hi.

I try to set a custom configurations like "Debug-Demo" and "Release-Demo".

I had used a snippet from wiki:
http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_specify_my_own_configurations_.28for_generators_that_allow_it.29_.3F
with additional modifying DEBUG_CONFIGURATIONS, because the "Debug-Demo"
configuration should be linked with debug version of libraries.

if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Debug Release Debug-Demo Release-Demo)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
"Reset the configurations to what we need"
FORCE)
set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS "Debug;Debug-Demo")
endif()

But what I got is bunch of errors at generation time.
CMake Error: Error evaluating generator expression: $<CONFIG:DEBUG-DEMO>

If I delete the "set_property" line, I get Debug-Demo configuration which
is kind of optimized configuration (as default).

So, does I have missed some notes about using a hyphen chars in
configuration names, or is it a bug in the cmake?

Alexander Iljin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150619/192447ce/attachment.html>


More information about the CMake mailing list