diff options
author | Brad King <brad.king@kitware.com> | 2017-11-30 12:33:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-11-30 12:37:35 (GMT) |
commit | 3eee33012e10a77b6b337dc70b2dc6b2320c5ecc (patch) | |
tree | b626e399c156a61bc1f49f3e8d875c50a21f68e0 /Modules/CheckIncludeFiles.cmake | |
parent | b31d5e1dfdea5abcf95de05baf7b0e53cc18937a (diff) | |
download | CMake-3eee33012e10a77b6b337dc70b2dc6b2320c5ecc.zip CMake-3eee33012e10a77b6b337dc70b2dc6b2320c5ecc.tar.gz CMake-3eee33012e10a77b6b337dc70b2dc6b2320c5ecc.tar.bz2 |
CheckIncludeFiles: Fix name of source file used for check
In commit 7669695a74 (CheckIncludeFiles: extend to allow a LANGUAGE
argument, 2017-11-08) the file name used for the check was accidentally
left as `${var}.c`, where `var` is not a variable we define. It was
passing tests by accidentally using just `.c` as the file name, but can
break in real projects that may leave `var` defined to something else.
The reference was taken from similar code in CheckTypeSize where the
variable names are different. Fix our reference to be `${VARIABLE}`.
Diffstat (limited to 'Modules/CheckIncludeFiles.cmake')
-rw-r--r-- | Modules/CheckIncludeFiles.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake index 347231c..6cf9c49 100644 --- a/Modules/CheckIncludeFiles.cmake +++ b/Modules/CheckIncludeFiles.cmake @@ -60,9 +60,9 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) endif() if(_lang STREQUAL "C") - set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${var}.c) + set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${VARIABLE}.c) elseif(_lang STREQUAL "CXX") - set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${var}.cpp) + set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${VARIABLE}.cpp) else() message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n") endif() |