I try to install the required system libraries (msvcp140d.dll, ucrtbasedd.dll...) for debug configuration only. In release configuration I want to install none of these, neither the normal version nor the debug version.
I tried the following and figured out that it doesn't work because the if is evaluated at generation time and the generator expression is evaluated at build time
if($<CONFIG:Debug>)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
set(CMAKE_INSTALL_OPENMP_LIBRARIES TRUE)
set(CMAKE_INSTALL_DEBUG_LIBRARIES TRUE)
set(CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY TRUE)
include (InstallRequiredSystemLibraries)
endif()
Furthermore I tried to modify the value of the set function with the generator expression but it didn't work. I couldn't find information about when the value is evaluated
set(CMAKE_INSTALL_UCRT_LIBRARIES $<IF$<CONFIG:Debug>:,TRUE,FALSE>)
set(CMAKE_INSTALL_OPENMP_LIBRARIES $<IF$<CONFIG:Debug>:,TRUE,FALSE>)
set(CMAKE_INSTALL_DEBUG_LIBRARIES $<IF$<CONFIG:Debug>:,TRUE,FALSE>)
set(CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY $<IF$<CONFIG:Debug>:,TRUE,FALSE>)
include (InstallRequiredSystemLibraries)
I expected that the required system libraries would not be installed in the release configuration
I try to install the required system libraries (msvcp140d.dll, ucrtbasedd.dll...) for debug configuration only. In release configuration I want to install none of these, neither the normal version nor the debug version.
I tried the following and figured out that it doesn't work because the if is evaluated at generation time and the generator expression is evaluated at build time
if($<CONFIG:Debug>)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
set(CMAKE_INSTALL_OPENMP_LIBRARIES TRUE)
set(CMAKE_INSTALL_DEBUG_LIBRARIES TRUE)
set(CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY TRUE)
include (InstallRequiredSystemLibraries)
endif()
Furthermore I tried to modify the value of the set function with the generator expression but it didn't work. I couldn't find information about when the value is evaluated
set(CMAKE_INSTALL_UCRT_LIBRARIES $<IF$<CONFIG:Debug>:,TRUE,FALSE>)
set(CMAKE_INSTALL_OPENMP_LIBRARIES $<IF$<CONFIG:Debug>:,TRUE,FALSE>)
set(CMAKE_INSTALL_DEBUG_LIBRARIES $<IF$<CONFIG:Debug>:,TRUE,FALSE>)
set(CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY $<IF$<CONFIG:Debug>:,TRUE,FALSE>)
include (InstallRequiredSystemLibraries)
I expected that the required system libraries would not be installed in the release configuration
Share Improve this question asked Mar 13 at 7:10 Kevin HaybachKevin Haybach 331 silver badge3 bronze badges1 Answer
Reset to default 0What works is to add set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
and use install with configurations.
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ${sensor_modules_tps_rxg_installation_dir})
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
set(CMAKE_INSTALL_OPENMP_LIBRARIES TRUE)
set(CMAKE_INSTALL_DEBUG_LIBRARIES TRUE)
set(CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY TRUE)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include (InstallRequiredSystemLibraries)
install (
FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
DESTINATION ${sensor_modules_tps_rxg_installation_dir}
CONFIGURATIONS Debug
)
I'm not fully happy with this solution as I would prefer to manage the sets independently e.g. (CMAKE_INSTALL_OPENMP_LIBRARIES, CMAKE_INSTALL_UCRT_LIBRARIES) based on the configuration
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744715923a4589616.html
评论列表(0条)