我的问题与CMake : Changing name of Visual Studio and Xcode exectuables depending on configuration in a project generated by CMake非常相似。在那篇文章中,输出文件名将根据项目配置(调试,发布等)进行更改。我想走得更远。当我知道项目的配置时,我想告诉可执行程序根据项目配置链接不同的库名称。我想知道在CMake中是否有一个变量可以告诉项目配置。如果存在这样一个变量,我的任务将变得更加容易:CMake中的项目构建配置
if (Project_Configure_Name STREQUAL "Debug")
#do some thing
elseif (Project_Configure_Name STREQUAL "Release")
#do some thing
endif()
这对于多配置目标(Visual Studio,xcode等)不适用, – ltjax