aboutsummaryrefslogtreecommitdiff
path: root/ports/vtk/SplitLibraryConfigurations.cmake
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2017-09-21 12:22:00 -0700
committerGitHub <noreply@github.com>2017-09-21 12:22:00 -0700
commitfac96eb344a500405ab65b7e7f3755af0ad00b7e (patch)
treef9e3376ca1a8f2de408e087e42ae393f224d6c42 /ports/vtk/SplitLibraryConfigurations.cmake
parent46db0f03fcb42d9f738474885fda372160362e44 (diff)
parent1bbce1ee844262647f994afd5f31da12d938e7ee (diff)
downloadvcpkg-fac96eb344a500405ab65b7e7f3755af0ad00b7e.tar.gz
vcpkg-fac96eb344a500405ab65b7e7f3755af0ad00b7e.zip
Merge branch 'master' into master
Diffstat (limited to 'ports/vtk/SplitLibraryConfigurations.cmake')
-rw-r--r--ports/vtk/SplitLibraryConfigurations.cmake28
1 files changed, 28 insertions, 0 deletions
diff --git a/ports/vtk/SplitLibraryConfigurations.cmake b/ports/vtk/SplitLibraryConfigurations.cmake
new file mode 100644
index 000000000..fc4d87ec8
--- /dev/null
+++ b/ports/vtk/SplitLibraryConfigurations.cmake
@@ -0,0 +1,28 @@
+
+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})
+ if("${LIBRARY}" STREQUAL "optimized" OR "${LIBRARY}" STREQUAL "debug" OR "${LIBRARY}" STREQUAL "general")
+ set(CURRENT_TYPE "${LIBRARY}")
+ else()
+ 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() \ No newline at end of file