123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
- set(options )
- set(oneValueArgs CONFIGURATION )
- set(multiValueArgs LIBRARIES )
- cmake_parse_arguments(CEIT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
- if(CEIT_UNPARSED_ARGUMENTS)
- message(FATAL_ERROR "Unknown keywords given to CMAKE_EXPAND_IMPORTED_TARGETS(): \"${CEIT_UNPARSED_ARGUMENTS}\"")
- endif()
- if(NOT CEIT_CONFIGURATION)
-
-
-
-
- if(CMAKE_CONFIGURATION_TYPES)
- list(GET CMAKE_CONFIGURATION_TYPES 0 CEIT_CONFIGURATION)
- else()
- set(CEIT_CONFIGURATION ${CMAKE_BUILD_TYPE})
- endif()
- endif()
-
- set(_CCSR_REQ_LIBS ${CEIT_LIBRARIES})
- set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
- set(_CCSR_LOOP_COUNTER 0)
- while(_CHECK_FOR_IMPORTED_TARGETS)
- math(EXPR _CCSR_LOOP_COUNTER "${_CCSR_LOOP_COUNTER} + 1 ")
- set(_CCSR_NEW_REQ_LIBS )
- set(_CHECK_FOR_IMPORTED_TARGETS FALSE)
- foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
- if(TARGET "${_CURRENT_LIB}")
- get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS)
- else()
- set(_importedConfigs "")
- endif()
- if (_importedConfigs)
-
-
-
-
-
-
-
- if ("${_CCSR_LOOP_COUNTER}" LESS 100)
- set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
- endif ()
-
-
- list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse)
- if("${_configIndexToUse}" EQUAL -1)
- set(_configIndexToUse 0)
- endif()
- list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse)
- get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse})
- get_target_property(_linkInterfaceLibs "${_CURRENT_LIB}" IMPORTED_LINK_INTERFACE_LIBRARIES_${_importedConfigToUse} )
- list(APPEND _CCSR_NEW_REQ_LIBS "${_importedLocation}")
- if(_linkInterfaceLibs)
- foreach(_currentLinkInterfaceLib ${_linkInterfaceLibs})
- if(_currentLinkInterfaceLib)
- list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" )
- endif()
- endforeach()
- endif()
- else()
-
- list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
- endif()
- endforeach()
- set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} )
- endwhile()
-
-
- set(_CCSR_NEW_REQ_LIBS )
- foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
- if(TARGET "${_CURRENT_LIB}")
- get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS)
- else()
- set(_importedConfigs "")
- endif()
- if (NOT _importedConfigs)
- list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
- else ()
- endif ()
- endforeach()
- set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE)
- endfunction()
|