summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CheckFunctionExists.cmake3
-rw-r--r--Modules/CheckLibraryExists.cmake23
-rw-r--r--Modules/CheckSizeOf.cmake2
3 files changed, 14 insertions, 14 deletions
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index 3640fd9..e5bb3b9 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -7,10 +7,11 @@
#
MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
+ SET(MACRO_CHECK_FUNCTION_DEFINITIONS -DCHECK_FUNCTION_EXISTS=${FUNCTION})
TRY_COMPILE(${VARIABLE}
${PROJECT_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckFunctionExists.c
- COMPILE_DEFINITIONS -DCHECK_FUNCTION_EXISTS=${FUNCTION}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
OUTPUT_VARIABLE OUTPUT)
IF(NOT ${VARIABLE})
WRITE_FILE(${PROJECT_BINARY_DIR}/CMakeError.log
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)
diff --git a/Modules/CheckSizeOf.cmake b/Modules/CheckSizeOf.cmake
index dcf0991..82d9f43 100644
--- a/Modules/CheckSizeOf.cmake
+++ b/Modules/CheckSizeOf.cmake
@@ -18,7 +18,7 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
${PROJECT_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckSizeOf.c
- COMPILE_DEFINITIONS ${MACRO_CHECK_TYPE_SIZE_FLAGS}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
OUTPUT_VARIABLE OUTPUT)
IF(NOT HAVE_${VARIABLE})
WRITE_FILE(${PROJECT_BINARY_DIR}/CMakeError.log