diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index 408f87b..3556731 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -880,14 +880,20 @@ macro( tde_import _library ) set( TDE_IMPORT_${_library} "build" CACHE INTERNAL "Library ${_library} activated for build" ) else() if( EXISTS "${TDE_CMAKE_DIR}/${_library}.cmake" ) - include( "${TDE_CMAKE_DIR}/${_library}.cmake" ) + set( tde_import_include "${TDE_CMAKE_DIR}/${_library}.cmake" ) elseif( EXISTS "${TQT_CMAKE_DIR}/${_library}.cmake" ) - include( "${TQT_CMAKE_DIR}/${_library}.cmake" ) + set( tde_import_include "${TQT_CMAKE_DIR}/${_library}.cmake" ) else() tde_message_fatal( "'${_library}' is required, but is not installed nor selected for build" ) endif() + include( "${tde_import_include}" ) message( STATUS "Checking for '${_library}' - ok, found import file" ) - set( TDE_IMPORT_${_library} "import" CACHE INTERNAL "Library ${_library} imported" ) + set( TDE_IMPORT_${_library} "import:${tde_import_include}" CACHE INTERNAL "Library ${_library} imported" ) + endif() + else() + if( "${TDE_IMPORT_${_library}}" MATCHES "^import:" ) + string( REGEX REPLACE "^import:" "" tde_import_include "${TDE_IMPORT_${_library}}" ) + include( "${tde_import_include}" ) endif() endif() endmacro()