summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/AndroidTestUtilities.cmake2
-rw-r--r--Modules/BundleUtilities.cmake15
-rw-r--r--Modules/CMakeASMInformation.cmake10
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake6
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake4
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake6
-rw-r--r--Modules/CMakeDetermineCompiler.cmake24
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake41
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineJavaCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineOBJCCompiler.cmake15
-rw-r--r--Modules/CMakeDetermineOBJCXXCompiler.cmake15
-rw-r--r--Modules/CMakeDetermineRCCompiler.cmake2
-rw-r--r--Modules/CMakeDetermineSwiftCompiler.cmake2
-rw-r--r--Modules/CMakeParseImplicitIncludeInfo.cmake4
-rw-r--r--Modules/CMakePlatformId.h.in19
-rw-r--r--Modules/CMakeTestCCompiler.cmake2
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake2
-rw-r--r--Modules/CMakeTestOBJCCompiler.cmake2
-rw-r--r--Modules/CMakeTestOBJCXXCompiler.cmake2
-rw-r--r--Modules/CPack.cmake27
-rw-r--r--Modules/CPackIFW.cmake2
-rw-r--r--Modules/CPackIFWConfigureFile.cmake2
-rw-r--r--Modules/CSharpUtilities.cmake2
-rw-r--r--Modules/CTestCoverageCollectGCOV.cmake2
-rw-r--r--Modules/CheckFortranCompilerFlag.cmake2
-rw-r--r--Modules/CheckFortranSourceCompiles.cmake2
-rw-r--r--Modules/CheckFortranSourceRuns.cmake2
-rw-r--r--Modules/CheckIPOSupported.cmake2
-rw-r--r--Modules/CheckLanguage.cmake2
-rw-r--r--Modules/CheckLinkerFlag.cmake2
-rw-r--r--Modules/CheckOBJCCompilerFlag.cmake2
-rw-r--r--Modules/CheckOBJCSourceCompiles.cmake2
-rw-r--r--Modules/CheckOBJCSourceRuns.cmake2
-rw-r--r--Modules/CheckOBJCXXCompilerFlag.cmake2
-rw-r--r--Modules/CheckOBJCXXSourceCompiles.cmake2
-rw-r--r--Modules/CheckOBJCXXSourceRuns.cmake2
-rw-r--r--Modules/CheckPIESupported.cmake2
-rw-r--r--Modules/CheckTypeSize.cmake54
-rw-r--r--Modules/Compiler/ARMClang.cmake2
-rw-r--r--Modules/Compiler/AppleClang-C.cmake2
-rw-r--r--Modules/Compiler/AppleClang-CXX.cmake2
-rw-r--r--Modules/Compiler/Clang-C.cmake2
-rw-r--r--Modules/Compiler/Clang-CXX.cmake2
-rw-r--r--Modules/Compiler/Clang.cmake10
-rw-r--r--Modules/Compiler/GNU-C.cmake2
-rw-r--r--Modules/Compiler/GNU-CXX.cmake2
-rw-r--r--Modules/Compiler/Intel-C.cmake2
-rw-r--r--Modules/Compiler/Intel-CXX.cmake2
-rw-r--r--Modules/Compiler/OpenWatcom.cmake2
-rw-r--r--Modules/Compiler/PGI-CXX.cmake8
-rw-r--r--Modules/Compiler/TI-ASM.cmake8
-rw-r--r--Modules/Compiler/TI-C.cmake18
-rw-r--r--Modules/Compiler/TI-CXX.cmake17
-rw-r--r--Modules/Compiler/TI.cmake40
-rw-r--r--Modules/Compiler/XL-C.cmake2
-rw-r--r--Modules/Compiler/XL-CXX.cmake5
-rw-r--r--Modules/Compiler/XLClang-C.cmake2
-rw-r--r--Modules/Compiler/XLClang-CXX.cmake2
-rw-r--r--Modules/CompilerId/VS-10.vcxproj.in4
-rw-r--r--Modules/CompilerId/Xcode-3.pbxproj.in1
-rw-r--r--Modules/ExternalProject.cmake6
-rw-r--r--Modules/FetchContent.cmake2
-rw-r--r--Modules/FindArmadillo.cmake1
-rw-r--r--Modules/FindBLAS.cmake11
-rw-r--r--Modules/FindBZip2.cmake4
-rw-r--r--Modules/FindBoost.cmake8
-rw-r--r--Modules/FindCUDA/run_nvcc.cmake2
-rw-r--r--Modules/FindCUDAToolkit.cmake157
-rw-r--r--Modules/FindCURL.cmake8
-rw-r--r--Modules/FindCurses.cmake4
-rw-r--r--Modules/FindEXPAT.cmake2
-rw-r--r--Modules/FindEnvModules.cmake2
-rw-r--r--Modules/FindFontconfig.cmake2
-rw-r--r--Modules/FindGIF.cmake1
-rw-r--r--Modules/FindGLEW.cmake4
-rw-r--r--Modules/FindGSL.cmake2
-rw-r--r--Modules/FindGTest.cmake40
-rw-r--r--Modules/FindHDF5.cmake4
-rw-r--r--Modules/FindICU.cmake2
-rw-r--r--Modules/FindIce.cmake2
-rw-r--r--Modules/FindIconv.cmake3
-rw-r--r--Modules/FindIntl.cmake4
-rw-r--r--Modules/FindJPEG.cmake4
-rw-r--r--Modules/FindLAPACK.cmake5
-rw-r--r--Modules/FindLTTngUST.cmake2
-rw-r--r--Modules/FindLibLZMA.cmake4
-rw-r--r--Modules/FindLibinput.cmake2
-rw-r--r--Modules/FindMPI.cmake2
-rw-r--r--Modules/FindMatlab.cmake5
-rw-r--r--Modules/FindODBC.cmake2
-rw-r--r--Modules/FindOpenACC.cmake2
-rw-r--r--Modules/FindOpenCL.cmake2
-rw-r--r--Modules/FindOpenGL.cmake14
-rw-r--r--Modules/FindOpenSSL.cmake4
-rw-r--r--Modules/FindPNG.cmake4
-rw-r--r--Modules/FindPatch.cmake2
-rw-r--r--Modules/FindPerlLibs.cmake3
-rw-r--r--Modules/FindProtobuf.cmake2
-rw-r--r--Modules/FindPython.cmake12
-rw-r--r--Modules/FindPython/Support.cmake13
-rw-r--r--Modules/FindPython2.cmake10
-rw-r--r--Modules/FindPython3.cmake12
-rw-r--r--Modules/FindQt4.cmake2
-rw-r--r--Modules/FindRuby.cmake3
-rw-r--r--Modules/FindSDL.cmake85
-rw-r--r--Modules/FindSQLite3.cmake2
-rw-r--r--Modules/FindTIFF.cmake99
-rw-r--r--Modules/FindTclsh.cmake7
-rw-r--r--Modules/FindVulkan.cmake32
-rw-r--r--Modules/FindX11.cmake19
-rw-r--r--Modules/FindXCTest.cmake2
-rw-r--r--Modules/FindXalanC.cmake8
-rw-r--r--Modules/FindXercesC.cmake2
-rw-r--r--Modules/FindwxWindows.cmake2
-rw-r--r--Modules/GetPrerequisites.cmake2
-rw-r--r--Modules/GoogleTest.cmake4
-rw-r--r--Modules/GoogleTestAddTests.cmake4
-rw-r--r--Modules/Internal/CPack/CPackDeb.cmake4
-rw-r--r--Modules/Platform/Android-Clang.cmake3
-rw-r--r--Modules/Platform/Android-Determine.cmake61
-rw-r--r--Modules/Platform/Android-Initialize.cmake2
-rw-r--r--Modules/Platform/Android/Determine-Compiler-NDK.cmake2
-rw-r--r--Modules/Platform/Android/VCXProjInspect.vcxproj.in38
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake43
-rw-r--r--Modules/Platform/HP-UX.cmake2
-rw-r--r--Modules/Platform/Windows-MSVC.cmake5
-rw-r--r--Modules/UseSWIG.cmake2
-rw-r--r--Modules/UseSWIG/ManageSupportFiles.cmake4
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake2
131 files changed, 889 insertions, 360 deletions
diff --git a/Modules/AndroidTestUtilities.cmake b/Modules/AndroidTestUtilities.cmake
index 95e2ef7e94..ddccf586bb 100644
--- a/Modules/AndroidTestUtilities.cmake
+++ b/Modules/AndroidTestUtilities.cmake
@@ -5,6 +5,8 @@
AndroidTestUtilities
------------------------
+.. versionadded:: 3.7
+
Create a test that automatically loads specified data onto an Android device.
Introduction
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 2f3b9e1d30..f521d22200 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -894,11 +894,16 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
# to install_name_tool:
#
if(changes)
- set(cmd ${CMAKE_INSTALL_NAME_TOOL} ${changes} "${resolved_embedded_item}")
- execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result)
- if(NOT install_name_tool_result EQUAL 0)
- string(REPLACE ";" "' '" msg "'${cmd}'")
- message(FATAL_ERROR "Command failed:\n ${msg}")
+ # Check for a script by extension (.bat,.sh,...) or if the file starts with "#!" (shebang)
+ file(READ ${resolved_embedded_item} file_contents LIMIT 5)
+ if(NOT "${resolved_embedded_item}" MATCHES "\\.(bat|c?sh|bash|ksh|cmd)$" AND
+ NOT file_contents MATCHES "^#!")
+ set(cmd ${CMAKE_INSTALL_NAME_TOOL} ${changes} "${resolved_embedded_item}")
+ execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result)
+ if(NOT install_name_tool_result EQUAL 0)
+ string(REPLACE ";" "' '" msg "'${cmd}'")
+ message(FATAL_ERROR "Command failed:\n ${msg}")
+ endif()
endif()
endif()
endfunction()
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index 03195ccec6..2dc1585dfa 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -96,15 +96,5 @@ if(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
set(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
endif()
-# to be done
-if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
- set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
-endif()
-
-if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
- set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
-endif()
-
set(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
-
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index bc8b86b898..a3e5a1229d 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -11,7 +11,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
if(NOT $ENV{ASM${ASM_DIALECT}} STREQUAL "")
get_filename_component(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT $ENV{ASM${ASM_DIALECT}} PROGRAM PROGRAM_ARGS CMAKE_ASM${ASM_DIALECT}_FLAGS_ENV_INIT)
if(CMAKE_ASM${ASM_DIALECT}_FLAGS_ENV_INIT)
- set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_FLAGS_ENV_INIT}" CACHE STRING "First argument to ASM${ASM_DIALECT} compiler")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_FLAGS_ENV_INIT}" CACHE STRING "Arguments to ASM${ASM_DIALECT} compiler")
endif()
if(NOT EXISTS ${CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable ASM${ASM_DIALECT}:\n$ENV{ASM${ASM_DIALECT}}.")
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 86683d1bad..96f32e506b 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -43,7 +43,7 @@ else()
if(NOT $ENV{CC} STREQUAL "")
get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
if(CMAKE_C_FLAGS_ENV_INIT)
- set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
+ set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "Arguments to C compiler")
endif()
if(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
@@ -87,7 +87,9 @@ else()
"--target=arm-arm-none-eabi -mcpu=cortex-m3"
)
endif()
-
+if(CMAKE_C_COMPILER_TARGET)
+ list(PREPEND CMAKE_C_COMPILER_ID_TEST_FLAGS "-c --target=${CMAKE_C_COMPILER_TARGET}")
+endif()
# Build a small source file to identify the compiler.
if(NOT CMAKE_C_COMPILER_ID_RUN)
set(CMAKE_C_COMPILER_ID_RUN 1)
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index fa497cd99a..daca382fa2 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -19,7 +19,7 @@ else()
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")
+ set(CMAKE_CUDA_COMPILER_ARG1 "${CMAKE_CUDA_FLAGS_ENV_INIT}" CACHE STRING "Arguments 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}")
@@ -232,7 +232,7 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
list(APPEND CMAKE_CUDA_COMPILER_ID_TEST_FLAGS_FIRST "${clang_test_flags}")
# We perform compiler identification for a second time to extract implicit linking info and host compiler for NVCC.
- # We also use it to verify that CMAKE_CUDA_ARCHITECTURES and additionaly on Clang that CUDA toolkit path works.
+ # We also use it to verify that CMAKE_CUDA_ARCHITECTURES and additionally on Clang that CUDA toolkit path works.
# The latter could be done during compiler testing in the future to avoid doing this for Clang.
# We need to unset the compiler ID otherwise CMAKE_DETERMINE_COMPILER_ID() doesn't work.
set(CMAKE_CUDA_COMPILER_ID)
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 662b831afb..4c2924a0a1 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -42,7 +42,7 @@ else()
if(NOT $ENV{CXX} STREQUAL "")
get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
if(CMAKE_CXX_FLAGS_ENV_INIT)
- set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
+ set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "Arguments to CXX compiler")
endif()
if(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
@@ -83,6 +83,10 @@ else()
)
endif()
+if(CMAKE_CXX_COMPILER_TARGET)
+ list(PREPEND CMAKE_CXX_COPMILER_ID_TEST_FLAGS "-c --target=${CMAKE_CXX_COMPILER_TARGET}")
+endif()
+
# Build a small source file to identify the compiler.
if(NOT CMAKE_CXX_COMPILER_ID_RUN)
set(CMAKE_CXX_COMPILER_ID_RUN 1)
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 7cd7c47b8a..2780399dcc 100644
--- a/Modules/CMakeDetermineCompiler.cmake
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -107,16 +107,14 @@ macro(_cmake_find_compiler_path lang)
if(CMAKE_${lang}_COMPILER)
# we only get here if CMAKE_${lang}_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
- # if CMAKE_${lang}_COMPILER is a list of length 2, use the first item as
- # CMAKE_${lang}_COMPILER and the 2nd one as CMAKE_${lang}_COMPILER_ARG1
- list(LENGTH CMAKE_${lang}_COMPILER _CMAKE_${lang}_COMPILER_LIST_LENGTH)
- if("${_CMAKE_${lang}_COMPILER_LIST_LENGTH}" EQUAL 2)
- list(GET CMAKE_${lang}_COMPILER 1 CMAKE_${lang}_COMPILER_ARG1)
- list(GET CMAKE_${lang}_COMPILER 0 CMAKE_${lang}_COMPILER)
- endif()
- unset(_CMAKE_${lang}_COMPILER_LIST_LENGTH)
+ # if CMAKE_${lang}_COMPILER is a list, use the first item as
+ # CMAKE_${lang}_COMPILER and the rest as CMAKE_${lang}_COMPILER_ARG1
+ set(CMAKE_${lang}_COMPILER_ARG1 "${CMAKE_${lang}_COMPILER}")
+ list(POP_FRONT CMAKE_${lang}_COMPILER_ARG1 CMAKE_${lang}_COMPILER)
+ list(JOIN CMAKE_${lang}_COMPILER_ARG1 " " CMAKE_${lang}_COMPILER_ARG1)
# find the compiler in the PATH if necessary
+ # if compiler (and arguments) comes from cache then synchronize cache with updated CMAKE_<LANG>_COMPILER
get_filename_component(_CMAKE_USER_${lang}_COMPILER_PATH "${CMAKE_${lang}_COMPILER}" PATH)
if(NOT _CMAKE_USER_${lang}_COMPILER_PATH)
find_program(CMAKE_${lang}_COMPILER_WITH_PATH NAMES ${CMAKE_${lang}_COMPILER})
@@ -129,6 +127,12 @@ macro(_cmake_find_compiler_path lang)
unset(_CMAKE_${lang}_COMPILER_CACHED)
endif()
unset(CMAKE_${lang}_COMPILER_WITH_PATH CACHE)
+ elseif (EXISTS ${CMAKE_${lang}_COMPILER})
+ get_property(_CMAKE_${lang}_COMPILER_CACHED CACHE CMAKE_${lang}_COMPILER PROPERTY TYPE)
+ if(_CMAKE_${lang}_COMPILER_CACHED)
+ set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER}" CACHE STRING "${lang} compiler" FORCE)
+ endif()
+ unset(_CMAKE_${lang}_COMPILER_CACHED)
endif()
endif()
endmacro()
@@ -140,7 +144,9 @@ function(_cmake_find_compiler_sysroot lang)
OUTPUT_VARIABLE _cmake_sysroot_run_out
ERROR_VARIABLE _cmake_sysroot_run_err)
- if(_cmake_sysroot_run_out AND NOT _cmake_sysroot_run_err AND IS_DIRECTORY "${_cmake_sysroot_run_out}/usr")
+ if(_cmake_sysroot_run_out AND NOT _cmake_sysroot_run_err
+ AND NOT _cmake_sysroot_run_out STREQUAL "/"
+ AND IS_DIRECTORY "${_cmake_sysroot_run_out}/usr")
file(TO_CMAKE_PATH "${_cmake_sysroot_run_out}/usr" _cmake_sysroot_run_out_usr)
set(CMAKE_${lang}_COMPILER_SYSROOT "${_cmake_sysroot_run_out_usr}" PARENT_SCOPE)
else()
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index df48fa574f..d7a35e11f4 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -14,8 +14,10 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
# Make sure user-specified compiler flags are used.
if(CMAKE_${lang}_FLAGS)
set(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
- else()
+ elseif(DEFINED ENV{${flagvar}})
set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
+ else(CMAKE_${lang}_FLAGS_INIT)
+ set(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS_INIT})
endif()
string(REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
@@ -248,7 +250,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_PostBuildEvent_Command "")
if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm](_v[0-9]+(_xp)?)?$")
set(id_cl_var "ClangClExecutable")
- elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg][Cc][Ll]$")
+ elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg]([Cc][Ll]$|_[0-9])")
set(id_cl "$(CLToolExe)")
elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*")
set(id_cl clang.exe)
@@ -310,17 +312,36 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_PreferredToolArchitecture "")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
+ set(id_keyword "Win32Proj")
set(id_system "<ApplicationType>Windows Phone</ApplicationType>")
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(id_keyword "Win32Proj")
set(id_system "<ApplicationType>Windows Store</ApplicationType>")
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
+ set(id_keyword "Android")
+ set(id_system "<ApplicationType>Android</ApplicationType>")
else()
+ set(id_keyword "Win32Proj")
set(id_system "")
endif()
- if(id_system AND CMAKE_SYSTEM_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
+ if(id_keyword STREQUAL "Android")
+ if(CMAKE_GENERATOR MATCHES "Visual Studio 14")
+ set(id_system_version "<ApplicationTypeRevision>2.0</ApplicationTypeRevision>")
+ elseif(CMAKE_GENERATOR MATCHES "Visual Studio 1[56]")
+ set(id_system_version "<ApplicationTypeRevision>3.0</ApplicationTypeRevision>")
+ else()
+ set(id_system_version "")
+ endif()
+ elseif(id_system AND CMAKE_SYSTEM_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
set(id_system_version "<ApplicationTypeRevision>${CMAKE_MATCH_1}</ApplicationTypeRevision>")
else()
set(id_system_version "")
endif()
+ if(id_keyword STREQUAL "Android")
+ set(id_config_type "DynamicLibrary")
+ else()
+ set(id_config_type "Application")
+ endif()
if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION)
set(id_WindowsTargetPlatformVersion "<WindowsTargetPlatformVersion>${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}</WindowsTargetPlatformVersion>")
endif()
@@ -333,9 +354,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
string(APPEND id_CustomGlobals "<${CMAKE_MATCH_1}>${CMAKE_MATCH_2}</${CMAKE_MATCH_1}>\n ")
endif()
endforeach()
- if(id_platform STREQUAL ARM64)
+ if(id_keyword STREQUAL "Android")
+ set(id_WindowsSDKDesktopARMSupport "")
+ elseif(id_platform STREQUAL "ARM64")
set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>")
- elseif(id_platform STREQUAL ARM)
+ elseif(id_platform STREQUAL "ARM")
set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>")
else()
set(id_WindowsSDKDesktopARMSupport "")
@@ -469,6 +492,12 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_clang_cxx_library "CLANG_CXX_LIBRARY = \"${CMAKE_MATCH_3}\";")
endif()
endif()
+ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_SYSROOT MATCHES "^$|[Mm][Aa][Cc][Oo][Ss]")
+ # When targeting macOS, use only the host architecture.
+ set(id_archs [[ARCHS = "$(NATIVE_ARCH_ACTUAL)";]])
+ else()
+ set(id_archs "")
+ endif()
configure_file(${CMAKE_ROOT}/Modules/CompilerId/Xcode-3.pbxproj.in
${id_dir}/CompilerId${lang}.xcodeproj/project.pbxproj @ONLY)
unset(_ENV_MACOSX_DEPLOYMENT_TARGET)
@@ -696,7 +725,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
# The IAR-AVR compiler uses a binary format that places a '6'
# character (0x34) before each character in the string. Strip
- # out these characters without removing any legitamate characters.
+ # out these characters without removing any legitimate characters.
if("${info}" MATCHES "(.)I.N.F.O.:.")
string(REGEX REPLACE "${CMAKE_MATCH_1}(.)" "\\1" info "${info}")
endif()
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 5f5a70ad3b..8a574086e1 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -26,7 +26,7 @@ else()
if(NOT $ENV{FC} STREQUAL "")
get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
if(CMAKE_Fortran_FLAGS_ENV_INIT)
- set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
+ set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "Arguments to Fortran compiler")
endif()
if(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
else()
diff --git a/Modules/CMakeDetermineJavaCompiler.cmake b/Modules/CMakeDetermineJavaCompiler.cmake
index 3092bb52d6..db456c0043 100644
--- a/Modules/CMakeDetermineJavaCompiler.cmake
+++ b/Modules/CMakeDetermineJavaCompiler.cmake
@@ -11,7 +11,7 @@ if(NOT CMAKE_Java_COMPILER)
if(NOT $ENV{JAVA_COMPILER} STREQUAL "")
get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(CMAKE_Java_FLAGS_ENV_INIT)
- set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
+ set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "Arguments to Java compiler")
endif()
if(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
diff --git a/Modules/CMakeDetermineOBJCCompiler.cmake b/Modules/CMakeDetermineOBJCCompiler.cmake
index 11b47fde84..709eb255d4 100644
--- a/Modules/CMakeDetermineOBJCCompiler.cmake
+++ b/Modules/CMakeDetermineOBJCCompiler.cmake
@@ -39,7 +39,7 @@ else()
if($ENV{${var}} MATCHES ".+")
get_filename_component(CMAKE_OBJC_COMPILER_INIT $ENV{${var}} PROGRAM PROGRAM_ARGS CMAKE_OBJC_FLAGS_ENV_INIT)
if(CMAKE_OBJC_FLAGS_ENV_INIT)
- set(CMAKE_OBJC_COMPILER_ARG1 "${CMAKE_OBJC_FLAGS_ENV_INIT}" CACHE STRING "First argument to Objective-C compiler")
+ set(CMAKE_OBJC_COMPILER_ARG1 "${CMAKE_OBJC_FLAGS_ENV_INIT}" CACHE STRING "Arguments to Objective-C compiler")
endif()
if(NOT EXISTS ${CMAKE_OBJC_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable ${var}:\n $ENV{${var}}")
@@ -65,14 +65,11 @@ else()
else()
# we only get here if CMAKE_OBJC_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
- # if CMAKE_OBJC_COMPILER is a list of length 2, use the first item as
- # CMAKE_OBJC_COMPILER and the 2nd one as CMAKE_OBJC_COMPILER_ARG1
-
- list(LENGTH CMAKE_OBJC_COMPILER _CMAKE_OBJC_COMPILER_LIST_LENGTH)
- if("${_CMAKE_OBJC_COMPILER_LIST_LENGTH}" EQUAL 2)
- list(GET CMAKE_OBJC_COMPILER 1 CMAKE_OBJC_COMPILER_ARG1)
- list(GET CMAKE_OBJC_COMPILER 0 CMAKE_OBJC_COMPILER)
- endif()
+ # if CMAKE_OBJC_COMPILER is a list, use the first item as
+ # CMAKE_OBJC_COMPILER and the rest as CMAKE_OBJC_COMPILER_ARG1
+ set(CMAKE_OBJC_COMPILER_ARG1 "${CMAKE_OBJC_COMPILER}")
+ list(POP_FRONT CMAKE_OBJC_COMPILER_ARG1 CMAKE_OBJC_COMPILER)
+ list(JOIN CMAKE_OBJC_COMPILER_ARG1 " " CMAKE_OBJC_COMPILER_ARG1)
# if a compiler was specified by the user but without path,
# now try to find it with the full path
diff --git a/Modules/CMakeDetermineOBJCXXCompiler.cmake b/Modules/CMakeDetermineOBJCXXCompiler.cmake
index 99ad6c31ed..ffd0091996 100644
--- a/Modules/CMakeDetermineOBJCXXCompiler.cmake
+++ b/Modules/CMakeDetermineOBJCXXCompiler.cmake
@@ -41,7 +41,7 @@ else()
if($ENV{${var}} MATCHES ".+")
get_filename_component(CMAKE_OBJCXX_COMPILER_INIT $ENV{${var}} PROGRAM PROGRAM_ARGS CMAKE_OBJCXX_FLAGS_ENV_INIT)
if(CMAKE_OBJCXX_FLAGS_ENV_INIT)
- set(CMAKE_OBJCXX_COMPILER_ARG1 "${CMAKE_OBJCXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to Objective-C++ compiler")
+ set(CMAKE_OBJCXX_COMPILER_ARG1 "${CMAKE_OBJCXX_FLAGS_ENV_INIT}" CACHE STRING "Arguments to Objective-C++ compiler")
endif()
if(NOT EXISTS ${CMAKE_OBJCXX_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable ${var}:\n $ENV{${var}}")
@@ -67,14 +67,11 @@ else()
else()
# we only get here if CMAKE_OBJCXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
- # if CMAKE_OBJCXX_COMPILER is a list of length 2, use the first item as
- # CMAKE_OBJCXX_COMPILER and the 2nd one as CMAKE_OBJCXX_COMPILER_ARG1
-
- list(LENGTH CMAKE_OBJCXX_COMPILER _CMAKE_OBJCXX_COMPILER_LIST_LENGTH)
- if("${_CMAKE_OBJCXX_COMPILER_LIST_LENGTH}" EQUAL 2)
- list(GET CMAKE_OBJCXX_COMPILER 1 CMAKE_OBJCXX_COMPILER_ARG1)
- list(GET CMAKE_OBJCXX_COMPILER 0 CMAKE_OBJCXX_COMPILER)
- endif()
+ # if CMAKE_OBJCXX_COMPILER is a list, use the first item as
+ # CMAKE_OBJCXX_COMPILER and the rest as CMAKE_OBJCXX_COMPILER_ARG1
+ set(CMAKE_OBJCXX_COMPILER_ARG1 "${CMAKE_OBJCXX_COMPILER}")
+ list(POP_FRONT CMAKE_OBJCXX_COMPILER_ARG1 CMAKE_OBJCXX_COMPILER)
+ list(JOIN CMAKE_OBJCXX_COMPILER_ARG1 " " CMAKE_OBJCXX_COMPILER_ARG1)
# if a compiler was specified by the user but without path,
# now try to find it with the full path
diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake
index 8801e16320..f8d55a5c01 100644
--- a/Modules/CMakeDetermineRCCompiler.cmake
+++ b/Modules/CMakeDetermineRCCompiler.cmake
@@ -13,7 +13,7 @@ if(NOT CMAKE_RC_COMPILER)
if(NOT $ENV{RC} STREQUAL "")
get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
if(CMAKE_RC_FLAGS_ENV_INIT)
- set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
+ set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "Arguments to RC compiler")
endif()
if(EXISTS ${CMAKE_RC_COMPILER_INIT})
else()
diff --git a/Modules/CMakeDetermineSwiftCompiler.cmake b/Modules/CMakeDetermineSwiftCompiler.cmake
index 688133f34f..aaad5601da 100644
--- a/Modules/CMakeDetermineSwiftCompiler.cmake
+++ b/Modules/CMakeDetermineSwiftCompiler.cmake
@@ -27,7 +27,7 @@ elseif("${CMAKE_GENERATOR}" MATCHES "^Ninja")
PROGRAM_ARGS CMAKE_Swift_FLAGS_ENV_INIT)
if(CMAKE_Swift_FLAGS_ENV_INIT)
set(CMAKE_Swift_COMPILER_ARG1 "${CMAKE_Swift_FLAGS_ENV_INIT}" CACHE
- STRING "First argument to the Swift compiler")
+ STRING "Arguments to the Swift compiler")
endif()
if(NOT EXISTS ${CMAKE_Swift_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable SWIFTC\n$ENV{SWIFTC}.\n${CMAKE_Swift_COMPILER_INIT}")
diff --git a/Modules/CMakeParseImplicitIncludeInfo.cmake b/Modules/CMakeParseImplicitIncludeInfo.cmake
index ff4c32561c..7cd75488cd 100644
--- a/Modules/CMakeParseImplicitIncludeInfo.cmake
+++ b/Modules/CMakeParseImplicitIncludeInfo.cmake
@@ -7,7 +7,7 @@
# for compilers that report them that way. on success we return the
# list of dirs in id_var and set state_var to the 'done' state.
function(cmake_parse_implicit_include_line line lang id_var log_var state_var)
- # clear variables we append to (avoids possible polution from parent scopes)
+ # clear variables we append to (avoids possible pollution from parent scopes)
unset(rv)
set(log "")
@@ -162,7 +162,7 @@ endfunction()
function(cmake_parse_implicit_include_info text lang dir_var log_var state_var)
set(state start) # values: start, loading, done
- # clear variables we append to (avoids possible polution from parent scopes)
+ # clear variables we append to (avoids possible pollution from parent scopes)
set(implicit_dirs_tmp)
set(log "")
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index 40668a3e6b..0b81c88ebe 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -206,6 +206,24 @@
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
+
+#elif defined(__TI_COMPILER_VERSION__)
+# if defined(__TI_ARM__)
+# define ARCHITECTURE_ID "ARM"
+
+# elif defined(__MSP430__)
+# define ARCHITECTURE_ID "MSP430"
+
+# elif defined(__TMS320C28XX__)
+# define ARCHITECTURE_ID "TMS320C28x"
+
+# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
+# define ARCHITECTURE_ID "TMS320C6x"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
+
#else
# define ARCHITECTURE_ID
#endif
@@ -283,4 +301,3 @@ char const info_simulate_version[] = {
array rather than assigning a pointer to a static array. */
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
-
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 3734ec46ac..03f2db2d22 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -11,7 +11,7 @@ endif()
include(CMakeTestCompilerCommon)
-# work around enforced code signing and / or missing exectuable target type
+# work around enforced code signing and / or missing executable target type
set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index b9cb1dd0eb..0d2d0b0530 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -11,7 +11,7 @@ endif()
include(CMakeTestCompilerCommon)
-# work around enforced code signing and / or missing exectuable target type
+# work around enforced code signing and / or missing executable target type
set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
diff --git a/Modules/CMakeTestOBJCCompiler.cmake b/Modules/CMakeTestOBJCCompiler.cmake
index 0e333c0eff..298272b85a 100644
--- a/Modules/CMakeTestOBJCCompiler.cmake
+++ b/Modules/CMakeTestOBJCCompiler.cmake
@@ -11,7 +11,7 @@ endif()
include(CMakeTestCompilerCommon)
-# work around enforced code signing and / or missing exectuable target type
+# work around enforced code signing and / or missing executable target type
set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
diff --git a/Modules/CMakeTestOBJCXXCompiler.cmake b/Modules/CMakeTestOBJCXXCompiler.cmake
index dc153a7b93..36e3efc509 100644
--- a/Modules/CMakeTestOBJCXXCompiler.cmake
+++ b/Modules/CMakeTestOBJCXXCompiler.cmake
@@ -11,7 +11,7 @@ endif()
include(CMakeTestCompilerCommon)
-# work around enforced code signing and / or missing exectuable target type
+# work around enforced code signing and / or missing executable target type
set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index d0cfc2b18a..8a0ef3050a 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -22,9 +22,13 @@ section below for details.
The generated binary installers will contain all files that have been installed
via CMake's :command:`install` command (and the deprecated commands
:command:`install_files`, :command:`install_programs`, and
-:command:`install_targets`). Certain kinds of binary installers can be
-configured such that users can select individual application components to
-install. See the :module:`CPackComponent` module for further details.
+:command:`install_targets`). Note that the ``DESTINATION`` option of the
+:command:`install` command must be a relative path; otherwise installed files
+are ignored by CPack.
+
+Certain kinds of binary installers can be configured such that users can select
+individual application components to install. See the :module:`CPackComponent`
+module for further details.
Source packages (configured through ``CPackSourceConfig.cmake`` and generated
by the :cpack_gen:`CPack Archive Generator`) will contain all source files in
@@ -386,6 +390,21 @@ The following variables are for advanced uses of CPack:
select the CPack generator(s) to be used when building the ``package``
target or when running :manual:`cpack <cpack(1)>` without the ``-G`` option.
+.. variable:: CPACK_PRE_BUILD_SCRIPTS
+
+ List of CMake scripts to execute after CPack has installed the files to
+ be packed into a staging directory and before producing the result
+ packages.
+
+.. variable:: CPACK_POST_BUILD_SCRIPTS
+
+ List of CMake scripts to execute after CPack has produced the result
+ packages and before copying them back to a build directory.
+
+.. variable:: CPACK_PACKAGE_FILES
+
+ List of resulting package files passed to the ``CPACK_POST_BUILD_SCRIPTS``.
+
#]=======================================================================]
# Define this var in order to avoid (or warn) concerning multiple inclusion
@@ -420,7 +439,7 @@ endmacro()
# find any variable that starts with CPACK and create a variable
# _CPACK_OTHER_VARIABLES_ that contains SET commands for
# each cpack variable. _CPACK_OTHER_VARIABLES_ is then
-# used as an @ replacment in configure_file for the CPackConfig.
+# used as an @ replacement in configure_file for the CPackConfig.
function(cpack_encode_variables)
set(commands "")
get_cmake_property(res VARIABLES)
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index 80a907ffd2..58e6a375f4 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -5,6 +5,8 @@
CPackIFW
--------
+.. versionadded:: 3.1
+
This module looks for the location of the command-line utilities supplied with the
`Qt Installer Framework <http://doc.qt.io/qtinstallerframework/index.html>`_
(QtIFW).
diff --git a/Modules/CPackIFWConfigureFile.cmake b/Modules/CPackIFWConfigureFile.cmake
index 0abe0da371..296b13f725 100644
--- a/Modules/CPackIFWConfigureFile.cmake
+++ b/Modules/CPackIFWConfigureFile.cmake
@@ -5,6 +5,8 @@
CPackIFWConfigureFile
---------------------
+.. versionadded:: 3.8
+
The module defines :command:`configure_file` similar command to
configure file templates prepared in QtIFW/SDK/Creator style.
diff --git a/Modules/CSharpUtilities.cmake b/Modules/CSharpUtilities.cmake
index 6a4b5c7f7b..dedb146ac1 100644
--- a/Modules/CSharpUtilities.cmake
+++ b/Modules/CSharpUtilities.cmake
@@ -5,6 +5,8 @@
CSharpUtilities
---------------
+.. versionadded:: 3.8
+
Functions to make configuration of CSharp/.NET targets easier.
A collection of CMake utility functions useful for dealing with CSharp
diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index b1268bebf2..a01a2fea22 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -5,6 +5,8 @@
CTestCoverageCollectGCOV
------------------------
+.. versionadded:: 3.2
+
This module provides the ``ctest_coverage_collect_gcov`` function.
This function runs gcov on all .gcda files found in the binary tree
diff --git a/Modules/CheckFortranCompilerFlag.cmake b/Modules/CheckFortranCompilerFlag.cmake
index 299cd8cfc8..b8fac97cc5 100644
--- a/Modules/CheckFortranCompilerFlag.cmake
+++ b/Modules/CheckFortranCompilerFlag.cmake
@@ -5,6 +5,8 @@
CheckFortranCompilerFlag
------------------------
+.. versionadded:: 3.3
+
Check whether the Fortran compiler supports a given flag.
.. command:: check_fortran_compiler_flag
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index 3354bfb25f..d776b0c13b 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -5,6 +5,8 @@
CheckFortranSourceCompiles
--------------------------
+.. versionadded:: 3.1
+
Check if given Fortran source compiles and links into an executable.
.. command:: check_fortran_source_compiles
diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake
index f858b84a81..a710352325 100644
--- a/Modules/CheckFortranSourceRuns.cmake
+++ b/Modules/CheckFortranSourceRuns.cmake
@@ -5,6 +5,8 @@
CheckFortranSourceRuns
----------------------
+.. versionadded:: 3.14
+
Check if given Fortran source compiles and links into an executable and can
subsequently be run.
diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake
index 90a9f61804..1dd951d83c 100644
--- a/Modules/CheckIPOSupported.cmake
+++ b/Modules/CheckIPOSupported.cmake
@@ -5,6 +5,8 @@
CheckIPOSupported
-----------------
+.. versionadded:: 3.9
+
Check whether the compiler supports an interprocedural optimization (IPO/LTO).
Use this before enabling the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` target
property.
diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake
index d67d8d3ac2..44387d4b44 100644
--- a/Modules/CheckLanguage.cmake
+++ b/Modules/CheckLanguage.cmake
@@ -20,7 +20,7 @@ test project. The result is cached in :variable:`CMAKE_<LANG>_COMPILER`
as the compiler that was found, or ``NOTFOUND`` if the language cannot be
enabled. For CUDA which can have an explicit host compiler, the cache
:variable:`CMAKE_CUDA_HOST_COMPILER` variable will be set if it was required
-for compilation.
+for compilation (and cleared if it was not).
Example:
diff --git a/Modules/CheckLinkerFlag.cmake b/Modules/CheckLinkerFlag.cmake
index beda5fe3c3..cd7301f941 100644
--- a/Modules/CheckLinkerFlag.cmake
+++ b/Modules/CheckLinkerFlag.cmake
@@ -5,6 +5,8 @@
CheckLinkerFlag
---------------
+.. versionadded:: 3.18
+
Check whether the compiler supports a given link flag.
.. command:: check_linker_flag
diff --git a/Modules/CheckOBJCCompilerFlag.cmake b/Modules/CheckOBJCCompilerFlag.cmake
index 1d975da882..a98f4293c9 100644
--- a/Modules/CheckOBJCCompilerFlag.cmake
+++ b/Modules/CheckOBJCCompilerFlag.cmake
@@ -5,6 +5,8 @@
CheckOBJCCompilerFlag
---------------------
+.. versionadded:: 3.16
+
Check whether the Objective-C compiler supports a given flag.
.. command:: check_objc_compiler_flag
diff --git a/Modules/CheckOBJCSourceCompiles.cmake b/Modules/CheckOBJCSourceCompiles.cmake
index 601f1fa443..502ed74725 100644
--- a/Modules/CheckOBJCSourceCompiles.cmake
+++ b/Modules/CheckOBJCSourceCompiles.cmake
@@ -5,6 +5,8 @@
CheckOBJCSourceCompiles
-----------------------
+.. versionadded:: 3.16
+
Check if given Objective-C source compiles and links into an executable.
.. command:: check_objc_source_compiles
diff --git a/Modules/CheckOBJCSourceRuns.cmake b/Modules/CheckOBJCSourceRuns.cmake
index 6684693916..9d4fb1bacc 100644
--- a/Modules/CheckOBJCSourceRuns.cmake
+++ b/Modules/CheckOBJCSourceRuns.cmake
@@ -5,6 +5,8 @@
CheckOBJCSourceRuns
-------------------
+.. versionadded:: 3.16
+
Check if given Objective-C source compiles and links into an executable and can
subsequently be run.
diff --git a/Modules/CheckOBJCXXCompilerFlag.cmake b/Modules/CheckOBJCXXCompilerFlag.cmake
index c32741b54a..7944ab07a0 100644
--- a/Modules/CheckOBJCXXCompilerFlag.cmake
+++ b/Modules/CheckOBJCXXCompilerFlag.cmake
@@ -5,6 +5,8 @@
CheckOBJCXXCompilerFlag
-----------------------
+.. versionadded:: 3.16
+
Check whether the Objective-C++ compiler supports a given flag.
.. command:: check_objcxx_compiler_flag
diff --git a/Modules/CheckOBJCXXSourceCompiles.cmake b/Modules/CheckOBJCXXSourceCompiles.cmake
index 2ee79f48a7..7b839e4cbf 100644
--- a/Modules/CheckOBJCXXSourceCompiles.cmake
+++ b/Modules/CheckOBJCXXSourceCompiles.cmake
@@ -5,6 +5,8 @@
CheckOBJCXXSourceCompiles
-------------------------
+.. versionadded:: 3.16
+
Check if given Objective-C++ source compiles and links into an executable.
.. command:: check_objcxx_source_compiles
diff --git a/Modules/CheckOBJCXXSourceRuns.cmake b/Modules/CheckOBJCXXSourceRuns.cmake
index 7f7e04f77e..c32759899e 100644
--- a/Modules/CheckOBJCXXSourceRuns.cmake
+++ b/Modules/CheckOBJCXXSourceRuns.cmake
@@ -5,6 +5,8 @@
CheckOBJCXXSourceRuns
---------------------
+.. versionadded:: 3.16
+
Check if given Objective-C++ source compiles and links into an executable and can
subsequently be run.
diff --git a/Modules/CheckPIESupported.cmake b/Modules/CheckPIESupported.cmake
index 6d63f0bada..a99d8c41f1 100644
--- a/Modules/CheckPIESupported.cmake
+++ b/Modules/CheckPIESupported.cmake
@@ -5,6 +5,8 @@
CheckPIESupported
-----------------
+.. versionadded:: 3.14
+
Check whether the linker supports Position Independent Code (PIE) or No
Position Independent Code (NO_PIE) for executables.
Use this to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE` target
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 2b07b7cc03..17beadcb10 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -89,17 +89,38 @@ function(__check_type_size_impl type var map builtin language)
message(CHECK_START "Check size of ${type}")
endif()
+ # Perform language check
+ if(language STREQUAL "C")
+ set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c)
+ elseif(language STREQUAL "CXX")
+ set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.cpp)
+ else()
+ message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n")
+ endif()
+
# Include header files.
set(headers)
if(builtin)
- if(HAVE_SYS_TYPES_H)
- string(APPEND headers "#include <sys/types.h>\n")
- endif()
- if(HAVE_STDINT_H)
- string(APPEND headers "#include <stdint.h>\n")
- endif()
- if(HAVE_STDDEF_H)
- string(APPEND headers "#include <stddef.h>\n")
+ if(language STREQUAL "CXX" AND type MATCHES "^std::")
+ if(HAVE_SYS_TYPES_H)
+ string(APPEND headers "#include <sys/types.h>\n")
+ endif()
+ if(HAVE_CSTDINT)
+ string(APPEND headers "#include <cstdint>\n")
+ endif()
+ if(HAVE_CSTDDEF)
+ string(APPEND headers "#include <cstddef>\n")
+ endif()
+ else()
+ if(HAVE_SYS_TYPES_H)
+ string(APPEND headers "#include <sys/types.h>\n")
+ endif()
+ if(HAVE_STDINT_H)
+ string(APPEND headers "#include <stdint.h>\n")
+ endif()
+ if(HAVE_STDDEF_H)
+ string(APPEND headers "#include <stddef.h>\n")
+ endif()
endif()
endif()
foreach(h ${CMAKE_EXTRA_INCLUDE_FILES})
@@ -107,14 +128,6 @@ function(__check_type_size_impl type var map builtin language)
endforeach()
# Perform the check.
-
- if(language STREQUAL "C")
- set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c)
- elseif(language STREQUAL "CXX")
- set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.cpp)
- else()
- message(FATAL_ERROR "Unknown language:\n ${language}\nSupported languages: C, CXX.\n")
- endif()
set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin)
configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY)
try_compile(HAVE_${var} ${CMAKE_BINARY_DIR} ${src}
@@ -232,8 +245,13 @@ macro(CHECK_TYPE_SIZE TYPE VARIABLE)
check_include_file(stddef.h HAVE_STDDEF_H)
elseif(_language STREQUAL "CXX")
check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H)
- check_include_file_cxx(stdint.h HAVE_STDINT_H)
- check_include_file_cxx(stddef.h HAVE_STDDEF_H)
+ if("${TYPE}" MATCHES "^std::")
+ check_include_file_cxx(cstdint HAVE_CSTDINT)
+ check_include_file_cxx(cstddef HAVE_CSTDDEF)
+ else()
+ check_include_file_cxx(stdint.h HAVE_STDINT_H)
+ check_include_file_cxx(stddef.h HAVE_STDDEF_H)
+ endif()
endif()
endif()
unset(_CHECK_TYPE_SIZE_BUILTIN_TYPES_ONLY)
diff --git a/Modules/Compiler/ARMClang.cmake b/Modules/Compiler/ARMClang.cmake
index 01ce91d4a0..70e6ffbd31 100644
--- a/Modules/Compiler/ARMClang.cmake
+++ b/Modules/Compiler/ARMClang.cmake
@@ -98,7 +98,7 @@ macro(__compiler_armclang lang)
set(__mcpu_flag_set TRUE)
endif()
if(NOT __march_flag_set AND NOT __mcpu_flag_set)
- message(FATAL_ERROR "Atleast one of the variables CMAKE_SYSTEM_PROCESSOR or CMAKE_SYSTEM_ARCH must be set for ARMClang\n"
+ message(FATAL_ERROR "At least one of the variables CMAKE_SYSTEM_PROCESSOR or CMAKE_SYSTEM_ARCH must be set for ARMClang\n"
"Supported processor: ${CMAKE_${lang}_COMPILER_PROCESSOR_LIST}\n"
" Supported Architecture: ${CMAKE_${lang}_COMPILER_ARCH_LIST}")
endif()
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index 2794f52bbb..26a4bbd335 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -1,6 +1,8 @@
include(Compiler/Clang)
__compiler_clang(C)
+set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
+
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake
index 15edc21e99..611c674576 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -1,6 +1,8 @@
include(Compiler/Clang)
__compiler_clang(CXX)
+set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
+
if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index 7c4a263f6a..fb6ffa7b00 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -8,6 +8,8 @@ endif()
if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl")
+elseif("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 789e991594..311d2b07f6 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -2,7 +2,9 @@ include(Compiler/Clang)
__compiler_clang(CXX)
__compiler_clang_cxx_standards(CXX)
+
if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index bb516d3a20..52d5350a3c 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -222,11 +222,11 @@ macro(__compiler_clang_cxx_standards lang)
# can be attempted.
macro(cmake_record_${lang}_compile_features)
list(APPEND CMAKE_${lang}_COMPILE_FEATURES
- ${lang}_std_98
- ${lang}_std_11
- ${lang}_std_14
- ${lang}_std_17
- ${lang}_std_20
+ cxx_std_98
+ cxx_std_11
+ cxx_std_14
+ cxx_std_17
+ cxx_std_20
)
_record_compiler_features(${lang} "" CMAKE_${lang}_COMPILE_FEATURES)
endmacro()
diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake
index ca286b3975..8105a77f62 100644
--- a/Modules/Compiler/GNU-C.cmake
+++ b/Modules/Compiler/GNU-C.cmake
@@ -1,6 +1,8 @@
include(Compiler/GNU)
__compiler_gnu(C)
+set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
+
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index fcaaeab433..59ec05691c 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -1,6 +1,8 @@
include(Compiler/GNU)
__compiler_gnu(CXX)
+set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
+
if (WIN32)
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fno-keep-inline-dllexport")
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index ec3bfd88fa..322f63d0d2 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -28,6 +28,8 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
else()
+ set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
+
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index b71b946e92..42adfd10c7 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -42,6 +42,8 @@ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
else()
+ set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
+
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0)
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20")
diff --git a/Modules/Compiler/OpenWatcom.cmake b/Modules/Compiler/OpenWatcom.cmake
index 9efbfc282e..a9625137aa 100644
--- a/Modules/Compiler/OpenWatcom.cmake
+++ b/Modules/Compiler/OpenWatcom.cmake
@@ -86,7 +86,7 @@ set(CMAKE_C_CREATE_STATIC_LIBRARY
set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
-# old CMake internaly used OpenWatcom version macros
+# old CMake internally used OpenWatcom version macros
# for backward compatibility
if(NOT _CMAKE_WATCOM_VERSION)
set(_CMAKE_WATCOM_VERSION 1)
diff --git a/Modules/Compiler/PGI-CXX.cmake b/Modules/Compiler/PGI-CXX.cmake
index c77de3605b..2d7a303c9b 100644
--- a/Modules/Compiler/PGI-CXX.cmake
+++ b/Modules/Compiler/PGI-CXX.cmake
@@ -4,19 +4,19 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.10)
- set(CMAKE_CXX98_STANDARD_COMPILE_OPTION -A)
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION --gnu_extensions)
set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.10)
- set(CMAKE_CXX11_STANDARD_COMPILE_OPTION --c++11 -A)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION --c++11)
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION --c++11 --gnu_extensions)
set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.7)
- set(CMAKE_CXX14_STANDARD_COMPILE_OPTION --c++14 -A)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION --c++14)
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION --c++14 --gnu_extensions)
set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 17.1)
- set(CMAKE_CXX17_STANDARD_COMPILE_OPTION --c++17 -A)
+ set(CMAKE_CXX17_STANDARD_COMPILE_OPTION --c++17)
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION --c++17 --gnu_extensions)
set(CMAKE_CXX17_STANDARD__HAS_FULL_SUPPORT ON)
endif()
diff --git a/Modules/Compiler/TI-ASM.cmake b/Modules/Compiler/TI-ASM.cmake
index a566d70e16..01965d2e5e 100644
--- a/Modules/Compiler/TI-ASM.cmake
+++ b/Modules/Compiler/TI-ASM.cmake
@@ -1,8 +1,4 @@
-set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
-set(CMAKE_LINK_LIBRARY_FLAG "--library=")
-set(CMAKE_INCLUDE_FLAG_ASM "--include_path=")
-
-set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> --compile_only --asm_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")
-set(CMAKE_ASM_LINK_EXECUTABLE "<CMAKE_ASM_COMPILER> <OBJECTS> --run_linker --output_file=<TARGET> <CMAKE_ASM_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
+include(Compiler/TI)
+__compiler_ti(ASM)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm;s;abs)
diff --git a/Modules/Compiler/TI-C.cmake b/Modules/Compiler/TI-C.cmake
index b060ee9bbd..8ea01b59e0 100644
--- a/Modules/Compiler/TI-C.cmake
+++ b/Modules/Compiler/TI-C.cmake
@@ -1,22 +1,8 @@
-set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
-set(CMAKE_LINK_LIBRARY_FLAG "--library=")
-set(CMAKE_INCLUDE_FLAG_C "--include_path=")
+include(Compiler/TI)
+__compiler_ti(C)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "--c89")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "--c89 --relaxed_ansi")
set(CMAKE_C99_STANDARD_COMPILE_OPTION "--c99")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "--c99 --relaxed_ansi")
-
-set(CMAKE_DEPFILE_FLAGS_C "--preproc_with_compile --preproc_dependency=<DEPFILE>")
-
-set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> --compile_only --skip_assembler --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>")
-set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> --preproc_only --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
-
-set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> --compile_only --c_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")
-set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>")
-set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
-set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
-set(CMAKE_ASM_RESPONSE_FILE_FLAG "--cmd_file=")
-set(CMAKE_C_RESPONSE_FILE_FLAG "--cmd_file=")
-set(CMAKE_C_RESPONSE_FILE_LINK_FLAG " ")
diff --git a/Modules/Compiler/TI-CXX.cmake b/Modules/Compiler/TI-CXX.cmake
index 783654373d..c08d9a14a6 100644
--- a/Modules/Compiler/TI-CXX.cmake
+++ b/Modules/Compiler/TI-CXX.cmake
@@ -1,15 +1,2 @@
-set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
-set(CMAKE_LINK_LIBRARY_FLAG "--library=")
-set(CMAKE_INCLUDE_FLAG_CXX "--include_path=")
-
-set(CMAKE_DEPFILE_FLAGS_CXX "--preproc_with_compile --preproc_dependency=<DEPFILE>")
-
-set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> --compile_only --skip_assembler --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>")
-set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> --preproc_only --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
-
-set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> --compile_only --cpp_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")
-set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>")
-set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
-set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
-set(CMAKE_CXX_RESPONSE_FILE_FLAG "--cmd_file=")
-set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG " ")
+include(Compiler/TI)
+__compiler_ti(CXX)
diff --git a/Modules/Compiler/TI.cmake b/Modules/Compiler/TI.cmake
new file mode 100644
index 0000000000..9f2e8130d8
--- /dev/null
+++ b/Modules/Compiler/TI.cmake
@@ -0,0 +1,40 @@
+# 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_TI)
+ return()
+endif()
+set(__COMPILER_TI 1)
+
+macro(__compiler_ti lang)
+ string(TOLOWER ${lang} prefix)
+ if("x${lang}" STREQUAL "xCXX")
+ set(prefix "cpp")
+ endif()
+
+ set(CMAKE_${lang}_RESPONSE_FILE_FLAG "--cmd_file=")
+
+ set(CMAKE_INCLUDE_FLAG_${lang} "--include_path=")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "--preproc_with_compile --preproc_dependency=<DEPFILE>")
+
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> --preproc_only --${prefix}_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> --compile_only --skip_assembler --${prefix}_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>")
+
+ set(CMAKE_${lang}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> --compile_only --${prefix}_file=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<OBJECT>")
+
+ set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> qr <TARGET> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_FINISH "")
+
+ # After the --run_linker flag a response file is not possible
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "")
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_LIBRARIES 0)
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 0)
+
+ set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
+endmacro()
+
+set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
+set(CMAKE_LINK_LIBRARY_FLAG "--library=")
diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake
index 2077bdabdf..78c44d5d72 100644
--- a/Modules/Compiler/XL-C.cmake
+++ b/Modules/Compiler/XL-C.cmake
@@ -6,6 +6,8 @@ string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
# -qthreaded = Ensures that all optimizations will be thread-safe
string(APPEND CMAKE_C_FLAGS_INIT " -qthreaded")
+set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -qsourcetype=c)
+
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-qlanglvl=stdc89")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-qlanglvl=extc89")
diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake
index 41e3e11194..3b911f3d6c 100644
--- a/Modules/Compiler/XL-CXX.cmake
+++ b/Modules/Compiler/XL-CXX.cmake
@@ -6,6 +6,8 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
# -qthreaded = Ensures that all optimizations will be thread-safe
string(APPEND CMAKE_CXX_FLAGS_INIT " -qthreaded")
+set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -+)
+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
if(CMAKE_SYSTEM MATCHES "Linux")
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
@@ -32,6 +34,3 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1)
endif ()
__compiler_check_default_language_standard(CXX 10.1 98)
-
-set(CMAKE_CXX_COMPILE_OBJECT
- "<CMAKE_CXX_COMPILER> -+ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
diff --git a/Modules/Compiler/XLClang-C.cmake b/Modules/Compiler/XLClang-C.cmake
index 54c18a668a..1668a4d0f9 100644
--- a/Modules/Compiler/XLClang-C.cmake
+++ b/Modules/Compiler/XLClang-C.cmake
@@ -1,6 +1,8 @@
include(Compiler/XLClang)
__compiler_xlclang(C)
+set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
+
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89")
diff --git a/Modules/Compiler/XLClang-CXX.cmake b/Modules/Compiler/XLClang-CXX.cmake
index 9ea3d7cace..02638c7917 100644
--- a/Modules/Compiler/XLClang-CXX.cmake
+++ b/Modules/Compiler/XLClang-CXX.cmake
@@ -1,6 +1,8 @@
include(Compiler/XLClang)
__compiler_xlclang(CXX)
+set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1)
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in
index b48a3323f9..3598fc7e20 100644
--- a/Modules/CompilerId/VS-10.vcxproj.in
+++ b/Modules/CompilerId/VS-10.vcxproj.in
@@ -9,7 +9,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{CAE07175-D007-4FC3-BFE8-47B392814159}</ProjectGuid>
<RootNamespace>CompilerId@id_lang@</RootNamespace>
- <Keyword>Win32Proj</Keyword>
+ <Keyword>@id_keyword@</Keyword>
@id_system@
@id_system_version@
@id_WindowsTargetPlatformVersion@
@@ -24,7 +24,7 @@
@id_PreferredToolArchitecture@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
+ <ConfigurationType>@id_config_type@</ConfigurationType>
@id_toolset@
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in
index 672044e135..6fe17e541d 100644
--- a/Modules/CompilerId/Xcode-3.pbxproj.in
+++ b/Modules/CompilerId/Xcode-3.pbxproj.in
@@ -84,6 +84,7 @@
CODE_SIGNING_REQUIRED = NO;
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
SYMROOT = .;
+ @id_archs@
@id_toolset@
@id_lang_version@
@id_clang_cxx_library@
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 3a47090a76..aecc00b3bc 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1124,7 +1124,11 @@ function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git
message(FATAL_ERROR "Tag for git checkout should not be empty.")
endif()
- set(git_clone_options "--no-checkout")
+ if(GIT_VERSION_STRING VERSION_LESS 2.20 OR 2.21 VERSION_LESS_EQUAL GIT_VERSION_STRING)
+ set(git_clone_options "--no-checkout")
+ else()
+ set(git_clone_options)
+ endif()
if(git_shallow)
if(NOT GIT_VERSION_STRING VERSION_LESS 1.7.10)
list(APPEND git_clone_options "--depth 1 --no-single-branch")
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index e05ca96921..c85e2d8370 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -5,6 +5,8 @@
FetchContent
------------------
+.. versionadded:: 3.11
+
.. only:: html
.. contents::
diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake
index 243b9e077c..c8a31a0386 100644
--- a/Modules/FindArmadillo.cmake
+++ b/Modules/FindArmadillo.cmake
@@ -84,6 +84,7 @@ if(_ARMA_USE_WRAPPER)
# Link to the armadillo wrapper library.
find_library(ARMADILLO_LIBRARY
NAMES armadillo
+ NAMES_PER_DIR
PATHS
"$ENV{ProgramFiles}/Armadillo/lib"
"$ENV{ProgramFiles}/Armadillo/lib64"
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 60f178be74..88a252d602 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -36,7 +36,7 @@ The following variables may be set to influence this module's behavior:
* ``SCSL``
* ``SGIMATH``
* ``IBMESSL``
- * ``Intel10_32`` (intel mkl v10 32 bit)
+ * ``Intel10_32`` (intel mkl v10 32 bit, threaded code)
* ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model)
* ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model)
* ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model)
@@ -208,6 +208,7 @@ macro(CHECK_BLAS_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _add
if(_libraries_work)
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
+ NAMES_PER_DIR
PATHS ${_extaddlibdir}
PATH_SUFFIXES ${_subdirs}
)
@@ -397,6 +398,10 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
# Add threading/sequential libs
set(BLAS_SEARCH_LIBS_WIN_THREAD "")
+ if(BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
+ list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
+ "libiomp5md mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}")
+ endif()
if(BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
@@ -441,7 +446,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
"${BLAS_mkl_START_GROUP} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core ${BLAS_mkl_END_GROUP}")
endif()
- #older vesions of intel mkl libs
+ #older versions of intel mkl libs
if(BLA_VENDOR STREQUAL "Intel" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl")
@@ -483,7 +488,9 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endif()
set(BLAS_mkl_LIB_PATH_SUFFIXES
"compiler/lib" "compiler/lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}"
+ "compiler/lib/${BLAS_mkl_ARCH_NAME}"
"mkl/lib" "mkl/lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}"
+ "mkl/lib/${BLAS_mkl_ARCH_NAME}"
"lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}")
foreach(IT ${BLAS_SEARCH_LIBS})
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index 98ab72cd85..5704d1d83c 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -45,8 +45,8 @@ set(_BZIP2_PATHS PATHS
find_path(BZIP2_INCLUDE_DIR bzlib.h ${_BZIP2_PATHS} PATH_SUFFIXES include)
if (NOT BZIP2_LIBRARIES)
- find_library(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 libbz2 libbzip2 ${_BZIP2_PATHS} PATH_SUFFIXES lib)
- find_library(BZIP2_LIBRARY_DEBUG NAMES bz2d bzip2d libbz2d libbzip2d ${_BZIP2_PATHS} PATH_SUFFIXES lib)
+ find_library(BZIP2_LIBRARY_RELEASE NAMES bz2 bzip2 libbz2 libbzip2 NAMES_PER_DIR ${_BZIP2_PATHS} PATH_SUFFIXES lib)
+ find_library(BZIP2_LIBRARY_DEBUG NAMES bz2d bzip2d libbz2d libbzip2d NAMES_PER_DIR ${_BZIP2_PATHS} PATH_SUFFIXES lib)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
SELECT_LIBRARY_CONFIGURATIONS(BZIP2)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 13981d3b84..ec087ad432 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -305,7 +305,7 @@ function(_boost_get_canonical_target_name component target_var)
endfunction()
macro(_boost_set_in_parent_scope name value)
- # Set a variable in parent scope and make it visibile in current scope
+ # Set a variable in parent scope and make it visible in current scope
set(${name} "${value}" PARENT_SCOPE)
set(${name} "${value}")
endmacro()
@@ -1270,10 +1270,8 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
set(_Boost_UNIT_TEST_FRAMEWORK_HEADERS "boost/test/framework.hpp")
set(_Boost_WAVE_HEADERS "boost/wave.hpp")
set(_Boost_WSERIALIZATION_HEADERS "boost/archive/text_wiarchive.hpp")
- if(WIN32)
- set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp")
- set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp")
- endif()
+ set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp")
+ set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp")
string(TOUPPER ${component} uppercomponent)
set(${_hdrs} ${_Boost_${uppercomponent}_HEADERS} PARENT_SCOPE)
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index ba3543306b..17e12f8cf7 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -155,7 +155,7 @@ macro(cuda_execute_process status command)
# copy and paste a runnable command line.
set(cuda_execute_process_string)
foreach(arg ${ARGN})
- # If there are quotes, excape them, so they come through.
+ # If there are quotes, escape them, so they come through.
string(REPLACE "\"" "\\\"" arg ${arg})
# Args with spaces need quotes around them to get them to be parsed as a single argument.
if(arg MATCHES " ")
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 47bc5466c0..1054f60bfb 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -5,6 +5,8 @@
FindCUDAToolkit
---------------
+.. versionadded:: 3.17
+
This script locates the NVIDIA CUDA toolkit and the associated libraries, but
does not require the ``CUDA`` language be enabled for a given project. This
module does not search for the NVIDIA CUDA Samples.
@@ -12,8 +14,7 @@ module does not search for the NVIDIA CUDA Samples.
Search Behavior
^^^^^^^^^^^^^^^
-Finding the CUDA Toolkit requires finding the ``nvcc`` executable, which is
-searched for in the following order:
+The CUDA Toolkit search behavior uses the following order:
1. If the ``CUDA`` language has been enabled we will use the directory
containing the compiler as the first search location for ``nvcc``.
@@ -24,13 +25,12 @@ searched for in the following order:
configuration variable are specified, the *configuration* variable takes
precedence.
- The directory specified here must be such that the executable ``nvcc`` can be
- found underneath the directory specified by ``CUDAToolkit_ROOT``. If
- ``CUDAToolkit_ROOT`` is specified, but no ``nvcc`` is found underneath, this
- package is marked as **not** found. No subsequent search attempts are
- performed.
+ The directory specified here must be such that the executable ``nvcc`` or
+ the appropriate ``version.txt`` file can be found underneath the specified
+ directory.
-3. If the CUDA_PATH environment variable is defined, it will be searched.
+3. If the CUDA_PATH environment variable is defined, it will be searched
+ for ``nvcc``.
4. The user's path is searched for ``nvcc`` using :command:`find_program`. If
this is found, no subsequent search attempts are performed. Users are
@@ -402,7 +402,7 @@ Result variables
``CUDAToolkit_VERSION``
The exact version of the CUDA Toolkit found (as reported by
- ``nvcc --version``).
+ ``nvcc --version`` or ``version.txt``).
``CUDAToolkit_VERSION_MAJOR``
The major version of the CUDA Toolkit.
@@ -431,8 +431,8 @@ Result variables
``CUDAToolkit_TARGET_DIR``
The path to the CUDA Toolkit directory including the target architecture
- when cross-compiling. When not cross-compiling this will be equivalant to
- ``CUDAToolkit_ROOT_DIR``.
+ when cross-compiling. When not cross-compiling this will be equivalent to
+ the parent directory of ``CUDAToolkit_BIN_DIR``.
``CUDAToolkit_NVCC_EXECUTABLE``
The path to the NVIDIA CUDA compiler ``nvcc``. Note that this path may
@@ -491,31 +491,81 @@ if(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT)
set(CUDAToolkit_BIN_DIR "${CUDAToolkit_ROOT_DIR}/bin")
set(CUDAToolkit_NVCC_EXECUTABLE "${CUDAToolkit_BIN_DIR}/nvcc${CMAKE_EXECUTABLE_SUFFIX}")
else()
+
+ function(_CUDAToolkit_find_root_dir )
+ cmake_parse_arguments(arg "" "" "SEARCH_PATHS;FIND_FLAGS" ${ARGN})
+
+
+ if(NOT CUDAToolkit_BIN_DIR)
+ if(NOT CUDAToolkit_SENTINEL_FILE)
+ find_program(CUDAToolkit_NVCC_EXECUTABLE
+ NAMES nvcc nvcc.exe
+ PATHS ${arg_SEARCH_PATHS}
+ ${arg_FIND_FLAGS}
+ )
+ endif()
+
+ if(NOT CUDAToolkit_NVCC_EXECUTABLE)
+ find_file(CUDAToolkit_SENTINEL_FILE
+ NAMES version.txt
+ PATHS ${arg_SEARCH_PATHS}
+ NO_DEFAULT_PATH
+ )
+ endif()
+
+ if(CUDAToolkit_NVCC_EXECUTABLE)
+ get_filename_component(CUDAToolkit_BIN_DIR "${CUDAToolkit_NVCC_EXECUTABLE}" DIRECTORY)
+
+ set(CUDAToolkit_BIN_DIR "${CUDAToolkit_BIN_DIR}" CACHE PATH "" FORCE)
+ mark_as_advanced(CUDAToolkit_BIN_DIR)
+ elseif(CUDAToolkit_SENTINEL_FILE)
+ get_filename_component(CUDAToolkit_BIN_DIR ${CUDAToolkit_SENTINEL_FILE} DIRECTORY ABSOLUTE)
+ set(CUDAToolkit_BIN_DIR "${CUDAToolkit_BIN_DIR}/bin")
+
+ set(CUDAToolkit_BIN_DIR "${CUDAToolkit_BIN_DIR}" CACHE PATH "" FORCE)
+ mark_as_advanced(CUDAToolkit_BIN_DIR)
+ endif()
+ endif()
+
+ if(CUDAToolkit_BIN_DIR)
+ get_filename_component(CUDAToolkit_ROOT_DIR ${CUDAToolkit_BIN_DIR} DIRECTORY ABSOLUTE)
+ set(CUDAToolkit_ROOT_DIR "${CUDAToolkit_ROOT_DIR}" PARENT_SCOPE)
+ endif()
+
+ endfunction()
+
+ function(_CUDAToolkit_find_version_file result_variable)
+ # We first check for a non-scattered installation to prefer it over a scattered installation.
+ if(CUDAToolkit_ROOT AND EXISTS "${CUDAToolkit_ROOT}/version.txt")
+ set(${result_variable} "${CUDAToolkit_ROOT}/version.txt" PARENT_SCOPE)
+ elseif(CUDAToolkit_ROOT_DIR AND EXISTS "${CUDAToolkit_ROOT_DIR}/version.txt")
+ set(${result_variable} "${CUDAToolkit_ROOT_DIR}/version.txt" PARENT_SCOPE)
+ elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/version.txt")
+ set(${result_variable} "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/version.txt" PARENT_SCOPE)
+ elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/cuda/version.txt")
+ set(${result_variable} "${CMAKE_SYSROOT}/usr/lib/cuda/version.txt" PARENT_SCOPE)
+ endif()
+ endfunction()
+
# For NVCC we can easily deduce the SDK binary directory from the compiler path.
if(CMAKE_CUDA_COMPILER_LOADED AND NOT CUDAToolkit_BIN_DIR AND CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
get_filename_component(CUDAToolkit_BIN_DIR "${CMAKE_CUDA_COMPILER}" DIRECTORY)
set(CUDAToolkit_BIN_DIR "${CUDAToolkit_BIN_DIR}" CACHE PATH "")
+ # Try language provided path first.
+ _CUDAToolkit_find_root_dir(SEARCH_PATHS "${CUDAToolkit_BIN_DIR}" FIND_FLAGS NO_DEFAULT_PATH)
mark_as_advanced(CUDAToolkit_BIN_DIR)
endif()
- # Try language- or user-provided path first.
- if(CUDAToolkit_BIN_DIR)
- find_program(CUDAToolkit_NVCC_EXECUTABLE
- NAMES nvcc nvcc.exe
- PATHS ${CUDAToolkit_BIN_DIR}
- NO_DEFAULT_PATH
- )
+ # Try user provided path
+ if(NOT CUDAToolkit_ROOT_DIR AND CUDAToolkit_ROOT)
+ _CUDAToolkit_find_root_dir(SEARCH_PATHS "${CUDAToolkit_ROOT}" FIND_FLAGS PATH_SUFFIXES bin NO_DEFAULT_PATH)
+ endif()
+ if(NOT CUDAToolkit_ROOT_DIR)
+ _CUDAToolkit_find_root_dir(FIND_FLAGS PATHS "ENV CUDA_PATH" PATH_SUFFIXES bin)
endif()
- # Search using CUDAToolkit_ROOT
- find_program(CUDAToolkit_NVCC_EXECUTABLE
- NAMES nvcc nvcc.exe
- PATHS ENV CUDA_PATH
- PATH_SUFFIXES bin
- )
-
- # If the user specified CUDAToolkit_ROOT but nvcc could not be found, this is an error.
- if(NOT CUDAToolkit_NVCC_EXECUTABLE AND (DEFINED CUDAToolkit_ROOT OR DEFINED ENV{CUDAToolkit_ROOT}))
+ # If the user specified CUDAToolkit_ROOT but the toolkit could not be found, this is an error.
+ if(NOT CUDAToolkit_ROOT_DIR AND (DEFINED CUDAToolkit_ROOT OR DEFINED ENV{CUDAToolkit_ROOT}))
# Declare error messages now, print later depending on find_package args.
set(fail_base "Could not find nvcc executable in path specified by")
set(cuda_root_fail "${fail_base} CUDAToolkit_ROOT=${CUDAToolkit_ROOT}")
@@ -552,7 +602,7 @@ else()
# We will also search the default symlink location /usr/local/cuda first since
# if CUDAToolkit_ROOT is not specified, it is assumed that the symlinked
# directory is the desired location.
- if(NOT CUDAToolkit_NVCC_EXECUTABLE)
+ if(NOT CUDAToolkit_ROOT_DIR)
if(UNIX)
if(NOT APPLE)
set(platform_base "/usr/local/cuda-")
@@ -589,12 +639,8 @@ else()
list(INSERT search_paths 0 "/usr/local/cuda")
endif()
- # Now search for nvcc again using the platform default search paths.
- find_program(CUDAToolkit_NVCC_EXECUTABLE
- NAMES nvcc nvcc.exe
- PATHS ${search_paths}
- PATH_SUFFIXES bin
- )
+ # Now search for the toolkit again using the platform default search paths.
+ _CUDAToolkit_find_root_dir(SEARCH_PATHS "${search_paths}" FIND_FLAGS PATH_SUFFIXES bin)
# We are done with these variables now, cleanup for caller.
unset(platform_base)
@@ -602,7 +648,7 @@ else()
unset(versions)
unset(search_paths)
- if(NOT CUDAToolkit_NVCC_EXECUTABLE)
+ if(NOT CUDAToolkit_ROOT_DIR)
if(CUDAToolkit_FIND_REQUIRED)
message(FATAL_ERROR "Could not find nvcc, please set CUDAToolkit_ROOT.")
elseif(NOT CUDAToolkit_FIND_QUIETLY)
@@ -614,24 +660,12 @@ else()
endif()
endif()
- if(NOT CUDAToolkit_BIN_DIR AND CUDAToolkit_NVCC_EXECUTABLE)
- get_filename_component(CUDAToolkit_BIN_DIR "${CUDAToolkit_NVCC_EXECUTABLE}" DIRECTORY)
- set(CUDAToolkit_BIN_DIR "${CUDAToolkit_BIN_DIR}" CACHE PATH "" FORCE)
- mark_as_advanced(CUDAToolkit_BIN_DIR)
- endif()
-
- get_filename_component(CUDAToolkit_ROOT_DIR ${CUDAToolkit_BIN_DIR} DIRECTORY ABSOLUTE)
-
- # CUDAToolkit_LIBRARY_ROOT contains the device library and version file.
- # In a non-scattered installation this is equivalent to CUDAToolkit_ROOT_DIR.
- # We first check for a non-scattered installation to prefer it over a scattered installation.
- if(EXISTS "${CUDAToolkit_ROOT_DIR}/version.txt")
- set(CUDAToolkit_LIBRARY_ROOT "${CUDAToolkit_ROOT_DIR}")
- elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/version.txt")
- set(CUDAToolkit_LIBRARY_ROOT "${CMAKE_SYSROOT_LINK}/usr/lib/cuda")
- elseif(EXISTS "${CMAKE_SYSROOT}/usr/lib/cuda/version.txt")
- set(CUDAToolkit_LIBRARY_ROOT "${CMAKE_SYSROOT}/usr/lib/cuda")
+ _CUDAToolkit_find_version_file( _CUDAToolkit_version_file )
+ if(_CUDAToolkit_version_file)
+ # CUDAToolkit_LIBRARY_ROOT contains the device library and version file.
+ get_filename_component(CUDAToolkit_LIBRARY_ROOT "${_CUDAToolkit_version_file}" DIRECTORY ABSOLUTE)
endif()
+ unset(_CUDAToolkit_version_file)
endif()
# Handle cross compilation
@@ -693,7 +727,7 @@ if(CUDAToolkit_NVCC_EXECUTABLE AND
set(CUDAToolkit_VERSION_PATCH "${CMAKE_MATCH_3}")
set(CUDAToolkit_VERSION "${CMAKE_CUDA_COMPILER_VERSION}")
endif()
-else()
+elseif(CUDAToolkit_NVCC_EXECUTABLE)
# Compute the version by invoking nvcc
execute_process(COMMAND ${CUDAToolkit_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT)
if(NVCC_OUT MATCHES [=[ V([0-9]+)\.([0-9]+)\.([0-9]+)]=])
@@ -703,6 +737,17 @@ else()
set(CUDAToolkit_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
endif()
unset(NVCC_OUT)
+else()
+ _CUDAToolkit_find_version_file(version_file)
+ if(version_file)
+ file(READ "${version_file}" VERSION_INFO)
+ if(VERSION_INFO MATCHES [=[CUDA Version ([0-9]+)\.([0-9]+)\.([0-9]+)]=])
+ set(CUDAToolkit_VERSION_MAJOR "${CMAKE_MATCH_1}")
+ set(CUDAToolkit_VERSION_MINOR "${CMAKE_MATCH_2}")
+ set(CUDAToolkit_VERSION_PATCH "${CMAKE_MATCH_3}")
+ set(CUDAToolkit_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
+ endif()
+ endif()
endif()
# Find the CUDA Runtime Library libcudart
@@ -719,7 +764,6 @@ if(NOT CUDA_CUDART AND NOT CUDAToolkit_FIND_QUIETLY)
message(STATUS "Unable to find cudart library.")
endif()
-unset(CUDAToolkit_ROOT_DIR)
if(_CUDAToolkit_Pop_Prefix)
list(REMOVE_AT CMAKE_PREFIX_PATH -1)
unset(_CUDAToolkit_Pop_Prefix)
@@ -732,13 +776,16 @@ find_package_handle_standard_args(CUDAToolkit
REQUIRED_VARS
CUDAToolkit_INCLUDE_DIR
CUDA_CUDART
- CUDAToolkit_NVCC_EXECUTABLE
+ CUDAToolkit_BIN_DIR
VERSION_VAR
CUDAToolkit_VERSION
)
+
+unset(CUDAToolkit_ROOT_DIR)
mark_as_advanced(CUDA_CUDART
CUDAToolkit_INCLUDE_DIR
CUDAToolkit_NVCC_EXECUTABLE
+ CUDAToolkit_SENTINEL_FILE
)
#-----------------------------------------------------------------------------
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index 919babcde5..74b36c6f7c 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -92,6 +92,7 @@ if(NOT CURL_LIBRARY)
curllib_static
# Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
libcurl
+ NAMES_PER_DIR
HINTS ${PC_CURL_LIBRARY_DIRS}
)
mark_as_advanced(CURL_LIBRARY_RELEASE)
@@ -100,6 +101,7 @@ if(NOT CURL_LIBRARY)
# Windows MSVC CMake builds in debug configuration on vcpkg:
libcurl-d_imp
libcurl-d
+ NAMES_PER_DIR
HINTS ${PC_CURL_LIBRARY_DIRS}
)
mark_as_advanced(CURL_LIBRARY_DEBUG)
@@ -148,16 +150,16 @@ if(CURL_FIND_COMPONENTS)
endif()
foreach(component IN LISTS CURL_FIND_COMPONENTS)
list(FIND CURL_KNOWN_PROTOCOLS ${component} _found)
- if(_found)
+ if(NOT _found EQUAL -1)
list(FIND CURL_SUPPORTED_PROTOCOLS ${component} _found)
- if(_found)
+ if(NOT _found EQUAL -1)
set(CURL_${component}_FOUND TRUE)
elseif(CURL_FIND_REQUIRED)
message(FATAL_ERROR "CURL: Required protocol ${component} is not found")
endif()
else()
list(FIND CURL_SUPPORTED_FEATURES ${component} _found)
- if(_found)
+ if(NOT _found EQUAL -1)
set(CURL_${component}_FOUND TRUE)
elseif(CURL_FIND_REQUIRED)
message(FATAL_ERROR "CURL: Required feature ${component} is not found")
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index ba56078a50..cde3a4d2d7 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -156,7 +156,9 @@ if(CURSES_USE_NCURSES)
CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
cbreak "" CURSES_NCURSES_HAS_CBREAK)
- if(NOT CURSES_NCURSES_HAS_CBREAK)
+ CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
+ nodelay "" CURSES_NCURSES_HAS_NODELAY)
+ if(NOT CURSES_NCURSES_HAS_CBREAK OR NOT CURSES_NCURSES_HAS_NODELAY)
find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" HINTS "${_cursesLibDir}")
find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" )
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 15b419a614..b0bb02a566 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -38,7 +38,7 @@ pkg_check_modules(PC_EXPAT QUIET expat)
find_path(EXPAT_INCLUDE_DIR NAMES expat.h HINTS ${PC_EXPAT_INCLUDE_DIRS})
# Look for the library.
-find_library(EXPAT_LIBRARY NAMES expat libexpat HINTS ${PC_EXPAT_LIBRARY_DIRS})
+find_library(EXPAT_LIBRARY NAMES expat libexpat NAMES_PER_DIR HINTS ${PC_EXPAT_LIBRARY_DIRS})
if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str
diff --git a/Modules/FindEnvModules.cmake b/Modules/FindEnvModules.cmake
index 4dd5116cd7..a4ac0b47f3 100644
--- a/Modules/FindEnvModules.cmake
+++ b/Modules/FindEnvModules.cmake
@@ -5,6 +5,8 @@
FindEnvModules
--------------
+.. versionadded:: 3.15
+
Locate an environment module implementation and make commands available to
CMake scripts to use them. This is compatible with both Lua-based Lmod
and TCL-based EnvironmentModules.
diff --git a/Modules/FindFontconfig.cmake b/Modules/FindFontconfig.cmake
index a6f0180b37..5228831374 100644
--- a/Modules/FindFontconfig.cmake
+++ b/Modules/FindFontconfig.cmake
@@ -5,6 +5,8 @@
FindFontconfig
--------------
+.. versionadded:: 3.14
+
Find Fontconfig headers and library.
Imported Targets
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index d5a143e81d..cea9cd8c7e 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -60,6 +60,7 @@ set(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib giflib4)
find_library(GIF_LIBRARY
NAMES ${POTENTIAL_GIF_LIBS}
+ NAMES_PER_DIR
HINTS
ENV GIF_DIR
PATH_SUFFIXES lib
diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake
index 27ffa13475..080371a915 100644
--- a/Modules/FindGLEW.cmake
+++ b/Modules/FindGLEW.cmake
@@ -139,11 +139,13 @@ __glew_set_find_library_suffix(SHARED)
find_library(GLEW_SHARED_LIBRARY_RELEASE
NAMES GLEW glew glew32
+ NAMES_PER_DIR
PATH_SUFFIXES lib lib64 libx32 lib/Release/${_arch}
PATHS ENV GLEW_ROOT)
find_library(GLEW_SHARED_LIBRARY_DEBUG
NAMES GLEWd glewd glew32d
+ NAMES_PER_DIR
PATH_SUFFIXES lib lib64
PATHS ENV GLEW_ROOT)
@@ -152,11 +154,13 @@ __glew_set_find_library_suffix(STATIC)
find_library(GLEW_STATIC_LIBRARY_RELEASE
NAMES GLEW glew glew32s
+ NAMES_PER_DIR
PATH_SUFFIXES lib lib64 libx32 lib/Release/${_arch}
PATHS ENV GLEW_ROOT)
find_library(GLEW_STATIC_LIBRARY_DEBUG
NAMES GLEWds glewds glew32ds
+ NAMES_PER_DIR
PATH_SUFFIXES lib lib64
PATHS ENV GLEW_ROOT)
diff --git a/Modules/FindGSL.cmake b/Modules/FindGSL.cmake
index da1b3c4e4d..3d4e7f939f 100644
--- a/Modules/FindGSL.cmake
+++ b/Modules/FindGSL.cmake
@@ -5,6 +5,8 @@
FindGSL
--------
+.. versionadded:: 3.2
+
Find the native GNU Scientific Library (GSL) includes and libraries.
The GNU Scientific Library (GSL) is a numerical library for C and C++
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index 53cab1a760..10e31b29fc 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -96,6 +96,27 @@ function(__gtest_find_library _name)
mark_as_advanced(${_name})
endfunction()
+function(__gtest_find_library_configuration _name _lib _cfg_suffix)
+ set(_libs ${_lib})
+ if(MSVC AND GTEST_MSVC_SEARCH STREQUAL "MD")
+ # The provided /MD project files for Google Test add -md suffixes to the
+ # library names.
+ list(INSERT _libs 0 ${_lib}-md)
+ endif()
+ list(TRANSFORM _libs APPEND "${_cfg_suffix}")
+
+ __gtest_find_library(${_name} ${_libs})
+endfunction()
+
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+function(__gtest_find_and_select_library_configurations _basename _lib)
+ __gtest_find_library_configuration(${_basename}_LIBRARY_RELEASE ${_lib} "")
+ __gtest_find_library_configuration(${_basename}_LIBRARY_DEBUG ${_lib} "d")
+
+ select_library_configurations(${_basename})
+ set(${_basename}_LIBRARY ${${_basename}_LIBRARY} PARENT_SCOPE)
+endfunction()
+
macro(__gtest_determine_windows_library_type _var)
if(EXISTS "${${_var}}")
file(TO_NATIVE_PATH "${${_var}}" _lib_path)
@@ -187,18 +208,13 @@ find_path(GTEST_INCLUDE_DIR gtest/gtest.h
)
mark_as_advanced(GTEST_INCLUDE_DIR)
-if(MSVC AND GTEST_MSVC_SEARCH STREQUAL "MD")
- # The provided /MD project files for Google Test add -md suffixes to the
- # library names.
- __gtest_find_library(GTEST_LIBRARY gtest-md gtest)
- __gtest_find_library(GTEST_LIBRARY_DEBUG gtest-mdd gtestd)
- __gtest_find_library(GTEST_MAIN_LIBRARY gtest_main-md gtest_main)
- __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_main-mdd gtest_maind)
-else()
- __gtest_find_library(GTEST_LIBRARY gtest)
- __gtest_find_library(GTEST_LIBRARY_DEBUG gtestd)
- __gtest_find_library(GTEST_MAIN_LIBRARY gtest_main)
- __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_maind)
+# Allow GTEST_LIBRARY and GTEST_MAIN_LIBRARY to be set manually, as the
+# locations of the gtest and gtest_main libraries, respectively.
+if(NOT GTEST_LIBRARY)
+ __gtest_find_and_select_library_configurations(GTEST gtest)
+endif()
+if(NOT GTEST_MAIN_LIBRARY)
+ __gtest_find_and_select_library_configurations(GTEST_MAIN gtest_main)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 60a313d737..7a1c252183 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -125,8 +125,6 @@ The following variables can be set to guide the search for HDF5 libraries and in
Set ``true`` to skip trying to find ``hdf5-config.cmake``.
#]=======================================================================]
-# This module is maintained by Will Dicharry <wdicharry@stellarscience.com>.
-
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
@@ -347,6 +345,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var
# wrapper exists, but not the compiler. E.g. Miniconda / Anaconda Python
execute_process(
COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} ${test_file}
+ WORKING_DIRECTORY ${scratch_dir}
RESULT_VARIABLE return_value
)
if(return_value)
@@ -355,6 +354,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var
else()
execute_process(
COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} ${test_file}
+ WORKING_DIRECTORY ${scratch_dir}
OUTPUT_VARIABLE output
ERROR_VARIABLE output
RESULT_VARIABLE return_value
diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake
index 38081f5fa2..c8b3e1fb75 100644
--- a/Modules/FindICU.cmake
+++ b/Modules/FindICU.cmake
@@ -5,6 +5,8 @@
FindICU
-------
+.. versionadded:: 3.7
+
Find the International Components for Unicode (ICU) libraries and
programs.
diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake
index 5ce2b42d9f..0f821e886f 100644
--- a/Modules/FindIce.cmake
+++ b/Modules/FindIce.cmake
@@ -5,6 +5,8 @@
FindIce
-------
+.. versionadded:: 3.1
+
Find the ZeroC Internet Communication Engine (ICE) programs,
libraries and datafiles.
diff --git a/Modules/FindIconv.cmake b/Modules/FindIconv.cmake
index bf20f6f7ea..41b75509fa 100644
--- a/Modules/FindIconv.cmake
+++ b/Modules/FindIconv.cmake
@@ -5,6 +5,8 @@
FindIconv
---------
+.. versionadded:: 3.11
+
This module finds the ``iconv()`` POSIX.1 functions on the system.
These functions might be provided in the regular C library or externally
in the form of an additional library.
@@ -110,6 +112,7 @@ endif()
find_library(Iconv_LIBRARY
NAMES ${Iconv_LIBRARY_NAMES}
+ NAMES_PER_DIR
DOC "iconv library (potentially the C library)")
mark_as_advanced(Iconv_INCLUDE_DIR)
diff --git a/Modules/FindIntl.cmake b/Modules/FindIntl.cmake
index 3818d45ec9..1a09a60972 100644
--- a/Modules/FindIntl.cmake
+++ b/Modules/FindIntl.cmake
@@ -5,6 +5,8 @@
FindIntl
--------
+.. versionadded:: 3.2
+
Find the Gettext libintl headers and libraries.
This module reports information about the Gettext libintl
@@ -40,7 +42,7 @@ find_path(Intl_INCLUDE_DIR
mark_as_advanced(Intl_INCLUDE_DIR)
# Find all Intl libraries
-find_library(Intl_LIBRARY "intl"
+find_library(Intl_LIBRARY "intl" NAMES_PER_DIR
DOC "libintl libraries (if not in the C library)")
mark_as_advanced(Intl_LIBRARY)
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index 0bb698979f..632fc9aa0f 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -58,8 +58,8 @@ foreach(name ${jpeg_names})
endforeach()
if(NOT JPEG_LIBRARY)
- find_library(JPEG_LIBRARY_RELEASE NAMES ${jpeg_names})
- find_library(JPEG_LIBRARY_DEBUG NAMES ${jpeg_names_debug})
+ find_library(JPEG_LIBRARY_RELEASE NAMES ${jpeg_names} NAMES_PER_DIR)
+ find_library(JPEG_LIBRARY_DEBUG NAMES ${jpeg_names_debug} NAMES_PER_DIR)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(JPEG)
mark_as_advanced(JPEG_LIBRARY_RELEASE JPEG_LIBRARY_DEBUG)
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 31e7de68c0..f996d4c0fe 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -28,7 +28,7 @@ The following variables may be set to influence this module's behavior:
* ``OpenBLAS``
* ``FLAME``
- * ``Intel10_32`` (intel mkl v10 32 bit)
+ * ``Intel10_32`` (intel mkl v10 32 bit, threaded code)
* ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model)
* ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model)
* ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model)
@@ -162,6 +162,7 @@ macro(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _a
if(_libraries_work)
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
+ NAMES_PER_DIR
PATHS ${_extaddlibdir}
PATH_SUFFIXES ${_subdirs}
)
@@ -289,7 +290,9 @@ if(BLAS_FOUND)
endif()
set(LAPACK_mkl_LIB_PATH_SUFFIXES
"compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"
+ "compiler/lib/${LAPACK_mkl_ARCH_NAME}"
"mkl/lib" "mkl/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"
+ "mkl/lib/${LAPACK_mkl_ARCH_NAME}"
"lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}")
# First try empty lapack libs
diff --git a/Modules/FindLTTngUST.cmake b/Modules/FindLTTngUST.cmake
index 9cd17eb05c..f478e4d240 100644
--- a/Modules/FindLTTngUST.cmake
+++ b/Modules/FindLTTngUST.cmake
@@ -5,6 +5,8 @@
FindLTTngUST
------------
+.. versionadded:: 3.6
+
Find
`Linux Trace Toolkit Next Generation (LTTng-UST) <http://lttng.org/>`__ library.
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
index 200d6bf8d6..4a79a1028b 100644
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -43,8 +43,8 @@ This module will set the following variables in your project:
find_path(LIBLZMA_INCLUDE_DIR lzma.h )
if(NOT LIBLZMA_LIBRARY)
- find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma PATH_SUFFIXES lib)
- find_library(LIBLZMA_LIBRARY_DEBUG NAMES lzmad liblzmad PATH_SUFFIXES lib)
+ find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma NAMES_PER_DIR PATH_SUFFIXES lib)
+ find_library(LIBLZMA_LIBRARY_DEBUG NAMES lzmad liblzmad NAMES_PER_DIR PATH_SUFFIXES lib)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(LIBLZMA)
else()
diff --git a/Modules/FindLibinput.cmake b/Modules/FindLibinput.cmake
index c1fe45562e..88d5b2fb3a 100644
--- a/Modules/FindLibinput.cmake
+++ b/Modules/FindLibinput.cmake
@@ -5,6 +5,8 @@
FindLibinput
------------
+.. versionadded:: 3.14
+
Find libinput headers and library.
Imported Targets
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 25de562e2e..b2526c1209 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -760,7 +760,7 @@ function (_MPI_interrogate_compiler LANG)
# Save the explicitly given link directories
set(MPI_LINK_DIRECTORIES_LEFTOVER "${MPI_LINK_DIRECTORIES_WORK}")
- # An MPI compiler wrapper could have its MPI libraries in the implictly
+ # An MPI compiler wrapper could have its MPI libraries in the implicitly
# linked directories of the compiler itself.
if(DEFINED CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES)
list(APPEND MPI_LINK_DIRECTORIES_WORK "${CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES}")
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index e42c20654d..05ec3ae5df 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -992,7 +992,10 @@ function(matlab_add_mex)
endif()
endif()
- if(NOT Matlab_VERSION_STRING VERSION_LESS "9.4") # For 9.4 (R2018a) and newer, add API macro
+ # For 9.4 (R2018a) and newer, add API macro.
+ # Add it for unknown versions too, just in case.
+ if(NOT Matlab_VERSION_STRING VERSION_LESS "9.4"
+ OR Matlab_VERSION_STRING STREQUAL "unknown")
if(${${prefix}_R2018a})
set(MEX_API_MACRO "MATLAB_DEFAULT_RELEASE=R2018a")
else()
diff --git a/Modules/FindODBC.cmake b/Modules/FindODBC.cmake
index 3f710dbb95..884653c752 100644
--- a/Modules/FindODBC.cmake
+++ b/Modules/FindODBC.cmake
@@ -5,6 +5,8 @@
FindODBC
--------
+.. versionadded:: 3.12
+
Find an Open Database Connectivity (ODBC) include directory and library.
On Windows, when building with Visual Studio, this module assumes the ODBC
diff --git a/Modules/FindOpenACC.cmake b/Modules/FindOpenACC.cmake
index 398dcf54f3..ed52e3591f 100644
--- a/Modules/FindOpenACC.cmake
+++ b/Modules/FindOpenACC.cmake
@@ -5,6 +5,8 @@
FindOpenACC
-----------
+.. versionadded:: 3.10
+
Detect OpenACC support by the compiler.
This module can be used to detect OpenACC support in a compiler.
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
index 34a203e137..b3e5a9f8de 100644
--- a/Modules/FindOpenCL.cmake
+++ b/Modules/FindOpenCL.cmake
@@ -5,6 +5,8 @@
FindOpenCL
----------
+.. versionadded:: 3.1
+
Finds Open Computing Language (OpenCL)
IMPORTED Targets
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 17ffe85b3f..110e7f9637 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -132,19 +132,7 @@ endforeach()
set(_OpenGL_CACHE_VARS)
-if (CYGWIN)
- find_path(OPENGL_INCLUDE_DIR GL/gl.h )
- list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
-
- find_library(OPENGL_gl_LIBRARY opengl32 )
- find_library(OPENGL_glu_LIBRARY glu32 )
-
- list(APPEND _OpenGL_CACHE_VARS
- OPENGL_INCLUDE_DIR
- OPENGL_gl_LIBRARY
- OPENGL_glu_LIBRARY
- )
-elseif (WIN32)
+if (WIN32)
if(BORLAND)
set (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32")
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index ee40696eb7..9196851c6a 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -27,11 +27,11 @@ This module defines the following :prop_tgt:`IMPORTED` targets:
projects under MSVC. This target is available only if found OpenSSL version
is not less than 0.9.8. By linking this target the above OpenSSL targets can
be linked even if the project has different MSVC runtime configurations with
- the above OpenSSL targets. This target has no effect on plaforms other than
+ the above OpenSSL targets. This target has no effect on platforms other than
MSVC.
NOTE: Due to how ``INTERFACE_SOURCES`` are consumed by the consuming target,
-unless you certainly know what you are doing, it is always prefered to link
+unless you certainly know what you are doing, it is always preferred to link
``OpenSSL::applink`` target as ``PRIVATE`` and to make sure that this target is
linked at most once for the whole dependency graph of any library or
executable:
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index f1fe89af1e..fd0e4e93e9 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -76,8 +76,8 @@ if(ZLIB_FOUND)
# For compatibility with versions prior to this multi-config search, honor
# any PNG_LIBRARY that is already specified and skip the search.
if(NOT PNG_LIBRARY)
- find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES})
- find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG})
+ find_library(PNG_LIBRARY_RELEASE NAMES ${PNG_NAMES} NAMES_PER_DIR)
+ find_library(PNG_LIBRARY_DEBUG NAMES ${PNG_NAMES_DEBUG} NAMES_PER_DIR)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(PNG)
mark_as_advanced(PNG_LIBRARY_RELEASE PNG_LIBRARY_DEBUG)
diff --git a/Modules/FindPatch.cmake b/Modules/FindPatch.cmake
index 49988395bc..41086517d9 100644
--- a/Modules/FindPatch.cmake
+++ b/Modules/FindPatch.cmake
@@ -5,6 +5,8 @@
FindPatch
---------
+.. versionadded:: 3.10
+
The module defines the following variables:
``Patch_EXECUTABLE``
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index 7e27f31880..d576b86cd5 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -108,6 +108,9 @@ if (PERL_EXECUTABLE)
if (NOT PERL_POSSIBLE_LIBRARY_NAMES)
set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl)
endif()
+ if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
+ list (APPEND PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING})
+ endif()
if (CMAKE_SYSTEM_NAME MATCHES "MSYS|CYGWIN")
# on MSYS and CYGWIN environments, current perl -V:libperl gives shared library name
# rather than the import library. So, extends possible library names
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index e09717db8b..f6d8fe3100 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -376,11 +376,13 @@ function(_protobuf_find_libraries name filename)
else()
find_library(${name}_LIBRARY_RELEASE
NAMES ${filename}
+ NAMES_PER_DIR
PATHS ${Protobuf_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release)
mark_as_advanced(${name}_LIBRARY_RELEASE)
find_library(${name}_LIBRARY_DEBUG
NAMES ${filename}d ${filename}
+ NAMES_PER_DIR
PATHS ${Protobuf_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug)
mark_as_advanced(${name}_LIBRARY_DEBUG)
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index 01b82c4b21..d89029a263 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -5,6 +5,8 @@
FindPython
----------
+.. versionadded:: 3.12
+
Find Python interpreter, compiler and development environment (include
directories and libraries).
@@ -44,7 +46,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``
- configuration. This contraint does not apply if only ``Interpreter``
+ configuration. This constraint does not apply if only ``Interpreter``
component is specified.
Imported Targets
@@ -155,7 +157,7 @@ This module will set the following variables in your project
``Python_NumPy_FOUND``
System has the NumPy.
``Python_NumPy_INCLUDE_DIRS``
- The NumPy include directries.
+ The NumPy include directories.
``Python_NumPy_VERSION``
The NumPy version.
@@ -189,7 +191,7 @@ Hints
* ``ON``: Corresponding flag is selected.
* ``OFF``: Corresponding flag is not selected.
- * ``ANY``: The two posibilties (``ON`` and ``OFF``) will be searched.
+ * ``ANY``: The two possibilities (``ON`` and ``OFF``) will be searched.
From this 3-tuple, various ABIs will be searched starting from the most
specialized to the most general. Moreover, ``debug`` versions will be
@@ -347,7 +349,7 @@ setting the following variables:
When an artifact is specified, all ``HINTS`` will be ignored and no search
will be performed for this artifact.
- If more than one artifact is specified, it is the user's responsability to
+ If more than one artifact is specified, it is the user's responsibility to
ensure the consistency of the various artifacts.
By default, this module supports multiple calls in different directories of a
@@ -355,7 +357,7 @@ project with different version/component requirements while providing correct
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 controled with the following variable:
+can be controlled with the following variable:
``Python_ARTIFACTS_INTERACTIVE``
Selects the behavior of the module. This is a boolean variable:
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 1be06250f5..9b65f39867 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -5,17 +5,13 @@
# This file is a "template" file used by various FindPython modules.
#
-cmake_policy (GET CMP0094 _${_PYTHON_PREFIX}_LOOKUP_POLICY)
-
-cmake_policy (VERSION 3.7)
-
-if (_${_PYTHON_PREFIX}_LOOKUP_POLICY)
- cmake_policy (SET CMP0094 ${_${_PYTHON_PREFIX}_LOOKUP_POLICY})
-endif()
-
#
# Initial configuration
#
+
+# IN_LIST operator
+cmake_policy (SET CMP0057 NEW)
+
if (NOT DEFINED _PYTHON_PREFIX)
message (FATAL_ERROR "FindPython: INTERNAL ERROR")
endif()
@@ -1097,6 +1093,7 @@ endif()
unset (${_PYTHON_PREFIX}_SOABI)
# Define lookup strategy
+cmake_policy (GET CMP0094 _${_PYTHON_PREFIX}_LOOKUP_POLICY)
if (_${_PYTHON_PREFIX}_LOOKUP_POLICY STREQUAL "NEW")
set (_${_PYTHON_PREFIX}_FIND_STRATEGY "LOCATION")
else()
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index 84c0c73b60..f5ad4545bd 100644
--- a/Modules/FindPython2.cmake
+++ b/Modules/FindPython2.cmake
@@ -5,6 +5,8 @@
FindPython2
-----------
+.. versionadded:: 3.12
+
Find Python 2 interpreter, compiler and development environment (include
directories and libraries).
@@ -45,7 +47,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``
- configuration. This contraint does not apply if only ``Interpreter``
+ configuration. This constraint does not apply if only ``Interpreter``
component is specified.
Imported Targets
@@ -147,7 +149,7 @@ This module will set the following variables in your project
``Python2_NumPy_FOUND``
System has the NumPy.
``Python2_NumPy_INCLUDE_DIRS``
- The NumPy include directries.
+ The NumPy include directories.
``Python2_NumPy_VERSION``
The NumPy version.
@@ -294,7 +296,7 @@ setting the following variables:
When an artifact is specified, all ``HINTS`` will be ignored and no search
will be performed for this artifact.
- If more than one artifact is specified, it is the user's responsability to
+ If more than one artifact is specified, it is the user's responsibility to
ensure the consistency of the various artifacts.
By default, this module supports multiple calls in different directories of a
@@ -302,7 +304,7 @@ project with different version/component requirements while providing correct
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 controled with the following variable:
+can be controlled with the following variable:
``Python2_ARTIFACTS_INTERACTIVE``
Selects the behavior of the module. This is a boolean variable:
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index f142c07ee6..bacdc4260b 100644
--- a/Modules/FindPython3.cmake
+++ b/Modules/FindPython3.cmake
@@ -5,6 +5,8 @@
FindPython3
-----------
+.. versionadded:: 3.12
+
Find Python 3 interpreter, compiler and development environment (include
directories and libraries).
@@ -45,7 +47,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``
- configuration. This contraint does not apply if only ``Interpreter``
+ configuration. This constraint does not apply if only ``Interpreter``
component is specified.
Imported Targets
@@ -156,7 +158,7 @@ This module will set the following variables in your project
``Python3_NumPy_FOUND``
System has the NumPy.
``Python3_NumPy_INCLUDE_DIRS``
- The NumPy include directries.
+ The NumPy include directories.
``Python3_NumPy_VERSION``
The NumPy version.
@@ -186,7 +188,7 @@ Hints
* ``ON``: Corresponding flag is selected.
* ``OFF``: Corresponding flag is not selected.
- * ``ANY``: The two posibilties (``ON`` and ``OFF``) will be searched.
+ * ``ANY``: The two possibilities (``ON`` and ``OFF``) will be searched.
From this 3-tuple, various ABIs will be searched starting from the most
specialized to the most general. Moreover, ``debug`` versions will be
@@ -344,7 +346,7 @@ setting the following variables:
When an artifact is specified, all ``HINTS`` will be ignored and no search
will be performed for this artifact.
- If more than one artifact is specified, it is the user's responsability to
+ If more than one artifact is specified, it is the user's responsibility to
ensure the consistency of the various artifacts.
By default, this module supports multiple calls in different directories of a
@@ -352,7 +354,7 @@ project with different version/component requirements while providing correct
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 controled with the following variable:
+can be controlled with the following variable:
``Python3_ARTIFACTS_INTERACTIVE``
Selects the behavior of the module. This is a boolean variable:
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 2e3da746bc..ec0f4536ce 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -147,7 +147,7 @@ more-manual way. Several macros are available to add targets for such uses.
in: directories sources ts_files
options: flags to pass to lupdate, such as -extensions to specify
extensions for a directory scan.
- generates commands to create .ts (vie lupdate) and .qm
+ generates commands to create .ts (via lupdate) and .qm
(via lrelease) - files from directories and/or sources. The ts files are
created and/or updated in the source tree (unless given with full paths).
The qm files are generated in the build tree.
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 1bdee60336..3b8122e1ac 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -50,7 +50,7 @@ This module will set the following variables in your project:
Also:
-``Ruby_INCLUDE_PATH``
+``RUBY_INCLUDE_PATH``
same as Ruby_INCLUDE_DIRS, only provided for compatibility reasons, don't use it
Hints
@@ -493,7 +493,6 @@ foreach(Camel
Ruby_VERSION_MAJOR
Ruby_VERSION_MINOR
Ruby_VERSION_PATCH
- Ruby_INCLUDE_PATH
Ruby_ARCH_DIR
Ruby_ARCH
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 8d793a9750..59eddbbc99 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -5,24 +5,54 @@
FindSDL
-------
-Locate SDL library
+Locate the SDL library
-This module defines
-::
+Imported targets
+^^^^^^^^^^^^^^^^
- SDL_LIBRARY, the name of the library to link against
- SDL_FOUND, if false, do not try to link to SDL
- SDL_INCLUDE_DIR, where to find SDL.h
- SDL_VERSION_STRING, human-readable string containing the version of SDL
+This module defines the following :prop_tgt:`IMPORTED` target:
+``SDL::SDL``
+ The SDL library, if found
+Result variables
+^^^^^^^^^^^^^^^^
-This module responds to the flag:
+This module will set the following variables in your project:
+
+``SDL_INCLUDE_DIRS``
+ where to find SDL.h
+``SDL_LIBRARIES``
+ the name of the library to link against
+``SDL_FOUND``
+ if false, do not try to link to SDL
+``SDL_VERSION``
+ the human-readable string containing the version of SDL if found
+``SDL_VERSION_MAJOR``
+ SDL major version
+``SDL_VERSION_MINOR``
+ SDL minor version
+``SDL_VERSION_PATCH``
+ SDL patch version
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+These variables may optionally be set to help this module find the correct files:
-::
+``SDL_INCLUDE_DIR``
+ where to find SDL.h
+``SDL_LIBRARY``
+ the name of the library to link against
+
+
+Variables for locating SDL
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This module responds to the flag:
- SDL_BUILDING_LIBRARY
+``SDL_BUILDING_LIBRARY``
If this is defined, then no SDL_main will be linked in because
only applications need main().
Otherwise, it is assumed you are building an application and this
@@ -30,6 +60,15 @@ This module responds to the flag:
as part of the returned SDL_LIBRARY variable.
+Obsolete variables
+^^^^^^^^^^^^^^^^^^
+
+These variables are obsolete and provided for backwards compatibility:
+
+``SDL_VERSION_STRING``
+ the human-readable string containing the version of SDL if found.
+ Identical to SDL_VERSION
+
Don't forget to include SDLmain.h and SDLmain.m your project for the
OS X framework based version. (Other versions link to -lSDLmain which
@@ -52,15 +91,6 @@ does not get created.
$SDLDIR is an environment variable that would correspond to the
./configure --prefix=$SDLDIR used in building SDL. l.e.galup 9-20-02
-Modified by Eric Wing. Added code to assist with automated building
-by using environmental variables and providing a more
-controlled/consistent search behavior. Added new modifications to
-recognize OS X frameworks and additional Unix paths (FreeBSD, etc).
-Also corrected the header search path to follow "proper" SDL
-guidelines. Added a search for SDLmain which is needed by some
-platforms. Added a search for threads which is needed by some
-platforms. Added needed compile switches for MinGW.
-
On OSX, this will prefer the Framework version (if found) over others.
People will have to manually change the cache values of SDL_LIBRARY to
override this selection or set the CMake environment
@@ -174,13 +204,11 @@ if(SDL_INCLUDE_DIR AND EXISTS "${SDL_INCLUDE_DIR}/SDL_version.h")
string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MAJOR "${SDL_VERSION_MAJOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MINOR "${SDL_VERSION_MINOR_LINE}")
string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_VERSION_PATCH "${SDL_VERSION_PATCH_LINE}")
- set(SDL_VERSION_STRING ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH})
unset(SDL_VERSION_MAJOR_LINE)
unset(SDL_VERSION_MINOR_LINE)
unset(SDL_VERSION_PATCH_LINE)
- unset(SDL_VERSION_MAJOR)
- unset(SDL_VERSION_MINOR)
- unset(SDL_VERSION_PATCH)
+ set(SDL_VERSION ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH})
+ set(SDL_VERSION_STRING ${SDL_VERSION})
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
@@ -188,3 +216,14 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL
REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR
VERSION_VAR SDL_VERSION_STRING)
+
+if(SDL_FOUND)
+ set(SDL_LIBRARIES ${SDL_LIBRARY})
+ set(SDL_INCLUDE_DIRS ${SDL_INCLUDE_DIR})
+ if(NOT TARGET SDL::SDL)
+ add_library(SDL::SDL INTERFACE IMPORTED)
+ set_target_properties(SDL::SDL PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${SDL_INCLUDE_DIR}"
+ INTERFACE_LINK_LIBRARIES "${SDL_LIBRARY}")
+ endif()
+endif()
diff --git a/Modules/FindSQLite3.cmake b/Modules/FindSQLite3.cmake
index 374d7af6c2..88c7dd2098 100644
--- a/Modules/FindSQLite3.cmake
+++ b/Modules/FindSQLite3.cmake
@@ -5,6 +5,8 @@
FindSQLite3
-----------
+.. versionadded:: 3.14
+
Find the SQLite libraries, v3
IMPORTED targets
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index 00a3a415ac..3b74c94f0c 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -5,7 +5,14 @@
FindTIFF
--------
-Find the TIFF library (``libtiff``).
+Find the TIFF library (``libtiff``, https://libtiff.gitlab.io/libtiff/).
+
+Optional COMPONENTS
+^^^^^^^^^^^^^^^^^^^
+
+This module supports the optional component `CXX`, for use with the COMPONENTS
+argument of the :command:`find_package` command. This component has an associated
+imported target, as described below.
Imported targets
^^^^^^^^^^^^^^^^
@@ -15,6 +22,11 @@ This module defines the following :prop_tgt:`IMPORTED` targets:
``TIFF::TIFF``
The TIFF library, if found.
+``TIFF::CXX``
+ The C++ wrapper libtiffxx, if requested by the `COMPONENTS CXX` option,
+ if the compiler is not MSVC (which includes the C++ wrapper in libtiff),
+ and if found.
+
Result variables
^^^^^^^^^^^^^^^^
@@ -36,10 +48,19 @@ The following cache variables may also be set:
``TIFF_INCLUDE_DIR``
the directory containing the TIFF headers
-``TIFF_LIBRARY``
- the path to the TIFF library
+``TIFF_LIBRARY_RELEASE``
+ the path to the TIFF library for release configurations
+``TIFF_LIBRARY_DEBUG``
+ the path to the TIFF library for debug configurations
+``TIFFXX_LIBRARY_RELEASE``
+ the path to the TIFFXX library for release configurations
+``TIFFXX_LIBRARY_DEBUG``
+ the path to the TIFFXX library for debug configurations
#]=======================================================================]
+cmake_policy(PUSH)
+cmake_policy(SET CMP0057 NEW)
+
find_path(TIFF_INCLUDE_DIR tiff.h)
set(TIFF_NAMES ${TIFF_NAMES} tiff libtiff tiff3 libtiff3)
@@ -54,8 +75,6 @@ if(NOT TIFF_LIBRARY)
select_library_configurations(TIFF)
mark_as_advanced(TIFF_LIBRARY_RELEASE TIFF_LIBRARY_DEBUG)
endif()
-unset(TIFF_NAMES)
-unset(TIFF_NAMES_DEBUG)
if(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h")
file(STRINGS "${TIFF_INCLUDE_DIR}/tiffvers.h" tiff_version_str
@@ -66,13 +85,46 @@ if(TIFF_INCLUDE_DIR AND EXISTS "${TIFF_INCLUDE_DIR}/tiffvers.h")
unset(tiff_version_str)
endif()
+foreach(_comp IN LISTS TIFF_FIND_COMPONENTS)
+ if(_comp STREQUAL "CXX")
+ if(MSVC)
+ # C++ bindings are built into the main tiff library.
+ set(TIFF_CXX_FOUND 1)
+ else()
+ foreach(name ${TIFF_NAMES})
+ list(APPEND TIFFXX_NAMES "${name}xx")
+ list(APPEND TIFFXX_NAMES_DEBUG "${name}xxd")
+ endforeach()
+ find_library(TIFFXX_LIBRARY_RELEASE NAMES ${TIFFXX_NAMES})
+ find_library(TIFFXX_LIBRARY_DEBUG NAMES ${TIFFXX_NAMES_DEBUG})
+ include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+ select_library_configurations(TIFFXX)
+ mark_as_advanced(TIFFXX_LIBRARY_RELEASE TIFFXX_LIBRARY_DEBUG)
+ unset(TIFFXX_NAMES)
+ unset(TIFFXX_NAMES_DEBUG)
+ if(TIFFXX_LIBRARY)
+ set(TIFF_CXX_FOUND 1)
+ endif()
+ endif()
+ endif()
+endforeach()
+unset(_comp)
+
+unset(TIFF_NAMES)
+unset(TIFF_NAMES_DEBUG)
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF
+ HANDLE_COMPONENTS
REQUIRED_VARS TIFF_LIBRARY TIFF_INCLUDE_DIR
VERSION_VAR TIFF_VERSION_STRING)
if(TIFF_FOUND)
set(TIFF_LIBRARIES ${TIFF_LIBRARY})
+ if("CXX" IN_LIST TIFF_FIND_COMPONENTS AND NOT MSVC)
+ list(APPEND TIFF_LIBRARIES ${TIFFXX_LIBRARY})
+ endif()
+
set(TIFF_INCLUDE_DIRS "${TIFF_INCLUDE_DIR}")
if(NOT TARGET TIFF::TIFF)
@@ -101,6 +153,41 @@ if(TIFF_FOUND)
IMPORTED_LOCATION_DEBUG "${TIFF_LIBRARY_DEBUG}")
endif()
endif()
+
+ if(NOT TARGET TIFF::CXX)
+ if(MSVC)
+ add_library(TIFF::CXX INTERFACE IMPORTED)
+ set_property(TARGET TIFF::CXX PROPERTY INTERFACE_LINK_LIBRARIES TIFF::TIFF)
+ else()
+ add_library(TIFF::CXX UNKNOWN IMPORTED)
+ set_property(TARGET TIFF::CXX PROPERTY INTERFACE_LINK_LIBRARIES TIFF::TIFF)
+ if(TIFF_INCLUDE_DIRS)
+ set_target_properties(TIFF::CXX PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${TIFF_INCLUDE_DIRS}")
+ endif()
+ if(EXISTS "${TIFFXX_LIBRARY}")
+ set_target_properties(TIFF::CXX PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${TIFFXX_LIBRARY}")
+ endif()
+ if(EXISTS "${TIFFXX_LIBRARY_RELEASE}")
+ set_property(TARGET TIFF::CXX APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(TIFF::CXX PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
+ IMPORTED_LOCATION_RELEASE "${TIFFXX_LIBRARY_RELEASE}")
+ endif()
+ if(EXISTS "${TIFFXX_LIBRARY_DEBUG}")
+ set_property(TARGET TIFF::CXX APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(TIFF::CXX PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
+ IMPORTED_LOCATION_DEBUG "${TIFFXX_LIBRARY_DEBUG}")
+ endif()
+ endif()
+ endif()
+
endif()
-mark_as_advanced(TIFF_INCLUDE_DIR TIFF_LIBRARY)
+mark_as_advanced(TIFF_INCLUDE_DIR)
+cmake_policy(POP)
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index 5555d5960e..594d0ec81f 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -15,15 +15,8 @@ library is. This code sets the following variables:
TCLSH_FOUND = TRUE if tclsh has been found
TCL_TCLSH = the path to the tclsh executable
-
-In cygwin, look for the cygwin version first. Don't look for it later
-to avoid finding the cygwin version on a Win32 build.
#]=======================================================================]
-if(CYGWIN)
- find_program(TCL_TCLSH NAMES cygtclsh83 cygtclsh80)
-endif()
-
get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH)
get_filename_component(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
string(REGEX REPLACE
diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake
index 4b999b62a0..0ec60133ce 100644
--- a/Modules/FindVulkan.cmake
+++ b/Modules/FindVulkan.cmake
@@ -5,6 +5,8 @@
FindVulkan
----------
+.. versionadded:: 3.7
+
Find Vulkan, which is a low-overhead, cross-platform 3D graphics
and computing API.
@@ -14,6 +16,9 @@ IMPORTED Targets
This module defines :prop_tgt:`IMPORTED` target ``Vulkan::Vulkan``, if
Vulkan has been found.
+This module defines :prop_tgt:`IMPORTED` target ``Vulkan::glslc``, if
+Vulkan and the GLSLC SPIR-V compiler has been found.
+
Result Variables
^^^^^^^^^^^^^^^^
@@ -23,10 +28,11 @@ This module defines the following variables::
Vulkan_INCLUDE_DIRS - include directories for Vulkan
Vulkan_LIBRARIES - link against this library to use Vulkan
-The module will also define two cache variables::
+The module will also define three cache variables::
- Vulkan_INCLUDE_DIR - the Vulkan include directory
- Vulkan_LIBRARY - the path to the Vulkan library
+ Vulkan_INCLUDE_DIR - the Vulkan include directory
+ Vulkan_LIBRARY - the path to the Vulkan library
+ Vulkan_GLSLC_EXECUTABLE - the path to the GLSL SPIR-V compiler
Hints
^^^^^
@@ -53,6 +59,11 @@ if(WIN32)
"$ENV{VULKAN_SDK}/Lib"
"$ENV{VULKAN_SDK}/Bin"
)
+ find_program(Vulkan_GLSLC_EXECUTABLE
+ NAMES glslc
+ HINTS
+ "$ENV{VULKAN_SDK}/Bin"
+ )
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
find_library(Vulkan_LIBRARY
NAMES vulkan-1
@@ -60,6 +71,11 @@ if(WIN32)
"$ENV{VULKAN_SDK}/Lib32"
"$ENV{VULKAN_SDK}/Bin32"
)
+ find_program(Vulkan_GLSLC_EXECUTABLE
+ NAMES glslc
+ HINTS
+ "$ENV{VULKAN_SDK}/Bin32"
+ )
endif()
else()
find_path(Vulkan_INCLUDE_DIR
@@ -68,6 +84,9 @@ else()
find_library(Vulkan_LIBRARY
NAMES vulkan
HINTS "$ENV{VULKAN_SDK}/lib")
+ find_program(Vulkan_GLSLC_EXECUTABLE
+ NAMES glslc
+ HINTS "$ENV{VULKAN_SDK}/bin")
endif()
set(Vulkan_LIBRARIES ${Vulkan_LIBRARY})
@@ -78,7 +97,7 @@ find_package_handle_standard_args(Vulkan
DEFAULT_MSG
Vulkan_LIBRARY Vulkan_INCLUDE_DIR)
-mark_as_advanced(Vulkan_INCLUDE_DIR Vulkan_LIBRARY)
+mark_as_advanced(Vulkan_INCLUDE_DIR Vulkan_LIBRARY Vulkan_GLSLC_EXECUTABLE)
if(Vulkan_FOUND AND NOT TARGET Vulkan::Vulkan)
add_library(Vulkan::Vulkan UNKNOWN IMPORTED)
@@ -86,3 +105,8 @@ if(Vulkan_FOUND AND NOT TARGET Vulkan::Vulkan)
IMPORTED_LOCATION "${Vulkan_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}")
endif()
+
+if(Vulkan_FOUND AND Vulkan_GLSLC_EXECUTABLE AND NOT TARGET Vulkan::glslc)
+ add_executable(Vulkan::glslc IMPORTED)
+ set_property(TARGET Vulkan::glslc PROPERTY IMPORTED_LOCATION "${Vulkan_GLSLC_EXECUTABLE}")
+endif()
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index ccd0252661..778da9b8e8 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -59,6 +59,7 @@ and also the following more fine grained variables and targets:
X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
+ X11_Xaw_INCLUDE_PATH, X11_Xaw_LIB X11_Xaw_FOUND X11::Xaw
#]=======================================================================]
if (UNIX)
@@ -100,6 +101,7 @@ if (UNIX)
find_path(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xaw_INCLUDE_PATH X11/Xaw/Intrinsic.h ${X11_INC_SEARCH_PATH})
find_path(X11_xcb_INCLUDE_PATH xcb/xcb.h ${X11_INC_SEARCH_PATH})
find_path(X11_X11_xcb_INCLUDE_PATH X11/Xlib-xcb.h ${X11_INC_SEARCH_PATH})
find_path(X11_xcb_icccm_INCLUDE_PATH xcb/xcb_icccm.h ${X11_INC_SEARCH_PATH})
@@ -134,6 +136,8 @@ if (UNIX)
find_path(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH})
find_path(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH})
+
+
# Backwards compatibility.
set(X11_Xinput_INCLUDE_PATH "${X11_Xi_INCLUDE_PATH}")
set(X11_xf86misc_INCLUDE_PATH "${X11_Xxf86misc_INCLUDE_PATH}")
@@ -148,6 +152,7 @@ if (UNIX)
find_library(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH})
find_library(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH})
find_library(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xaw_LIB Xaw ${X11_LIB_SEARCH_PATH})
find_library(X11_xcb_LIB xcb ${X11_LIB_SEARCH_PATH})
find_library(X11_X11_xcb_LIB X11-xcb ${X11_LIB_SEARCH_PATH})
find_library(X11_xcb_icccm_LIB xcb-icccm ${X11_LIB_SEARCH_PATH})
@@ -392,6 +397,10 @@ if (UNIX)
set(X11_SM_FOUND TRUE)
endif()
+ if(X11_Xaw_LIB AND X11_Xaw_INCLUDE_PATH)
+ set(X11_Xaw_FOUND TRUE)
+ endif()
+
# Most of the X11 headers will be in the same directories, avoid
# creating a huge list of duplicates.
if (X11_INCLUDE_DIR)
@@ -527,6 +536,14 @@ if (UNIX)
INTERFACE_INCLUDE_DIRECTORIES "${X11_Xau_INCLUDE_PATH}")
endif ()
+ if (X11_Xaw_FOUND AND NOT TARGET X11::Xaw)
+ add_library(X11::Xaw UNKNOWN IMPORTED)
+ set_target_properties(X11::Xaw PROPERTIES
+ IMPORTED_LOCATION "${X11_Xaw_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xaw_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xext;X11::Xmu;X11::Xt;X11::Xpm;X11::X11")
+ endif ()
+
if (X11_xcb_FOUND AND NOT TARGET X11::xcb)
add_library(X11::xcb UNKNOWN IMPORTED)
set_target_properties(X11::xcb PROPERTIES
@@ -825,6 +842,8 @@ if (UNIX)
X11_SM_LIB
X11_SM_INCLUDE_PATH
X11_XSync_INCLUDE_PATH
+ X11_Xaw_LIB
+ X11_Xaw_INCLUDE_PATH
)
set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
diff --git a/Modules/FindXCTest.cmake b/Modules/FindXCTest.cmake
index 15721e1849..1f6e825138 100644
--- a/Modules/FindXCTest.cmake
+++ b/Modules/FindXCTest.cmake
@@ -5,6 +5,8 @@
FindXCTest
----------
+.. versionadded:: 3.3
+
Functions to help creating and executing XCTest bundles.
An XCTest bundle is a CFBundle with a special product-type
diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake
index 3adaa44d33..a7fb766cae 100644
--- a/Modules/FindXalanC.cmake
+++ b/Modules/FindXalanC.cmake
@@ -5,6 +5,8 @@
FindXalanC
-----------
+.. versionadded:: 3.5
+
Find the Apache Xalan-C++ XSL transform processor headers and libraries.
Imported targets
@@ -47,9 +49,9 @@ The following cache variables may also be set:
function(_XalanC_GET_VERSION version_hdr)
file(STRINGS ${version_hdr} _contents REGEX "^[ \t]*#define XALAN_VERSION_.*")
if(_contents)
- string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" XalanC_MAJOR "${_contents}")
- string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" XalanC_MINOR "${_contents}")
- string(REGEX REPLACE "[^*]*#define XALAN_VERSION_REVISION[ \t]+([0-9]+).*" "\\1" XalanC_PATCH "${_contents}")
+ string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MAJOR[ \t(]+([0-9]+).*" "\\1" XalanC_MAJOR "${_contents}")
+ string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MINOR[ \t(]+([0-9]+).*" "\\1" XalanC_MINOR "${_contents}")
+ string(REGEX REPLACE "[^*]*#define XALAN_VERSION_REVISION[ \t(]+([0-9]+).*" "\\1" XalanC_PATCH "${_contents}")
if(NOT XalanC_MAJOR MATCHES "^[0-9]+$")
message(FATAL_ERROR "Version parsing failed for XALAN_VERSION_MAJOR!")
diff --git a/Modules/FindXercesC.cmake b/Modules/FindXercesC.cmake
index db78b61bdf..abe18c0570 100644
--- a/Modules/FindXercesC.cmake
+++ b/Modules/FindXercesC.cmake
@@ -5,6 +5,8 @@
FindXercesC
-----------
+.. versionadded:: 3.1
+
Find the Apache Xerces-C++ validating XML parser headers and libraries.
Imported targets
diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake
index 35840f5f95..07fbc1bff8 100644
--- a/Modules/FindwxWindows.cmake
+++ b/Modules/FindwxWindows.cmake
@@ -307,7 +307,7 @@ if(WIN32_STYLE_FIND)
else ()
## WX is built as multiple small pieces libraries instead of monolithic
- ## DEPECATED (jw) replaced by more general WXWINDOWS_USE_MONOLITHIC ON/OFF
+ ## DEPRECATED (jw) replaced by more general WXWINDOWS_USE_MONOLITHIC ON/OFF
# option(WXWINDOWS_SEPARATE_LIBS_BUILD "Is wxWindows build with separate libs?" OFF)
## HACK: This is very dirty.
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 5c8c196711..c99c7725a9 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -61,7 +61,7 @@ is the name of a CMake variable to contain the results.
exclude "system" prerequisites. If <recurse> is set to 1 all
prerequisites will be found recursively, if set to 0 only direct
prerequisites are listed. <exepath> is the path to the top level
-executable used for @executable_path replacment on the Mac. <dirs> is
+executable used for @executable_path replacement on the Mac. <dirs> is
a list of paths where libraries might be found: these paths are
searched first when a target without any path info is given. Then
standard system locations are also searched: PATH, Framework
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake
index b210a77153..057b29d6da 100644
--- a/Modules/GoogleTest.cmake
+++ b/Modules/GoogleTest.cmake
@@ -5,6 +5,8 @@
GoogleTest
----------
+.. versionadded:: 3.9
+
This module defines functions to help use the Google Test infrastructure. Two
mechanisms for adding tests are provided. :command:`gtest_add_tests` has been
around for some time, originally via ``find_package(GTest)``.
@@ -493,7 +495,7 @@ function(gtest_discover_tests TARGET)
string(CONCAT ctest_include_content
"if(EXISTS \"$<TARGET_FILE:${TARGET}>\")" "\n"
" if(\"$<TARGET_FILE:${TARGET}>\" IS_NEWER_THAN \"${ctest_tests_file}\")" "\n"
- " include(GoogleTestAddTests)" "\n"
+ " include(\"${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}\")" "\n"
" gtest_discover_tests_impl(" "\n"
" TEST_EXECUTABLE" " [==[" "$<TARGET_FILE:${TARGET}>" "]==]" "\n"
" TEST_EXECUTOR" " [==[" "${crosscompiling_emulator}" "]==]" "\n"
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index 5d098d96a0..883e1f48d0 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -44,8 +44,8 @@ function(gtest_discover_tests_impl)
cmake_parse_arguments(
""
""
- "NO_PRETTY_TYPES;NO_PRETTY_VALUES;TEST_EXECUTABLE;TEST_EXECUTOR;TEST_WORKING_DIR;TEST_PREFIX;TEST_SUFFIX;TEST_LIST;CTEST_FILE;TEST_DISCOVERY_TIMEOUT;TEST_XML_OUTPUT_DIR"
- "TEST_EXTRA_ARGS;TEST_PROPERTIES"
+ "NO_PRETTY_TYPES;NO_PRETTY_VALUES;TEST_EXECUTABLE;TEST_WORKING_DIR;TEST_PREFIX;TEST_SUFFIX;TEST_LIST;CTEST_FILE;TEST_DISCOVERY_TIMEOUT;TEST_XML_OUTPUT_DIR"
+ "TEST_EXTRA_ARGS;TEST_PROPERTIES;TEST_EXECUTOR"
${ARGN}
)
diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake
index db35e3afb4..431b074c91 100644
--- a/Modules/Internal/CPack/CPackDeb.cmake
+++ b/Modules/Internal/CPack/CPackDeb.cmake
@@ -547,8 +547,8 @@ function(cpack_deb_prepare_package_vars)
message(FATAL_ERROR _description_failure_message)
endif()
- # Ok, description has set. According to the `Debian Policy Manual`_ the frist
- # line is a pacakge summary. Try to get it as well...
+ # Ok, description has set. According to the `Debian Policy Manual`_ the first
+ # line is a package summary. Try to get it as well...
# See also: https://www.debian.org/doc/debian-policy/ch-controlfields.html#description
elseif(CPACK_PACKAGE_DESCRIPTION_SUMMARY AND
NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY STREQUAL CPACK_DEFAULT_PACKAGE_DESCRIPTION_SUMMARY)
diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake
index 759448b8ec..160eadae01 100644
--- a/Modules/Platform/Android-Clang.cmake
+++ b/Modules/Platform/Android-Clang.cmake
@@ -53,4 +53,7 @@ macro(__android_compiler_clang lang)
endif()
list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}")
endif()
+ if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ set(_ANDROID_STL_NOSTDLIBXX 1)
+ endif()
endmacro()
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake
index 2225897fab..11a050425a 100644
--- a/Modules/Platform/Android-Determine.cmake
+++ b/Modules/Platform/Android-Determine.cmake
@@ -7,8 +7,8 @@
# Support for NVIDIA Nsight Tegra Visual Studio Edition was previously
# implemented in the CMake VS IDE generators. Avoid interfering with
-# that functionality for now. Later we may try to integrate this.
-if(CMAKE_GENERATOR MATCHES "Visual Studio")
+# that functionality for now.
+if(CMAKE_GENERATOR_PLATFORM STREQUAL "Tegra-Android")
return()
endif()
@@ -27,6 +27,63 @@ endif()
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
+# If using Android tools for Visual Studio, compile a sample project to get the
+# sysroot.
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ if(NOT CMAKE_SYSROOT)
+ set(vcx_platform ${CMAKE_GENERATOR_PLATFORM})
+ if(CMAKE_GENERATOR MATCHES "Visual Studio 1[45]")
+ set(vcx_sysroot_var "Sysroot")
+ else()
+ set(vcx_sysroot_var "SysrootLink")
+ endif()
+ if(CMAKE_GENERATOR MATCHES "Visual Studio 14")
+ set(vcx_revision "2.0")
+ elseif(CMAKE_GENERATOR MATCHES "Visual Studio 1[56]")
+ set(vcx_revision "3.0")
+ else()
+ set(vcx_revision "")
+ endif()
+ configure_file(${CMAKE_ROOT}/Modules/Platform/Android/VCXProjInspect.vcxproj.in
+ ${CMAKE_PLATFORM_INFO_DIR}/VCXProjInspect.vcxproj @ONLY)
+ execute_process(
+ COMMAND "${CMAKE_VS_MSBUILD_COMMAND}" "VCXProjInspect.vcxproj"
+ "/p:Configuration=Debug" "/p:Platform=${vcx_platform}"
+ WORKING_DIRECTORY ${CMAKE_PLATFORM_INFO_DIR}
+ OUTPUT_VARIABLE VCXPROJ_INSPECT_OUTPUT
+ ERROR_VARIABLE VCXPROJ_INSPECT_OUTPUT
+ RESULT_VARIABLE VCXPROJ_INSPECT_RESULT
+ )
+ if(NOT CMAKE_SYSROOT AND VCXPROJ_INSPECT_OUTPUT MATCHES "CMAKE_SYSROOT=([^%\r\n]+)[\r\n]")
+ # Strip VS diagnostic output from the end of the line.
+ string(REGEX REPLACE " \\(TaskId:[0-9]*\\)$" "" _sysroot "${CMAKE_MATCH_1}")
+ if(EXISTS "${_sysroot}")
+ file(TO_CMAKE_PATH "${_sysroot}" CMAKE_SYSROOT)
+ endif()
+ endif()
+ if(VCXPROJ_INSPECT_RESULT)
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining the sysroot for the Android NDK failed.
+The output was:
+${VCXPROJ_INSPECT_RESULT}
+${VCXPROJ_INSPECT_OUTPUT}
+
+")
+ else()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining the sysroot for the Android NDK succeeded.
+The output was:
+${VCXPROJ_INSPECT_RESULT}
+${VCXPROJ_INSPECT_OUTPUT}
+
+")
+ endif()
+ endif()
+ if(NOT CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION)
+ set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang")
+ endif()
+endif()
+
# If the user provided CMAKE_SYSROOT for us, extract information from it.
set(_ANDROID_SYSROOT_NDK "")
set(_ANDROID_SYSROOT_API "")
diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake
index b90dd7a569..5019c28bdc 100644
--- a/Modules/Platform/Android-Initialize.cmake
+++ b/Modules/Platform/Android-Initialize.cmake
@@ -6,7 +6,7 @@
# Support for NVIDIA Nsight Tegra Visual Studio Edition was previously
# implemented in the CMake VS IDE generators. Avoid interfering with
-# that functionality for now. Later we may try to integrate this.
+# that functionality for now.
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
return()
endif()
diff --git a/Modules/Platform/Android/Determine-Compiler-NDK.cmake b/Modules/Platform/Android/Determine-Compiler-NDK.cmake
index f56e1d5e58..a4d67c4387 100644
--- a/Modules/Platform/Android/Determine-Compiler-NDK.cmake
+++ b/Modules/Platform/Android/Determine-Compiler-NDK.cmake
@@ -184,7 +184,7 @@ foreach(line IN LISTS _ANDROID_TOOL_SETUP)
# We just matched the gcc toolchain name without version number. Save it for later.
set(_ANDROID_TOOL_NAME_ONLY "${CMAKE_MATCH_1}")
elseif(line MATCHES [[^TOOLCHAIN_PREFIX +:= +.*/bin/(\$\(TOOLCHAIN_NAME\)-) *$]])
- # We just matched the toolchain prefix with a name placholder, so substitute it.
+ # We just matched the toolchain prefix with a name placeholder, so substitute it.
# The gcc toolchain name will have already been extracted without version number from a TOOLCHAIN_NAME line.
string(REPLACE "$(TOOLCHAIN_NAME)" "${_ANDROID_TOOL_NAME_ONLY}" _ANDROID_TOOL_PREFIX "${CMAKE_MATCH_1}")
elseif(line MATCHES [[^LLVM_VERSION +:= +([0-9.]+)$]])
diff --git a/Modules/Platform/Android/VCXProjInspect.vcxproj.in b/Modules/Platform/Android/VCXProjInspect.vcxproj.in
new file mode 100644
index 0000000000..6919d2cd85
--- /dev/null
+++ b/Modules/Platform/Android/VCXProjInspect.vcxproj.in
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|@vcx_platform@">
+ <Configuration>Debug</Configuration>
+ <Platform>@vcx_platform@</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{14D44772-ECF7-47BD-9E29-BC62FAF940A5}</ProjectGuid>
+ <RootNamespace>VCXProjInspect</RootNamespace>
+ <Keyword>Android</Keyword>
+ <ApplicationType>Android</ApplicationType>
+ <ApplicationTypeRevision>@vcx_revision@</ApplicationTypeRevision>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'">
+ <PostBuildEvent>
+ <Command>%40echo CMAKE_SYSROOT=$(@vcx_sysroot_var@)</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 80e9a40195..d0874124d5 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -62,45 +62,36 @@ elseif("${CMAKE_GENERATOR}" MATCHES Xcode
# Find installed SDKs in either Xcode-4.3+ or pre-4.3 SDKs directory.
set(_CMAKE_OSX_SDKS_DIR "")
if(OSX_DEVELOPER_ROOT)
- foreach(d Platforms/MacOSX.platform/Developer/SDKs SDKs)
- file(GLOB _CMAKE_OSX_SDKS ${OSX_DEVELOPER_ROOT}/${d}/*)
+ foreach(_d Platforms/MacOSX.platform/Developer/SDKs SDKs)
+ file(GLOB _CMAKE_OSX_SDKS ${OSX_DEVELOPER_ROOT}/${_d}/*)
if(_CMAKE_OSX_SDKS)
- set(_CMAKE_OSX_SDKS_DIR ${OSX_DEVELOPER_ROOT}/${d})
+ set(_CMAKE_OSX_SDKS_DIR ${OSX_DEVELOPER_ROOT}/${_d})
break()
endif()
endforeach()
endif()
if(_CMAKE_OSX_SDKS_DIR)
- # Select SDK for current OSX version accounting for the known
- # specially named SDKs.
- set(_CMAKE_OSX_SDKS_VER_SUFFIX_10.4 "u")
- set(_CMAKE_OSX_SDKS_VER_SUFFIX_10.3 ".9")
-
- # find the latest SDK
+ # Find the latest SDK as recommended by Apple (Technical Q&A QA1806)
set(_CMAKE_OSX_LATEST_SDK_VERSION "0.0")
file(GLOB _CMAKE_OSX_SDKS RELATIVE "${_CMAKE_OSX_SDKS_DIR}" "${_CMAKE_OSX_SDKS_DIR}/MacOSX*.sdk")
foreach(_SDK ${_CMAKE_OSX_SDKS})
- if(_SDK MATCHES "MacOSX([0-9]+\\.[0-9]+)[^/]*\\.sdk" AND CMAKE_MATCH_1 VERSION_GREATER ${_CMAKE_OSX_LATEST_SDK_VERSION})
+ if(IS_DIRECTORY "${_CMAKE_OSX_SDKS_DIR}/${_SDK}"
+ AND _SDK MATCHES "MacOSX([0-9]+\\.[0-9]+)[^/]*\\.sdk"
+ AND CMAKE_MATCH_1 VERSION_GREATER ${_CMAKE_OSX_LATEST_SDK_VERSION})
set(_CMAKE_OSX_LATEST_SDK_VERSION "${CMAKE_MATCH_1}")
endif()
endforeach()
- # pick an SDK that works
- set(_CMAKE_OSX_SYSROOT_DEFAULT)
- foreach(ver ${CMAKE_OSX_DEPLOYMENT_TARGET}
- ${_CURRENT_OSX_VERSION}
- ${_CMAKE_OSX_LATEST_SDK_VERSION})
- set(_CMAKE_OSX_DEPLOYMENT_TARGET ${ver})
- set(_CMAKE_OSX_SDKS_VER ${_CMAKE_OSX_DEPLOYMENT_TARGET}${_CMAKE_OSX_SDKS_VER_SUFFIX_${_CMAKE_OSX_DEPLOYMENT_TARGET}})
- set(_CMAKE_OSX_SYSROOT_CHECK "${_CMAKE_OSX_SDKS_DIR}/MacOSX${_CMAKE_OSX_SDKS_VER}.sdk")
- if(IS_DIRECTORY "${_CMAKE_OSX_SYSROOT_CHECK}")
- set(_CMAKE_OSX_SYSROOT_DEFAULT "${_CMAKE_OSX_SYSROOT_CHECK}")
- break()
- endif()
- endforeach()
+ if(NOT _CMAKE_OSX_LATEST_SDK_VERSION STREQUAL "0.0")
+ set(_CMAKE_OSX_SYSROOT_DEFAULT "${_CMAKE_OSX_SDKS_DIR}/MacOSX${_CMAKE_OSX_LATEST_SDK_VERSION}.sdk")
+ else()
+ message(WARNING "Could not find any valid SDKs in ${_CMAKE_OSX_SDKS_DIR}")
+ endif()
- if(NOT CMAKE_CROSSCOMPILING AND NOT CMAKE_OSX_DEPLOYMENT_TARGET AND _CURRENT_OSX_VERSION VERSION_LESS _CMAKE_OSX_DEPLOYMENT_TARGET)
+ if(NOT CMAKE_CROSSCOMPILING AND NOT CMAKE_OSX_DEPLOYMENT_TARGET
+ AND (_CURRENT_OSX_VERSION VERSION_LESS _CMAKE_OSX_LATEST_SDK_VERSION
+ OR _CMAKE_OSX_LATEST_SDK_VERSION STREQUAL "0.0"))
set(CMAKE_OSX_DEPLOYMENT_TARGET ${_CURRENT_OSX_VERSION} CACHE STRING
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value." FORCE)
endif()
@@ -113,8 +104,8 @@ endif()
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
# Choose the type based on the current value.
set(_CMAKE_OSX_SYSROOT_TYPE STRING)
-foreach(v CMAKE_OSX_SYSROOT _CMAKE_OSX_SYSROOT_DEFAULT)
- if("x${${v}}" MATCHES "/")
+foreach(_v CMAKE_OSX_SYSROOT _CMAKE_OSX_SYSROOT_DEFAULT)
+ if("x${${_v}}" MATCHES "/")
set(_CMAKE_OSX_SYSROOT_TYPE PATH)
break()
endif()
diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake
index 9572a7ebb0..425a13f451 100644
--- a/Modules/Platform/HP-UX.cmake
+++ b/Modules/Platform/HP-UX.cmake
@@ -22,7 +22,7 @@ set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
# set flags for gcc support
include(Platform/UnixPaths)
-# Look in both 32-bit and 64-bit implict link directories, but tell
+# Look in both 32-bit and 64-bit implicit link directories, but tell
# CMake not to pass the paths to the linker. The linker will find the
# library for the proper architecture. In the future we should detect
# which path will be used by the linker. Since the pointer type size
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 2476a338e6..e272da94fb 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -356,6 +356,11 @@ macro(__windows_compiler_msvc lang)
set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
+ if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4.0)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "-target ")
+ else()
+ set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "--target=")
+ endif()
# '-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
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index a60e05e6ee..b75eb5e22e 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -83,7 +83,7 @@ Defines the following command for use with ``SWIG``:
``SOURCES``
List of sources for the library. Files with extension ``.i`` will be
identified as sources for the ``SWIG`` tool. Other files will be handled in
- the standard way. This behavior can be overriden by specifying the variable
+ the standard way. This behavior can be overridden by specifying the variable
``SWIG_SOURCE_FILE_EXTENSIONS``.
.. note::
diff --git a/Modules/UseSWIG/ManageSupportFiles.cmake b/Modules/UseSWIG/ManageSupportFiles.cmake
index 4a03900b7f..6618fd5122 100644
--- a/Modules/UseSWIG/ManageSupportFiles.cmake
+++ b/Modules/UseSWIG/ManageSupportFiles.cmake
@@ -4,7 +4,7 @@
if (ACTION STREQUAL "CLEAN")
# Collect current list of generated files
- file (GLOB files LIST_DIRECTORIES FALSE RELATIVE "${SUPPORT_FILES_WORKING_DIRECTORY}" "${SUPPORT_FILES_WORKING_DIRECTORY}/*")
+ file (GLOB_RECURSE files LIST_DIRECTORIES TRUE RELATIVE "${SUPPORT_FILES_WORKING_DIRECTORY}" "${SUPPORT_FILES_WORKING_DIRECTORY}/*")
if (files)
# clean-up the output directory
@@ -22,7 +22,7 @@ endif()
if (ACTION STREQUAL "COPY")
# Collect current list of generated files
- file (GLOB files LIST_DIRECTORIES FALSE "${SUPPORT_FILES_WORKING_DIRECTORY}/*")
+ file (GLOB files LIST_DIRECTORIES TRUE "${SUPPORT_FILES_WORKING_DIRECTORY}/*")
if (files)
# copy files to the output directory
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index 23d81b5fcd..5100035b39 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -5,6 +5,8 @@
WriteCompilerDetectionHeader
----------------------------
+.. versionadded:: 3.1
+
This module provides the function ``write_compiler_detection_header()``.
This function can be used to generate a file suitable for preprocessor