qr 6.5.1: still missed with cmake version, trying 3.18.3

This commit is contained in:
kleuter 2023-10-31 23:36:59 +01:00
parent c386aac06f
commit 72a8e4201b
2808 changed files with 8828 additions and 3966 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,22 +0,0 @@
get_source_file_property
------------------------
Get a property for a source file.
.. code-block:: cmake
get_source_file_property(VAR file property)
Gets a property from a source file. The value of the property is
stored in the variable ``VAR``. If the source property is not found, the
behavior depends on whether it has been defined to be an ``INHERITED`` property
or not (see :command:`define_property`). Non-inherited properties will set
``VAR`` to "NOTFOUND", whereas inherited properties will search the relevant
parent scope as described for the :command:`define_property` command and
if still unable to find the property, ``VAR`` will be set to an empty string.
Use :command:`set_source_files_properties` to set property values. Source
file properties usually control how the file is built. One property that is
always there is :prop_sf:`LOCATION`.
See also the more general :command:`get_property` command.

View File

@ -1,19 +0,0 @@
set_source_files_properties
---------------------------
Source files can have properties that affect how they are built.
.. code-block:: cmake
set_source_files_properties([file1 [file2 [...]]]
PROPERTIES prop1 value1
[prop2 value2 [...]])
Sets properties associated with source files using a key/value paired
list.
See also the :command:`set_property(SOURCE)` command.
See :ref:`Source File Properties` for the list of properties known
to CMake. Source file properties are visible only to targets added
in the same directory (``CMakeLists.txt``).

View File

@ -1,36 +0,0 @@
CPack Archive Generator
-----------------------
Archive CPack generator that supports packaging of sources and binaries in
different formats:
- 7Z - 7zip - (.7z)
- TBZ2 (.tar.bz2)
- TGZ (.tar.gz)
- TXZ (.tar.xz)
- TZ (.tar.Z)
- TZST (.tar.zst)
- ZIP (.zip)
Variables specific to CPack Archive generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. variable:: CPACK_ARCHIVE_FILE_NAME
CPACK_ARCHIVE_<component>_FILE_NAME
Package file name without extension which is added automatically depending
on the archive format.
* Mandatory : YES
* Default : ``<CPACK_PACKAGE_FILE_NAME>[-<component>].<extension>`` with
spaces replaced by '-'
.. variable:: CPACK_ARCHIVE_COMPONENT_INSTALL
Enable component packaging for CPackArchive
* Mandatory : NO
* Default : OFF
If enabled (ON) multiple packages are generated. By default a single package
containing files of all components is generated.

View File

@ -1,10 +0,0 @@
Fortran_FORMAT
--------------
Set to ``FIXED`` or ``FREE`` to indicate the Fortran source layout.
This property tells CMake whether a given Fortran source file uses
fixed-format or free-format. CMake will pass the corresponding format
flag to the compiler. Consider using the target-wide
:prop_tgt:`Fortran_FORMAT` property if all source files in a target
share the same format.

View File

@ -1,7 +0,0 @@
REQUIRED_FILES
--------------
List of files required to run the test.
If set to a list of files, the test will not be run unless all of the
files exist.

View File

@ -1,21 +0,0 @@
CMAKE_SYSTEM_PREFIX_PATH
------------------------
:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying installation
*prefixes* to be searched by the :command:`find_package`,
:command:`find_program`, :command:`find_library`, :command:`find_file`, and
:command:`find_path` commands. Each command will add appropriate
subdirectories (like ``bin``, ``lib``, or ``include``) as specified in its own
documentation.
By default this contains the standard directories for the current system, the
:variable:`CMAKE_INSTALL_PREFIX`, and the :variable:`CMAKE_STAGING_PREFIX`.
The installation and staging prefixes may be excluded by setting
the :variable:`CMAKE_FIND_NO_INSTALL_PREFIX` variable.
``CMAKE_SYSTEM_PREFIX_PATH`` is *not* intended to be modified by the project;
use :variable:`CMAKE_PREFIX_PATH` for this.
See also :variable:`CMAKE_SYSTEM_INCLUDE_PATH`,
:variable:`CMAKE_SYSTEM_LIBRARY_PATH`, :variable:`CMAKE_SYSTEM_PROGRAM_PATH`,
and :variable:`CMAKE_SYSTEM_IGNORE_PATH`.

View File

@ -1,5 +0,0 @@
CTEST_NIGHTLY_START_TIME
------------------------
Specify the CTest ``NightlyStartTime`` setting
in a :manual:`ctest(1)` dashboard client script.

View File

@ -1,6 +0,0 @@
PROJECT_SOURCE_DIR
------------------
Top level source directory for the current project.
This is the source directory of the most recent :command:`project` command.

View File

@ -1,252 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
include(${CMAKE_ROOT}/Modules//CMakeParseImplicitLinkInfo.cmake)
if( NOT ( ("${CMAKE_GENERATOR}" MATCHES "Make") OR
("${CMAKE_GENERATOR}" MATCHES "Ninja") OR
("${CMAKE_GENERATOR}" MATCHES "Visual Studio (1|[9][0-9])") ) )
message(FATAL_ERROR "CUDA language not currently supported by \"${CMAKE_GENERATOR}\" generator")
endif()
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
else()
if(NOT CMAKE_CUDA_COMPILER)
set(CMAKE_CUDA_COMPILER_INIT NOTFOUND)
# prefer the environment variable CUDACXX
if(NOT $ENV{CUDACXX} STREQUAL "")
get_filename_component(CMAKE_CUDA_COMPILER_INIT $ENV{CUDACXX} PROGRAM PROGRAM_ARGS CMAKE_CUDA_FLAGS_ENV_INIT)
if(CMAKE_CUDA_FLAGS_ENV_INIT)
set(CMAKE_CUDA_COMPILER_ARG1 "${CMAKE_CUDA_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
endif()
if(NOT EXISTS ${CMAKE_CUDA_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable CUDACXX:\n$ENV{CUDACXX}.\n${CMAKE_CUDA_COMPILER_INIT}")
endif()
endif()
# finally list compilers to try
if(NOT CMAKE_CUDA_COMPILER_INIT)
set(CMAKE_CUDA_COMPILER_LIST nvcc)
endif()
_cmake_find_compiler(CUDA)
else()
_cmake_find_compiler_path(CUDA)
endif()
mark_as_advanced(CMAKE_CUDA_COMPILER)
endif()
#Allow the user to specify a host compiler
if(NOT $ENV{CUDAHOSTCXX} STREQUAL "")
get_filename_component(CMAKE_CUDA_HOST_COMPILER $ENV{CUDAHOSTCXX} PROGRAM)
if(NOT EXISTS ${CMAKE_CUDA_HOST_COMPILER})
message(FATAL_ERROR "Could not find compiler set in environment variable CUDAHOSTCXX:\n$ENV{CUDAHOSTCXX}.\n${CMAKE_CUDA_HOST_COMPILER}")
endif()
endif()
# Build a small source file to identify the compiler.
if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
set(CMAKE_CUDA_COMPILER_ID_RUN 1)
# Try to identify the compiler.
set(CMAKE_CUDA_COMPILER_ID)
set(CMAKE_CUDA_PLATFORM_ID)
file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
CMAKE_CUDA_COMPILER_ID_PLATFORM_CONTENT)
list(APPEND CMAKE_CUDA_COMPILER_ID_MATCH_VENDORS NVIDIA)
set(CMAKE_CUDA_COMPILER_ID_MATCH_VENDOR_REGEX_NVIDIA "nvcc: NVIDIA \(R\) Cuda compiler driver")
set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdCUDA/(\\./)?(CompilerIdCUDA.xctest/)?CompilerIdCUDA[ \t\n\\\"]")
set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_INDEX 2)
set(CMAKE_CUDA_COMPILER_ID_FLAGS_ALWAYS -v --keep --keep-dir tmp)
if(CMAKE_CUDA_HOST_COMPILER)
list(APPEND CMAKE_CUDA_COMPILER_ID_FLAGS_ALWAYS "-ccbin=${CMAKE_CUDA_HOST_COMPILER}")
endif()
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
CMAKE_DETERMINE_COMPILER_ID(CUDA CUDAFLAGS CMakeCUDACompilerId.cu)
endif()
set(_CMAKE_PROCESSING_LANGUAGE "CUDA")
include(CMakeFindBinUtils)
unset(_CMAKE_PROCESSING_LANGUAGE)
if(MSVC_CUDA_ARCHITECTURE_ID)
set(SET_MSVC_CUDA_ARCHITECTURE_ID
"set(MSVC_CUDA_ARCHITECTURE_ID ${MSVC_CUDA_ARCHITECTURE_ID})")
endif()
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${CMAKE_LINKER}")
set(CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES "")
set(CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES "")
set(CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
# We do not currently detect CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES but we
# do need to detect CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT from the compiler by
# looking at which cudart library exists in the implicit link libraries passed
# to the host linker.
if(CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT MATCHES "link\\.exe [^\n]*cudart_static\\.lib")
set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "STATIC")
elseif(CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT MATCHES "link\\.exe [^\n]*cudart\\.lib")
set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "SHARED")
else()
set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "NONE")
endif()
set(_SET_CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT
"set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT \"${CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT}\")")
elseif(CMAKE_CUDA_COMPILER_ID STREQUAL NVIDIA)
set(_nvcc_log "")
string(REPLACE "\r" "" _nvcc_output_orig "${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}")
if(_nvcc_output_orig MATCHES "#\\\$ +PATH= *([^\n]*)\n")
set(_nvcc_path "${CMAKE_MATCH_1}")
string(APPEND _nvcc_log " found 'PATH=' string: [${_nvcc_path}]\n")
string(REPLACE ":" ";" _nvcc_path "${_nvcc_path}")
else()
set(_nvcc_path "")
string(REPLACE "\n" "\n " _nvcc_output_log "\n${_nvcc_output_orig}")
string(APPEND _nvcc_log " no 'PATH=' string found in nvcc output:${_nvcc_output_log}\n")
endif()
if(_nvcc_output_orig MATCHES "#\\\$ +LIBRARIES= *([^\n]*)\n")
set(_nvcc_libraries "${CMAKE_MATCH_1}")
string(APPEND _nvcc_log " found 'LIBRARIES=' string: [${_nvcc_libraries}]\n")
else()
set(_nvcc_libraries "")
string(REPLACE "\n" "\n " _nvcc_output_log "\n${_nvcc_output_orig}")
string(APPEND _nvcc_log " no 'LIBRARIES=' string found in nvcc output:${_nvcc_output_log}\n")
endif()
set(_nvcc_link_line "")
if(_nvcc_libraries)
# Remove variable assignments.
string(REGEX REPLACE "#\\\$ *[^= ]+=[^\n]*\n" "" _nvcc_output "${_nvcc_output_orig}")
# Encode [] characters that break list expansion.
string(REPLACE "[" "{==={" _nvcc_output "${_nvcc_output}")
string(REPLACE "]" "}===}" _nvcc_output "${_nvcc_output}")
# Split lines.
string(REGEX REPLACE "\n+(#\\\$ )?" ";" _nvcc_output "${_nvcc_output}")
foreach(line IN LISTS _nvcc_output)
set(_nvcc_output_line "${line}")
string(REPLACE "{==={" "[" _nvcc_output_line "${_nvcc_output_line}")
string(REPLACE "}===}" "]" _nvcc_output_line "${_nvcc_output_line}")
string(APPEND _nvcc_log " considering line: [${_nvcc_output_line}]\n")
if("${_nvcc_output_line}" MATCHES "^ *nvlink")
string(APPEND _nvcc_log " ignoring nvlink line\n")
elseif(_nvcc_libraries)
if("${_nvcc_output_line}" MATCHES "(@\"?tmp/a\\.exe\\.res\"?)")
set(_nvcc_link_res_arg "${CMAKE_MATCH_1}")
set(_nvcc_link_res "${CMAKE_PLATFORM_INFO_DIR}/CompilerIdCUDA/tmp/a.exe.res")
if(EXISTS "${_nvcc_link_res}")
file(READ "${_nvcc_link_res}" _nvcc_link_res_content)
string(REPLACE "${_nvcc_link_res_arg}" "${_nvcc_link_res_content}" _nvcc_output_line "${_nvcc_output_line}")
endif()
endif()
string(FIND "${_nvcc_output_line}" "${_nvcc_libraries}" _nvcc_libraries_pos)
if(NOT _nvcc_libraries_pos EQUAL -1)
set(_nvcc_link_line "${_nvcc_output_line}")
string(APPEND _nvcc_log " extracted link line: [${_nvcc_link_line}]\n")
endif()
endif()
endforeach()
endif()
if(_nvcc_link_line)
if("x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${CMAKE_LINKER}")
else()
#extract the compiler that is being used for linking
separate_arguments(_nvcc_link_line_args UNIX_COMMAND "${_nvcc_link_line}")
list(GET _nvcc_link_line_args 0 _nvcc_host_link_launcher)
if(IS_ABSOLUTE "${_nvcc_host_link_launcher}")
string(APPEND _nvcc_log " extracted link launcher absolute path: [${_nvcc_host_link_launcher}]\n")
set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${_nvcc_host_link_launcher}")
else()
string(APPEND _nvcc_log " extracted link launcher name: [${_nvcc_host_link_launcher}]\n")
find_program(_nvcc_find_host_link_launcher
NAMES ${_nvcc_host_link_launcher}
PATHS ${_nvcc_path} NO_DEFAULT_PATH)
find_program(_nvcc_find_host_link_launcher
NAMES ${_nvcc_host_link_launcher})
if(_nvcc_find_host_link_launcher)
string(APPEND _nvcc_log " found link launcher absolute path: [${_nvcc_find_host_link_launcher}]\n")
set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${_nvcc_find_host_link_launcher}")
else()
string(APPEND _nvcc_log " could not find link launcher absolute path\n")
set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${_nvcc_host_link_launcher}")
endif()
unset(_nvcc_find_host_link_launcher CACHE)
endif()
endif()
#prefix the line with cuda-fake-ld so that implicit link info believes it is
#a link line
set(_nvcc_link_line "cuda-fake-ld ${_nvcc_link_line}")
CMAKE_PARSE_IMPLICIT_LINK_INFO("${_nvcc_link_line}"
CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES
CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES
CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES
log
"${CMAKE_CUDA_IMPLICIT_OBJECT_REGEX}")
# Detect CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT from the compiler by looking at which
# cudart library exists in the implicit link libraries passed to the host linker.
# This is required when a project sets the cuda runtime library as part of the
# initial flags.
if(";${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES};" MATCHES [[;cudart_static(\.lib)?;]])
set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "STATIC")
elseif(";${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES};" MATCHES [[;cudart(\.lib)?;]])
set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "SHARED")
else()
set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "NONE")
endif()
set(_SET_CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT
"set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT \"${CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT}\")")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Parsed CUDA nvcc implicit link information from above output:\n${_nvcc_log}\n${log}\n\n")
else()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Failed to parsed CUDA nvcc implicit link information:\n${_nvcc_log}\n\n")
message(FATAL_ERROR "Failed to extract nvcc implicit link line.")
endif()
endif()
set(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES )
string(REPLACE "\r" "" _nvcc_output_orig "${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}")
if(_nvcc_output_orig MATCHES "#\\\$ +INCLUDES= *([^\n]*)\n")
set(_nvcc_includes "${CMAKE_MATCH_1}")
string(APPEND _nvcc_log " found 'INCLUDES=' string: [${_nvcc_includes}]\n")
else()
set(_nvcc_includes "")
string(REPLACE "\n" "\n " _nvcc_output_log "\n${_nvcc_output_orig}")
string(APPEND _nvcc_log " no 'INCLUDES=' string found in nvcc output:${_nvcc_output_log}\n")
endif()
if(_nvcc_includes)
# across all operating system each include directory is prefixed with -I
separate_arguments(_nvcc_output NATIVE_COMMAND "${_nvcc_includes}")
foreach(line IN LISTS _nvcc_output)
string(REGEX REPLACE "^-I" "" line "${line}")
get_filename_component(line "${line}" ABSOLUTE)
list(APPEND CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES "${line}")
endforeach()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Parsed CUDA nvcc include information from above output:\n${_nvcc_log}\n${log}\n\n")
else()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Failed to detect CUDA nvcc include information:\n${_nvcc_log}\n\n")
endif()
# configure all variables set in this file
configure_file(${CMAKE_ROOT}/Modules/CMakeCUDACompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeCUDACompiler.cmake
@ONLY
)
set(CMAKE_CUDA_COMPILER_ENV_VAR "CUDACXX")
set(CMAKE_CUDA_HOST_COMPILER_ENV_VAR "CUDAHOSTCXX")

