# 2009-2010 Ryan Pavlik # http://academic.cleardefinition.com/ # Iowa State University HCI Graduate Program/VRAC # # Will set: # MYPACKAGE_LIBRARIES # MYPACKAGE_MYLIB1_LIBRARIES # MYPACKAGE_MYLIB2_LIBRARIES # MYPACKAGE_INCLUDE_DIRS # MYPACKAGE_RUNTIME_LIBRARIES and MYPACKAGE_RUNTIME_LIBRARY_DIRS if applicable # MYPACKAGE_FOUND set(MYPACKAGE_INCLUDE_DIRS "@CMAKE_CURRENT_SOURCE_DIR@") include("@CMAKE_CURRENT_BINARY_DIR@/mypackage-targets.cmake") set(MYPACKAGE_LIBRARIES) set(MYPACKAGE_RUNTIME_LIBRARIES) set(MYPACKAGE_RUNTIME_LIBRARY_DIRS) foreach(_lib MyLib1 MyLib2) set(_explib mypackage_buildtree_${_lib}) # The exported target name string(TOUPPER MYPACKAGE_${_lib}_LIBRARIES _libvar) # Upper case variable name set(${_libvar} ${_explib}) list(APPEND MYPACKAGE_LIBRARIES ${_explib}) # Runtime library info - only useful for shared libraries get_property(_type TARGET ${_explib} PROPERTY TYPE) if(_type STREQUAL "SHARED_LIBRARY") get_property(_configs TARGET ${_explib} PROPERTY IMPORTED_CONFIGURATIONS) foreach(_config ${_configs}) get_property(_libloc TARGET ${_explib} PROPERTY IMPORTED_LOCATION_${_config}) if(EXISTS "${_libloc}") list(APPEND MYPACKAGE_RUNTIME_LIBRARIES "${_libloc}") get_filename_component(_libpath "${_libloc}" PATH) list(APPEND MYPACKAGE_RUNTIME_LIBRARY_DIRS ${_libpath}) endif() endforeach() endif() endforeach() if(MYPACKAGE_RUNTIME_LIBRARIES) list(REMOVE_DUPLICATES MYPACKAGE_RUNTIME_LIBRARIES) endif() if(MYPACKAGE_RUNTIME_LIBRARY_DIRS) list(REMOVE_DUPLICATES MYPACKAGE_RUNTIME_LIBRARY_DIRS) endif() set(MYPACKAGE_FOUND ON)