summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-01-01 20:02:47 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-01-01 20:02:47 (GMT)
commit5e48ccac35327927f137d99bb3ce20b2522e2aeb (patch)
tree75fbdcd918956a625a4774007800dd46000e69b9 /Modules
parent6d5c4370450fa34afb754ca2fdef79ee71ab9d99 (diff)
downloadCMake-5e48ccac35327927f137d99bb3ce20b2522e2aeb.zip
CMake-5e48ccac35327927f137d99bb3ce20b2522e2aeb.tar.gz
CMake-5e48ccac35327927f137d99bb3ce20b2522e2aeb.tar.bz2
Add a way to add custom libraries to the mix. Also add status reporting
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CheckVariableExists.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index b6e3a78..9648964 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -8,15 +8,23 @@
MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_VARIABLE_DEFINITIONS -DCHECK_VARIABLE_EXISTS=${VAR})
+ MESSAGE(STATUS "Looking for ${VARIABLE}")
+ IF(CMAKE_REQUIRED_LIBRARIES)
+ SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
+ "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+ ENDIF(CMAKE_REQUIRED_LIBRARIES)
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckVariableExists.c
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}")
+ MESSAGE(STATUS "Looking for ${VARIABLE} - found")
ELSE(${VARIABLE})
SET(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
+ MESSAGE(STATUS "Looking for ${VARIABLE} - not found")
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log
"Determining if the variable ${VAR} exists failed with the following output:\n"
"${OUTPUT}\n" APPEND)