diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-09-25 14:08:08 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-09-25 14:08:08 (GMT) |
commit | 5902279ebc28df950c3d076b4738449cd8d2e042 (patch) | |
tree | 78d34c1105189e266a627c8ffccd93e9055b07e9 /Modules/CheckLibraryExists.cmake | |
parent | 561a3da2043c3fbebd1f90c88842513625076aed (diff) | |
download | CMake-5902279ebc28df950c3d076b4738449cd8d2e042.zip CMake-5902279ebc28df950c3d076b4738449cd8d2e042.tar.gz CMake-5902279ebc28df950c3d076b4738449cd8d2e042.tar.bz2 |
Fix modules for recent changes
Diffstat (limited to 'Modules/CheckLibraryExists.cmake')
-rw-r--r-- | Modules/CheckLibraryExists.cmake | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake index 856840e..c2c9912 100644 --- a/Modules/CheckLibraryExists.cmake +++ b/Modules/CheckLibraryExists.cmake @@ -7,21 +7,20 @@ # MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) - SET(CHECK_LIBRARY_EXISTS_LIBRARY ${LIBRARY}) - SET(CHECK_LIBRARY_EXISTS_FUNCTION ${FUNCTION}) - SET(CHECK_LIBRARY_EXISTS_LOCATION ${LOCATION}) - SET(CHECK_LIBRARY_EXISTS_VARIABLE ${VARIABLE}) - SET(CHECK_LIBRARY_EXISTS_SOURCE ${CMAKE_ROOT}/Modules/CheckFunctionExists.c) - CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckLibraryExists.lists.in - ${PROJECT_BINARY_DIR}/CMakeTmp/CheckLibraryExists/CMakeLists.txt - IMMEDIATE) + SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION -DCHECK_FUNCTION_EXISTS=${FUNCTION}) + TRY_COMPILE(${VARIABLE} - ${PROJECT_BINARY_DIR}/CMakeTmp/CheckLibraryExists - ${PROJECT_BINARY_DIR}/CMakeTmp/CheckLibraryExists - CHECK_LIBRARY_EXISTS OUTPUT_VARIABLE OUTPUT) + ${PROJECT_BINARY_DIR}/CheckIfLibraryExists + ${CMAKE_ROOT}/Modules/CheckFunctionExists.c + CMAKE_FLAGS + -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_LIBRARY_EXISTS_DEFINITION} + -DLINK_DIRECTORIES:STRING=${LOCATION} + -DLINK_LIBRARIES:STRING=${LIBRARY} + OUTPUT_VARIABLE OUTPUT) + IF(NOT ${VARIABLE}) WRITE_FILE(${PROJECT_BINARY_DIR}/CMakeError.log - "Determining if the function ${FUNCTION} exists failed with the following output:\n" + "Determining if the function ${FUNCTION} exists in the ${LIBRARY} failed with the following output:\n" "${OUTPUT}\n") ENDIF(NOT ${VARIABLE}) ENDMACRO(CHECK_LIBRARY_EXISTS) |