: Release>" mean in cmake? In buildem_cmake_recipe.cmake, I saw an expression: externalproject_add_step(${_na...">

What does "$ <$ <CONFIG: Debug>: Release>" mean in cmake?

In buildem_cmake_recipe.cmake, I saw an expression:

    externalproject_add_step(${_name} BuildOtherConfig
                        COMMAND ${CMAKE_COMMAND} --build ${BINARY_DIR} --config "$<$<CONFIG:Debug>:Release>$<$<CONFIG:Release>:Debug>" --target INSTALL
                        DEPENDEES install
                        )

What does $<$<CONFIG:Debug>:Release>$<$<CONFIG:Release>:Debug>it mean here?

+4
source share
2 answers

This is a CMake expression. You can follow the link for a full discussion of what it is and what they can do. In short, this is a piece of text that CMake will evaluate when generating time (when it processed all the CMakeLists and generated the assembly); it can evaluate a different value for each configuration.

The one you have means something like this (pseudo-code):

if current_configuration == "Debug"
  output "Release"
if current_configureation == "Release"
  output "Debug"

, Debug, Release. Release, Debug. , "BuildOtherConfig", .


, :

$<CONFIG:Debug>

1, Debug .

$<1:X>

X.

$<0:X>

( ).

, $<$<CONFIG:Debug>:Release>. Debug, :

$<$<CONFIG:Debug>:Release>
$<1:Release>
Release

Debug, :

$<$<CONFIG:Debug>:Release>
$<0:Release>
+9

, $<...>, , CMake 2.8. , , , CMake.

$<$<CONFIG:Debug>:Release>

"Release", Debug.

0

Source: https://habr.com/ru/post/1621935/


All Articles