1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-21 06:10:16 +08:00

Modules: Use new SOURCES_FROM_* try_compile (1/2)

Modify some 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 users which
previously either used an existing file (but sometimes needed to rename
it), or which wrote out their source in entirety. It does NOT cover
users that actually need configure_file functionality, as those will be
more involved to update and will thus be tackled in part 2.
This commit is contained in:
Matthew Woehlke
2022-09-26 12:24:03 -04:00
parent 98aef0929f
commit db76876db5
19 changed files with 76 additions and 78 deletions

View File

@@ -38,7 +38,7 @@ endif()
if(NOT CMAKE_C_COMPILER_WORKS) if(NOT CMAKE_C_COMPILER_WORKS)
PrintTestCompilerStatus("C") PrintTestCompilerStatus("C")
__TestCompiler_setTryCompileTargetType() __TestCompiler_setTryCompileTargetType()
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c string(CONCAT __TestCompiler_testCCompilerSource
"#ifdef __cplusplus\n" "#ifdef __cplusplus\n"
"# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n" "# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
"#endif\n" "#endif\n"
@@ -54,8 +54,9 @@ if(NOT CMAKE_C_COMPILER_WORKS)
unset(CMAKE_C_COMPILER_WORKS) unset(CMAKE_C_COMPILER_WORKS)
# Puts test result in cache variable. # Puts test result in cache variable.
try_compile(CMAKE_C_COMPILER_WORKS try_compile(CMAKE_C_COMPILER_WORKS
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c SOURCE_FROM_VAR testCCompiler.c __TestCompiler_testCCompilerSource
OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT) OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
unset(__TestCompiler_testCCompilerSource)
# Move result from cache to normal variable. # Move result from cache to normal variable.
set(CMAKE_C_COMPILER_WORKS ${CMAKE_C_COMPILER_WORKS}) set(CMAKE_C_COMPILER_WORKS ${CMAKE_C_COMPILER_WORKS})
unset(CMAKE_C_COMPILER_WORKS CACHE) unset(CMAKE_C_COMPILER_WORKS CACHE)

View File

@@ -12,8 +12,6 @@ include(CMakeTestCompilerCommon)
unset(CMAKE_CSharp_COMPILER_WORKS CACHE) unset(CMAKE_CSharp_COMPILER_WORKS CACHE)
set(test_compile_file "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCSharpCompiler.cs")
# This file is used by EnableLanguage in cmGlobalGenerator to # This file is used by EnableLanguage in cmGlobalGenerator to
# determine that the selected C# compiler can actually compile # determine that the selected C# compiler can actually compile
# and link the most basic of programs. If not, a fatal error # and link the most basic of programs. If not, a fatal error
@@ -23,20 +21,21 @@ if(NOT CMAKE_CSharp_COMPILER_WORKS)
# Don't call PrintTestCompilerStatus() because the "C#" we want to pass # Don't call PrintTestCompilerStatus() because the "C#" we want to pass
# as the LANG doesn't match with the variable name "CMAKE_CSharp_COMPILER" # as the LANG doesn't match with the variable name "CMAKE_CSharp_COMPILER"
message(CHECK_START "Check for working C# compiler: ${CMAKE_CSharp_COMPILER}") message(CHECK_START "Check for working C# compiler: ${CMAKE_CSharp_COMPILER}")
file(WRITE "${test_compile_file}" string(CONCAT __TestCompiler_testCSharpCompilerSource
"namespace Test {" "namespace Test {\n"
" public class CSharp {" " public class CSharp {\n"
" static void Main(string[] args) {}" " static void Main(string[] args) {}\n"
" }" " }\n"
"}" "}\n"
) )
# Clear result from normal variable. # Clear result from normal variable.
unset(CMAKE_CSharp_COMPILER_WORKS) unset(CMAKE_CSharp_COMPILER_WORKS)
# Puts test result in cache variable. # Puts test result in cache variable.
try_compile(CMAKE_CSharp_COMPILER_WORKS try_compile(CMAKE_CSharp_COMPILER_WORKS
SOURCES "${test_compile_file}" SOURCE_FROM_VAR testCSharpCompiler.cs __TestCompiler_testCSharpCompilerSource
OUTPUT_VARIABLE __CMAKE_CSharp_COMPILER_OUTPUT OUTPUT_VARIABLE __CMAKE_CSharp_COMPILER_OUTPUT
) )
unset(__TestCompiler_testCSharpCompilerSource)
# Move result from cache to normal variable. # Move result from cache to normal variable.
set(CMAKE_CSharp_COMPILER_WORKS ${CMAKE_CSharp_COMPILER_WORKS}) set(CMAKE_CSharp_COMPILER_WORKS ${CMAKE_CSharp_COMPILER_WORKS})
unset(CMAKE_CSharp_COMPILER_WORKS CACHE) unset(CMAKE_CSharp_COMPILER_WORKS CACHE)

View File

@@ -76,7 +76,7 @@ endif()
# any makefiles or projects. # any makefiles or projects.
if(NOT CMAKE_CUDA_COMPILER_WORKS) if(NOT CMAKE_CUDA_COMPILER_WORKS)
PrintTestCompilerStatus("CUDA") PrintTestCompilerStatus("CUDA")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.cu string(CONCAT __TestCompiler_testCudaCompilerSource
"#ifndef __CUDACC__\n" "#ifndef __CUDACC__\n"
"# error \"The CMAKE_CUDA_COMPILER is set to an invalid CUDA compiler\"\n" "# error \"The CMAKE_CUDA_COMPILER is set to an invalid CUDA compiler\"\n"
"#endif\n" "#endif\n"
@@ -87,8 +87,9 @@ if(NOT CMAKE_CUDA_COMPILER_WORKS)
# Puts test result in cache variable. # Puts test result in cache variable.
try_compile(CMAKE_CUDA_COMPILER_WORKS try_compile(CMAKE_CUDA_COMPILER_WORKS
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.cu SOURCE_FROM_VAR main.cu __TestCompiler_testCudaCompilerSource
OUTPUT_VARIABLE __CMAKE_CUDA_COMPILER_OUTPUT) OUTPUT_VARIABLE __CMAKE_CUDA_COMPILER_OUTPUT)
unset(__TestCompiler_testCudaCompilerSource)
# Move result from cache to normal variable. # Move result from cache to normal variable.
set(CMAKE_CUDA_COMPILER_WORKS ${CMAKE_CUDA_COMPILER_WORKS}) set(CMAKE_CUDA_COMPILER_WORKS ${CMAKE_CUDA_COMPILER_WORKS})

View File

@@ -38,7 +38,7 @@ endif()
if(NOT CMAKE_CXX_COMPILER_WORKS) if(NOT CMAKE_CXX_COMPILER_WORKS)
PrintTestCompilerStatus("CXX") PrintTestCompilerStatus("CXX")
__TestCompiler_setTryCompileTargetType() __TestCompiler_setTryCompileTargetType()
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx string(CONCAT __TestCompiler_testCXXCompilerSource
"#ifndef __cplusplus\n" "#ifndef __cplusplus\n"
"# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n" "# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
"#endif\n" "#endif\n"
@@ -47,8 +47,9 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
unset(CMAKE_CXX_COMPILER_WORKS) unset(CMAKE_CXX_COMPILER_WORKS)
# Puts test result in cache variable. # Puts test result in cache variable.
try_compile(CMAKE_CXX_COMPILER_WORKS try_compile(CMAKE_CXX_COMPILER_WORKS
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx SOURCE_FROM_VAR testCXXCompiler.cxx __TestCompiler_testCXXCompilerSource
OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT) OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
unset(__TestCompiler_testCXXCompilerSource)
# Move result from cache to normal variable. # Move result from cache to normal variable.
set(CMAKE_CXX_COMPILER_WORKS ${CMAKE_CXX_COMPILER_WORKS}) set(CMAKE_CXX_COMPILER_WORKS ${CMAKE_CXX_COMPILER_WORKS})
unset(CMAKE_CXX_COMPILER_WORKS CACHE) unset(CMAKE_CXX_COMPILER_WORKS CACHE)

View File

@@ -38,7 +38,7 @@ endif()
# any makefiles or projects. # any makefiles or projects.
if(NOT CMAKE_Fortran_COMPILER_WORKS) if(NOT CMAKE_Fortran_COMPILER_WORKS)
PrintTestCompilerStatus("Fortran") PrintTestCompilerStatus("Fortran")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f " set(__TestCompiler_testFortranCompilerSource "
PROGRAM TESTFortran PROGRAM TESTFortran
PRINT *, 'Hello' PRINT *, 'Hello'
END END
@@ -47,8 +47,9 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS)
unset(CMAKE_Fortran_COMPILER_WORKS) unset(CMAKE_Fortran_COMPILER_WORKS)
# Puts test result in cache variable. # Puts test result in cache variable.
try_compile(CMAKE_Fortran_COMPILER_WORKS try_compile(CMAKE_Fortran_COMPILER_WORKS
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f SOURCE_FROM_VAR testFortranCompiler.f __TestCompiler_testFortranCompilerSource
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
unset(__TestCompiler_testFortranCompilerSource)
# Move result from cache to normal variable. # Move result from cache to normal variable.
set(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_Fortran_COMPILER_WORKS}) set(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_Fortran_COMPILER_WORKS})
unset(CMAKE_Fortran_COMPILER_WORKS CACHE) unset(CMAKE_Fortran_COMPILER_WORKS CACHE)
@@ -72,14 +73,15 @@ endif()
# Test for Fortran 90 support by using an f90-specific construct. # Test for Fortran 90 support by using an f90-specific construct.
if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90) if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
message(CHECK_START "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90") message(CHECK_START "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 " set(__TestCompiler_testFortranCompilerSource "
PROGRAM TESTFortran90 PROGRAM TESTFortran90
integer stop ; stop = 1 ; do while ( stop .eq. 0 ) ; end do integer stop ; stop = 1 ; do while ( stop .eq. 0 ) ; end do
END PROGRAM TESTFortran90 END PROGRAM TESTFortran90
") ")
try_compile(CMAKE_Fortran_COMPILER_SUPPORTS_F90 try_compile(CMAKE_Fortran_COMPILER_SUPPORTS_F90
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 SOURCE_FROM_VAR testFortranCompilerF90.f90 __TestCompiler_testFortranCompilerF90Source
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
unset(__TestCompiler_testFortranCompilerF90Source)
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
message(CHECK_PASS "yes") message(CHECK_PASS "yes")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log

View File

@@ -41,7 +41,7 @@ endif()
if(NOT CMAKE_HIP_COMPILER_WORKS) if(NOT CMAKE_HIP_COMPILER_WORKS)
PrintTestCompilerStatus("HIP") PrintTestCompilerStatus("HIP")
__TestCompiler_setTryCompileTargetType() __TestCompiler_setTryCompileTargetType()
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testHIPCompiler.hip string(CONCAT __TestCompiler_testHIPCompilerSource
"#ifndef __HIP__\n" "#ifndef __HIP__\n"
"# error \"The CMAKE_HIP_COMPILER is set to a C/CXX compiler\"\n" "# error \"The CMAKE_HIP_COMPILER is set to a C/CXX compiler\"\n"
"#endif\n" "#endif\n"
@@ -50,8 +50,9 @@ if(NOT CMAKE_HIP_COMPILER_WORKS)
unset(CMAKE_HIP_COMPILER_WORKS) unset(CMAKE_HIP_COMPILER_WORKS)
# Puts test result in cache variable. # Puts test result in cache variable.
try_compile(CMAKE_HIP_COMPILER_WORKS try_compile(CMAKE_HIP_COMPILER_WORKS
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testHIPCompiler.hip SOURCE_FROM_VAR testHIPCompiler.hip __TestCompiler_testHIPCompilerSource
OUTPUT_VARIABLE __CMAKE_HIP_COMPILER_OUTPUT) OUTPUT_VARIABLE __CMAKE_HIP_COMPILER_OUTPUT)
unset(__TestCompiler_testHIPCompilerSource)
# Move result from cache to normal variable. # Move result from cache to normal variable.
set(CMAKE_HIP_COMPILER_WORKS ${CMAKE_HIP_COMPILER_WORKS}) set(CMAKE_HIP_COMPILER_WORKS ${CMAKE_HIP_COMPILER_WORKS})
unset(CMAKE_HIP_COMPILER_WORKS CACHE) unset(CMAKE_HIP_COMPILER_WORKS CACHE)

View File

@@ -38,7 +38,7 @@ endif()
if(NOT CMAKE_OBJC_COMPILER_WORKS) if(NOT CMAKE_OBJC_COMPILER_WORKS)
PrintTestCompilerStatus("OBJC") PrintTestCompilerStatus("OBJC")
__TestCompiler_setTryCompileTargetType() __TestCompiler_setTryCompileTargetType()
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCCompiler.m string(CONCAT __TestCompiler_testObjCCompilerSource
"#ifdef __cplusplus\n" "#ifdef __cplusplus\n"
"# error \"The CMAKE_OBJC_COMPILER is set to a C++ compiler\"\n" "# error \"The CMAKE_OBJC_COMPILER is set to a C++ compiler\"\n"
"#endif\n" "#endif\n"
@@ -51,8 +51,9 @@ if(NOT CMAKE_OBJC_COMPILER_WORKS)
unset(CMAKE_OBJC_COMPILER_WORKS) unset(CMAKE_OBJC_COMPILER_WORKS)
# Puts test result in cache variable. # Puts test result in cache variable.
try_compile(CMAKE_OBJC_COMPILER_WORKS try_compile(CMAKE_OBJC_COMPILER_WORKS
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCCompiler.m SOURCE_FROM_VAR testObjCCompiler.m __TestCompiler_testObjCCompilerSource
OUTPUT_VARIABLE __CMAKE_OBJC_COMPILER_OUTPUT) OUTPUT_VARIABLE __CMAKE_OBJC_COMPILER_OUTPUT)
unset(__TestCompiler_testObjCCompilerSource)
# Move result from cache to normal variable. # Move result from cache to normal variable.
set(CMAKE_OBJC_COMPILER_WORKS ${CMAKE_OBJC_COMPILER_WORKS}) set(CMAKE_OBJC_COMPILER_WORKS ${CMAKE_OBJC_COMPILER_WORKS})
unset(CMAKE_OBJC_COMPILER_WORKS CACHE) unset(CMAKE_OBJC_COMPILER_WORKS CACHE)

View File

@@ -38,7 +38,7 @@ endif()
if(NOT CMAKE_OBJCXX_COMPILER_WORKS) if(NOT CMAKE_OBJCXX_COMPILER_WORKS)
PrintTestCompilerStatus("OBJCXX") PrintTestCompilerStatus("OBJCXX")
__TestCompiler_setTryCompileTargetType() __TestCompiler_setTryCompileTargetType()
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCXXCompiler.mm string(CONCAT __TestCompiler_testObjCXXCompilerSource
"#ifndef __cplusplus\n" "#ifndef __cplusplus\n"
"# error \"The CMAKE_OBJCXX_COMPILER is set to a C compiler\"\n" "# error \"The CMAKE_OBJCXX_COMPILER is set to a C compiler\"\n"
"#endif\n" "#endif\n"
@@ -50,8 +50,9 @@ if(NOT CMAKE_OBJCXX_COMPILER_WORKS)
unset(CMAKE_OBJCXX_COMPILER_WORKS) unset(CMAKE_OBJCXX_COMPILER_WORKS)
# Puts test result in cache variable. # Puts test result in cache variable.
try_compile(CMAKE_OBJCXX_COMPILER_WORKS try_compile(CMAKE_OBJCXX_COMPILER_WORKS
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCXXCompiler.mm SOURCE_FROM_VAR testObjCXXCompiler.mm __TestCompiler_testObjCXXCompilerSource
OUTPUT_VARIABLE __CMAKE_OBJCXX_COMPILER_OUTPUT) OUTPUT_VARIABLE __CMAKE_OBJCXX_COMPILER_OUTPUT)
unset(__TestCompiler_testObjCXXCompilerSource)
# Move result from cache to normal variable. # Move result from cache to normal variable.
set(CMAKE_OBJCXX_COMPILER_WORKS ${CMAKE_OBJCXX_COMPILER_WORKS}) set(CMAKE_OBJCXX_COMPILER_WORKS ${CMAKE_OBJCXX_COMPILER_WORKS})
unset(CMAKE_OBJCXX_COMPILER_WORKS CACHE) unset(CMAKE_OBJCXX_COMPILER_WORKS CACHE)

View File

@@ -21,13 +21,12 @@ unset(CMAKE_Swift_COMPILER_WORKS CACHE)
# any makefiles or projects. # any makefiles or projects.
if(NOT CMAKE_Swift_COMPILER_WORKS) if(NOT CMAKE_Swift_COMPILER_WORKS)
PrintTestCompilerStatus("Swift") PrintTestCompilerStatus("Swift")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift
"print(\"CMake\")\n")
# Clear result from normal variable. # Clear result from normal variable.
unset(CMAKE_Swift_COMPILER_WORKS) unset(CMAKE_Swift_COMPILER_WORKS)
# Puts test result in cache variable. # Puts test result in cache variable.
set(__CMAKE_Swift_TEST_SOURCE "print(\"CMake\")\n")
try_compile(CMAKE_Swift_COMPILER_WORKS try_compile(CMAKE_Swift_COMPILER_WORKS
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift SOURCE_FROM_VAR main.swift __CMAKE_Swift_TEST_SOURCE
OUTPUT_VARIABLE __CMAKE_Swift_COMPILER_OUTPUT) OUTPUT_VARIABLE __CMAKE_Swift_COMPILER_OUTPUT)
# Move result from cache to normal variable. # Move result from cache to normal variable.
set(CMAKE_Swift_COMPILER_WORKS ${CMAKE_Swift_COMPILER_WORKS}) set(CMAKE_Swift_COMPILER_WORKS ${CMAKE_Swift_COMPILER_WORKS})
@@ -64,4 +63,5 @@ else()
include(${CMAKE_PLATFORM_INFO_DIR}/CMakeSwiftCompiler.cmake) include(${CMAKE_PLATFORM_INFO_DIR}/CMakeSwiftCompiler.cmake)
endif() endif()
unset(__CMAKE_Swift_TEST_SOURCE)
unset(__CMAKE_Swift_COMPILER_OUTPUT) unset(__CMAKE_Swift_COMPILER_OUTPUT)

View File

@@ -74,5 +74,5 @@ include_guard(GLOBAL)
include(CheckSymbolExists) include(CheckSymbolExists)
macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE) macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
__CHECK_SYMBOL_EXISTS_IMPL("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) __CHECK_SYMBOL_EXISTS_IMPL(CheckSymbolExists.cxx "${SYMBOL}" "${FILES}" "${VARIABLE}" )
endmacro() endmacro()

View File

@@ -58,8 +58,7 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
else() else()
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
endif() endif()
file(WRITE set(__CheckFunction_testFortranCompilerSource
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
" "
program TESTFortran program TESTFortran
external ${FUNCTION} external ${FUNCTION}
@@ -68,11 +67,12 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
" "
) )
try_compile(${VARIABLE} try_compile(${VARIABLE}
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f SOURCE_FROM_VAR testFortranCompiler.f __CheckFunction_testFortranCompilerSource
${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS} ${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS}
${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES} ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}
OUTPUT_VARIABLE OUTPUT OUTPUT_VARIABLE OUTPUT
) )
unset(__CheckFunction_testFortranCompilerSource)
if(${VARIABLE}) if(${VARIABLE})
set(${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") set(${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
message(CHECK_PASS "found") message(CHECK_PASS "found")

View File

@@ -81,16 +81,15 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
endif() endif()
if(CMAKE_C_COMPILER_LOADED) if(CMAKE_C_COMPILER_LOADED)
set(_cfe_source ${CMAKE_ROOT}/Modules/CheckFunctionExists.c) set(_cfe_source CheckFunctionExists.c)
elseif(CMAKE_CXX_COMPILER_LOADED) elseif(CMAKE_CXX_COMPILER_LOADED)
set(_cfe_source ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists/CheckFunctionExists.cxx) set(_cfe_source CheckFunctionExists.cxx)
configure_file(${CMAKE_ROOT}/Modules/CheckFunctionExists.c "${_cfe_source}" COPYONLY)
else() else()
message(FATAL_ERROR "CHECK_FUNCTION_EXISTS needs either C or CXX language enabled") message(FATAL_ERROR "CHECK_FUNCTION_EXISTS needs either C or CXX language enabled")
endif() endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}
SOURCES ${_cfe_source} SOURCE_FROM_FILE "${_cfe_source}" "${CMAKE_ROOT}/Modules/CheckFunctionExists.c"
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS} ${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS}
${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES} ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}

View File

@@ -52,7 +52,7 @@ include_guard(GLOBAL)
macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE) macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
if(NOT DEFINED "${VARIABLE}") if(NOT DEFINED "${VARIABLE}")
set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") set(_src_content "/* */\n")
if("x${ARGN}" STREQUAL "x") if("x${ARGN}" STREQUAL "x")
if(CMAKE_C_COMPILER_LOADED) if(CMAKE_C_COMPILER_LOADED)
@@ -71,9 +71,9 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
endif() endif()
if(_lang STREQUAL "C") if(_lang STREQUAL "C")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${VARIABLE}.c) set(src ${VARIABLE}.c)
elseif(_lang STREQUAL "CXX") elseif(_lang STREQUAL "CXX")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${VARIABLE}.cpp) set(src ${VARIABLE}.cpp)
else() else()
message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n") message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n")
endif() endif()
@@ -86,13 +86,11 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
set(CHECK_INCLUDE_FILES_CONTENT "/* */\n") set(CHECK_INCLUDE_FILES_CONTENT "/* */\n")
set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(MACRO_CHECK_INCLUDE_FILES_FLAGS ${CMAKE_REQUIRED_FLAGS})
foreach(FILE ${INCLUDE}) foreach(FILE ${INCLUDE})
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT string(APPEND _src_content
"#include <${FILE}>\n") "#include <${FILE}>\n")
endforeach() endforeach()
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT string(APPEND _src_content
"\n\nint main(void){return 0;}\n") "\n\nint main(void){return 0;}\n")
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${src}" @ONLY)
set(_INCLUDE ${INCLUDE}) # remove empty elements set(_INCLUDE ${INCLUDE}) # remove empty elements
if("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$") if("${_INCLUDE}" MATCHES "^([^;]+);.+;([^;]+)$")
@@ -136,7 +134,7 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
message(CHECK_START "Looking for ${_description}") message(CHECK_START "Looking for ${_description}")
endif() endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}
SOURCES ${src} SOURCE_FROM_VAR "${src}" _src_content
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${_CIF_LINK_OPTIONS} ${_CIF_LINK_OPTIONS}
${_CIF_LINK_LIBRARIES} ${_CIF_LINK_LIBRARIES}
@@ -163,7 +161,7 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if files ${INCLUDE} " "Determining if files ${INCLUDE} "
"exist failed with the following output:\n" "exist failed with the following output:\n"
"${OUTPUT}\nSource:\n${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") "${OUTPUT}\nSource:\n${_src_content}\n")
endif() endif()
endif() endif()
endmacro() endmacro()

