summaryrefslogtreecommitdiffstats
path: root/Modules/CheckVariableExists.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-02-25 18:12:02 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-02-25 18:12:02 (GMT)
commitb887bca6ee3651857be663fe1f2e2f2c1ed1ac1e (patch)
tree26a9d0ed2226fa86be6cbffe6ffbbd661c6a40b1 /Modules/CheckVariableExists.cmake
parent6e567cabea8df6f8fc8c401f4b9bfe2997c4399e (diff)
parent236133e79e2d047810eeba90915e38d9861e2a22 (diff)
downloadCMake-b887bca6ee3651857be663fe1f2e2f2c1ed1ac1e.zip
CMake-b887bca6ee3651857be663fe1f2e2f2c1ed1ac1e.tar.gz
CMake-b887bca6ee3651857be663fe1f2e2f2c1ed1ac1e.tar.bz2
Merge topic 'try_compile-targets'
236133e Handle targets in the LINK_LIBRARIES of try_compile. 1c0597c Add a new Export generator for IMPORTED targets. f2ab17d Keep track of all targets seen while evaluating a genex.
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 f9155a0..a21e65f 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}")