View File

@ -1,102 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
if(CMAKE_Fortran_COMPILER_FORCED)
# The compiler configuration was forced by the user.
# Assume the user has configured all compiler information.
set(CMAKE_Fortran_COMPILER_WORKS TRUE)
return()
endif()
include(CMakeTestCompilerCommon)
# Remove any cached result from an older CMake version.
# We now store this in CMakeFortranCompiler.cmake.
unset(CMAKE_Fortran_COMPILER_WORKS CACHE)
# This file is used by EnableLanguage in cmGlobalGenerator to
# determine that the selected Fortran compiler can actually compile
# and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
if(NOT CMAKE_Fortran_COMPILER_WORKS)
PrintTestCompilerStatus("Fortran")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
PROGRAM TESTFortran
PRINT *, 'Hello'
END
")
try_compile(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
OUTPUT_VARIABLE OUTPUT)
# Move result from cache to normal variable.
set(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_Fortran_COMPILER_WORKS})
unset(CMAKE_Fortran_COMPILER_WORKS CACHE)
set(FORTRAN_TEST_WAS_RUN 1)
endif()
if(NOT CMAKE_Fortran_COMPILER_WORKS)
PrintTestCompilerResult(CHECK_FAIL "broken")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Fortran compiler works failed with "
"the following output:\n${OUTPUT}\n\n")
string(REPLACE "\n" "\n " _output "${OUTPUT}")
message(FATAL_ERROR "The Fortran compiler\n \"${CMAKE_Fortran_COMPILER}\"\n"
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${_output}\n\n"
"CMake will not be able to correctly generate this project.")
else()
if(FORTRAN_TEST_WAS_RUN)
PrintTestCompilerResult(CHECK_PASS "works")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler works passed with "
"the following output:\n${OUTPUT}\n\n")
endif()
# Try to identify the ABI and configure it into CMakeFortranCompiler.cmake
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
# Test for Fortran 90 support by using an f90-specific construct.
if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
message(CHECK_START "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
PROGRAM TESTFortran90
integer stop ; stop = 1 ; do while ( stop .eq. 0 ) ; end do
END PROGRAM TESTFortran90
")
try_compile(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90
OUTPUT_VARIABLE OUTPUT)
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
message(CHECK_PASS "yes")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler supports Fortran 90 passed with "
"the following output:\n${OUTPUT}\n\n")
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
else()
message(CHECK_FAIL "no")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Fortran compiler supports Fortran 90 failed with "
"the following output:\n${OUTPUT}\n\n")
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
endif()
unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
endif()
# Re-configure to save learned information.
configure_file(
${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeFortranCompiler.cmake
@ONLY
)
include(${CMAKE_PLATFORM_INFO_DIR}/CMakeFortranCompiler.cmake)
if(CMAKE_Fortran_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_Fortran_ABI_FILES})
include(${f})
endforeach()
unset(CMAKE_Fortran_ABI_FILES)
endif()
endif()

View File

@ -1,71 +0,0 @@
if(_ARMClang_CMAKE_LOADED)
return()
endif()
set(_ARMClang_CMAKE_LOADED TRUE)
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
get_filename_component(_CMAKE_C_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
get_filename_component(_CMAKE_CXX_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
set(CMAKE_EXECUTABLE_SUFFIX ".elf")
find_program(CMAKE_ARMClang_LINKER armlink HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" )
find_program(CMAKE_ARMClang_AR armar HINTS "${_CMAKE_C_TOOLCHAIN_LOCATION}" "${_CMAKE_CXX_TOOLCHAIN_LOCATION}" )
set(CMAKE_LINKER "${CMAKE_ARMClang_LINKER}" CACHE FILEPATH "The ARMClang linker" FORCE)
mark_as_advanced(CMAKE_ARMClang_LINKER)
set(CMAKE_AR "${CMAKE_ARMClang_AR}" CACHE FILEPATH "The ARMClang archiver" FORCE)
mark_as_advanced(CMAKE_ARMClang_AR)
# get compiler supported cpu list
function(__armclang_set_processor_list lang out_var)
execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" --target=${CMAKE_${lang}_COMPILER_TARGET} -mcpu=list
OUTPUT_VARIABLE processor_list
ERROR_VARIABLE processor_list)
string(REGEX MATCHALL "-mcpu=([^ \n]*)" processor_list "${processor_list}")
string(REGEX REPLACE "-mcpu=" "" processor_list "${processor_list}")
set(${out_var} "${processor_list}" PARENT_SCOPE)
endfunction()
# check processor is in list
function(__armclang_check_processor processor list out_var)
string(TOLOWER "${processor}" processor)
if(processor IN_LIST list)
set(${out_var} TRUE PARENT_SCOPE)
else()
set(${out_var} FALSE PARENT_SCOPE)
endif()
endfunction()
macro(__compiler_armclang lang)
if(NOT CMAKE_${lang}_COMPILER_TARGET)
set(CMAKE_${lang}_COMPILER_TARGET arm-arm-none-eabi)
endif()
if(NOT CMAKE_${lang}_COMPILER_PROCESSOR_LIST)
__armclang_set_processor_list(${lang} CMAKE_${lang}_COMPILER_PROCESSOR_LIST)
endif()
if(NOT CMAKE_SYSTEM_PROCESSOR)
message(FATAL_ERROR " CMAKE_SYSTEM_PROCESSOR must be set for ARMClang\n"
" Supported processor: ${CMAKE_${lang}_COMPILER_PROCESSOR_LIST}\n")
else()
__armclang_check_processor("${CMAKE_SYSTEM_PROCESSOR}" "${CMAKE_${lang}_COMPILER_PROCESSOR_LIST}" _CMAKE_${lang}_CHECK_RESULT)
if(NOT _CMAKE_${lang}_CHECK_RESULT)
message(FATAL_ERROR " System processor '${CMAKE_SYSTEM_PROCESSOR}' not supported by ARMClang ${lang} compiler\n"
" Supported processor: ${CMAKE_${lang}_COMPILER_PROCESSOR_LIST}\n")
endif()
unset(_CMAKE_${lang}_CHECK_RESULT)
endif()
string(APPEND CMAKE_${lang}_FLAGS_INIT "-mcpu=${CMAKE_SYSTEM_PROCESSOR}")
string(APPEND CMAKE_${lang}_LINK_FLAGS "--cpu=${CMAKE_SYSTEM_PROCESSOR}")
set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> --list <TARGET_BASE>.map")
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> --create -cr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> --create -cr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "--via=")
set(CMAKE_${lang}_OUTPUT_EXTENSION ".o")
set(CMAKE_${lang}_OUTPUT_EXTENSION_REPLACE 1)
endmacro()
cmake_policy(POP)

View File

@ -1,133 +0,0 @@
include(Compiler/Clang)
__compiler_clang(CXX)
if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
cmake_policy(GET CMP0025 appleClangPolicy)
if(APPLE AND NOT appleClangPolicy STREQUAL NEW)
return()
endif()
if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl")
endif()
if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
endif()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
endif()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
endif()
set(_clang_version_std17 5.0)
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(_clang_version_std17 6.0)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${_clang_version_std17}")
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++1z")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${_clang_version_std17}")
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++2a")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
endif()
unset(_clang_version_std17)
if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
# The MSVC standard library requires C++14, and MSVC itself has no
# notion of operating in a mode not aware of at least that standard.
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++14")
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++14")
# This clang++ is missing some features because of MSVC compatibility.
unset(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT)
unset(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT)
unset(CMAKE_CXX17_STANDARD__HAS_FULL_SUPPORT)
unset(CMAKE_CXX20_STANDARD__HAS_FULL_SUPPORT)
endif()
__compiler_check_default_language_standard(CXX 2.1 98)
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9
AND CMAKE_CXX_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.0)
# This version of clang-cl and the MSVC version it simulates have
# support for -std: flags.
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "")
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std:c++14")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std:c++14")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std:c++17")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std:c++17")
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++latest")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std:c++latest")
else()
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std:c++latest")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std:c++latest")
endif()
__compiler_check_default_language_standard(CXX 3.9 14)
else()
# This version of clang-cl, or the MSVC version it simulates, does not have
# language standards. Set these options as empty strings so the feature
# test infrastructure can at least check to see if they are defined.
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "")
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "")
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "")
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "")
# There is no meaningful default for this
set(CMAKE_CXX_STANDARD_DEFAULT "")
# There are no compiler modes so we only need to test features once.
# Override the default macro for this special case. Pretend that
# all language standards are available so that at least compilation
# can be attempted.
macro(cmake_record_cxx_compile_features)
list(APPEND CMAKE_CXX_COMPILE_FEATURES
cxx_std_98
cxx_std_11
cxx_std_14
cxx_std_17
cxx_std_20
)
_record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES)
endmacro()
endif()