View File

@@ -61,16 +61,15 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
endif() endif()
if(CMAKE_C_COMPILER_LOADED) if(CMAKE_C_COMPILER_LOADED)
set(_cle_source ${CMAKE_ROOT}/Modules/CheckFunctionExists.c) set(_cle_source CheckFunctionExists.c)
elseif(CMAKE_CXX_COMPILER_LOADED) elseif(CMAKE_CXX_COMPILER_LOADED)
set(_cle_source ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckLibraryExists/CheckFunctionExists.cxx) set(_cle_source CheckFunctionExists.cxx)
configure_file(${CMAKE_ROOT}/Modules/CheckFunctionExists.c "${_cle_source}" COPYONLY)
else() else()
message(FATAL_ERROR "CHECK_FUNCTION_EXISTS needs either C or CXX language enabled") message(FATAL_ERROR "CHECK_FUNCTION_EXISTS needs either C or CXX language enabled")
endif() endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}
SOURCES ${_cle_source} SOURCE_FROM_FILE "${_cle_source}" "${CMAKE_ROOT}/Modules/CheckFunctionExists.c"
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_LIBRARY_EXISTS_LINK_OPTIONS} ${CHECK_LIBRARY_EXISTS_LINK_OPTIONS}
LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES} LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES}

