summaryrefslogtreecommitdiffstats
path: root/Modules/CheckFunctionExists.cmake
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-01-01 20:02:20 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-01-01 20:02:20 (GMT)
commit6d5c4370450fa34afb754ca2fdef79ee71ab9d99 (patch)
tree9b3b0fdfe1fd7e94a2db560a503256198ce9e428 /Modules/CheckFunctionExists.cmake
parentfe6721af84a5ec31f1b185fce1f6024a5d9c7e20 (diff)
downloadCMake-6d5c4370450fa34afb754ca2fdef79ee71ab9d99.zip
CMake-6d5c4370450fa34afb754ca2fdef79ee71ab9d99.tar.gz
CMake-6d5c4370450fa34afb754ca2fdef79ee71ab9d99.tar.bz2
Add a way to add custom libraries to the mix
Diffstat (limited to 'Modules/CheckFunctionExists.cmake')
-rw-r--r--Modules/CheckFunctionExists.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index 1ab1ad3..0e830f6 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -10,10 +10,15 @@ MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS -DCHECK_FUNCTION_EXISTS=${FUNCTION})
MESSAGE(STATUS "Looking for ${FUNCTION}")
+ IF(CMAKE_REQUIRED_LIBRARIES)
+ SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
+ "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+ ENDIF(CMAKE_REQUIRED_LIBRARIES)
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckFunctionExists.c
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
+ ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}
OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE})
SET(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")