View File

@ -1,70 +0,0 @@
include(Compiler/Clang)
__compiler_clang(OBJCXX)
if("x${CMAKE_OBJCXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
if(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 2.1)
set(CMAKE_OBJCXX98_STANDARD_COMPILE_OPTION "-std=c++98")
set(CMAKE_OBJCXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
endif()
if(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 3.1)
set(CMAKE_OBJCXX98_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_OBJCXX11_STANDARD_COMPILE_OPTION "-std=c++11")
set(CMAKE_OBJCXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
set(CMAKE_OBJCXX11_STANDARD__HAS_FULL_SUPPORT ON)
elseif(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 2.1)
set(CMAKE_OBJCXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
set(CMAKE_OBJCXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
endif()
if(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 3.5)
set(CMAKE_OBJCXX14_STANDARD_COMPILE_OPTION "-std=c++14")
set(CMAKE_OBJCXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
set(CMAKE_OBJCXX14_STANDARD__HAS_FULL_SUPPORT ON)
elseif(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_OBJCXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
set(CMAKE_OBJCXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y")
set(CMAKE_OBJCXX14_STANDARD__HAS_FULL_SUPPORT ON)
endif()
set(_clang_version_std17 5.0)
if (NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS "${_clang_version_std17}")
set(CMAKE_OBJCXX17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_OBJCXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
elseif (NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 3.5)
set(CMAKE_OBJCXX17_STANDARD_COMPILE_OPTION "-std=c++1z")
set(CMAKE_OBJCXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z")
endif()
if (NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS "${_clang_version_std17}")
set(CMAKE_OBJCXX20_STANDARD_COMPILE_OPTION "-std=c++2a")
set(CMAKE_OBJCXX20_EXTENSION_COMPILE_OPTION "-std=gnu++2a")
endif()
unset(_clang_version_std17)
__compiler_check_default_language_standard(OBJCXX 2.1 98)
elseif(CMAKE_OBJCXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9
AND CMAKE_OBJCXX_SIMULATE_VERSION VERSION_GREATER_EQUAL 19.0)
# This version of clang-cl and the MSVC version it simulates have
# support for -std: flags.
set(CMAKE_OBJCXX98_STANDARD_COMPILE_OPTION "")
set(CMAKE_OBJCXX98_EXTENSION_COMPILE_OPTION "")
set(CMAKE_OBJCXX98_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_OBJCXX11_STANDARD_COMPILE_OPTION "")
set(CMAKE_OBJCXX11_EXTENSION_COMPILE_OPTION "")
set(CMAKE_OBJCXX14_STANDARD_COMPILE_OPTION "-std:c++14")
set(CMAKE_OBJCXX14_EXTENSION_COMPILE_OPTION "-std:c++14")
if (CMAKE_OBJCXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
set(CMAKE_OBJCXX17_STANDARD_COMPILE_OPTION "-std:c++17")
set(CMAKE_OBJCXX17_EXTENSION_COMPILE_OPTION "-std:c++17")
set(CMAKE_OBJCXX20_STANDARD_COMPILE_OPTION "-std:c++latest")
set(CMAKE_OBJCXX20_EXTENSION_COMPILE_OPTION "-std:c++latest")
else()
set(CMAKE_OBJCXX17_STANDARD_COMPILE_OPTION "-std:c++latest")
set(CMAKE_OBJCXX17_EXTENSION_COMPILE_OPTION "-std:c++latest")
endif()
__compiler_check_default_language_standard(OBJCXX 3.9 14)
endif()

View File

@ -1,107 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# This module is shared by multiple languages; use include blocker.
if(__COMPILER_CLANG)
return()
endif()
set(__COMPILER_CLANG 1)
include(Compiler/CMakeCommonCompilerMacros)
if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC")
macro(__compiler_clang lang)
endmacro()
else()
include(Compiler/GNU)
macro(__compiler_clang lang)
__compiler_gnu(${lang})
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
# Link options for PIE are already set in 'Compiler/GNU.cmake'
# but clang may require alternate syntax on some platforms
if (APPLE)
set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} -Xlinker -pie)
set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE -Xlinker -no_pie)
endif()
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4.0)
set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "-target ")
set(CMAKE_${lang}_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN "-gcc-toolchain ")
else()
set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "--target=")
set(CMAKE_${lang}_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN "--gcc-toolchain=")
endif()
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP)
if(CMAKE_${lang}_COMPILER_TARGET)
if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4.0)
list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-target" "${CMAKE_${lang}_COMPILER_TARGET}")
else()
list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}")
endif()
endif()
set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
string(COMPARE EQUAL "${CMAKE_${lang}_COMPILER_ID}" "AppleClang" __is_apple_clang)
# '-flto=thin' available since Clang 3.9 and Xcode 8
# * http://clang.llvm.org/docs/ThinLTO.html#clang-llvm
# * https://trac.macports.org/wiki/XcodeVersionInfo
set(_CMAKE_LTO_THIN TRUE)
if(__is_apple_clang)
if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 8.0)
set(_CMAKE_LTO_THIN FALSE)
endif()
else()
if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.9)
set(_CMAKE_LTO_THIN FALSE)
endif()
endif()
if(_CMAKE_LTO_THIN)
set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-flto=thin")
else()
set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-flto")
endif()
if(ANDROID)
# https://github.com/android-ndk/ndk/issues/242
set(CMAKE_${lang}_LINK_OPTIONS_IPO "-fuse-ld=gold")
endif()
if(ANDROID OR __is_apple_clang)
set(__ar "${CMAKE_AR}")
set(__ranlib "${CMAKE_RANLIB}")
else()
set(__ar "${CMAKE_${lang}_COMPILER_AR}")
set(__ranlib "${CMAKE_${lang}_COMPILER_RANLIB}")
endif()
set(CMAKE_${lang}_ARCHIVE_CREATE_IPO
"\"${__ar}\" cr <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_APPEND_IPO
"\"${__ar}\" r <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_FINISH_IPO
"\"${__ranlib}\" <TARGET>"
)
set(CMAKE_PCH_EXTENSION .pch)
if (NOT CMAKE_GENERATOR MATCHES "Xcode")
set(CMAKE_PCH_PROLOGUE "#pragma clang system_header")
endif()
set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE> -Xclang -include -Xclang <PCH_HEADER>)
set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER>)
endmacro()
endif()

View File

@ -1,6 +0,0 @@
# This file is loaded when gcc/g++ is used for assembler files (the "ASM" cmake language)
include(Compiler/GNU)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S;asm)
__compiler_gnu(ASM)

View File

@ -1,40 +0,0 @@
# MSVC has no specific options to set C language standards, but set them as
# empty strings anyways so the feature test infrastructure can at least check
# to see if they are defined.
set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "")
set(CMAKE_C11_STANDARD_COMPILE_OPTION "")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "")
# There is no meaningful default for this
set(CMAKE_C_STANDARD_DEFAULT "")
set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl")
# There are no C compiler modes so we hard-code the known compiler supported
# features. Override the default macro for this special case. Pretend that
# all language standards are available so that at least compilation
# can be attempted.
macro(cmake_record_c_compile_features)
list(APPEND CMAKE_C_COMPILE_FEATURES
c_std_90
c_std_99
c_std_11
c_function_prototypes
)
list(APPEND CMAKE_C90_COMPILE_FEATURES c_std_90 c_function_prototypes)
list(APPEND CMAKE_C99_COMPILE_FEATURES c_std_99)
list(APPEND CMAKE_C11_COMPILE_FEATURES c_std_11)
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0)
list(APPEND CMAKE_C_COMPILE_FEATURES c_variadic_macros)
list(APPEND CMAKE_C99_COMPILE_FEATURES c_variadic_macros)
endif()
set(_result 0) # expected by cmake_determine_compile_features
endmacro()
# /JMC "Just My Code" is only supported by MSVC 19.05 onward.
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
set(CMAKE_C_COMPILE_OPTIONS_JMC "-JMC")
endif()

View File