View File

@@ -68,11 +68,11 @@ cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE) macro(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
if(CMAKE_C_COMPILER_LOADED) if(CMAKE_C_COMPILER_LOADED)
__CHECK_SYMBOL_EXISTS_FILTER_FLAGS(C) __CHECK_SYMBOL_EXISTS_FILTER_FLAGS(C)
__CHECK_SYMBOL_EXISTS_IMPL("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) __CHECK_SYMBOL_EXISTS_IMPL(CheckSymbolExists.c "${SYMBOL}" "${FILES}" "${VARIABLE}" )
__CHECK_SYMBOL_EXISTS_RESTORE_FLAGS(C) __CHECK_SYMBOL_EXISTS_RESTORE_FLAGS(C)
elseif(CMAKE_CXX_COMPILER_LOADED) elseif(CMAKE_CXX_COMPILER_LOADED)
__CHECK_SYMBOL_EXISTS_FILTER_FLAGS(CXX) __CHECK_SYMBOL_EXISTS_FILTER_FLAGS(CXX)
__CHECK_SYMBOL_EXISTS_IMPL("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) __CHECK_SYMBOL_EXISTS_IMPL(CheckSymbolExists.cxx "${SYMBOL}" "${FILES}" "${VARIABLE}" )
__CHECK_SYMBOL_EXISTS_RESTORE_FLAGS(CXX) __CHECK_SYMBOL_EXISTS_RESTORE_FLAGS(CXX)
else() else()
message(FATAL_ERROR "CHECK_SYMBOL_EXISTS needs either C or CXX language enabled") message(FATAL_ERROR "CHECK_SYMBOL_EXISTS needs either C or CXX language enabled")
@@ -92,7 +92,7 @@ endmacro()
macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE) macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE)
if(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}") if(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}")
set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") set(_CSE_SOURCE "/* */\n")
set(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
if(CMAKE_REQUIRED_LINK_OPTIONS) if(CMAKE_REQUIRED_LINK_OPTIONS)
set(CHECK_SYMBOL_EXISTS_LINK_OPTIONS set(CHECK_SYMBOL_EXISTS_LINK_OPTIONS
@@ -113,17 +113,17 @@ macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE)
set(CMAKE_SYMBOL_EXISTS_INCLUDES) set(CMAKE_SYMBOL_EXISTS_INCLUDES)
endif() endif()
foreach(FILE ${FILES}) foreach(FILE ${FILES})
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT string(APPEND _CSE_SOURCE
"#include <${FILE}>\n") "#include <${FILE}>\n")
endforeach() endforeach()
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT " string(APPEND _CSE_SOURCE "
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
(void)argv;") (void)argv;")
set(_CSE_CHECK_NON_MACRO "return ((int*)(&${SYMBOL}))[argc];") set(_CSE_CHECK_NON_MACRO "return ((int*)(&${SYMBOL}))[argc];")
if("${SYMBOL}" MATCHES "^[a-zA-Z_][a-zA-Z0-9_]*$") if("${SYMBOL}" MATCHES "^[a-zA-Z_][a-zA-Z0-9_]*$")
# The SYMBOL has a legal macro name. Test whether it exists as a macro. # The SYMBOL has a legal macro name. Test whether it exists as a macro.
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT " string(APPEND _CSE_SOURCE "
#ifndef ${SYMBOL} #ifndef ${SYMBOL}
${_CSE_CHECK_NON_MACRO} ${_CSE_CHECK_NON_MACRO}
#else #else
@@ -132,21 +132,18 @@ int main(int argc, char** argv)
#endif") #endif")
else() else()
# The SYMBOL cannot be a macro (e.g., a template function). # The SYMBOL cannot be a macro (e.g., a template function).
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT " string(APPEND _CSE_SOURCE "
${_CSE_CHECK_NON_MACRO}") ${_CSE_CHECK_NON_MACRO}")
endif() endif()
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT " string(APPEND _CSE_SOURCE "
}") }")
unset(_CSE_CHECK_NON_MACRO) unset(_CSE_CHECK_NON_MACRO)
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${SOURCEFILE}" @ONLY)
if(NOT CMAKE_REQUIRED_QUIET) if(NOT CMAKE_REQUIRED_QUIET)
message(CHECK_START "Looking for ${SYMBOL}") message(CHECK_START "Looking for ${SYMBOL}")
endif() endif()
try_compile(${VARIABLE} try_compile(${VARIABLE}
SOURCES "${SOURCEFILE}" SOURCE_FROM_VAR "${SOURCEFILE}" _CSE_SOURCE
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_SYMBOL_EXISTS_LINK_OPTIONS} ${CHECK_SYMBOL_EXISTS_LINK_OPTIONS}
${CHECK_SYMBOL_EXISTS_LIBS} ${CHECK_SYMBOL_EXISTS_LIBS}
@@ -163,7 +160,7 @@ int main(int argc, char** argv)
"Determining if the ${SYMBOL} " "Determining if the ${SYMBOL} "
"exist passed with the following output:\n" "exist passed with the following output:\n"
"${OUTPUT}\nFile ${SOURCEFILE}:\n" "${OUTPUT}\nFile ${SOURCEFILE}:\n"
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") "${_CSE_SOURCE}\n")
else() else()
if(NOT CMAKE_REQUIRED_QUIET) if(NOT CMAKE_REQUIRED_QUIET)
message(CHECK_FAIL "not found") message(CHECK_FAIL "not found")
@@ -173,9 +170,9 @@ int main(int argc, char** argv)
"Determining if the ${SYMBOL} " "Determining if the ${SYMBOL} "
"exist failed with the following output:\n" "exist failed with the following output:\n"
"${OUTPUT}\nFile ${SOURCEFILE}:\n" "${OUTPUT}\nFile ${SOURCEFILE}:\n"
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n") "${_CSE_SOURCE}\n")
endif() endif()
unset(CMAKE_CONFIGURABLE_FILE_CONTENT) unset(_CSE_SOURCE)
endif() endif()
endmacro() endmacro()

View File

@@ -129,13 +129,12 @@ macro(_threads_check_flag_pthread)
elseif(NOT DEFINED THREADS_HAVE_PTHREAD_ARG) elseif(NOT DEFINED THREADS_HAVE_PTHREAD_ARG)
message(CHECK_START "Check if compiler accepts -pthread") message(CHECK_START "Check if compiler accepts -pthread")
if(CMAKE_C_COMPILER_LOADED) if(CMAKE_C_COMPILER_LOADED)
set(_threads_src ${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c) set(_threads_src CheckForPthreads.c)
elseif(CMAKE_CXX_COMPILER_LOADED) elseif(CMAKE_CXX_COMPILER_LOADED)
set(_threads_src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindThreads/CheckForPthreads.cxx) set(_threads_src CheckForPthreads.cxx)
configure_file(${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c "${_threads_src}" COPYONLY)
endif() endif()
try_compile(THREADS_HAVE_PTHREAD_ARG try_compile(THREADS_HAVE_PTHREAD_ARG
SOURCES ${_threads_src} SOURCE_FROM_FILE "${_threads_src}" "${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c"
CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread
OUTPUT_VARIABLE _cmake_check_pthreads_output) OUTPUT_VARIABLE _cmake_check_pthreads_output)

View File

@@ -86,14 +86,13 @@ function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var)
else() else()
set(CHECK_${LANG}_SOURCE_COMPILES_ADD_INCLUDES) set(CHECK_${LANG}_SOURCE_COMPILES_ADD_INCLUDES)
endif() endif()
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}"
"${_source}\n")
if(NOT CMAKE_REQUIRED_QUIET) if(NOT CMAKE_REQUIRED_QUIET)
message(CHECK_START "Performing Test ${_var}") message(CHECK_START "Performing Test ${_var}")
endif() endif()
string(APPEND _source "\n")
try_compile(${_var} try_compile(${_var}
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT} SOURCE_FROM_VAR "src.${_SRC_EXT}" _source
COMPILE_DEFINITIONS -D${_var} ${CMAKE_REQUIRED_DEFINITIONS} COMPILE_DEFINITIONS -D${_var} ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_${LANG}_SOURCE_COMPILES_ADD_LINK_OPTIONS} ${CHECK_${LANG}_SOURCE_COMPILES_ADD_LINK_OPTIONS}
${CHECK_${LANG}_SOURCE_COMPILES_ADD_LIBRARIES} ${CHECK_${LANG}_SOURCE_COMPILES_ADD_LIBRARIES}

