summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeASM_MARMASMInformation.cmake20
-rw-r--r--Modules/CMakeDetermineASM_MARMASMCompiler.cmake18
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake3
-rw-r--r--Modules/CMakeDetermineRCCompiler.cmake15
-rw-r--r--Modules/CMakeDetermineSystem.cmake52
-rw-r--r--Modules/CMakeFindDependencyMacro.cmake84
-rw-r--r--Modules/CMakeFortranCompiler.cmake.in2
-rw-r--r--Modules/CMakeGenericSystem.cmake12
-rw-r--r--Modules/CMakeSwiftInformation.cmake26
-rw-r--r--Modules/CMakeTestASM_MARMASMCompiler.cmake13
-rw-r--r--Modules/CPack.cmake2
-rw-r--r--Modules/Compiler/Clang.cmake2
-rw-r--r--Modules/Compiler/GNU.cmake14
-rw-r--r--Modules/Compiler/IBMClang.cmake6
-rw-r--r--Modules/Compiler/Intel.cmake14
-rw-r--r--Modules/Compiler/IntelLLVM.cmake20
-rw-r--r--Modules/Compiler/LCC.cmake14
-rw-r--r--Modules/Compiler/MSVC-CXX.cmake1
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake2
-rw-r--r--Modules/Compiler/QCC.cmake14
-rw-r--r--Modules/Compiler/Tasking.cmake14
-rw-r--r--Modules/ExternalData.cmake2
-rw-r--r--Modules/ExternalProject.cmake46
-rw-r--r--Modules/FetchContent.cmake12
-rw-r--r--Modules/FindBZip2.cmake21
-rw-r--r--Modules/FindCUDAToolkit.cmake11
-rw-r--r--Modules/FindLibLZMA.cmake18
-rw-r--r--Modules/FindOpenCL.cmake2
-rw-r--r--Modules/FindPython.cmake15
-rw-r--r--Modules/FindPython/Support.cmake39
-rw-r--r--Modules/FindPython2.cmake4
-rw-r--r--Modules/FindPython3.cmake13
-rw-r--r--Modules/FindRuby.cmake3
-rw-r--r--Modules/FindZLIB.cmake75
-rw-r--r--Modules/GoogleTest.cmake8
-rw-r--r--Modules/Internal/CheckFlagCommonConfig.cmake2
-rw-r--r--Modules/Internal/CheckSourceCompiles.cmake11
-rw-r--r--Modules/Platform/Android-Clang.cmake4
-rw-r--r--Modules/Platform/Android.cmake1
-rw-r--r--Modules/Platform/Windows-GNU.cmake3
-rw-r--r--Modules/Platform/Windows.cmake4
-rw-r--r--Modules/UseJava.cmake2
-rw-r--r--Modules/UseSWIG.cmake7
43 files changed, 465 insertions, 186 deletions
diff --git a/Modules/CMakeASM_MARMASMInformation.cmake b/Modules/CMakeASM_MARMASMInformation.cmake
new file mode 100644
index 0000000..ac81097
--- /dev/null
+++ b/Modules/CMakeASM_MARMASMInformation.cmake
@@ -0,0 +1,20 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+
+# support for the MS ARM assembler, marmasm and marmasm64
+
+set(ASM_DIALECT "_MARMASM")
+
+set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
+
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
+
+# The ASM_MARMASM compiler id for this compiler is "MSVC", so fill out the runtime library table.
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
+set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
+
+include(CMakeASMInformation)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeDetermineASM_MARMASMCompiler.cmake b/Modules/CMakeDetermineASM_MARMASMCompiler.cmake
new file mode 100644
index 0000000..26714dd
--- /dev/null
+++ b/Modules/CMakeDetermineASM_MARMASMCompiler.cmake
@@ -0,0 +1,18 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+
+# Find the MS ARM assembler (marmasm or marmasm64)
+
+set(ASM_DIALECT "_MARMASM")
+
+# if we are using the 64bit cl compiler, assume we also want the 64bit assembler
+if(";${CMAKE_VS_PLATFORM_NAME};${CMAKE_C_COMPILER_ARCHITECTURE_ID};${CMAKE_CXX_COMPILER_ARCHITECTURE_ID};"
+ MATCHES ";(ARM64);")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT armasm64)
+else()
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT armasm)
+endif()
+
+include(CMakeDetermineASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 087c0f6..d169012 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -284,6 +284,9 @@ if(MSVC_Fortran_ARCHITECTURE_ID)
set(SET_MSVC_Fortran_ARCHITECTURE_ID
"set(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
endif()
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC")
+ set(CMAKE_Fortran_VENDOR_SOURCE_FILE_EXTENSIONS ";cuf;CUF")
+endif()
# configure variables set in this file for fast reload later on
configure_file(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeFortranCompiler.cmake
diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake
index f8d55a5..d22741b 100644
--- a/Modules/CMakeDetermineRCCompiler.cmake
+++ b/Modules/CMakeDetermineRCCompiler.cmake
@@ -30,16 +30,19 @@ if(NOT CMAKE_RC_COMPILER)
# finally list compilers to try
if(CMAKE_RC_COMPILER_INIT)
- set(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
- else()
- set(CMAKE_RC_COMPILER_LIST rc)
+ set(_CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
+ set(_CMAKE_RC_COMPILER_FALLBACK ${CMAKE_RC_COMPILER_INIT})
+ elseif(NOT _CMAKE_RC_COMPILER_LIST)
+ set(_CMAKE_RC_COMPILER_LIST rc)
endif()
# Find the compiler.
- find_program(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
- if(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
- set(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
+ find_program(CMAKE_RC_COMPILER NAMES ${_CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
+ if(_CMAKE_RC_COMPILER_FALLBACK AND NOT CMAKE_RC_COMPILER)
+ set(CMAKE_RC_COMPILER "${_CMAKE_RC_COMPILER_FALLBACK}" CACHE FILEPATH "RC compiler" FORCE)
endif()
+ unset(_CMAKE_RC_COMPILER_FALLBACK)
+ unset(_CMAKE_RC_COMPILER_LIST)
endif()
mark_as_advanced(CMAKE_RC_COMPILER)
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index 2c2c2ac..94e92e8 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -33,20 +33,32 @@
# find out on which system cmake runs
if(CMAKE_HOST_UNIX)
- find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
+ find_program(CMAKE_UNAME NAMES uname PATHS /bin /usr/bin /usr/local/bin)
if(CMAKE_UNAME)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "AIX")
- exec_program(${CMAKE_UNAME} ARGS -v OUTPUT_VARIABLE _CMAKE_HOST_SYSTEM_MAJOR_VERSION)
- exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE _CMAKE_HOST_SYSTEM_MINOR_VERSION)
+ execute_process(COMMAND ${CMAKE_UNAME} -v
+ OUTPUT_VARIABLE _CMAKE_HOST_SYSTEM_MAJOR_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET)
+ execute_process(COMMAND ${CMAKE_UNAME} -r
+ OUTPUT_VARIABLE _CMAKE_HOST_SYSTEM_MINOR_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET)
set(CMAKE_HOST_SYSTEM_VERSION "${_CMAKE_HOST_SYSTEM_MAJOR_VERSION}.${_CMAKE_HOST_SYSTEM_MINOR_VERSION}")
unset(_CMAKE_HOST_SYSTEM_MAJOR_VERSION)
unset(_CMAKE_HOST_SYSTEM_MINOR_VERSION)
else()
- exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
+ execute_process(COMMAND ${CMAKE_UNAME} -r
+ OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET)
endif()
if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|MSYS.*|^GNU$|Android")
- exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
- RETURN_VALUE val)
+ execute_process(COMMAND ${CMAKE_UNAME} -m
+ OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+ RESULT_VARIABLE val
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET)
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
# If we are running on Apple Silicon, honor CMAKE_APPLE_SILICON_PROCESSOR.
if(DEFINED CMAKE_APPLE_SILICON_PROCESSOR)
@@ -74,8 +86,11 @@ if(CMAKE_HOST_UNIX)
if(_CMAKE_APPLE_SILICON_PROCESSOR)
set(CMAKE_HOST_SYSTEM_PROCESSOR "${_CMAKE_APPLE_SILICON_PROCESSOR}")
else()
- exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
- RETURN_VALUE val)
+ execute_process(COMMAND ${CMAKE_UNAME} -m
+ OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+ RESULT_VARIABLE val
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET)
endif()
unset(_CMAKE_APPLE_SILICON_PROCESSOR)
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "Power Macintosh")
@@ -83,14 +98,23 @@ if(CMAKE_HOST_UNIX)
set(CMAKE_HOST_SYSTEM_PROCESSOR "powerpc")
endif()
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
- exec_program(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
- RETURN_VALUE val)
+ execute_process(COMMAND arch -s
+ OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+ RESULT_VARIABLE val
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET)
else()
- exec_program(${CMAKE_UNAME} ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
- RETURN_VALUE val)
+ execute_process(COMMAND ${CMAKE_UNAME} -p
+ OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+ RESULT_VARIABLE val
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET)
if("${val}" GREATER 0)
- exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
- RETURN_VALUE val)
+ execute_process(COMMAND ${CMAKE_UNAME} -m
+ OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+ RESULT_VARIABLE val
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_QUIET)
endif()
endif()
# check the return of the last uname -m or -p
diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake
index bcdfbeb..2c04abe 100644
--- a/Modules/CMakeFindDependencyMacro.cmake
+++ b/Modules/CMakeFindDependencyMacro.cmake
@@ -3,7 +3,7 @@
#[=======================================================================[.rst:
CMakeFindDependencyMacro
--------------------------
+------------------------
.. command:: find_dependency
@@ -28,36 +28,70 @@ CMakeFindDependencyMacro
The call to :command:`return` makes this macro unsuitable to call
from :ref:`Find Modules`.
+
+Package Dependency Search Optimizations
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If ``find_dependency`` is called with arguments identical to a previous
+call in the same directory, perhaps due to diamond-shaped package
+dependencies, the underlying call to :command:`find_package` is optimized
+out. This optimization is important to support large package dependency
+graphs while avoiding a combinatorial explosion of repeated searches.
+However, the heuristic cannot account for ambient variables that
+affect package behavior, such as ``<PackageName>_USE_STATIC_LIBS``,
+offered by some packages. Therefore package configuration files should
+avoid setting such variables before their calls to ``find_dependency``.
+
+.. versionchanged:: 3.15
+ Previously, the underlying call to :command:`find_package` was always
+ optimized out if the package had already been found. CMake 3.15
+ removed the optimization to support cases in which ``find_dependency``
+ call arguments request different components.
+
+.. versionchanged:: 3.26
+ The pre-3.15 optimization was restored, but with the above-described
+ heuristic to account for varying ``find_dependency`` call arguments.
+
#]=======================================================================]
macro(find_dependency dep)
- set(cmake_fd_quiet_arg)
- if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
- set(cmake_fd_quiet_arg QUIET)
- endif()
- set(cmake_fd_required_arg)
- if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
- set(cmake_fd_required_arg REQUIRED)
- endif()
+ string(SHA256 cmake_fd_call_hash "${dep};${ARGN};${${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED}")
+ if(_CMAKE_${dep}_${cmake_fd_call_hash}_FOUND)
+ unset(cmake_fd_call_hash)
+ else()
+ list(APPEND _CMAKE_${dep}_HASH_STACK ${cmake_fd_call_hash})
+ set(cmake_fd_quiet_arg)
+ if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
+ set(cmake_fd_quiet_arg QUIET)
+ endif()
+ set(cmake_fd_required_arg)
+ if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
+ set(cmake_fd_required_arg REQUIRED)
+ endif()
- get_property(cmake_fd_alreadyTransitive GLOBAL PROPERTY
- _CMAKE_${dep}_TRANSITIVE_DEPENDENCY
- )
+ get_property(cmake_fd_alreadyTransitive GLOBAL PROPERTY
+ _CMAKE_${dep}_TRANSITIVE_DEPENDENCY
+ )
- find_package(${dep} ${ARGN}
- ${cmake_fd_quiet_arg}
- ${cmake_fd_required_arg}
- )
+ find_package(${dep} ${ARGN}
+ ${cmake_fd_quiet_arg}
+ ${cmake_fd_required_arg}
+ )
+ list(POP_BACK _CMAKE_${dep}_HASH_STACK cmake_fd_call_hash)
+ set("_CMAKE_${dep}_${cmake_fd_call_hash}_FOUND" "${${dep}_FOUND}")
- if(NOT DEFINED cmake_fd_alreadyTransitive OR cmake_fd_alreadyTransitive)
- set_property(GLOBAL PROPERTY _CMAKE_${dep}_TRANSITIVE_DEPENDENCY TRUE)
- endif()
+ if(NOT DEFINED cmake_fd_alreadyTransitive OR cmake_fd_alreadyTransitive)
+ set_property(GLOBAL PROPERTY _CMAKE_${dep}_TRANSITIVE_DEPENDENCY TRUE)
+ endif()
- if (NOT ${dep}_FOUND)
- set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency ${dep} could not be found.")
- set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
- return()
+ unset(cmake_fd_alreadyTransitive)
+ unset(cmake_fd_call_hash)
+ unset(cmake_fd_quiet_arg)
+ unset(cmake_fd_required_arg)
+ if (NOT ${dep}_FOUND)
+ set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency ${dep} could not be found.")
+ set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
+ return()
+ endif()
endif()
- set(cmake_fd_required_arg)
- set(cmake_fd_quiet_arg)
endmacro()
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index 97f891e..f52ad02 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -25,7 +25,7 @@ set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)
set(CMAKE_Fortran_COMPILER_ID_RUN 1)
-set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;fpp;FPP;f77;F77;f90;F90;for;For;FOR;f95;F95)
+set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;fpp;FPP;f77;F77;f90;F90;for;For;FOR;f95;F95@CMAKE_Fortran_VENDOR_SOURCE_FILE_EXTENSIONS@)
set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_Fortran_LINKER_PREFERENCE 20)
if(UNIX)
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index e2925dc..77c1780 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -30,12 +30,18 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
# LINK_LIBRARY_OVERRIDE_<LIBRARY> target properties
set(CMAKE_LINK_LIBRARY_USING_DEFAULT_SUPPORTED TRUE)
-set(CMAKE_AUTOGEN_ORIGIN_DEPENDS ON)
-set(CMAKE_AUTOMOC_COMPILER_PREDEFINES ON)
+if(NOT DEFINED CMAKE_AUTOGEN_ORIGIN_DEPENDS)
+ set(CMAKE_AUTOGEN_ORIGIN_DEPENDS ON)
+endif()
+if(NOT DEFINED CMAKE_AUTOMOC_COMPILER_PREDEFINES)
+ set(CMAKE_AUTOMOC_COMPILER_PREDEFINES ON)
+endif()
if(NOT DEFINED CMAKE_AUTOMOC_PATH_PREFIX)
set(CMAKE_AUTOMOC_PATH_PREFIX OFF)
endif()
-set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")
+if(NOT DEFINED CMAKE_AUTOMOC_MACRO_NAMES)
+ set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")
+endif()
# basically all general purpose OSs support shared libs
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 16726d2..62f7ef2 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -65,10 +65,22 @@ set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -libc MD)
set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -libc MTd)
set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -libc MDd)
-set(CMAKE_Swift_FLAGS_DEBUG_INIT "-Onone -g")
-set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
-set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g")
-set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")
+if(CMAKE_GENERATOR STREQUAL "Xcode")
+ # Xcode has a separate Xcode project option (SWIFT_COMPILATION_MODE) used to set
+ # whether compiling with whole-module optimizations or incrementally. Setting
+ # these options here will have no effect when compiling with the built-in driver,
+ # and will explode violently, leaving build products in the source directory, when
+ # using the old swift driver.
+ set(CMAKE_Swift_FLAGS_DEBUG_INIT "-Onone -g")
+ set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
+ set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g")
+ set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")
+else()
+ set(CMAKE_Swift_FLAGS_DEBUG_INIT "-Onone -g -incremental")
+ set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O -wmo")
+ set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g -wmo")
+ set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize -wmo")
+endif()
if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
if(NOT DEFINED CMAKE_Swift_LINK_WHAT_YOU_USE_FLAG)
@@ -91,7 +103,7 @@ if(NOT CMAKE_Swift_NUM_THREADS MATCHES "^[0-9]+$")
endif()
if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY)
- set(CMAKE_Swift_CREATE_SHARED_LIBRARY "<CMAKE_Swift_COMPILER> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -j ${CMAKE_Swift_NUM_THREADS} -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS} <LINK_LIBRARIES>")
+ set(CMAKE_Swift_CREATE_SHARED_LIBRARY "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS} <LINK_LIBRARIES>")
endif()
if(NOT CMAKE_Swift_CREATE_SHARED_MODULE)
@@ -99,11 +111,11 @@ if(NOT CMAKE_Swift_CREATE_SHARED_MODULE)
endif()
if(NOT CMAKE_Swift_LINK_EXECUTABLE)
- set(CMAKE_Swift_LINK_EXECUTABLE "<CMAKE_Swift_COMPILER> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -j ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+ set(CMAKE_Swift_LINK_EXECUTABLE "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-executable -o <TARGET> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
endif()
if(NOT CMAKE_Swift_CREATE_STATIC_LIBRARY)
- set(CMAKE_Swift_CREATE_STATIC_LIBRARY "<CMAKE_Swift_COMPILER> -output-file-map <SWIFT_OUTPUT_FILE_MAP> -incremental -j ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
+ set(CMAKE_Swift_CREATE_STATIC_LIBRARY "<CMAKE_Swift_COMPILER> -j ${CMAKE_Swift_NUM_THREADS} -num-threads ${CMAKE_Swift_NUM_THREADS} -emit-library -static -o <TARGET> -module-name <SWIFT_MODULE_NAME> -module-link-name <SWIFT_LIBRARY_NAME> -emit-module -emit-module-path <SWIFT_MODULE> -emit-dependencies <DEFINES> <FLAGS> <INCLUDES> <SWIFT_SOURCES> <LINK_FLAGS> <LINK_LIBRARIES>")
set(CMAKE_Swift_ARCHIVE_CREATE "<CMAKE_AR> crs <TARGET> <OBJECTS>")
set(CMAKE_Swift_ARCHIVE_FINISH "")
diff --git a/Modules/CMakeTestASM_MARMASMCompiler.cmake b/Modules/CMakeTestASM_MARMASMCompiler.cmake
new file mode 100644
index 0000000..a6de04c
--- /dev/null
+++ b/Modules/CMakeTestASM_MARMASMCompiler.cmake
@@ -0,0 +1,13 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+
+# This file is used by EnableLanguage in cmGlobalGenerator to
+# determine that the selected ASM_MARMASM "compiler" (should be marmasm or marmasm64)
+# works. For assembler this can only check whether the compiler has been found,
+# because otherwise there would have to be a separate assembler source file
+# for each assembler on every architecture.
+
+set(ASM_DIALECT "_MARMASM")
+include(CMakeTestASMCompiler)
+set(ASM_DIALECT)
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 7c3ad6b..f9cf33f 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -262,7 +262,7 @@ installers. The most commonly-used variables are:
Lists each of the executables and associated text label to be used to
create Start Menu shortcuts. For example, setting this to the list
``ccmake;CMake`` will create a shortcut named "CMake" that will execute the
- installed executable ``ccmake``. Not all CPack generators use it (at least
+ installed executable :program:`ccmake`. Not all CPack generators use it (at least
NSIS, and WIX do).
.. variable:: CPACK_STRIP_FILES
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index 4f9af37..b59b38c 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -44,7 +44,7 @@ else()
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP)
- if(CMAKE_${lang}_COMPILER_TARGET)
+ if(CMAKE_${lang}_COMPILER_TARGET AND "${lang}" STREQUAL "CXX")
if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4.0)
list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-target" "${CMAKE_${lang}_COMPILER_TARGET}")
else()
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 48639cd..5930e37 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -121,13 +121,15 @@ macro(__compiler_gnu lang)
)
endif()
- set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
- if(CMAKE_${lang}_COMPILER_ARG1)
- separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
- unset(_COMPILER_ARGS)
+ if("${lang}" STREQUAL "CXX")
+ set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
+ if(CMAKE_${lang}_COMPILER_ARG1)
+ separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
+ unset(_COMPILER_ARGS)
+ endif()
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
endif()
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
if(NOT "x${lang}" STREQUAL "xFortran")
set(CMAKE_PCH_EXTENSION .gch)
diff --git a/Modules/Compiler/IBMClang.cmake b/Modules/Compiler/IBMClang.cmake
index 9ed7658..a9d760f 100644
--- a/Modules/Compiler/IBMClang.cmake
+++ b/Modules/Compiler/IBMClang.cmake
@@ -36,7 +36,7 @@ macro(__compiler_ibmclang lang)
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP)
- if(CMAKE_${lang}_COMPILER_TARGET)
+ if(CMAKE_${lang}_COMPILER_TARGET AND "${lang}" STREQUAL "CXX")
list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}")
endif()
@@ -66,7 +66,9 @@ macro(__compiler_ibmclang lang)
"\"${__ranlib}\" <TARGET>"
)
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
+ if("${lang}" STREQUAL "CXX")
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
+ endif()
set(CMAKE_PCH_EXTENSION .pch)
diff --git a/Modules/Compiler/Intel.cmake b/Modules/Compiler/Intel.cmake
index 642e58a..317cfc7 100644
--- a/Modules/Compiler/Intel.cmake
+++ b/Modules/Compiler/Intel.cmake
@@ -30,13 +30,15 @@ else()
string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3")
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
- set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
- if(CMAKE_${lang}_COMPILER_ARG1)
- separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
- unset(_COMPILER_ARGS)
+ if("${lang}" STREQUAL "CXX")
+ set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
+ if(CMAKE_${lang}_COMPILER_ARG1)
+ separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
+ unset(_COMPILER_ARGS)
+ endif()
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-QdM" "-P" "-Za" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
endif()
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-QdM" "-P" "-Za" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
if("x${lang}" STREQUAL "xFortran")
set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-warn" "errors")
diff --git a/Modules/Compiler/IntelLLVM.cmake b/Modules/Compiler/IntelLLVM.cmake
index 30de1a9..e256c8f 100644
--- a/Modules/Compiler/IntelLLVM.cmake
+++ b/Modules/Compiler/IntelLLVM.cmake
@@ -80,15 +80,17 @@ else()
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
- set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
- if(CMAKE_${lang}_COMPILER_ARG1)
- separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
- unset(_COMPILER_ARGS)
- endif()
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
- if(CMAKE_${lang}_COMPILER_TARGET)
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}")
+ if("${lang}" STREQUAL "CXX")
+ set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
+ if(CMAKE_${lang}_COMPILER_ARG1)
+ separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
+ unset(_COMPILER_ARGS)
+ endif()
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
+ if(CMAKE_${lang}_COMPILER_TARGET)
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}")
+ endif()
endif()
if("x${lang}" STREQUAL "xFortran")
diff --git a/Modules/Compiler/LCC.cmake b/Modules/Compiler/LCC.cmake
index bdee9a6..f8c2084 100644
--- a/Modules/Compiler/LCC.cmake
+++ b/Modules/Compiler/LCC.cmake
@@ -76,13 +76,15 @@ macro(__compiler_lcc lang)
"\"${CMAKE_${lang}_COMPILER_RANLIB}\" <TARGET>"
)
- set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
- if(CMAKE_${lang}_COMPILER_ARG1)
- separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
- unset(_COMPILER_ARGS)
+ if("${lang}" STREQUAL "CXX")
+ set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
+ if(CMAKE_${lang}_COMPILER_ARG1)
+ separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
+ unset(_COMPILER_ARGS)
+ endif()
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
endif()
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
if(NOT "x${lang}" STREQUAL "xFortran")
set(CMAKE_PCH_EXTENSION .gch)
diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake
index 212f6d1..10a9073 100644
--- a/Modules/Compiler/MSVC-CXX.cmake
+++ b/Modules/Compiler/MSVC-CXX.cmake
@@ -79,7 +79,6 @@ elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.34")
- set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
string(CONCAT CMAKE_EXPERIMENTAL_CXX_SCANDEP_SOURCE
"<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> <SOURCE> -nologo -TP"
" -showIncludes"
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index c8dcd2a..34dd09a 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -70,7 +70,7 @@ if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
endif()
set(CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS -shared)
-set(CMAKE_INCLUDE_SYSTEM_FLAG_CUDA -isystem=)
+set(CMAKE_INCLUDE_SYSTEM_FLAG_CUDA "-isystem ")
if (CMAKE_CUDA_SIMULATE_ID STREQUAL "GNU")
set(CMAKE_CUDA_LINKER_WRAPPER_FLAG "-Wl,")
diff --git a/Modules/Compiler/QCC.cmake b/Modules/Compiler/QCC.cmake
index 7fbfd10..b720dc1 100644
--- a/Modules/Compiler/QCC.cmake
+++ b/Modules/Compiler/QCC.cmake
@@ -22,13 +22,15 @@ macro(__compiler_qcc lang)
set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE NO)
set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO)
- set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
- if(CMAKE_${lang}_COMPILER_ARG1)
- separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
- unset(_COMPILER_ARGS)
+ if("${lang}" STREQUAL "CXX")
+ set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
+ if(CMAKE_${lang}_COMPILER_ARG1)
+ separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
+ unset(_COMPILER_ARGS)
+ endif()
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-Wp,-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
endif()
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-Wp,-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
unset(CMAKE_${lang}_COMPILE_OPTIONS_IPO)
unset(CMAKE_${lang}_ARCHIVE_CREATE_IPO)
diff --git a/Modules/Compiler/Tasking.cmake b/Modules/Compiler/Tasking.cmake
index 5bf066e..82622fa 100644
--- a/Modules/Compiler/Tasking.cmake
+++ b/Modules/Compiler/Tasking.cmake
@@ -43,12 +43,14 @@ macro(__compiler_tasking lang)
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -cs <SOURCE> -o <ASSEMBLY_SOURCE>")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -Ep <SOURCE> > <PREPROCESSED_SOURCE>")
- set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
- if(CMAKE_${lang}_COMPILER_ARG1)
- separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
- unset(_COMPILER_ARGS)
+ if("${lang}" STREQUAL "CXX")
+ set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
+ if(CMAKE_${lang}_COMPILER_ARG1)
+ separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}")
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS})
+ unset(_COMPILER_ARGS)
+ endif()
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-Ep" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
endif()
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-Ep" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
endmacro()
diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake
index 189374b..6826c7b 100644
--- a/Modules/ExternalData.cmake
+++ b/Modules/ExternalData.cmake
@@ -945,7 +945,7 @@ function(_ExternalData_link_or_copy src dst)
file(CREATE_LINK "${tgt}" "${tmp}" RESULT result COPY_ON_ERROR SYMBOLIC)
else()
# Create a copy.
- file(COPY_FILE "${src}" "${tmp}" RESULT result)
+ file(COPY_FILE "${src}" "${tmp}" RESULT result INPUT_MAY_BE_RECENT)
endif()
if(result)
file(REMOVE "${tmp}")
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 22a25bd..3752ceb 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -525,9 +525,9 @@ External Project Definition
option without the ``CMAKE_GENERATOR`` option.
``CMAKE_ARGS <arg>...``
- The specified arguments are passed to the ``cmake`` command line. They
- can be any argument the ``cmake`` command understands, not just cache
- values defined by ``-D...`` arguments (see also
+ The specified arguments are passed to the :program:`cmake` command line.
+ They can be any argument the :program:`cmake` command understands, not just
+ cache values defined by ``-D...`` arguments (see also
:manual:`CMake Options <cmake(1)>`).
.. versionadded:: 3.3
@@ -611,9 +611,9 @@ External Project Definition
supported). If this option is not given, the default build command will
be chosen to integrate with the main build in the most appropriate way
(e.g. using recursive ``make`` for Makefile generators or
- ``cmake --build`` if the project uses a CMake build). This option can be
- specified with an empty string as the command to make the build step do
- nothing.
+ :option:`cmake --build` if the project uses a CMake build). This option
+ can be specified with an empty string as the command to make the build
+ step do nothing.
``BUILD_IN_SOURCE <bool>``
When this option is enabled, the build will be done directly within the
@@ -637,8 +637,11 @@ External Project Definition
Specifies files that will be generated by the build command but which
might or might not have their modification time updated by subsequent
- builds. These ultimately get passed through as ``BYPRODUCTS`` to the
- build step's own underlying call to :command:`add_custom_command`.
+ builds. This may also be required to explicitly declare dependencies
+ when using the :generator:`Ninja` generator.
+ These ultimately get passed through as ``BYPRODUCTS`` to the
+ build step's own underlying call to :command:`add_custom_command`, which
+ has additional documentation.
**Install Step Options:**
If the configure step assumed the external project uses CMake as its build
@@ -661,6 +664,17 @@ External Project Definition
supported). Passing an empty string as the ``<cmd>`` makes the install
step do nothing.
+ ``INSTALL_BYPRODUCTS <file>...``
+ .. versionadded:: 3.26
+
+ Specifies files that will be generated by the install command but which
+ might or might not have their modification time updated by subsequent
+ installs. This may also be required to explicitly declare dependencies
+ when using the :generator:`Ninja` generator.
+ These ultimately get passed through as ``BYPRODUCTS`` to the
+ install step's own underlying call to :command:`add_custom_command`, which
+ has additional documentation.
+
.. note::
If the :envvar:`CMAKE_INSTALL_MODE` environment variable is set when the
main project is built, it will only have an effect if the following
@@ -943,9 +957,12 @@ control needed to implement such step-level capabilities.
.. versionadded:: 3.2
Files that will be generated by this custom step but which might or might
- not have their modification time updated by subsequent builds. This list of
+ not have their modification time updated by subsequent builds.
+ This may also be required to explicitly declare dependencies
+ when using the :generator:`Ninja` generator. This list of
files will ultimately be passed through as the ``BYPRODUCTS`` option to the
- :command:`add_custom_command` used to implement the custom step internally.
+ :command:`add_custom_command` used to implement the custom step internally,
+ which has additional documentation.
``ALWAYS <bool>``
When enabled, this option specifies that the custom step should always be
@@ -3642,7 +3659,7 @@ function(_ep_extract_configure_command var name)
)
endif()
- list(APPEND cmd "<SOURCE_DIR><SOURCE_SUBDIR>")
+ list(APPEND cmd -S "<SOURCE_DIR><SOURCE_SUBDIR>" -B "<BINARY_DIR>")
endif()
set("${var}" "${cmd}" PARENT_SCOPE)
@@ -3846,6 +3863,11 @@ function(_ep_add_install_command name)
set(always 0)
endif()
+ get_property(install_byproducts
+ TARGET ${name}
+ PROPERTY _EP_INSTALL_BYPRODUCTS
+ )
+
set(__cmdQuoted)
foreach(__item IN LISTS cmd)
string(APPEND __cmdQuoted " [==[${__item}]==]")
@@ -3854,6 +3876,7 @@ function(_ep_add_install_command name)
ExternalProject_Add_Step(${name} install
INDEPENDENT FALSE
COMMAND ${__cmdQuoted}
+ BYPRODUCTS \${install_byproducts}
WORKING_DIRECTORY \${binary_dir}
DEPENDEES build
ALWAYS \${always}
@@ -4081,6 +4104,7 @@ function(ExternalProject_Add name)
# Install step options
#
INSTALL_COMMAND
+ INSTALL_BYPRODUCTS
#
# Test step options
#
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index ac3918c..80554d0 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -923,9 +923,8 @@ it depends directly on projects ``projB`` and ``projC``. Both ``projB`` and
that all five projects are available on a company git server. The
``CMakeLists.txt`` of each project might have sections like the following:
-*projA*:
-
.. code-block:: cmake
+ :caption: *projA*
include(FetchContent)
FetchContent_Declare(
@@ -952,9 +951,9 @@ that all five projects are available on a company git server. The
# Order is important, see notes in the discussion further below
FetchContent_MakeAvailable(projD projB projC)
-*projB*:
.. code-block:: cmake
+ :caption: *projB*
include(FetchContent)
FetchContent_Declare(
@@ -970,9 +969,9 @@ that all five projects are available on a company git server. The
FetchContent_MakeAvailable(projD projE)
-*projC*:
.. code-block:: cmake
+ :caption: *projC*
include(FetchContent)
FetchContent_Declare(
@@ -1047,7 +1046,7 @@ directory. The :variable:`CMAKE_TOOLCHAIN_FILE` variable is not used until
the :command:`project` command is reached, at which point CMake looks for the
named toolchain file relative to the build directory. Because the tarball has
already been downloaded and unpacked by then, the toolchain file will be in
-place, even the very first time that ``cmake`` is run in the build directory.
+place, even the very first time that :program:`cmake` is run in the build directory.
Populating Content In CMake Script Mode
"""""""""""""""""""""""""""""""""""""""
@@ -1058,9 +1057,8 @@ firmware tarball using CMake's :manual:`script mode <cmake(1)>`. The call to
unpacked firmware will be placed in a ``firmware`` directory below the
current working directory.
-*getFirmware.cmake*:
-
.. code-block:: cmake
+ :caption: :file:`getFirmware.cmake`
# NOTE: Intended to be run in script mode with cmake -P
include(FetchContent)
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index 355c4bb..326e700 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -29,8 +29,11 @@ This module defines the following variables:
Link these to use BZip2
``BZIP2_NEED_PREFIX``
this is set if the functions are prefixed with ``BZ2_``
-``BZIP2_VERSION_STRING``
- the version of BZip2 found
+``BZIP2_VERSION``
+ .. versionadded:: 3.26
+ the version of BZip2 found.
+
+ See also legacy variable ``BZIP2_VERSION_STRING``.
Cache variables
^^^^^^^^^^^^^^^
@@ -39,6 +42,17 @@ The following cache variables may also be set:
``BZIP2_INCLUDE_DIR``
the BZip2 include directory
+
+Legacy Variables
+^^^^^^^^^^^^^^^^
+
+The following variables are provided for backward compatibility:
+
+``BZIP2_VERSION_STRING``
+ the version of BZip2 found.
+
+ .. versionchanged:: 3.26
+ Superseded by ``BZIP2_VERSION``.
#]=======================================================================]
set(_BZIP2_PATHS PATHS
@@ -60,12 +74,13 @@ endif ()
if (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h")
file(STRINGS "${BZIP2_INCLUDE_DIR}/bzlib.h" BZLIB_H REGEX "bzip2/libbzip2 version [0-9]+\\.[^ ]+ of [0-9]+ ")
string(REGEX REPLACE ".* bzip2/libbzip2 version ([0-9]+\\.[^ ]+) of [0-9]+ .*" "\\1" BZIP2_VERSION_STRING "${BZLIB_H}")
+ set(BZIP2_VERSION ${BZIP2_VERSION_STRING})
endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2
REQUIRED_VARS BZIP2_LIBRARIES BZIP2_INCLUDE_DIR
- VERSION_VAR BZIP2_VERSION_STRING)
+ VERSION_VAR BZIP2_VERSION)
if (BZIP2_FOUND)
set(BZIP2_INCLUDE_DIRS ${BZIP2_INCLUDE_DIR})
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index f06f0e8..a4cebe4 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -831,11 +831,18 @@ elseif(NOT CUDAToolkit_FIND_QUIETLY)
message(STATUS "Unable to find cuda_runtime.h in \"${CUDAToolkit_TARGET_DIR}/include\" for CUDAToolkit_INCLUDE_DIR.")
endif()
-# The NVHPC layout moves math library headers and libraries to a sibling directory.
+# The NVHPC layout moves math library headers and libraries to a sibling directory and it could be nested under
+# the version of the CUDA toolchain
# Create a separate variable so this directory can be selectively added to math targets.
if(NOT EXISTS "${CUDAToolkit_INCLUDE_DIR}/cublas_v2.h")
- set(CUDAToolkit_MATH_INCLUDE_DIR "${CUDAToolkit_TARGET_DIR}/../../math_libs/include")
+ file(REAL_PATH "${CUDAToolkit_TARGET_DIR}" CUDAToolkit_MATH_INCLUDE_DIR)
+ cmake_path(APPEND CUDAToolkit_MATH_INCLUDE_DIR "../../math_libs/")
+ if(EXISTS "${CUDAToolkit_MATH_INCLUDE_DIR}/${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}/")
+ cmake_path(APPEND CUDAToolkit_MATH_INCLUDE_DIR "${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}/")
+ endif()
+ cmake_path(APPEND CUDAToolkit_MATH_INCLUDE_DIR "include")
cmake_path(NORMAL_PATH CUDAToolkit_MATH_INCLUDE_DIR)
+
if(NOT EXISTS "${CUDAToolkit_MATH_INCLUDE_DIR}/cublas_v2.h")
if(NOT CUDAToolkit_FIND_QUIETLY)
message(STATUS "Unable to find cublas_v2.h in either \"${CUDAToolkit_INCLUDE_DIR}\" or \"${CUDAToolkit_MATH_INCLUDE_DIR}\"")
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
index 9ec8f07..c298bab 100644
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -33,6 +33,17 @@ This module will set the following variables in your project:
True if lzma_easy_encoder() is found (required).
``LIBLZMA_HAS_LZMA_PRESET``
True if lzma_lzma_preset() is found (required).
+``LIBLZMA_VERSION``
+ .. versionadded:: 3.26
+ the version of LZMA found.
+
+ See also legacy variable ``LIBLZMA_VERSION_STRING``.
+
+Legacy Variables
+^^^^^^^^^^^^^^^^
+
+The following variables are provided for backward compatibility:
+
``LIBLZMA_VERSION_MAJOR``
The major version of lzma
``LIBLZMA_VERSION_MINOR``
@@ -41,6 +52,10 @@ This module will set the following variables in your project:
The patch version of lzma
``LIBLZMA_VERSION_STRING``
version number as a string (ex: "5.0.3")
+
+ .. versionchanged:: 3.26
+ Superseded by ``LIBLZMA_VERSION``.
+
#]=======================================================================]
find_path(LIBLZMA_INCLUDE_DIR lzma.h )
@@ -61,6 +76,7 @@ if(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
string(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}")
set(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}")
+ set(LIBLZMA_VERSION ${LIBLZMA_VERSION_STRING})
unset(LIBLZMA_HEADER_CONTENTS)
endif()
@@ -91,7 +107,7 @@ find_package_handle_standard_args(LibLZMA REQUIRED_VARS LIBLZMA_LIBRARY
LIBLZMA_HAS_AUTO_DECODER
LIBLZMA_HAS_EASY_ENCODER
LIBLZMA_HAS_LZMA_PRESET
- VERSION_VAR LIBLZMA_VERSION_STRING
+ VERSION_VAR LIBLZMA_VERSION
)
mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
index 5c7aa22..2b700ff 100644
--- a/Modules/FindOpenCL.cmake
+++ b/Modules/FindOpenCL.cmake
@@ -48,7 +48,7 @@ function(_FIND_OPENCL_VERSION)
foreach(VERSION "3_0" "2_2" "2_1" "2_0" "1_2" "1_1" "1_0")
set(CMAKE_REQUIRED_INCLUDES "${OpenCL_INCLUDE_DIR}")
- if(APPLE)
+ if(EXISTS ${OpenCL_INCLUDE_DIR}/Headers/cl.h)
CHECK_SYMBOL_EXISTS(
CL_VERSION_${VERSION}
"${OpenCL_INCLUDE_DIR}/Headers/cl.h"
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index 04f9d8c..3fb56e4 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -56,7 +56,7 @@ To manage concurrent versions 3 and 2 of Python, use :module:`FindPython3` and
If components ``Interpreter`` and ``Development`` (or one of its
sub-components) are both specified, this module search only for interpreter
- with same platform architecture as the one defined by ``CMake``
+ with same platform architecture as the one defined by CMake
configuration. This constraint does not apply if only ``Interpreter``
component is specified.
@@ -139,12 +139,11 @@ This module will set the following variables in your project
Extension suffix for modules.
- Information returned by
- ``distutils.sysconfig.get_config_var('SOABI')`` or computed from
- ``distutils.sysconfig.get_config_var('EXT_SUFFIX')`` or
- ``python-config --extension-suffix``. If package ``distutils.sysconfig`` is
- not available, ``sysconfig.get_config_var('SOABI')`` or
- ``sysconfig.get_config_var('EXT_SUFFIX')`` are used.
+ Information computed from ``distutils.sysconfig.get_config_var('EXT_SUFFIX')``
+ or ``distutils.sysconfig.get_config_var('SOABI')`` or
+ ``python3-config --extension-suffix``. If package ``distutils.sysconfig`` is
+ not available, ``sysconfig.get_config_var('EXT_SUFFIX')`` or
+ ``sysconfig.get_config_var('SOABI')`` are used.
``Python_Compiler_FOUND``
System has the Python compiler.
@@ -449,7 +448,7 @@ setting the following variables:
By default, this module supports multiple calls in different directories of a
project with different version/component requirements while providing correct
-and consistent results for each call. To support this behavior, ``CMake`` cache
+and consistent results for each call. To support this behavior, CMake cache
is not used in the traditional way which can be problematic for interactive
specification. So, to enable also interactive specification, module behavior
can be controlled with the following variable:
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 7a127e4..9b78220 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -508,21 +508,16 @@ function (_PYTHON_GET_CONFIG_VAR _PYTHON_PGCV_VALUE NAME)
list (REMOVE_DUPLICATES _values)
endif()
elseif (NAME STREQUAL "SOABI")
+ # first step: compute SOABI form EXT_SUFFIX config variable
execute_process (COMMAND ${_${_PYTHON_PREFIX}_INTERPRETER_LAUNCHER} "${_${_PYTHON_PREFIX}_EXECUTABLE}" -c
- "import sys\ntry:\n from distutils import sysconfig\n sys.stdout.write(';'.join([sysconfig.get_config_var('SOABI') or '',sysconfig.get_config_var('EXT_SUFFIX') or '',sysconfig.get_config_var('SO') or '']))\nexcept Exception:\n import sysconfig;sys.stdout.write(';'.join([sysconfig.get_config_var('SOABI') or '',sysconfig.get_config_var('EXT_SUFFIX') or '',sysconfig.get_config_var('SO') or '']))"
+ "import sys\ntry:\n from distutils import sysconfig\n sys.stdout.write(sysconfig.get_config_var('EXT_SUFFIX') or '')\nexcept Exception:\n import sysconfig;sys.stdout.write(sysconfig.get_config_var('EXT_SUFFIX') or '')"
RESULT_VARIABLE _result
- OUTPUT_VARIABLE _soabi
+ OUTPUT_VARIABLE _values
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (_result)
unset (_values)
else()
- foreach (_item IN LISTS _soabi)
- if (_item)
- set (_values "${_item}")
- break()
- endif()
- endforeach()
if (_values)
# clean-up: remove prefix character and suffix
if (_values MATCHES "^(\\.${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.so|\\.pyd)$")
@@ -532,6 +527,34 @@ function (_PYTHON_GET_CONFIG_VAR _PYTHON_PGCV_VALUE NAME)
endif()
endif()
endif()
+
+ # second step: use SOABI or SO config variables as fallback
+ if (NOT _values)
+ execute_process (COMMAND ${_${_PYTHON_PREFIX}_INTERPRETER_LAUNCHER} "${_${_PYTHON_PREFIX}_EXECUTABLE}" -c
+ "import sys\ntry:\n from distutils import sysconfig\n sys.stdout.write(';'.join([sysconfig.get_config_var('SOABI') or '',sysconfig.get_config_var('SO') or '']))\nexcept Exception:\n import sysconfig;sys.stdout.write(';'.join([sysconfig.get_config_var('SOABI') or '',sysconfig.get_config_var('SO') or '']))"
+ RESULT_VARIABLE _result
+ OUTPUT_VARIABLE _soabi
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if (_result)
+ unset (_values)
+ else()
+ foreach (_item IN LISTS _soabi)
+ if (_item)
+ set (_values "${_item}")
+ break()
+ endif()
+ endforeach()
+ if (_values)
+ # clean-up: remove prefix character and suffix
+ if (_values MATCHES "^(\\.${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.so|\\.pyd)$")
+ set(_values "")
+ else()
+ string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}")
+ endif()
+ endif()
+ endif()
+ endif()
else()
set (config_flag "${NAME}")
if (NAME STREQUAL "CONFIGDIR")
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index 268acfe..41d9b68 100644
--- a/Modules/FindPython2.cmake
+++ b/Modules/FindPython2.cmake
@@ -57,7 +57,7 @@ for you.
If components ``Interpreter`` and ``Development`` (or one of its
sub-components) are both specified, this module search only for interpreter
- with same platform architecture as the one defined by ``CMake``
+ with same platform architecture as the one defined by CMake
configuration. This constraint does not apply if only ``Interpreter``
component is specified.
@@ -388,7 +388,7 @@ setting the following variables:
By default, this module supports multiple calls in different directories of a
project with different version/component requirements while providing correct
-and consistent results for each call. To support this behavior, ``CMake`` cache
+and consistent results for each call. To support this behavior, CMake cache
is not used in the traditional way which can be problematic for interactive
specification. So, to enable also interactive specification, module behavior
can be controlled with the following variable:
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index 4f198bb..837300e 100644
--- a/Modules/FindPython3.cmake
+++ b/Modules/FindPython3.cmake
@@ -57,7 +57,7 @@ for you.
If components ``Interpreter`` and ``Development`` (or one of its
sub-components) are both specified, this module search only for interpreter
- with same platform architecture as the one defined by ``CMake``
+ with same platform architecture as the one defined by CMake
configuration. This constraint does not apply if only ``Interpreter``
component is specified.
@@ -140,12 +140,11 @@ This module will set the following variables in your project
Extension suffix for modules.
- Information returned by
- ``distutils.sysconfig.get_config_var('SOABI')`` or computed from
- ``distutils.sysconfig.get_config_var('EXT_SUFFIX')`` or
+ Information computed from ``distutils.sysconfig.get_config_var('EXT_SUFFIX')``
+ or ``distutils.sysconfig.get_config_var('SOABI')`` or
``python3-config --extension-suffix``. If package ``distutils.sysconfig`` is
- not available, ``sysconfig.get_config_var('SOABI')`` or
- ``sysconfig.get_config_var('EXT_SUFFIX')`` are used.
+ not available, ``sysconfig.get_config_var('EXT_SUFFIX')`` or
+ ``sysconfig.get_config_var('SOABI')`` are used.
``Python3_Compiler_FOUND``
System has the Python 3 compiler.
@@ -447,7 +446,7 @@ setting the following variables:
By default, this module supports multiple calls in different directories of a
project with different version/component requirements while providing correct
-and consistent results for each call. To support this behavior, ``CMake`` cache
+and consistent results for each call. To support this behavior, CMake cache
is not used in the traditional way which can be problematic for interactive
specification. So, to enable also interactive specification, module behavior
can be controlled with the following variable:
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index b14349f..d82f41d 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -71,9 +71,6 @@ Hints
.. versionadded:: 3.18
-``Ruby_ROOT_DIR``
- Define the root directory of a Ruby installation.
-
``Ruby_FIND_VIRTUALENV``
This variable defines the handling of virtual environments managed by
``rvm``. It is meaningful only when a virtual environment
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index be5c775..d0deb87 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -20,33 +20,57 @@ Result Variables
This module defines the following variables:
-::
+``ZLIB_INCLUDE_DIRS``
+ where to find zlib.h, etc.
+``ZLIB_LIBRARIES``
+ List of libraries when using zlib.
+``ZLIB_FOUND``
+ True if zlib found.
+``ZLIB_VERSION``
+ .. versionadded:: 3.26
+ the version of Zlib found.
+
+ See also legacy variable ``ZLIB_VERSION_STRING``.
- ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
- ZLIB_LIBRARIES - List of libraries when using zlib.
- ZLIB_FOUND - True if zlib found.
+.. versionadded:: 3.4
+ Debug and Release variants are found separately.
-::
+Legacy Variables
+^^^^^^^^^^^^^^^^
- ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
- ZLIB_VERSION_MAJOR - The major version of zlib
- ZLIB_VERSION_MINOR - The minor version of zlib
- ZLIB_VERSION_PATCH - The patch version of zlib
- ZLIB_VERSION_TWEAK - The tweak version of zlib
+The following variables are provided for backward compatibility:
-.. versionadded:: 3.4
- Debug and Release variants are found separately.
+``ZLIB_VERSION_MAJOR``
+ The major version of zlib.
-Backward Compatibility
-^^^^^^^^^^^^^^^^^^^^^^
+ .. versionchanged:: 3.26
+ Superseded by ``ZLIB_VERSION``.
+``ZLIB_VERSION_MINOR``
+ The minor version of zlib.
-The following variable are provided for backward compatibility
+ .. versionchanged:: 3.26
+ Superseded by ``ZLIB_VERSION``.
+``ZLIB_VERSION_PATCH``
+ The patch version of zlib.
-::
+ .. versionchanged:: 3.26
+ Superseded by ``ZLIB_VERSION``.
+``ZLIB_VERSION_TWEAK``
+ The tweak version of zlib.
- ZLIB_MAJOR_VERSION - The major version of zlib
- ZLIB_MINOR_VERSION - The minor version of zlib
- ZLIB_PATCH_VERSION - The patch version of zlib
+ .. versionchanged:: 3.26
+ Superseded by ``ZLIB_VERSION``.
+``ZLIB_VERSION_STRING``
+ The version of zlib found (x.y.z)
+
+ .. versionchanged:: 3.26
+ Superseded by ``ZLIB_VERSION``.
+``ZLIB_MAJOR_VERSION``
+ The major version of zlib. Superseded by ``ZLIB_VERSION_MAJOR``.
+``ZLIB_MINOR_VERSION``
+ The minor version of zlib. Superseded by ``ZLIB_VERSION_MINOR``.
+``ZLIB_PATCH_VERSION``
+ The patch version of zlib. Superseded by ``ZLIB_VERSION_PATCH``.
Hints
^^^^^
@@ -60,6 +84,14 @@ module where to look.
#]=======================================================================]
+if(ZLIB_FIND_COMPONENTS AND NOT ZLIB_FIND_QUIETLY)
+ message(AUTHOR_WARNING
+ "ZLIB does not provide any COMPONENTS. Calling\n"
+ " find_package(ZLIB COMPONENTS ...)\n"
+ "will always fail."
+ )
+endif()
+
set(_ZLIB_SEARCHES)
# Search ZLIB_ROOT first if it is set.
@@ -160,11 +192,14 @@ if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
+
+ set(ZLIB_VERSION ${ZLIB_VERSION_STRING})
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
- VERSION_VAR ZLIB_VERSION_STRING)
+ VERSION_VAR ZLIB_VERSION
+ HANDLE_COMPONENTS)
if(ZLIB_FOUND)
set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake
index b8dc482..57a7476 100644
--- a/Modules/GoogleTest.cmake
+++ b/Modules/GoogleTest.cmake
@@ -212,7 +212,7 @@ same as the Google Test name (i.e. ``suite.testcase``); see also
discovery. Note that the expression is a wildcard-based format that
matches against the original test names as used by gtest. For type or
value-parameterized tests, these names may be different to the potentially
- pretty-printed test names that ``ctest`` uses.
+ pretty-printed test names that :program:`ctest` uses.
``NO_PRETTY_TYPES``
By default, the type index of type-parameterized tests is replaced by the
@@ -405,6 +405,12 @@ function(gtest_add_tests)
--gtest_filter=${gtest_test_name}
${ARGS_EXTRA_ARGS}
)
+ # Makes sure a skipped GTest is reported as so by CTest
+ set_tests_properties(
+ ${ctest_test_name}
+ PROPERTIES
+ SKIP_REGULAR_EXPRESSION "\\[ SKIPPED \\]"
+ )
list(APPEND testList ${ctest_test_name})
endif()
endforeach()
diff --git a/Modules/Internal/CheckFlagCommonConfig.cmake b/Modules/Internal/CheckFlagCommonConfig.cmake
index c011c24..f8481cd 100644
--- a/Modules/Internal/CheckFlagCommonConfig.cmake
+++ b/Modules/Internal/CheckFlagCommonConfig.cmake
@@ -48,6 +48,8 @@ macro(CMAKE_CHECK_FLAG_COMMON_INIT _FUNC _LANG _SRC _PATTERNS)
FAIL_REGEX "argument unused during compilation: .*") # Clang
elseif("${_LANG}" STREQUAL "ISPC")
set(${_SRC} "float func(uniform int32, float a) { return a / 2.25; }")
+ elseif("${_LANG}" STREQUAL "Swift")
+ set(${_SRC} "func blarpy() { }")
else()
message (SEND_ERROR "${_FUNC}: ${_LANG}: unknown language.")
return()
diff --git a/Modules/Internal/CheckSourceCompiles.cmake b/Modules/Internal/CheckSourceCompiles.cmake
index eadf3da..bf5a82d 100644
--- a/Modules/Internal/CheckSourceCompiles.cmake
+++ b/Modules/Internal/CheckSourceCompiles.cmake
@@ -9,7 +9,7 @@ cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var)
if(NOT DEFINED "${_var}")
-
+ set(_lang_filename "src")
if(_lang STREQUAL "C")
set(_lang_textual "C")
set(_lang_ext "c")
@@ -34,6 +34,13 @@ function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var)
elseif(_lang STREQUAL "OBJCXX")
set(_lang_textual "Objective-C++")
set(_lang_ext "mm")
+ elseif(_lang STREQUAL "Swift")
+ set(_lang_textual "Swift")
+ set(_lang_ext "swift")
+ if (NOT DEFINED CMAKE_TRY_COMPILE_TARGET_TYPE
+ OR CMAKE_TRY_COMPILE_TARGET_TYPE STREQUAL "EXECUTABLE")
+ set(_lang_filename "main")
+ endif()
else()
message (SEND_ERROR "check_source_compiles: ${_lang}: unknown language.")
return()
@@ -92,7 +99,7 @@ function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var)
endif()
string(APPEND _source "\n")
try_compile(${_var}
- SOURCE_FROM_VAR "src.${_SRC_EXT}" _source
+ SOURCE_FROM_VAR "${_lang_filename}.${_SRC_EXT}" _source
COMPILE_DEFINITIONS -D${_var} ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_${LANG}_SOURCE_COMPILES_ADD_LINK_OPTIONS}
${CHECK_${LANG}_SOURCE_COMPILES_ADD_LIBRARIES}
diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake
index 3a279ca..aaaae9b 100644
--- a/Modules/Platform/Android-Clang.cmake
+++ b/Modules/Platform/Android-Clang.cmake
@@ -77,7 +77,9 @@ macro(__android_compiler_clang lang)
if(CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED)
string(APPEND CMAKE_${lang}_COMPILER_TARGET "${CMAKE_SYSTEM_VERSION}")
endif()
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}")
+ if("${lang}" STREQUAL "CXX")
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}")
+ endif()
endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio")
set(_ANDROID_STL_NOSTDLIBXX 1)
diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake
index 09a12cc..d0f686c 100644
--- a/Modules/Platform/Android.cmake
+++ b/Modules/Platform/Android.cmake
@@ -5,6 +5,7 @@ if(CMAKE_ANDROID_NDK)
endif()
include(Platform/Linux)
+unset(LINUX)
set(ANDROID 1)
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index bf96e63..088b238 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -157,7 +157,8 @@ macro(__windows_compiler_gnu lang)
endif()
if(NOT CMAKE_RC_COMPILER_INIT AND NOT CMAKE_GENERATOR_RC)
- set(CMAKE_RC_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}windres windres)
+ set(_CMAKE_RC_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}windres windres)
+ set(_CMAKE_RC_COMPILER_FALLBACK windres)
endif()
enable_language(RC)
diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake
index 5263161..d8b3957 100644
--- a/Modules/Platform/Windows.cmake
+++ b/Modules/Platform/Windows.cmake
@@ -19,8 +19,8 @@ set(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
set(CMAKE_DL_LIBS "")
set(CMAKE_EXTRA_LINK_EXTENSIONS ".targets")
-set(CMAKE_FIND_LIBRARY_PREFIXES "" "lib")
-set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a")
+set(CMAKE_FIND_LIBRARY_PREFIXES "")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
# for borland make long command lines are redirected to a file
# with the following syntax, see Windows-bcc32.cmake for use
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 1511bfd..54a8cf7 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -7,7 +7,7 @@ UseJava
This file provides support for ``Java``. It is assumed that
:module:`FindJava` has already been loaded. See :module:`FindJava` for
-information on how to load Java into your ``CMake`` project.
+information on how to load Java into your CMake project.
Synopsis
^^^^^^^^
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index fd6596b..e0e01f5 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -378,6 +378,7 @@ set(SWIG_PYTHON_EXTRA_FILE_EXTENSIONS ".py")
set(SWIG_JAVA_EXTRA_FILE_EXTENSIONS ".java" "JNI.java")
set(SWIG_CSHARP_EXTRA_FILE_EXTENSIONS ".cs" "PINVOKE.cs")
set(SWIG_PERL_EXTRA_FILE_EXTENSIONS ".pm")
+set(SWIG_PERL5_EXTRA_FILE_EXTENSIONS ".pm")
set(SWIG_MANAGE_SUPPORT_FILES_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/UseSWIG/ManageSupportFiles.cmake")
@@ -414,8 +415,8 @@ macro(SWIG_MODULE_INITIALIZE name language)
endif()
if(SWIG_MODULE_${name}_LANGUAGE STREQUAL "UNKNOWN")
message(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
- elseif(SWIG_MODULE_${name}_LANGUAGE STREQUAL "PERL" AND
- NOT "-shadow" IN_LIST SWIG_MODULE_${name}_EXTRA_FLAGS)
+ elseif((SWIG_MODULE_${name}_LANGUAGE STREQUAL "PERL" OR SWIG_MODULE_${name}_LANGUAGE STREQUAL "PERL5")
+ AND NOT "-shadow" IN_LIST SWIG_MODULE_${name}_EXTRA_FLAGS)
list(APPEND SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
endif()
endmacro()
@@ -971,7 +972,7 @@ function(SWIG_ADD_LIBRARY name)
if (APPLE)
set_target_properties (${target_name} PROPERTIES SUFFIX ".bundle")
endif ()
- elseif (swig_lowercase_language STREQUAL "perl")
+ elseif (swig_lowercase_language STREQUAL "perl" OR swig_lowercase_language STREQUAL "perl5")
# assume empty prefix because we expect the module to be dynamically loaded
set_target_properties (${target_name} PROPERTIES PREFIX "")
if (APPLE)