@ -1,93 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindOpenAL
----------
Finds Open Audio Library (OpenAL).
This module defines ``OPENAL_LIBRARY OPENAL_FOUND``, if
false, do not try to link to OpenAL ``OPENAL_INCLUDE_DIR``, where to find
the headers.
``$OPENALDIR`` is an environment variable that would correspond to the
``./configure --prefix=$OPENALDIR`` used in building OpenAL.
Created by Eric Wing. This was influenced by the ``FindSDL.cmake``
module.
#]=======================================================================]
# This makes the presumption that you are include al.h like
# #include "al.h"
# and not
# #include <AL/al.h>
# The reason for this is that the latter is not entirely portable.
# Windows/Creative Labs does not by default put their headers in AL/ and
# OS X uses the convention <OpenAL/al.h>.
#
# For Windows, Creative Labs seems to have added a registry key for their
# OpenAL 1.1 installer. I have added that key to the list of search paths,
# however, the key looks like it could be a little fragile depending on
# if they decide to change the 1.00.0000 number for bug fix releases.
# Also, they seem to have laid down groundwork for multiple library platforms
# which puts the library in an extra subdirectory. Currently there is only
# Win32 and I have hardcoded that here. This may need to be adjusted as
# platforms are introduced.
# The OpenAL 1.0 installer doesn't seem to have a useful key I can use.
# I do not know if the Nvidia OpenAL SDK has a registry key.
#
# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger).
# To support the framework, I originally wrote special framework detection
# code in this module which I have now removed with CMake's introduction
# of native support for frameworks.
# In addition, OpenAL is open source, and it is possible to compile on Panther.
# Furthermore, due to bugs in the initial OpenAL release, and the
# transition to OpenAL 1.1, it is common to need to override the built-in
# framework.
# Per my request, CMake should search for frameworks first in
# the following order:
# ~/Library/Frameworks/OpenAL.framework/Headers
# /Library/Frameworks/OpenAL.framework/Headers
# /System/Library/Frameworks/OpenAL.framework/Headers
#
# On OS X, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of
# OPENAL_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
find_path(OPENAL_INCLUDE_DIR al.h
HINTS
ENV OPENALDIR
PATH_SUFFIXES include/AL include/OpenAL include AL OpenAL
PATHS
~/Library/Frameworks
/Library/Frameworks
/opt
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_OpenAL_ARCH_DIR libs/Win64)
else()
set(_OpenAL_ARCH_DIR libs/Win32)
endif()
find_library(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
HINTS
ENV OPENALDIR
PATH_SUFFIXES libx32 lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
PATHS
~/Library/Frameworks
/Library/Frameworks
/opt
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
)
unset(_OpenAL_ARCH_DIR)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)

View File

@ -1,295 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindRuby
--------
Find Ruby
This module finds if Ruby is installed and determines where the
include files and libraries are. Ruby 1.8, 1.9, 2.0 and 2.1 are
supported.
The minimum required version of Ruby can be specified using the
standard syntax, e.g. find_package(Ruby 1.8)
It also determines what the name of the library is. This code sets
the following variables:
``RUBY_EXECUTABLE``
full path to the ruby binary
``RUBY_INCLUDE_DIRS``
include dirs to be used when using the ruby library
``RUBY_LIBRARY``
full path to the ruby library
``RUBY_VERSION``
the version of ruby which was found, e.g. "1.8.7"
``RUBY_FOUND``
set to true if ruby ws found successfully
Also:
``RUBY_INCLUDE_PATH``
same as RUBY_INCLUDE_DIRS, only provided for compatibility reasons, don't use it
#]=======================================================================]
# RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
# RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
# RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
# RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'`
# RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
# uncomment the following line to get debug output for this file
# set(_RUBY_DEBUG_OUTPUT TRUE)
# Determine the list of possible names of the ruby executable depending
# on which version of ruby is required
set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ruby)
# if 1.9 is required, don't look for ruby18 and ruby1.8, default to version 1.8
if(DEFINED Ruby_FIND_VERSION_MAJOR AND DEFINED Ruby_FIND_VERSION_MINOR)
set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${RUBY_FIND_VERSION_MINOR}")
# we can't construct that if only major version is given
set(_RUBY_POSSIBLE_EXECUTABLE_NAMES
ruby${Ruby_FIND_VERSION_MAJOR}.${Ruby_FIND_VERSION_MINOR}
ruby${Ruby_FIND_VERSION_MAJOR}${Ruby_FIND_VERSION_MINOR}
${_RUBY_POSSIBLE_EXECUTABLE_NAMES})
else()
set(Ruby_FIND_VERSION_SHORT_NODOT "18")
endif()
if(NOT Ruby_FIND_VERSION_EXACT)
list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby2.4 ruby24)
list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby2.3 ruby23)
list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby2.2 ruby22)
list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby2.1 ruby21)
list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby2.0 ruby20)
list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby1.9 ruby19)
# if we want a version below 1.9, also look for ruby 1.8
if("${Ruby_FIND_VERSION_SHORT_NODOT}" VERSION_LESS "19")
list(APPEND _RUBY_POSSIBLE_EXECUTABLE_NAMES ruby1.8 ruby18)
endif()
list(REMOVE_DUPLICATES _RUBY_POSSIBLE_EXECUTABLE_NAMES)
endif()
find_program(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES})
if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
function(_RUBY_CONFIG_VAR RBVAR OUTVAR)
execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['${RBVAR}']"
RESULT_VARIABLE _RUBY_SUCCESS
OUTPUT_VARIABLE _RUBY_OUTPUT
ERROR_QUIET)
if(_RUBY_SUCCESS OR _RUBY_OUTPUT STREQUAL "")
execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']"
RESULT_VARIABLE _RUBY_SUCCESS
OUTPUT_VARIABLE _RUBY_OUTPUT
ERROR_QUIET)
endif()
set(${OUTVAR} "${_RUBY_OUTPUT}" PARENT_SCOPE)
endfunction()
# query the ruby version
_RUBY_CONFIG_VAR("MAJOR" RUBY_VERSION_MAJOR)
_RUBY_CONFIG_VAR("MINOR" RUBY_VERSION_MINOR)
_RUBY_CONFIG_VAR("TEENY" RUBY_VERSION_PATCH)
# query the different directories
_RUBY_CONFIG_VAR("archdir" RUBY_ARCH_DIR)
_RUBY_CONFIG_VAR("arch" RUBY_ARCH)
_RUBY_CONFIG_VAR("rubyhdrdir" RUBY_HDR_DIR)
_RUBY_CONFIG_VAR("rubyarchhdrdir" RUBY_ARCHHDR_DIR)
_RUBY_CONFIG_VAR("libdir" RUBY_POSSIBLE_LIB_DIR)
_RUBY_CONFIG_VAR("rubylibdir" RUBY_RUBY_LIB_DIR)
# site_ruby
_RUBY_CONFIG_VAR("sitearchdir" RUBY_SITEARCH_DIR)
_RUBY_CONFIG_VAR("sitelibdir" RUBY_SITELIB_DIR)
# vendor_ruby available ?
execute_process(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'"
OUTPUT_VARIABLE RUBY_HAS_VENDOR_RUBY ERROR_QUIET)
if(RUBY_HAS_VENDOR_RUBY)
_RUBY_CONFIG_VAR("vendorlibdir" RUBY_VENDORLIB_DIR)
_RUBY_CONFIG_VAR("vendorarchdir" RUBY_VENDORARCH_DIR)
endif()
# save the results in the cache so we don't have to run ruby the next time again
set(RUBY_VERSION_MAJOR ${RUBY_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE)
set(RUBY_VERSION_MINOR ${RUBY_VERSION_MINOR} CACHE PATH "The Ruby minor version" FORCE)
set(RUBY_VERSION_PATCH ${RUBY_VERSION_PATCH} CACHE PATH "The Ruby patch version" FORCE)
set(RUBY_ARCH_DIR ${RUBY_ARCH_DIR} CACHE PATH "The Ruby arch dir" FORCE)
set(RUBY_HDR_DIR ${RUBY_HDR_DIR} CACHE PATH "The Ruby header dir (1.9+)" FORCE)
set(RUBY_ARCHHDR_DIR ${RUBY_ARCHHDR_DIR} CACHE PATH "The Ruby arch header dir (2.0+)" FORCE)
set(RUBY_POSSIBLE_LIB_DIR ${RUBY_POSSIBLE_LIB_DIR} CACHE PATH "The Ruby lib dir" FORCE)
set(RUBY_RUBY_LIB_DIR ${RUBY_RUBY_LIB_DIR} CACHE PATH "The Ruby ruby-lib dir" FORCE)
set(RUBY_SITEARCH_DIR ${RUBY_SITEARCH_DIR} CACHE PATH "The Ruby site arch dir" FORCE)
set(RUBY_SITELIB_DIR ${RUBY_SITELIB_DIR} CACHE PATH "The Ruby site lib dir" FORCE)
set(RUBY_HAS_VENDOR_RUBY ${RUBY_HAS_VENDOR_RUBY} CACHE BOOL "Vendor Ruby is available" FORCE)
set(RUBY_VENDORARCH_DIR ${RUBY_VENDORARCH_DIR} CACHE PATH "The Ruby vendor arch dir" FORCE)
set(RUBY_VENDORLIB_DIR ${RUBY_VENDORLIB_DIR} CACHE PATH "The Ruby vendor lib dir" FORCE)
mark_as_advanced(
RUBY_ARCH_DIR
RUBY_ARCH
RUBY_HDR_DIR
RUBY_ARCHHDR_DIR
RUBY_POSSIBLE_LIB_DIR
RUBY_RUBY_LIB_DIR
RUBY_SITEARCH_DIR
RUBY_SITELIB_DIR
RUBY_HAS_VENDOR_RUBY
RUBY_VENDORARCH_DIR
RUBY_VENDORLIB_DIR
RUBY_VERSION_MAJOR
RUBY_VERSION_MINOR
RUBY_VERSION_PATCH
)
endif()
# In case RUBY_EXECUTABLE could not be executed (e.g. cross compiling)
# try to detect which version we found. This is not too good.
if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
# by default assume 1.8.0
set(RUBY_VERSION_MAJOR 1)
set(RUBY_VERSION_MINOR 8)
set(RUBY_VERSION_PATCH 0)
# check whether we found 1.9.x
if(${RUBY_EXECUTABLE} MATCHES "ruby1\\.?9")
set(RUBY_VERSION_MAJOR 1)
set(RUBY_VERSION_MINOR 9)
endif()
# check whether we found 2.0.x
if(${RUBY_EXECUTABLE} MATCHES "ruby2\\.?0")
set(RUBY_VERSION_MAJOR 2)
set(RUBY_VERSION_MINOR 0)
endif()
# check whether we found 2.1.x
if(${RUBY_EXECUTABLE} MATCHES "ruby2\\.?1")
set(RUBY_VERSION_MAJOR 2)
set(RUBY_VERSION_MINOR 1)
endif()
# check whether we found 2.2.x
if(${RUBY_EXECUTABLE} MATCHES "ruby2\\.?2")
set(RUBY_VERSION_MAJOR 2)
set(RUBY_VERSION_MINOR 2)
endif()
# check whether we found 2.3.x
if(${RUBY_EXECUTABLE} MATCHES "ruby2\\.?3")
set(RUBY_VERSION_MAJOR 2)
set(RUBY_VERSION_MINOR 3)
endif()
# check whether we found 2.4.x
if(${RUBY_EXECUTABLE} MATCHES "ruby2\\.?4")
set(RUBY_VERSION_MAJOR 2)
set(RUBY_VERSION_MINOR 4)
endif()
endif()
if(RUBY_VERSION_MAJOR)
set(RUBY_VERSION "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}.${RUBY_VERSION_PATCH}")
set(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}")
set(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}")
set(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}")
endif()
find_path(RUBY_INCLUDE_DIR
NAMES ruby.h
HINTS
${RUBY_HDR_DIR}
${RUBY_ARCH_DIR}
/usr/lib/ruby/${_RUBY_VERSION_SHORT}/i586-linux-gnu/
)
set(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIR} )
# if ruby > 1.8 is required or if ruby > 1.8 was found, search for the config.h dir
if( "${Ruby_FIND_VERSION_SHORT_NODOT}" GREATER 18 OR "${_RUBY_VERSION_SHORT_NODOT}" GREATER 18 OR RUBY_HDR_DIR)
find_path(RUBY_CONFIG_INCLUDE_DIR
NAMES ruby/config.h config.h
HINTS
${RUBY_HDR_DIR}/${RUBY_ARCH}
${RUBY_ARCH_DIR}
${RUBY_ARCHHDR_DIR}
)
set(RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_DIRS} ${RUBY_CONFIG_INCLUDE_DIR} )
endif()
# Determine the list of possible names for the ruby library
set(_RUBY_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_RUBY_VERSION_SHORT} ruby${_RUBY_VERSION_SHORT_NODOT} ruby-${_RUBY_VERSION_SHORT} ruby-${RUBY_VERSION})
if(WIN32)
set( _RUBY_MSVC_RUNTIME "" )
if( MSVC_VERSION EQUAL 1200 )
set( _RUBY_MSVC_RUNTIME "60" )
endif()
if( MSVC_VERSION EQUAL 1300 )
set( _RUBY_MSVC_RUNTIME "70" )
endif()
if( MSVC_VERSION EQUAL 1310 )
set( _RUBY_MSVC_RUNTIME "71" )
endif()
if( MSVC_VERSION EQUAL 1400 )
set( _RUBY_MSVC_RUNTIME "80" )
endif()
if( MSVC_VERSION EQUAL 1500 )
set( _RUBY_MSVC_RUNTIME "90" )
endif()
set(_RUBY_ARCH_PREFIX "")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_RUBY_ARCH_PREFIX "x64-")
endif()
list(APPEND _RUBY_POSSIBLE_LIB_NAMES
"${_RUBY_ARCH_PREFIX}msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}"
"${_RUBY_ARCH_PREFIX}msvcr${_RUBY_MSVC_RUNTIME}-ruby${_RUBY_NODOT_VERSION}-static"
"${_RUBY_ARCH_PREFIX}msvcrt-ruby${_RUBY_NODOT_VERSION}"
"${_RUBY_ARCH_PREFIX}msvcrt-ruby${_RUBY_NODOT_VERSION}-static" )
endif()
find_library(RUBY_LIBRARY NAMES ${_RUBY_POSSIBLE_LIB_NAMES} HINTS ${RUBY_POSSIBLE_LIB_DIR} )
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
set(_RUBY_REQUIRED_VARS RUBY_EXECUTABLE RUBY_INCLUDE_DIR RUBY_LIBRARY)
if(_RUBY_VERSION_SHORT_NODOT GREATER 18)
list(APPEND _RUBY_REQUIRED_VARS RUBY_CONFIG_INCLUDE_DIR)
endif()
if(_RUBY_DEBUG_OUTPUT)
message(STATUS "--------FindRuby.cmake debug------------")
message(STATUS "_RUBY_POSSIBLE_EXECUTABLE_NAMES: ${_RUBY_POSSIBLE_EXECUTABLE_NAMES}")
message(STATUS "_RUBY_POSSIBLE_LIB_NAMES: ${_RUBY_POSSIBLE_LIB_NAMES}")
message(STATUS "RUBY_ARCH_DIR: ${RUBY_ARCH_DIR}")
message(STATUS "RUBY_HDR_DIR: ${RUBY_HDR_DIR}")
message(STATUS "RUBY_POSSIBLE_LIB_DIR: ${RUBY_POSSIBLE_LIB_DIR}")
message(STATUS "Found RUBY_VERSION: \"${RUBY_VERSION}\" , short: \"${_RUBY_VERSION_SHORT}\", nodot: \"${_RUBY_VERSION_SHORT_NODOT}\"")
message(STATUS "_RUBY_REQUIRED_VARS: ${_RUBY_REQUIRED_VARS}")
message(STATUS "RUBY_EXECUTABLE: ${RUBY_EXECUTABLE}")
message(STATUS "RUBY_LIBRARY: ${RUBY_LIBRARY}")
message(STATUS "RUBY_INCLUDE_DIR: ${RUBY_INCLUDE_DIR}")
message(STATUS "RUBY_CONFIG_INCLUDE_DIR: ${RUBY_CONFIG_INCLUDE_DIR}")
message(STATUS "--------------------")
endif()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby REQUIRED_VARS ${_RUBY_REQUIRED_VARS}
VERSION_VAR RUBY_VERSION )
mark_as_advanced(
RUBY_EXECUTABLE
RUBY_LIBRARY
RUBY_INCLUDE_DIR
RUBY_CONFIG_INCLUDE_DIR
)
# Set some variables for compatibility with previous version of this file
set(RUBY_POSSIBLE_LIB_PATH ${RUBY_POSSIBLE_LIB_DIR})
set(RUBY_RUBY_LIB_PATH ${RUBY_RUBY_LIB_DIR})
set(RUBY_INCLUDE_PATH ${RUBY_INCLUDE_DIRS})

