summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/AndroidTestUtilities.cmake2
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake29
-rw-r--r--Modules/CMakePlatformId.h.in3
-rw-r--r--Modules/CPack.cmake2
-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/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/Compiler/Intel-CXX.cmake10
-rw-r--r--Modules/CompilerId/VS-10.vcxproj.in4
-rw-r--r--Modules/FetchContent.cmake2
-rw-r--r--Modules/FindArmadillo.cmake1
-rw-r--r--Modules/FindBISON.cmake2
-rw-r--r--Modules/FindBLAS.cmake9
-rw-r--r--Modules/FindBZip2.cmake4
-rw-r--r--Modules/FindCUDA.cmake7
-rw-r--r--Modules/FindCUDA/select_compute_arch.cmake36
-rw-r--r--Modules/FindCUDAToolkit.cmake2
-rw-r--r--Modules/FindCURL.cmake2
-rw-r--r--Modules/FindEXPAT.cmake2
-rw-r--r--Modules/FindEnvModules.cmake2
-rw-r--r--Modules/FindFLEX.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/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/FindJava.cmake5
-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/FindLua.cmake2
-rw-r--r--Modules/FindMPI.cmake6
-rw-r--r--Modules/FindODBC.cmake2
-rw-r--r--Modules/FindOpenACC.cmake2
-rw-r--r--Modules/FindOpenCL.cmake2
-rw-r--r--Modules/FindPNG.cmake4
-rw-r--r--Modules/FindPatch.cmake2
-rw-r--r--Modules/FindProtobuf.cmake2
-rw-r--r--Modules/FindPython.cmake2
-rw-r--r--Modules/FindPython2.cmake2
-rw-r--r--Modules/FindPython3.cmake2
-rw-r--r--Modules/FindSQLite3.cmake2
-rw-r--r--Modules/FindTIFF.cmake99
-rw-r--r--Modules/FindVulkan.cmake32
-rw-r--r--Modules/FindXCTest.cmake2
-rw-r--r--Modules/FindXalanC.cmake2
-rw-r--r--Modules/FindXercesC.cmake2
-rw-r--r--Modules/GoogleTest.cmake4
-rw-r--r--Modules/GoogleTestAddTests.cmake2
-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/VCXProjInspect.vcxproj.in38
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake18
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake2
74 files changed, 458 insertions, 74 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/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index df48fa574f..ebfd5a48f6 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -248,7 +248,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 +310,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 +352,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 "")
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index 64a00b3d4f..40668a3e6b 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -87,6 +87,9 @@
# elif defined(__WINDOWS__)
# define PLATFORM_ID "Windows3x"
+# elif defined(__VXWORKS__)
+# define PLATFORM_ID "VxWorks"
+
# else /* unknown platform */
# define PLATFORM_ID
# endif
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index eba4e71654..532e368d7b 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -83,7 +83,7 @@ one may call ``cmake --build . --target package`` or ``make package`` or
If CMake is run with the Makefile or Ninja generator, then ``include(CPack)``
also generates a target ``package_source``. To build a source package,
-instead of ``cpack -G TGZ --config CPackConfig.cmake`` one may call
+instead of ``cpack -G TGZ --config CPackSourceConfig.cmake`` one may call
``cmake --build . --target package_source``, ``make package_source``,
or ``ninja package_source``.
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/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/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index 47d5672f2e..42adfd10c7 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -11,6 +11,11 @@ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0)
+ set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-Qstd=c++20")
+ set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-Qstd=c++20")
+ endif()
+
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Qstd=c++17")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-Qstd=c++17")
@@ -39,6 +44,11 @@ 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")
+ endif()
+
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
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/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/FindBISON.cmake b/Modules/FindBISON.cmake
index 6b5828eef3..1e1a5a3b41 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -82,7 +82,7 @@ Example usage:
add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
#]=======================================================================]
-find_program(BISON_EXECUTABLE NAMES bison win_bison DOC "path to the bison executable")
+find_program(BISON_EXECUTABLE NAMES bison win-bison win_bison DOC "path to the bison executable")
mark_as_advanced(BISON_EXECUTABLE)
if(BISON_EXECUTABLE)
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index c5d791eeb2..1e3b563985 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
@@ -473,7 +478,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
set(BLAS_mkl_OS_NAME "lin")
endif()
if(DEFINED ENV{MKLROOT})
- set(BLAS_mkl_MKLROOT "$ENV{MKLROOT}")
+ file(TO_CMAKE_PATH "$ENV{MKLROOT}" BLAS_mkl_MKLROOT)
# If MKLROOT points to the subdirectory 'mkl', use the parent directory instead
# so we can better detect other relevant libraries in 'compiler' or 'tbb':
get_filename_component(BLAS_mkl_MKLROOT_LAST_DIR "${BLAS_mkl_MKLROOT}" NAME)
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/FindCUDA.cmake b/Modules/FindCUDA.cmake
index e1af2d6185..a93d4fd10e 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -357,7 +357,8 @@ The script defines the following variables::
CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
Only available for CUDA version 9.0.
CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
- Only available for CUDA version 9.0.
+ Only available for CUDA version 9.0 - 10.2.
+ Replaced by nvjpeg.
CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
Only available for CUDA version 9.0.
CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
@@ -1002,7 +1003,9 @@ if(NOT CUDA_VERSION VERSION_LESS "9.0")
find_cuda_helper_libs(nppc)
find_cuda_helper_libs(nppial)
find_cuda_helper_libs(nppicc)
- find_cuda_helper_libs(nppicom)
+ if(CUDA_VERSION VERSION_LESS "11.0")
+ find_cuda_helper_libs(nppicom)
+ endif()
find_cuda_helper_libs(nppidei)
find_cuda_helper_libs(nppif)
find_cuda_helper_libs(nppig)
diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake
index 7ddb709698..c11725d99f 100644
--- a/Modules/FindCUDA/select_compute_arch.cmake
+++ b/Modules/FindCUDA/select_compute_arch.cmake
@@ -5,9 +5,9 @@
# - "Auto" detects local machine GPU compute arch at runtime.
# - "Common" and "All" cover common and entire subsets of architectures
# ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
-# NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing
+# NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing Ampere
# NUM: Any number. Only those pairs are currently accepted by NVCC though:
-# 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5
+# 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5 8.0
# Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable}
# Additionally, sets ${out_variable}_readable to the resulting numeric list
# Example:
@@ -30,7 +30,12 @@ endif()
set(CUDA_KNOWN_GPU_ARCHITECTURES "Fermi" "Kepler" "Maxwell")
# This list will be used for CUDA_ARCH_NAME = Common option (enabled by default)
-set(CUDA_COMMON_GPU_ARCHITECTURES "3.0" "3.5" "5.0")
+set(CUDA_COMMON_GPU_ARCHITECTURES "3.5" "5.0")
+# 3.0 is removed in CUDA 11, see:
+# https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#deprecated-features
+if(CUDA_VERSION VERSION_LESS "11.0")
+ list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "3.0")
+endif()
if(CUDA_VERSION VERSION_LESS "7.0")
set(CUDA_LIMIT_GPU_ARCHITECTURE "5.2")
@@ -55,27 +60,39 @@ if(CUDA_VERSION VERSION_GREATER_EQUAL "8.0")
list(APPEND CUDA_ALL_GPU_ARCHITECTURES "6.0" "6.1" "6.2")
if(CUDA_VERSION VERSION_LESS "9.0")
- list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.1+PTX")
+ list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.2+PTX")
set(CUDA_LIMIT_GPU_ARCHITECTURE "7.0")
endif()
endif ()
if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0")
list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Volta")
- list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.0" "7.0+PTX")
- list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.0" "7.0+PTX" "7.2" "7.2+PTX")
+ list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.0")
+ list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.0" "7.2")
if(CUDA_VERSION VERSION_LESS "10.0")
+ list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.2+PTX")
set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0")
endif()
endif()
if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0")
list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Turing")
- list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.5" "7.5+PTX")
- list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.5" "7.5+PTX")
+ list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.5")
+ list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.5")
if(CUDA_VERSION VERSION_LESS "11.0")
+ set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0")
+ list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.5+PTX")
+ endif()
+endif()
+
+if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
+ list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Ampere")
+ list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.0" "8.0+PTX")
+ list(APPEND CUDA_ALL_GPU_ARCHITECTURES "8.0")
+
+ if(CUDA_VERSION VERSION_LESS "12.0")
set(CUDA_LIMIT_GPU_ARCHITECTURE "9.0")
endif()
endif()
@@ -214,6 +231,9 @@ function(CUDA_SELECT_NVCC_ARCH_FLAGS out_variable)
elseif(${arch_name} STREQUAL "Turing")
set(arch_bin 7.5)
set(arch_ptx 7.5)
+ elseif(${arch_name} STREQUAL "Ampere")
+ set(arch_bin 8.0)
+ set(arch_ptx 8.0)
else()
message(SEND_ERROR "Unknown CUDA Architecture Name ${arch_name} in CUDA_SELECT_NVCC_ARCH_FLAGS")
endif()
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 47bc5466c0..4e52e0358c 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.
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index 919babcde5..3acadc2f3b 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)
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/FindFLEX.cmake b/Modules/FindFLEX.cmake
index 90e5f86b41..13847367d0 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -99,7 +99,7 @@ respectively ``FLEX_TARGET`` and ``BISON_TARGET`` macros.
====================================================================
#]=======================================================================]
-find_program(FLEX_EXECUTABLE NAMES flex win_flex DOC "path to the flex executable")
+find_program(FLEX_EXECUTABLE NAMES flex win-flex win_flex DOC "path to the flex executable")
mark_as_advanced(FLEX_EXECUTABLE)
find_library(FL_LIBRARY NAMES fl
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/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/FindJava.cmake b/Modules/FindJava.cmake
index 945df3c986..9db740b4f8 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -160,9 +160,8 @@ if(Java_JAVA_EXECUTABLE)
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE)
if( res )
- if(var MATCHES "No Java runtime present, requesting install")
- set_property(CACHE Java_JAVA_EXECUTABLE
- PROPERTY VALUE "Java_JAVA_EXECUTABLE-NOTFOUND")
+ if(var MATCHES "Unable to locate a Java Runtime to invoke|No Java runtime present, requesting install")
+ set(Java_JAVA_EXECUTABLE Java_JAVA_EXECUTABLE-NOTFOUND)
elseif(${Java_FIND_REQUIRED})
message( FATAL_ERROR "Error executing java -version" )
else()
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index a18cec4320..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}
)
@@ -279,7 +280,7 @@ if(BLAS_FOUND)
set(LAPACK_mkl_OS_NAME "lin")
endif()
if(DEFINED ENV{MKLROOT})
- set(LAPACK_mkl_MKLROOT "$ENV{MKLROOT}")
+ file(TO_CMAKE_PATH "$ENV{MKLROOT}" LAPACK_mkl_MKLROOT)
# If MKLROOT points to the subdirectory 'mkl', use the parent directory instead
# so we can better detect other relevant libraries in 'compiler' or 'tbb':
get_filename_component(LAPACK_mkl_MKLROOT_LAST_DIR "${LAPACK_mkl_MKLROOT}" NAME)
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/FindLua.cmake b/Modules/FindLua.cmake
index 0b0c970abc..c4361b74b1 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -48,7 +48,7 @@ unset(_lua_append_versions)
# this is a function only to have all the variables inside go away automatically
function(_lua_get_versions)
- set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
+ set(LUA_VERSIONS5 5.4 5.3 5.2 5.1 5.0)
if (Lua_FIND_VERSION_EXACT)
if (Lua_FIND_VERSION_COUNT GREATER 1)
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 786bcc8742..25de562e2e 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1153,15 +1153,19 @@ macro(_MPI_create_imported_target LANG)
add_library(MPI::MPI_${LANG} INTERFACE IMPORTED)
endif()
- # When this is consumed for compiling CUDA, use '-Xcompiler' to wrap '-pthread'.
+ # When this is consumed for compiling CUDA, use '-Xcompiler' to wrap '-pthread' and '-fexceptions'.
string(REPLACE "-pthread" "$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:SHELL:-Xcompiler >-pthread"
_MPI_${LANG}_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}")
+ string(REPLACE "-fexceptions" "$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:SHELL:-Xcompiler >-fexceptions"
+ _MPI_${LANG}_COMPILE_OPTIONS "${MPI_${LANG}_COMPILE_OPTIONS}")
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_OPTIONS "${_MPI_${LANG}_COMPILE_OPTIONS}")
unset(_MPI_${LANG}_COMPILE_OPTIONS)
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}")
if(MPI_${LANG}_LINK_FLAGS)
+ string(REPLACE "-pthread" "$<$<LINK_LANG_AND_ID:CUDA,NVIDIA>:-Xlinker >-pthread"
+ _MPI_${LANG}_LINK_FLAGS "${MPI_${LANG}_LINK_FLAGS}")
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_OPTIONS "SHELL:${MPI_${LANG}_LINK_FLAGS}")
endif()
# If the compiler links MPI implicitly, no libraries will be found as they're contained within
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/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/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..f503ccaa24 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).
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index 84c0c73b60..42d87c8510 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).
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index f142c07ee6..b58ee30c9e 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).
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/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/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..ca9195cc14 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
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/GoogleTest.cmake b/Modules/GoogleTest.cmake
index f75d6ad372..2ef73821cd 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)``.
@@ -527,7 +529,7 @@ function(gtest_discover_tests TARGET)
endif()
else()
- message(SEND_ERROR "Unknown DISCOVERY_MODE: ${_DISCOVERY_MODE}")
+ message(FATAL_ERROR "Unknown DISCOVERY_MODE: ${_DISCOVERY_MODE}")
endif()
# Add discovered tests to directory TEST_INCLUDE_FILES
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index 4af62ed7fd..5d098d96a0 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -112,7 +112,7 @@ function(gtest_discover_tests_impl)
string(REGEX REPLACE "^DISABLED_" "" pretty_test "${pretty_test}")
string(REGEX REPLACE "#.*" "" test "${test}")
if(NOT "${_TEST_XML_OUTPUT_DIR}" STREQUAL "")
- set(TEST_XML_OUTPUT_PARAM "--gtest_output=xml:${_TEST_XML_OUTPUT_DIR}/${prefix}${pretty_suite}.${pretty_test}${suffix}.xml")
+ set(TEST_XML_OUTPUT_PARAM "--gtest_output=xml:${_TEST_XML_OUTPUT_DIR}/${prefix}${suite}.${test}${suffix}.xml")
else()
unset(TEST_XML_OUTPUT_PARAM)
endif()
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/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..aa0e554523 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -62,10 +62,10 @@ 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()
@@ -88,10 +88,10 @@ elseif("${CMAKE_GENERATOR}" MATCHES Xcode
# 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})
+ 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}")
@@ -113,8 +113,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/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