summaryrefslogtreecommitdiff
path: root/Modules/CheckVariableExists.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CheckVariableExists.cmake')
-rw-r--r--Modules/CheckVariableExists.cmake7
1 files changed, 2 insertions, 5 deletions
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index f9155a014..a21e65f26 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -26,7 +26,6 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
@@ -35,10 +34,8 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
"-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "Looking for ${VAR}")
if(CMAKE_REQUIRED_LIBRARIES)
- # this one translates potentially used imported library targets to their files on disk
- CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
- "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
+ LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
else()
set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES)
endif()
@@ -46,8 +43,8 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckVariableExists.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_VARIABLE_EXISTS_ADD_LIBRARIES}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_VARIABLE_DEFINITIONS}
- "${CHECK_VARIABLE_EXISTS_ADD_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT)
if(${VARIABLE})
set(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")