View File

@@ -85,14 +85,13 @@ function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var)
else() else()
set(CHECK_${_lang}_SOURCE_COMPILES_ADD_INCLUDES) set(CHECK_${_lang}_SOURCE_COMPILES_ADD_INCLUDES)
endif() endif()
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}"
"${_source}\n")
if(NOT CMAKE_REQUIRED_QUIET) if(NOT CMAKE_REQUIRED_QUIET)
message(CHECK_START "Performing Test ${_var}") message(CHECK_START "Performing Test ${_var}")
endif() endif()
string(APPEND _source "\n")
try_run(${_var}_EXITCODE ${_var}_COMPILED try_run(${_var}_EXITCODE ${_var}_COMPILED
SOURCES ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT} SOURCE_FROM_VAR "src.${_SRC_EXT}" _source
COMPILE_DEFINITIONS -D${_var} ${CMAKE_REQUIRED_DEFINITIONS} COMPILE_DEFINITIONS -D${_var} ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_${_lang}_SOURCE_COMPILES_ADD_LINK_OPTIONS} ${CHECK_${_lang}_SOURCE_COMPILES_ADD_LINK_OPTIONS}
${CHECK_${_lang}_SOURCE_COMPILES_ADD_LIBRARIES} ${CHECK_${_lang}_SOURCE_COMPILES_ADD_LIBRARIES}

