summaryrefslogtreecommitdiff
path: root/Modules/CheckIncludeFiles.cmake
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-02-23 09:58:07 -0500
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-02-23 09:58:07 -0500
commit01a55559dd8ed40ea88582b49b9e94136fd7613a (patch)
tree9b7f77fd66357ac003e5151d4e7945809b1ce1be /Modules/CheckIncludeFiles.cmake
parent1d96f839d7e67548e51b8d3729cf74ea167e4e08 (diff)
downloadcmake-01a55559dd8ed40ea88582b49b9e94136fd7613a.tar.gz
ENH: Make modules use configure instead of file write
Diffstat (limited to 'Modules/CheckIncludeFiles.cmake')
-rw-r--r--Modules/CheckIncludeFiles.cmake15
1 files changed, 8 insertions, 7 deletions
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index bc923f09d5..88a7819a79 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -14,6 +14,7 @@
MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
IF(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_INCLUDE_FILES_INCLUDE_DIRS "-DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}")
ELSE(CMAKE_REQUIRED_INCLUDES)
@@ -22,13 +23,13 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
SET(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
SET(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
FOREACH(FILE ${INCLUDE})
- SET(CHECK_INCLUDE_FILES_CONTENT
- "${CHECK_INCLUDE_FILES_CONTENT}#include <${FILE}>\n")
+ SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+ "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
ENDFOREACH(FILE)
- SET(CHECK_INCLUDE_FILES_CONTENT
- "${CHECK_INCLUDE_FILES_CONTENT}\n\nint main(){return 0;}\n")
- FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckIncludeFiles.c
- "${CHECK_INCLUDE_FILES_CONTENT}")
+ SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+ "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n")
+ CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
+ "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckIncludeFiles.c" @ONLY)
MESSAGE(STATUS "Looking for include files ${VARIABLE}")
TRY_COMPILE(${VARIABLE}
@@ -52,7 +53,7 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Determining if files ${INCLUDE} "
"exist failed with the following output:\n"
- "${OUTPUT}\nSource:\n${CHECK_INCLUDE_FILES_CONTENT}\n")
+ "${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
ENDIF(${VARIABLE})
ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
ENDMACRO(CHECK_INCLUDE_FILES)