mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 02:09:01 +08:00
31 lines
1.1 KiB
CMake
31 lines
1.1 KiB
CMake
|
|
cmake_minimum_required(VERSION 3.2.0)
|
|
|
|
function(split_library_configurations LIBRARIES OPTIMIZED_OUT_VAR DEBUG_OUT_VAR GENERAL_OUT_VAR)
|
|
set(OPTIMIZED_LIBRARIES)
|
|
set(DEBUG_LIBRARIES)
|
|
set(GENERAL_LIBRARIES)
|
|
|
|
set(CURRENT_TYPE)
|
|
foreach(LIBRARY ${LIBRARIES})
|
|
message(STATUS "LIB ${LIBRARY}:")
|
|
if("${LIBRARY}" STREQUAL "optimized" OR "${LIBRARY}" STREQUAL "debug" OR "${LIBRARY}" STREQUAL "general")
|
|
set(CURRENT_TYPE "${LIBRARY}")
|
|
message(STATUS "SET CURRENT_TYPE: ${CURRENT_TYPE}")
|
|
else()
|
|
message(STATUS "ADD TO ${CURRENT_TYPE}")
|
|
if("${CURRENT_TYPE}" STREQUAL "optimized")
|
|
list(APPEND OPTIMIZED_LIBRARIES "${LIBRARY}")
|
|
elseif("${CURRENT_TYPE}" STREQUAL "debug")
|
|
list(APPEND DEBUG_LIBRARIES "${LIBRARY}")
|
|
else()
|
|
list(APPEND GENERAL_LIBRARIES "${LIBRARY}")
|
|
endif()
|
|
set(CURRENT_TYPE)
|
|
endif()
|
|
endforeach()
|
|
|
|
set(${OPTIMIZED_OUT_VAR} "${OPTIMIZED_LIBRARIES}" PARENT_SCOPE)
|
|
set(${DEBUG_OUT_VAR} "${DEBUG_LIBRARIES}" PARENT_SCOPE)
|
|
set(${GENERAL_OUT_VAR} "${GENERAL_LIBRARIES}" PARENT_SCOPE)
|
|
endfunction() |