Warning, /libraries/kdb/cmake/modules/SelectLibraryConfigurations.cmake is written in an unsupported language. File is not indexed.
0001 # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
0002 # file Copyright.txt or https://cmake.org/licensing for details.
0003
0004 #.rst:
0005 # SelectLibraryConfigurations
0006 # ---------------------------
0007 #
0008 #
0009 #
0010 # select_library_configurations( basename )
0011 #
0012 # This macro takes a library base name as an argument, and will choose
0013 # good values for basename_LIBRARY, basename_LIBRARIES,
0014 # basename_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE depending on what
0015 # has been found and set. If only basename_LIBRARY_RELEASE is defined,
0016 # basename_LIBRARY will be set to the release value, and
0017 # basename_LIBRARY_DEBUG will be set to basename_LIBRARY_DEBUG-NOTFOUND.
0018 # If only basename_LIBRARY_DEBUG is defined, then basename_LIBRARY will
0019 # take the debug value, and basename_LIBRARY_RELEASE will be set to
0020 # basename_LIBRARY_RELEASE-NOTFOUND.
0021 #
0022 # If the generator supports configuration types, then basename_LIBRARY
0023 # and basename_LIBRARIES will be set with debug and optimized flags
0024 # specifying the library to be used for the given configuration. If no
0025 # build type has been set or the generator in use does not support
0026 # configuration types, then basename_LIBRARY and basename_LIBRARIES will
0027 # take only the release value, or the debug value if the release one is
0028 # not set.
0029
0030 # This macro was adapted from the FindQt4 CMake module and is maintained by Will
0031 # Dicharry <wdicharry@stellarscience.com>.
0032
0033 macro( select_library_configurations basename )
0034 if(NOT ${basename}_LIBRARY_RELEASE)
0035 set(${basename}_LIBRARY_RELEASE "${basename}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library.")
0036 endif()
0037 if(NOT ${basename}_LIBRARY_DEBUG)
0038 set(${basename}_LIBRARY_DEBUG "${basename}_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "Path to a library.")
0039 endif()
0040
0041 if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
0042 NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE AND
0043 ( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) )
0044 # if the generator supports configuration types or CMAKE_BUILD_TYPE
0045 # is set, then set optimized and debug options.
0046 set( ${basename}_LIBRARY "" )
0047 foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
0048 list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
0049 endforeach()
0050 foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
0051 list( APPEND ${basename}_LIBRARY debug "${_libname}" )
0052 endforeach()
0053 elseif( ${basename}_LIBRARY_RELEASE )
0054 set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
0055 elseif( ${basename}_LIBRARY_DEBUG )
0056 set( ${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG} )
0057 else()
0058 set( ${basename}_LIBRARY "${basename}_LIBRARY-NOTFOUND")
0059 endif()
0060
0061 set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
0062
0063 if( ${basename}_LIBRARY )
0064 set( ${basename}_FOUND TRUE )
0065 endif()
0066
0067 mark_as_advanced( ${basename}_LIBRARY_RELEASE
0068 ${basename}_LIBRARY_DEBUG
0069 )
0070 endmacro()