CMake/CheckIncludeFiles: use correct variable name

Merged from https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1538

This file can be dropped once the minimum version of CMake for fish is
3.11.0.
This commit is contained in:
David Adam 2021-06-06 18:09:50 +08:00
parent 775c5f01b4
commit 7aefaff298

View file

@ -56,9 +56,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()