diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2022-09-26 16:12:57 -0400 |
---|---|---|
committer | Matthew Woehlke <matthew.woehlke@kitware.com> | 2022-09-27 13:29:52 -0400 |
commit | 41f7b1169a0b3e86506ac9c6d8f2664997cd340c (patch) | |
tree | 437327cc528d41c1a69c08600c629d720cf78e7e /Modules/CheckIncludeFileCXX.cmake | |
parent | db76876db5c16d610efd08f6deb0e4c9cd0e5603 (diff) | |
download | cmake-41f7b1169a0b3e86506ac9c6d8f2664997cd340c.tar.gz |
Modules: Use new SOURCES_FROM_* try_compile (2/2)
Modify some additional modules that ship with CMake to use the new
SOURCES_FROM_* arguments to try_compile / try_run as added by commits
cb14ae2b87 (try_compile: Add SOURCE_FROM_{ARG,VAR}, 2022-09-21) and
611d801790 (try_compile: Add SOURCE_FROM_FILE, 2022-09-22). This covers
modules that need to read and alter a template source file, which were
not addressed in the previous commit.
Note that FindOpenACC.cmake does not actually need configure_file
functionality; it appears to have inherited the (gratuitous) use thereof
from FindOpenMP.cmake, with which its code bears significant similarity.
Diffstat (limited to 'Modules/CheckIncludeFileCXX.cmake')
-rw-r--r-- | Modules/CheckIncludeFileCXX.cmake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake index 453751e746..f6af03692c 100644 --- a/Modules/CheckIncludeFileCXX.cmake +++ b/Modules/CheckIncludeFileCXX.cmake @@ -53,8 +53,8 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) endif() set(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(CHECK_INCLUDE_FILE_VAR ${INCLUDE}) - configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx) + file(READ ${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in _CIF_SOURCE_CONTENT) + string(CONFIGURE "${_CIF_SOURCE_CONTENT}" _CIF_SOURCE_CONTENT) if(NOT CMAKE_REQUIRED_QUIET) message(CHECK_START "Looking for C++ include ${INCLUDE}") endif() @@ -92,7 +92,7 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) endif() try_compile(${VARIABLE} - SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx + SOURCE_FROM_VAR CheckIncludeFile.cxx _CIF_SOURCE_CONTENT COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${_CIF_LINK_OPTIONS} ${_CIF_LINK_LIBRARIES} |