View File

@ -1,67 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindSWIG
--------
Find Simplified Wrapper and Interface Generator (SWIG)
This module finds an installed SWIG. It sets the following variables:
::
SWIG_FOUND - set to "True" if SWIG is found
SWIG_DIR - the directory where swig is installed
SWIG_EXECUTABLE - the path to the swig executable
SWIG_VERSION - the version number of the swig executable
The minimum required version of SWIG can be specified using the
standard syntax, e.g. :command:`find_package(SWIG 1.1)`
All information is collected from the ``SWIG_EXECUTABLE``, so the version
to be found can be changed from the command line by means of setting
``SWIG_EXECUTABLE``
#]=======================================================================]
find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig)
if(SWIG_EXECUTABLE)
execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib
OUTPUT_VARIABLE SWIG_swiglib_output
ERROR_VARIABLE SWIG_swiglib_error
RESULT_VARIABLE SWIG_swiglib_result)
if(SWIG_swiglib_result)
if(SWIG_FIND_REQUIRED)
message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
else()
message(STATUS "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}")
endif()
else()
string(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output})
find_path(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output} NO_CMAKE_FIND_ROOT_PATH)
if(SWIG_DIR)
set(SWIG_USE_FILE ${CMAKE_CURRENT_LIST_DIR}/UseSWIG.cmake)
execute_process(COMMAND ${SWIG_EXECUTABLE} -version
OUTPUT_VARIABLE SWIG_version_output
ERROR_VARIABLE SWIG_version_output
RESULT_VARIABLE SWIG_version_result)
if(SWIG_version_result)
message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -version\" failed with output:\n${SWIG_version_output}")
else()
string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1"
SWIG_version_output "${SWIG_version_output}")
set(SWIG_VERSION ${SWIG_version_output} CACHE STRING "Swig version" FORCE)
endif()
endif()
endif()
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
VERSION_VAR SWIG_VERSION )
mark_as_advanced(SWIG_DIR SWIG_VERSION SWIG_EXECUTABLE)

View File

@ -1,106 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
set(prefix "${TEST_PREFIX}")
set(suffix "${TEST_SUFFIX}")
set(extra_args ${TEST_EXTRA_ARGS})
set(properties ${TEST_PROPERTIES})
set(script)
set(suite)
set(tests)
function(add_command NAME)
set(_args "")
foreach(_arg ${ARGN})
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
set(_args "${_args} [==[${_arg}]==]")
else()
set(_args "${_args} ${_arg}")
endif()
endforeach()
set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE)
endfunction()
# Run test executable to get list of available tests
if(NOT EXISTS "${TEST_EXECUTABLE}")
message(FATAL_ERROR
"Specified test executable does not exist.\n"
" Path: '${TEST_EXECUTABLE}'"
)
endif()
execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" --gtest_list_tests
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
TIMEOUT ${TEST_DISCOVERY_TIMEOUT}
OUTPUT_VARIABLE output
RESULT_VARIABLE result
)
if(NOT ${result} EQUAL 0)
string(REPLACE "\n" "\n " output "${output}")
message(FATAL_ERROR
"Error running test executable.\n"
" Path: '${TEST_EXECUTABLE}'\n"
" Result: ${result}\n"
" Output:\n"
" ${output}\n"
)
endif()
string(REPLACE "\n" ";" output "${output}")
# Parse output
foreach(line ${output})
# Skip header
if(NOT line MATCHES "gtest_main\\.cc")
# Do we have a module name or a test name?
if(NOT line MATCHES "^ ")
# Module; remove trailing '.' to get just the name...
string(REGEX REPLACE "\\.( *#.*)?" "" suite "${line}")
if(line MATCHES "#" AND NOT NO_PRETTY_TYPES)
string(REGEX REPLACE "/[0-9]\\.+ +#.*= +" "/" pretty_suite "${line}")
else()
set(pretty_suite "${suite}")
endif()
string(REGEX REPLACE "^DISABLED_" "" pretty_suite "${pretty_suite}")
else()
# Test name; strip spaces and comments to get just the name...
string(REGEX REPLACE " +" "" test "${line}")
if(test MATCHES "#" AND NOT NO_PRETTY_VALUES)
string(REGEX REPLACE "/[0-9]+#GetParam..=" "/" pretty_test "${test}")
else()
string(REGEX REPLACE "#.*" "" pretty_test "${test}")
endif()
string(REGEX REPLACE "^DISABLED_" "" pretty_test "${pretty_test}")
string(REGEX REPLACE "#.*" "" test "${test}")
# ...and add to script
add_command(add_test
"${prefix}${pretty_suite}.${pretty_test}${suffix}"
${TEST_EXECUTOR}
"${TEST_EXECUTABLE}"
"--gtest_filter=${suite}.${test}"
"--gtest_also_run_disabled_tests"
${extra_args}
)
if(suite MATCHES "^DISABLED" OR test MATCHES "^DISABLED")
add_command(set_tests_properties
"${prefix}${pretty_suite}.${pretty_test}${suffix}"
PROPERTIES DISABLED TRUE
)
endif()
add_command(set_tests_properties
"${prefix}${pretty_suite}.${pretty_test}${suffix}"
PROPERTIES
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
${properties}
)
list(APPEND tests "${prefix}${pretty_suite}.${pretty_test}${suffix}")
endif()
endif()
endforeach()
# Create a list of all discovered tests, which users may use to e.g. set
# properties on the tests
add_command(set ${TEST_LIST} ${tests})
# Write CTest script
file(WRITE "${CTEST_FILE}" "${script}")

View File