View File

@@ -4,7 +4,7 @@ macro(_record_compiler_features lang compile_flags feature_list)
string(TOLOWER ${lang} lang_lc) string(TOLOWER ${lang} lang_lc)
file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin") file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin")
file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" " set(_content "
const char features[] = {\"\\n\"\n") const char features[] = {\"\\n\"\n")
get_property(known_features GLOBAL PROPERTY CMAKE_${lang}_KNOWN_FEATURES) get_property(known_features GLOBAL PROPERTY CMAKE_${lang}_KNOWN_FEATURES)
@@ -16,10 +16,11 @@ macro(_record_compiler_features lang compile_flags feature_list)
else() else()
set(_feature_condition "#if ${_cmake_feature_test_${feature}}\n\"1\"\n#else\n\"0\"\n#endif\n") set(_feature_condition "#if ${_cmake_feature_test_${feature}}\n\"1\"\n#else\n\"0\"\n#endif\n")
endif() endif()
file(APPEND "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" "\"${lang}_FEATURE:\"\n${_feature_condition}\"${feature}\\n\"\n") string(APPEND _content
"\"${lang}_FEATURE:\"\n${_feature_condition}\"${feature}\\n\"\n")
endif() endif()
endforeach() endforeach()
file(APPEND "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" string(APPEND _content
"\n};\n\nint main(int argc, char** argv) { (void)argv; return features[argc]; }\n") "\n};\n\nint main(int argc, char** argv) { (void)argv; return features[argc]; }\n")
if(CMAKE_${lang}_LINK_WITH_STANDARD_COMPILE_OPTION) if(CMAKE_${lang}_LINK_WITH_STANDARD_COMPILE_OPTION)
@@ -31,7 +32,7 @@ macro(_record_compiler_features lang compile_flags feature_list)
endif() endif()
try_compile(CMAKE_${lang}_FEATURE_TEST try_compile(CMAKE_${lang}_FEATURE_TEST
SOURCES "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" SOURCE_FROM_VAR "feature_tests.${lang_lc}" _content
COMPILE_DEFINITIONS "${compile_flags}" COMPILE_DEFINITIONS "${compile_flags}"
LINK_LIBRARIES "${compile_flags_for_link}" LINK_LIBRARIES "${compile_flags_for_link}"
OUTPUT_VARIABLE _output OUTPUT_VARIABLE _output