dichotomize multiconfig generators

This commit is contained in:
Maxime Gimeno 2021-04-02 14:30:02 +02:00
parent 16ee70bb12
commit c5ebd7c88e
1 changed files with 16 additions and 4 deletions

View File

@ -47,7 +47,19 @@ if( NOT GMP_in_cache )
DOC "Path to the Debug GMP library" DOC "Path to the Debug GMP library"
) )
if(NOT GMP_LIBRARY_DEBUG)
set(GMP_LIBRARY_DEBUG ${GMP_LIBRARY_RELEASE})
endif()
get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(IS_MULTI_CONFIG)
set(GMP_LIBRARIES $<IF:$<CONFIG:Debug>,${GMP_LIBRARY_DEBUG},${GMP_LIBRARY_RELEASE}>) set(GMP_LIBRARIES $<IF:$<CONFIG:Debug>,${GMP_LIBRARY_DEBUG},${GMP_LIBRARY_RELEASE}>)
else()
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(GMP_LIBRARIES ${GMP_LIBRARY_DEBUG})
else()
set(GMP_LIBRARIES ${GMP_LIBRARY_RELEASE})
endif()
endif()
if ( GMP_LIBRARIES ) if ( GMP_LIBRARIES )
get_filename_component(GMP_LIBRARIES_DIR ${GMP_LIBRARIES} PATH CACHE ) get_filename_component(GMP_LIBRARIES_DIR ${GMP_LIBRARIES} PATH CACHE )
endif() endif()