summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2024-07-18 00:55:31 +0200
committerSlávek Banko <slavek.banko@axis.cz>2024-07-18 01:17:04 +0200
commitfab0f33de434fbd293daf2142bfec04f403585a6 (patch)
treefc5fa1c2582f835b82397f952d13867902b15776
parent6ec646b0061e72276ddbd247eb7ea7369bf77e96 (diff)
downloadtde-cmake-fab0f33de434fbd293daf2142bfec04f403585a6.tar.gz
tde-cmake-fab0f33de434fbd293daf2142bfec04f403585a6.zip
tde_import: Always do 'include' because macro can be called in a scope that is not global.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--modules/TDEMacros.cmake12
1 files changed, 9 insertions, 3 deletions
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()