@ -1,129 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# This module is shared by multiple languages; use include blocker.
if(__WINDOWS_OPENWATCOM)
return()
endif()
set(__WINDOWS_OPENWATCOM 1)
set(CMAKE_LIBRARY_PATH_FLAG "libpath ")
set(CMAKE_LINK_LIBRARY_FLAG "library ")
set(CMAKE_LINK_LIBRARY_FILE_FLAG "library ")
if(CMAKE_VERBOSE_MAKEFILE)
set(CMAKE_WCL_QUIET)
set(CMAKE_WLINK_QUIET)
set(CMAKE_LIB_QUIET)
else()
set(CMAKE_WCL_QUIET "-zq")
set(CMAKE_WLINK_QUIET "option quiet")
set(CMAKE_LIB_QUIET "-q")
endif()
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ")
set(CMAKE_CREATE_WIN32_EXE "system nt_win" )
set(CMAKE_CREATE_CONSOLE_EXE "system nt" )
string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " system nt_dll")
string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " system nt_dll")
foreach(type SHARED MODULE EXE)
string(APPEND CMAKE_${type}_LINKER_FLAGS_DEBUG_INIT " debug all opt map")
string(APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO_INIT " debug all opt map")
endforeach()
set(CMAKE_C_COMPILE_OPTIONS_DLL "-bd") # Note: This variable is a ';' separated list
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-bd") # ... while this is a space separated string.
set(CMAKE_RC_COMPILER "rc" )
set(CMAKE_BUILD_TYPE_INIT Debug)
# single/multi-threaded /-bm
# static/DLL run-time libraries /-br
# default is setup for multi-threaded + DLL run-time libraries
string(APPEND CMAKE_C_FLAGS_INIT " -bt=nt -w3 -dWIN32 -br -bm")
string(APPEND CMAKE_CXX_FLAGS_INIT " -bt=nt -xs -w3 -dWIN32 -br -bm")
foreach(lang C CXX)
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -d2")
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -s -os -d0 -dNDEBUG")
string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -s -ot -d0 -dNDEBUG")
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -s -ot -d1 -dNDEBUG")
endforeach()
foreach(type CREATE_SHARED_LIBRARY CREATE_SHARED_MODULE LINK_EXECUTABLE)
set(CMAKE_C_${type}_USE_WATCOM_QUOTE 1)
set(CMAKE_CXX_${type}_USE_WATCOM_QUOTE 1)
endforeach()
set(CMAKE_C_CREATE_IMPORT_LIBRARY
"wlib -c -q -n -b <TARGET_IMPLIB> +<TARGET_QUOTED>")
set(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
set(CMAKE_C_LINK_EXECUTABLE
"wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name <TARGET> <LINK_FLAGS> file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
set(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
# compile a C++ file into an object file
set(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<OBJECT> -c -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}")
# compile a C file into an object file
set(CMAKE_C_COMPILE_OBJECT
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<OBJECT> -c -cc <SOURCE>${CMAKE_END_TEMP_FILE}")
# preprocess a C source file
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<PREPROCESSED_SOURCE> -pl -cc <SOURCE>${CMAKE_END_TEMP_FILE}")
# preprocess a C++ source file
set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<PREPROCESSED_SOURCE> -pl -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}")
set(CMAKE_CXX_CREATE_SHARED_LIBRARY
"wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name <TARGET> <LINK_FLAGS> option implib=<TARGET_IMPLIB> file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
string(REPLACE " option implib=<TARGET_IMPLIB>" ""
CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
# create a C shared library
set(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
# create a C shared module
set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE})
# create a C++ static library
set(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -c -n -b <TARGET_QUOTED> <LINK_FLAGS> <OBJECTS> ")
# create a C static library
set(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
if(NOT _CMAKE_WATCOM_VERSION)
set(_CMAKE_WATCOM_VERSION 1)
if(CMAKE_C_COMPILER_VERSION)
set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
set(_compiler_id ${CMAKE_C_COMPILER_ID})
else()
set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
set(_compiler_id ${CMAKE_CXX_COMPILER_ID})
endif()
set(WATCOM16)
set(WATCOM17)
set(WATCOM18)
set(WATCOM19)
if("${_compiler_id}" STREQUAL "OpenWatcom")
if("${_compiler_version}" VERSION_LESS 1.7)
set(WATCOM16 1)
endif()
if("${_compiler_version}" VERSION_EQUAL 1.7)
set(WATCOM17 1)
endif()
if("${_compiler_version}" VERSION_EQUAL 1.8)
set(WATCOM18 1)
endif()
if("${_compiler_version}" VERSION_EQUAL 1.9)
set(WATCOM19 1)
endif()
endif()
endif()

View File

@ -1,28 +0,0 @@
#!/bin/sh
SQUISHSERVER=$1
SQUISHRUNNER=$2
TESTSUITE=$3
TESTCASE=$4
AUT=$5
AUTDIR=$6
SETTINGSGROUP=$7
$SQUISHSERVER --stop > /dev/null 2>&1
echo "Adding AUT... $SQUISHSERVER --settingsGroup $SETTINGSGROUP --config addAUT $AUT $AUTDIR"
$SQUISHSERVER --settingsGroup "$SETTINGSGROUP" --config addAUT "$AUT" "$AUTDIR" || exit 255
# sleep 1
echo "Starting the squish server... $SQUISHSERVER --daemon"
$SQUISHSERVER --daemon || exit 255
# sleep 2
echo "Running the test case...$SQUISHRUNNER --settingsGroup $SETTINGSGROUP --testsuite $TESTSUITE --testcase $TESTCASE"
$SQUISHRUNNER --settingsGroup "$SETTINGSGROUP" --testsuite "$TESTSUITE" --testcase "$TESTCASE"
returnValue=$?
echo "Stopping the squish server... $SQUISHSERVER --stop"
$SQUISHSERVER --stop
exit $returnValue

View File

@ -0,0 +1,11 @@
When a device link step is involved, which is controlled by
:prop_tgt:`CUDA_SEPARABLE_COMPILATION` and
:prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` properties and policy :policy:`CMP0105`,
the raw options will be delivered to the host and device link steps (wrapped in
``-Xcompiler`` or equivalent for device link). Options wrapped with
``$<DEVICE_LINK:...>``
:manual:`generator expression <cmake-generator-expressions(7)>` will be used
only for the device link step. Options wrapped with ``$<HOST_LINK:...>``
:manual:`generator expression <cmake-generator-expressions(7)>` will be used
only for the host link step.

View File

@ -15,6 +15,7 @@ The general signature is:
[PATHS path1 [path2 ... ENV var]] [PATHS path1 [path2 ... ENV var]]
[PATH_SUFFIXES suffix1 [suffix2 ...]] [PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"] [DOC "cache documentation string"]
[REQUIRED]
[NO_DEFAULT_PATH] [NO_DEFAULT_PATH]
[NO_PACKAGE_ROOT_PATH] [NO_PACKAGE_ROOT_PATH]
[NO_CMAKE_PATH] [NO_CMAKE_PATH]
@ -31,8 +32,9 @@ A cache entry named by ``<VAR>`` is created to store the result
of this command. of this command.
If the |SEARCH_XXX| is found the result is stored in the variable If the |SEARCH_XXX| is found the result is stored in the variable
and the search will not be repeated unless the variable is cleared. and the search will not be repeated unless the variable is cleared.
If nothing is found, the result will be If nothing is found, the result will be ``<VAR>-NOTFOUND``.
``<VAR>-NOTFOUND``, and the search will be attempted again the The ``REQUIRED`` option stops processing with an error message if nothing
is found, otherwise the search will be attempted again the
next time |FIND_XXX| is invoked with the same variable. next time |FIND_XXX| is invoked with the same variable.
Options include: Options include:
@ -57,6 +59,9 @@ Options include:
``DOC`` ``DOC``
Specify the documentation string for the ``<VAR>`` cache entry. Specify the documentation string for the ``<VAR>`` cache entry.
``REQUIRED``
Stop processing with an error message if nothing is found.
If ``NO_DEFAULT_PATH`` is specified, then no additional paths are If ``NO_DEFAULT_PATH`` is specified, then no additional paths are
added to the search. added to the search.
If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
@ -138,6 +143,10 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
* |CMAKE_SYSTEM_XXX_PATH| * |CMAKE_SYSTEM_XXX_PATH|
* |CMAKE_SYSTEM_XXX_MAC_PATH| * |CMAKE_SYSTEM_XXX_MAC_PATH|
The platform paths that these variables contain are locations that
typically include installed software. An example being ``/usr/local`` for
UNIX based platforms.
7. Search the paths specified by the PATHS option 7. Search the paths specified by the PATHS option
or in the short-hand version of the command. or in the short-hand version of the command.
These are typically hard-coded guesses. These are typically hard-coded guesses.

View File

@ -46,3 +46,6 @@ to use the more specific commands :command:`add_compile_definitions`
and :command:`include_directories`. and :command:`include_directories`.
The command :command:`target_compile_options` adds target-specific options. The command :command:`target_compile_options` adds target-specific options.
The source file property :prop_sf:`COMPILE_OPTIONS` adds options to one
source file.

View File

@ -1,8 +1,15 @@
add_executable add_executable
-------------- --------------
.. only:: html
.. contents::
Add an executable to the project using the specified source files. Add an executable to the project using the specified source files.
Normal Executables
^^^^^^^^^^^^^^^^^^
.. code-block:: cmake .. code-block:: cmake
add_executable(<name> [WIN32] [MACOSX_BUNDLE] add_executable(<name> [WIN32] [MACOSX_BUNDLE]
@ -45,7 +52,8 @@ See also :prop_sf:`HEADER_FILE_ONLY` on what to do if some sources are
pre-processed, and you want to have the original sources reachable from pre-processed, and you want to have the original sources reachable from
within IDE. within IDE.
-------------------------------------------------------------------------- Imported Executables
^^^^^^^^^^^^^^^^^^^^
.. code-block:: cmake .. code-block:: cmake
@ -65,7 +73,8 @@ whose names begin in ``IMPORTED_``. The most important such property is
the main executable file on disk. See documentation of the ``IMPORTED_*`` the main executable file on disk. See documentation of the ``IMPORTED_*``
properties for more information. properties for more information.
-------------------------------------------------------------------------- Alias Executables
^^^^^^^^^^^^^^^^^
.. code-block:: cmake .. code-block:: cmake
@ -74,8 +83,13 @@ properties for more information.
Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can
be used to refer to ``<target>`` in subsequent commands. The ``<name>`` be used to refer to ``<target>`` in subsequent commands. The ``<name>``
does not appear in the generated buildsystem as a make target. The does not appear in the generated buildsystem as a make target. The
``<target>`` may not be a non-``GLOBAL`` ``<target>`` may not be an ``ALIAS``.
:ref:`Imported Target <Imported Targets>` or an ``ALIAS``.
An ``ALIAS`` to a non-``GLOBAL`` :ref:`Imported Target <Imported Targets>`
has scope in the directory in which the alias is created and below.
The :prop_tgt:`ALIAS_GLOBAL` target property can be used to check if the
alias is global or not.
``ALIAS`` targets can be used as targets to read properties ``ALIAS`` targets can be used as targets to read properties
from, executables for custom commands and custom targets. They can also be from, executables for custom commands and custom targets. They can also be
tested for existence with the regular :command:`if(TARGET)` subcommand. tested for existence with the regular :command:`if(TARGET)` subcommand.

View File

@ -139,8 +139,13 @@ Alias Libraries
Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can be Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can be
used to refer to ``<target>`` in subsequent commands. The ``<name>`` does used to refer to ``<target>`` in subsequent commands. The ``<name>`` does
not appear in the generated buildsystem as a make target. The ``<target>`` not appear in the generated buildsystem as a make target. The ``<target>``
may not be a non-``GLOBAL`` :ref:`Imported Target <Imported Targets>` or an may not be an ``ALIAS``.
``ALIAS``.
An ``ALIAS`` to a non-``GLOBAL`` :ref:`Imported Target <Imported Targets>`
has scope in the directory in which the alias is created and below.
The :prop_tgt:`ALIAS_GLOBAL` target property can be used to check if the
alias is global or not.
``ALIAS`` targets can be used as linkable targets and as targets to ``ALIAS`` targets can be used as linkable targets and as targets to
read properties from. They can also be tested for existence with the read properties from. They can also be tested for existence with the
regular :command:`if(TARGET)` subcommand. The ``<name>`` may not be used regular :command:`if(TARGET)` subcommand. The ``<name>`` may not be used

View File

@ -26,6 +26,8 @@ the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties. manual for more on defining buildsystem properties.
.. include:: DEVICE_LINK_OPTIONS.txt
.. include:: OPTIONS_SHELL.txt .. include:: OPTIONS_SHELL.txt
.. include:: LINK_OPTIONS_LINKER.txt .. include:: LINK_OPTIONS_LINKER.txt

View File

@ -0,0 +1,99 @@
cmake_language
--------------
Call meta-operations on CMake commands.
Synopsis
^^^^^^^^
.. parsed-literal::
cmake_language(`CALL`_ <command> [<args>...])
cmake_language(`EVAL`_ CODE <code>...)
Introduction
^^^^^^^^^^^^
This command will call meta-operations on built-in CMake commands or
those created via the :command:`macro` or :command:`function` commands.
``cmake_language`` does not introduce a new variable or policy scope.
Calling Commands
^^^^^^^^^^^^^^^^
.. _CALL:
.. code-block:: cmake
cmake_language(CALL <command> [<args>...])
Calls the named ``<command>`` with the given arguments (if any).
For example, the code:
.. code-block:: cmake
set(message_command "message")
cmake_language(CALL ${message_command} STATUS "Hello World!")
is equivalent to
.. code-block:: cmake
message(STATUS "Hello World!")
.. note::
To ensure consistency of the code, the following commands are not allowed:
* ``if`` / ``elseif`` / ``else`` / ``endif``
* ``while`` / ``endwhile``
* ``foreach`` / ``endforeach``
* ``function`` / ``endfunction``
* ``macro`` / ``endmacro``
Evaluating Code
^^^^^^^^^^^^^^^
.. _EVAL:
.. code-block:: cmake
cmake_language(EVAL CODE <code>...)
Evaluates the ``<code>...`` as CMake code.
For example, the code:
.. code-block:: cmake
set(A TRUE)
set(B TRUE)
set(C TRUE)
set(condition "(A AND B) OR C")
cmake_language(EVAL CODE "
if (${condition})
message(STATUS TRUE)
else()
message(STATUS FALSE)
endif()"
)
is equivalent to
.. code-block:: cmake
set(A TRUE)
set(B TRUE)
set(C TRUE)
set(condition "(A AND B) OR C")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/eval.cmake "
if (${condition})
message(STATUS TRUE)
else()
message(STATUS FALSE)
endif()"
)
include(${CMAKE_CURRENT_BINARY_DIR}/eval.cmake)

View File

@ -20,6 +20,7 @@ Perform the :ref:`CTest Test Step` as a :ref:`Dashboard Client`.
[RESOURCE_SPEC_FILE <file>] [RESOURCE_SPEC_FILE <file>]
[TEST_LOAD <threshold>] [TEST_LOAD <threshold>]
[SCHEDULE_RANDOM <ON|OFF>] [SCHEDULE_RANDOM <ON|OFF>]
[STOP_ON_FAILURE]
[STOP_TIME <time-of-day>] [STOP_TIME <time-of-day>]
[RETURN_VALUE <result-var>] [RETURN_VALUE <result-var>]
[CAPTURE_CMAKE_ERROR <result-var>] [CAPTURE_CMAKE_ERROR <result-var>]
@ -119,6 +120,9 @@ The options are:
Launch tests in a random order. This may be useful for detecting Launch tests in a random order. This may be useful for detecting
implicit test dependencies. implicit test dependencies.
``STOP_ON_FAILURE``
Stop the execution of the tests once one has failed.
``STOP_TIME <time-of-day>`` ``STOP_TIME <time-of-day>``
Specify a time of day at which the tests should all stop running. Specify a time of day at which the tests should all stop running.

View File

@ -21,7 +21,9 @@ Execute one or more child processes.
[COMMAND_ECHO <where>] [COMMAND_ECHO <where>]
[OUTPUT_STRIP_TRAILING_WHITESPACE] [OUTPUT_STRIP_TRAILING_WHITESPACE]
[ERROR_STRIP_TRAILING_WHITESPACE] [ERROR_STRIP_TRAILING_WHITESPACE]
[ENCODING <name>]) [ENCODING <name>]
[ECHO_OUTPUT_VARIABLE]
[ECHO_ERROR_VARIABLE])
Runs the given sequence of one or more commands. Runs the given sequence of one or more commands.
@ -105,6 +107,15 @@ Options:
for this encoding. In CMake 3.11.0, ``UTF-8`` was added for consistency with for this encoding. In CMake 3.11.0, ``UTF-8`` was added for consistency with
the `UTF-8 RFC <https://www.ietf.org/rfc/rfc3629>`_ naming convention. the `UTF-8 RFC <https://www.ietf.org/rfc/rfc3629>`_ naming convention.
``ECHO_OUTPUT_VARIABLE``, ``ECHO_ERROR_VARIABLE``
The standard output or standard error will not be exclusively redirected to
the configured variables.
The output will be duplicated, it will be sent into the configured variables
and also on standard output or standard error.
This is analogous to the ``tee`` Unix command.
If more than one ``OUTPUT_*`` or ``ERROR_*`` option is given for the If more than one ``OUTPUT_*`` or ``ERROR_*`` option is given for the
same pipe the precedence is not specified. same pipe the precedence is not specified.
If no ``OUTPUT_*`` or ``ERROR_*`` options are given the output will If no ``OUTPUT_*`` or ``ERROR_*`` options are given the output will

View File

@ -19,6 +19,7 @@ Synopsis
file({`WRITE`_ | `APPEND`_} <filename> <content>...) file({`WRITE`_ | `APPEND`_} <filename> <content>...)
file({`TOUCH`_ | `TOUCH_NOCREATE`_} [<file>...]) file({`TOUCH`_ | `TOUCH_NOCREATE`_} [<file>...])
file(`GENERATE`_ OUTPUT <output-file> [...]) file(`GENERATE`_ OUTPUT <output-file> [...])
file(`CONFIGURE`_ OUTPUT <output-file> CONTENT <content> [...])
`Filesystem`_ `Filesystem`_
file({`GLOB`_ | `GLOB_RECURSE`_} <out-var> [...] [<globbing-expr>...]) file({`GLOB`_ | `GLOB_RECURSE`_} <out-var> [...] [<globbing-expr>...])
@ -41,6 +42,10 @@ Synopsis
`Locking`_ `Locking`_
file(`LOCK`_ <path> [...]) file(`LOCK`_ <path> [...])
`Archiving`_
file(`ARCHIVE_CREATE`_ OUTPUT <archive> PATHS <paths>... [...])
file(`ARCHIVE_EXTRACT`_ INPUT <archive> [...])
Reading Reading
^^^^^^^ ^^^^^^^
@ -54,7 +59,9 @@ Reading
Read content from a file called ``<filename>`` and store it in a Read content from a file called ``<filename>`` and store it in a
``<variable>``. Optionally start from the given ``<offset>`` and ``<variable>``. Optionally start from the given ``<offset>`` and
read at most ``<max-in>`` bytes. The ``HEX`` option causes data to read at most ``<max-in>`` bytes. The ``HEX`` option causes data to
be converted to a hexadecimal representation (useful for binary data). be converted to a hexadecimal representation (useful for binary data). If the
``HEX`` option is specified, letters in the output (``a`` through ``f``) are in
lowercase.
.. _STRINGS: .. _STRINGS:
@ -243,8 +250,8 @@ be resolved. See below for a full description of how they work.
List of post-exclude regexes through which to filter the names of resolved List of post-exclude regexes through which to filter the names of resolved
dependencies. dependencies.
These arguments can be used to blacklist unwanted system libraries when These arguments can be used to exclude unwanted system libraries when
resolving the dependencies, or to whitelist libraries from a specific resolving the dependencies, or to include libraries from a specific
directory. The filtering works as follows: directory. The filtering works as follows:
1. If the not-yet-resolved dependency matches any of the 1. If the not-yet-resolved dependency matches any of the
@ -395,8 +402,8 @@ dependency resolution:
Determines the path to the tool to use for dependency resolution. This is the Determines the path to the tool to use for dependency resolution. This is the
actual path to ``objdump``, ``dumpbin``, or ``otool``. actual path to ``objdump``, ``dumpbin``, or ``otool``.
If this variable is not specified, it is determined automatically by system If this variable is not specified, it is determined by the value of
introspection. ``CMAKE_OBJDUMP`` if set, else by system introspection.
Writing Writing
^^^^^^^ ^^^^^^^
@ -482,6 +489,44 @@ generation phase. The output file will not yet have been written when the
``file(GENERATE)`` command returns, it is written only after processing all ``file(GENERATE)`` command returns, it is written only after processing all
of a project's ``CMakeLists.txt`` files. of a project's ``CMakeLists.txt`` files.
.. _CONFIGURE:
.. code-block:: cmake
file(CONFIGURE OUTPUT output-file
CONTENT content
[ESCAPE_QUOTES] [@ONLY]
[NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])
Generate an output file using the input given by ``CONTENT`` and substitute
variable values referenced as ``@VAR@`` or ``${VAR}`` contained therein. The
substitution rules behave the same as the :command:`configure_file` command.
In order to match :command:`configure_file`'s behavior, generator expressions
are not supported for both ``OUTPUT`` and ``CONTENT``.
The arguments are:
``OUTPUT <output-file>``
Specify the output file name to generate. A relative path is treated with
respect to the value of :variable:`CMAKE_CURRENT_BINARY_DIR`.
``<output-file>`` does not support generator expressions.
``CONTENT <content>``
Use the content given explicitly as input.
``<content>`` does not support generator expressions.
``ESCAPE_QUOTES``
Escape any substituted quotes with backslashes (C-style).
``@ONLY``
Restrict variable replacement to references of the form ``@VAR@``.
This is useful for configuring scripts that use ``${VAR}`` syntax.
``NEWLINE_STYLE <style>``
Specify the newline style for the output file. Specify
``UNIX`` or ``LF`` for ``\n`` newlines, or specify
``DOS``, ``WIN32``, or ``CRLF`` for ``\r\n`` newlines.
Filesystem Filesystem
^^^^^^^^^^ ^^^^^^^^^^
@ -790,6 +835,18 @@ Options to both ``DOWNLOAD`` and ``UPLOAD`` are:
If neither ``NETRC`` option is given CMake will check variables If neither ``NETRC`` option is given CMake will check variables
``CMAKE_NETRC`` and ``CMAKE_NETRC_FILE``, respectively. ``CMAKE_NETRC`` and ``CMAKE_NETRC_FILE``, respectively.
``TLS_VERIFY <ON|OFF>``
Specify whether to verify the server certificate for ``https://`` URLs.
The default is to *not* verify.
``TLS_CAINFO <file>``
Specify a custom Certificate Authority file for ``https://`` URLs.
For ``https://`` URLs CMake must be built with OpenSSL support. ``TLS/SSL``
certificates are not checked by default. Set ``TLS_VERIFY`` to ``ON`` to
check certificates. If neither ``TLS`` option is given CMake will check
variables ``CMAKE_TLS_VERIFY`` and ``CMAKE_TLS_CAINFO``, respectively.
Additional options to ``DOWNLOAD`` are: Additional options to ``DOWNLOAD`` are:
``EXPECTED_HASH ALGO=<value>`` ``EXPECTED_HASH ALGO=<value>``
@ -801,19 +858,6 @@ Additional options to ``DOWNLOAD`` are:
``EXPECTED_MD5 <value>`` ``EXPECTED_MD5 <value>``
Historical short-hand for ``EXPECTED_HASH MD5=<value>``. Historical short-hand for ``EXPECTED_HASH MD5=<value>``.
``TLS_VERIFY <ON|OFF>``
Specify whether to verify the server certificate for ``https://`` URLs.
The default is to *not* verify.
``TLS_CAINFO <file>``
Specify a custom Certificate Authority file for ``https://`` URLs.
For ``https://`` URLs CMake must be built with OpenSSL support. ``TLS/SSL``
certificates are not checked by default. Set ``TLS_VERIFY`` to ``ON`` to
check certificates and/or use ``EXPECTED_HASH`` to verify downloaded content.
If neither ``TLS`` option is given CMake will check variables
``CMAKE_TLS_VERIFY`` and ``CMAKE_TLS_CAINFO``, respectively.
Locking Locking
^^^^^^^ ^^^^^^^
@ -846,3 +890,66 @@ child directory or file.
Trying to lock file twice is not allowed. Any intermediate directories and Trying to lock file twice is not allowed. Any intermediate directories and
file itself will be created if they not exist. ``GUARD`` and ``TIMEOUT`` file itself will be created if they not exist. ``GUARD`` and ``TIMEOUT``
options ignored on ``RELEASE`` operation. options ignored on ``RELEASE`` operation.
Archiving
^^^^^^^^^
.. _ARCHIVE_CREATE:
.. code-block:: cmake
file(ARCHIVE_CREATE OUTPUT <archive>
PATHS <paths>...
[FORMAT <format>]
[COMPRESSION <compression>]
[MTIME <mtime>]
[VERBOSE])
Creates the specified ``<archive>`` file with the files and directories
listed in ``<paths>``. Note that ``<paths>`` must list actual files or
directories, wildcards are not supported.
Use the ``FORMAT`` option to specify the archive format. Supported values
for ``<format>`` are ``7zip``, ``gnutar``, ``pax``, ``paxr``, ``raw`` and
``zip``. If ``FORMAT`` is not given, the default format is ``paxr``.
Some archive formats allow the type of compression to be specified.
The ``7zip`` and ``zip`` archive formats already imply a specific type of
compression. The other formats use no compression by default, but can be
directed to do so with the ``COMPRESSION`` option. Valid values for
``<compression>`` are ``None``, ``BZip2``, ``GZip``, ``XZ``, and ``Zstd``.
.. note::
With ``FORMAT`` set to ``raw`` only one file will be compressed with the
compression type specified by ``COMPRESSION``.
The ``VERBOSE`` option enables verbose output for the archive operation.
To specify the modification time recorded in tarball entries, use
the ``MTIME`` option.
.. _ARCHIVE_EXTRACT:
.. code-block:: cmake
file(ARCHIVE_EXTRACT INPUT <archive>
[DESTINATION <dir>]
[PATTERNS <patterns>...]
[LIST_ONLY]
[VERBOSE])
Extracts or lists the content of the specified ``<archive>``.
The directory where the content of the archive will be extracted to can
be specified using the ``DESTINATION`` option. If the directory does not
exist, it will be created. If ``DESTINATION`` is not given, the current
binary directory will be used.
If required, you may select which files and directories to list or extract
from the archive using the specified ``<patterns>``. Wildcards are supported.
If the ``PATTERNS`` option is not given, the entire archive will be listed or
extracted.
``LIST_ONLY`` will list the files in the archive rather than extract them.
With ``VERBOSE``, the command will produce verbose output.

View File

@ -59,7 +59,7 @@ for finding the package, checking the version, and producing any needed
messages. Some find-modules provide limited or no support for versioning; messages. Some find-modules provide limited or no support for versioning;
check the module documentation. check the module documentation.
If the ``MODULE`` option is not specfied in the above signature, If the ``MODULE`` option is not specified in the above signature,
CMake first searches for the package using Module mode. Then, if the CMake first searches for the package using Module mode. Then, if the
package is not found, it searches again using Config mode. A user package is not found, it searches again using Config mode. A user
may set the variable :variable:`CMAKE_FIND_PACKAGE_PREFER_CONFIG` to may set the variable :variable:`CMAKE_FIND_PACKAGE_PREFER_CONFIG` to
@ -302,23 +302,23 @@ enabled.
are intended to be used on the command line with a ``-DVAR=value``. are intended to be used on the command line with a ``-DVAR=value``.
The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`. The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
This can be skipped if ``NO_CMAKE_PATH`` is passed or by setting the This can be skipped if ``NO_CMAKE_PATH`` is passed or by setting the
:variable:`CMAKE_FIND_USE_CMAKE_PATH` to ``FALSE``:: :variable:`CMAKE_FIND_USE_CMAKE_PATH` to ``FALSE``:
CMAKE_PREFIX_PATH * :variable:`CMAKE_PREFIX_PATH`
CMAKE_FRAMEWORK_PATH * :variable:`CMAKE_FRAMEWORK_PATH`
CMAKE_APPBUNDLE_PATH * :variable:`CMAKE_APPBUNDLE_PATH`
3. Search paths specified in cmake-specific environment variables. 3. Search paths specified in cmake-specific environment variables.
These are intended to be set in the user's shell configuration, These are intended to be set in the user's shell configuration,
and therefore use the host's native path separator and therefore use the host's native path separator
(``;`` on Windows and ``:`` on UNIX). (``;`` on Windows and ``:`` on UNIX).
This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed or by setting This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed or by setting
the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` to ``FALSE``:: the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` to ``FALSE``:
<PackageName>_DIR * ``<PackageName>_DIR``
CMAKE_PREFIX_PATH * :envvar:`CMAKE_PREFIX_PATH`
CMAKE_FRAMEWORK_PATH * ``CMAKE_FRAMEWORK_PATH``
CMAKE_APPBUNDLE_PATH * ``CMAKE_APPBUNDLE_PATH``
4. Search paths specified by the ``HINTS`` option. These should be paths 4. Search paths specified by the ``HINTS`` option. These should be paths
computed by system introspection, such as a hint provided by the computed by system introspection, such as a hint provided by the
@ -329,9 +329,9 @@ enabled.
skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed or by setting the skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed or by setting the
:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` to ``FALSE``. Path entries :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` to ``FALSE``. Path entries
ending in ``/bin`` or ``/sbin`` are automatically converted to their ending in ``/bin`` or ``/sbin`` are automatically converted to their
parent directories:: parent directories:
PATH * ``PATH``
6. Search paths stored in the CMake :ref:`User Package Registry`. 6. Search paths stored in the CMake :ref:`User Package Registry`.
This can be skipped if ``NO_CMAKE_PACKAGE_REGISTRY`` is passed or by This can be skipped if ``NO_CMAKE_PACKAGE_REGISTRY`` is passed or by
@ -345,11 +345,15 @@ enabled.
7. Search cmake variables defined in the Platform files for the 7. Search cmake variables defined in the Platform files for the
current system. This can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is current system. This can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is
passed or by setting the :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH` passed or by setting the :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`
to ``FALSE``:: to ``FALSE``:
CMAKE_SYSTEM_PREFIX_PATH * :variable:`CMAKE_SYSTEM_PREFIX_PATH`
CMAKE_SYSTEM_FRAMEWORK_PATH * :variable:`CMAKE_SYSTEM_FRAMEWORK_PATH`
CMAKE_SYSTEM_APPBUNDLE_PATH * :variable:`CMAKE_SYSTEM_APPBUNDLE_PATH`
The platform paths that these variables contain are locations that
typically include installed software. An example being ``/usr/local`` for
UNIX based platforms.
8. Search paths stored in the CMake :ref:`System Package Registry`. 8. Search paths stored in the CMake :ref:`System Package Registry`.
This can be skipped if ``NO_CMAKE_SYSTEM_PACKAGE_REGISTRY`` is passed This can be skipped if ``NO_CMAKE_SYSTEM_PACKAGE_REGISTRY`` is passed

View File

@ -44,11 +44,15 @@ can be invoked through any of
foo() foo()
Foo() Foo()
FOO() FOO()
cmake_language(CALL foo)
and so on. However, it is strongly recommended to stay with the and so on. However, it is strongly recommended to stay with the
case chosen in the function definition. Typically functions use case chosen in the function definition. Typically functions use
all-lowercase names. all-lowercase names.
The :command:`cmake_language(CALL ...)` command can also be used to
invoke the function.
Arguments Arguments
^^^^^^^^^ ^^^^^^^^^

View File

@ -10,6 +10,7 @@ Get a property.
DIRECTORY [<dir>] | DIRECTORY [<dir>] |
TARGET <target> | TARGET <target> |
SOURCE <source> | SOURCE <source> |
[DIRECTORY <dir> | TARGET_DIRECTORY <target>] |
INSTALL <file> | INSTALL <file> |
TEST <test> | TEST <test> |
CACHE <entry> | CACHE <entry> |
@ -30,18 +31,36 @@ It must be one of the following:
Scope defaults to the current directory but another Scope defaults to the current directory but another
directory (already processed by CMake) may be named by the directory (already processed by CMake) may be named by the
full or relative path ``<dir>``. full or relative path ``<dir>``.
See also the :command:`get_directory_property` command.
``TARGET`` ``TARGET``
Scope must name one existing target. Scope must name one existing target.
See also the :command:`get_target_property` command.
``SOURCE`` ``SOURCE``
Scope must name one source file. Scope must name one source file. By default, the source file's property
will be read from the current source directory's scope, but this can be
overridden with one of the following sub-options:
``DIRECTORY <dir>``
The source file property will be read from the ``<dir>`` directory's
scope. CMake must already know about that source directory, either by
having added it through a call to :command:`add_subdirectory` or ``<dir>``
being the top level source directory. Relative paths are treated as
relative to the current source directory.
``TARGET_DIRECTORY <target>``
The source file property will be read from the directory scope in which
``<target>`` was created (``<target>`` must therefore already exist).
See also the :command:`get_source_file_property` command.
``INSTALL`` ``INSTALL``
Scope must name one installed file path. Scope must name one installed file path.
``TEST`` ``TEST``
Scope must name one existing test. Scope must name one existing test.
See also the :command:`get_test_property` command.
``CACHE`` ``CACHE``
Scope must name one cache entry. Scope must name one cache entry.

View File

@ -0,0 +1,40 @@
get_source_file_property
------------------------
Get a property for a source file.
.. code-block:: cmake
get_source_file_property(<variable> <file>
[DIRECTORY <dir> | TARGET_DIRECTORY <target>]
<property>)
Gets a property from a source file. The value of the property is
stored in the specified ``<variable>``. If the source property is not found,
the behavior depends on whether it has been defined to be an ``INHERITED``
property or not (see :command:`define_property`). Non-inherited properties
will set ``variable`` to ``NOTFOUND``, whereas inherited properties will search
the relevant parent scope as described for the :command:`define_property`
command and if still unable to find the property, ``variable`` will be set to
an empty string.
By default, the source file's property will be read from the current source
directory's scope, but this can be overridden with one of the following
sub-options:
``DIRECTORY <dir>``
The source file property will be read from the ``<dir>`` directory's
scope. CMake must already know about that source directory, either by
having added it through a call to :command:`add_subdirectory` or ``<dir>``
being the top level source directory. Relative paths are treated as
relative to the current source directory.
``TARGET_DIRECTORY <target>``
The source file property will be read from the directory scope in which
``<target>`` was created (``<target>`` must therefore already exist).
Use :command:`set_source_files_properties` to set property values. Source
file properties usually control how the file is built. One property that is
always there is :prop_sf:`LOCATION`.
See also the more general :command:`get_property` command.

Some files were not shown because too many files have changed in this diff Show More