summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeCInformation.cmake10
-rw-r--r--Modules/CMakeCUDAInformation.cmake9
-rw-r--r--Modules/CMakeCXXInformation.cmake9
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake19
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake7
-rw-r--r--Modules/CMakeFortranCompilerABI.F9048
-rw-r--r--Modules/CMakeFortranInformation.cmake9
-rw-r--r--Modules/CMakeHIPInformation.cmake9
-rw-r--r--Modules/CMakeOBJCInformation.cmake9
-rw-r--r--Modules/CMakeOBJCXXInformation.cmake9
-rw-r--r--Modules/CMakeSwiftInformation.cmake9
-rw-r--r--Modules/CMakeTestFortranCompiler.cmake9
-rw-r--r--Modules/Compiler/ARMClang-C.cmake8
-rw-r--r--Modules/Compiler/ARMClang-CXX.cmake8
-rw-r--r--Modules/Compiler/MSVC-C.cmake6
-rw-r--r--Modules/Compiler/MSVC-CXX.cmake6
-rw-r--r--Modules/Compiler/PGI.cmake2
-rw-r--r--Modules/FindBLAS.cmake67
-rw-r--r--Modules/FindCUDAToolkit.cmake7
-rw-r--r--Modules/FindGLUT.cmake163
-rw-r--r--Modules/FindLAPACK.cmake76
-rw-r--r--Modules/FindMPI.cmake54
-rw-r--r--Modules/FindMPI/test_mpi.c18
-rw-r--r--Modules/FindPatch.cmake2
-rw-r--r--Modules/FindPkgConfig.cmake52
-rw-r--r--Modules/FindX11.cmake6
-rw-r--r--Modules/GoogleTest.cmake11
-rw-r--r--Modules/GoogleTestAddTests.cmake11
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake33
-rw-r--r--Modules/Internal/CPack/CPackDeb.cmake6
-rw-r--r--Modules/Internal/CPack/CPackRPM.cmake12
-rw-r--r--Modules/Internal/CPack/NSIS.template.in15
-rw-r--r--Modules/UseSWIG.cmake25
-rw-r--r--Modules/VTKCompatibility.cmake4
34 files changed, 596 insertions, 152 deletions
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index 6be1865..665f309 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -91,6 +91,14 @@ if(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
endif()
+if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ if(NOT DEFINED CMAKE_C_LINK_WHAT_YOU_USE_FLAG)
+ set(CMAKE_C_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
+ endif()
+ if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
+ set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
+ endif()
+endif()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
@@ -196,5 +204,3 @@ if(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
endif()
set(CMAKE_C_INFORMATION_LOADED 1)
-
-
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index a2946f4..e9cfed6 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -100,6 +100,15 @@ if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_CREATE_CUDA_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS})
endif()
+if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ if(NOT DEFINED CMAKE_CUDA_LINK_WHAT_YOU_USE_FLAG)
+ set(CMAKE_CUDA_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
+ endif()
+ if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
+ set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
+ endif()
+endif()
+
# add the flags to the cache based
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 944d236..53abf37 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -193,6 +193,15 @@ foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
endif()
endforeach()
+if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ if(NOT DEFINED CMAKE_CXX_LINK_WHAT_YOU_USE_FLAG)
+ set(CMAKE_CXX_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
+ endif()
+ if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
+ set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
+ endif()
+endif()
+
# add the flags to the cache based
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index e360d31..342425c 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -192,17 +192,31 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
get_filename_component(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "${_CUDA_NVCC_EXECUTABLE}" DIRECTORY)
get_filename_component(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}" DIRECTORY)
endif()
+
+ if(_CUDA_NVCC_OUT MATCHES "\\#\\$ NVVMIR_LIBRARY_DIR=([^\r\n]*)")
+ get_filename_component(_CUDA_NVVMIR_LIBRARY_DIR "${CMAKE_MATCH_1}" ABSOLUTE)
+
+ #We require the path to end in `/nvvm/libdevice'
+ if(_CUDA_NVVMIR_LIBRARY_DIR MATCHES "nvvm/libdevice$")
+ get_filename_component(_CUDA_NVVMIR_LIBRARY_DIR "${_CUDA_NVVMIR_LIBRARY_DIR}/../.." ABSOLUTE)
+ set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT_FROM_NVVMIR_LIBRARY_DIR "${_CUDA_NVVMIR_LIBRARY_DIR}")
+ endif()
+
+ unset(_CUDA_NVVMIR_LIBRARY_DIR)
+ unset(_cuda_nvvmir_dir_name)
+ endif()
unset(_CUDA_NVCC_OUT)
set(CMAKE_CUDA_DEVICE_LINKER "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/bin/nvlink${CMAKE_EXECUTABLE_SUFFIX}")
set(CMAKE_CUDA_FATBINARY "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/bin/fatbinary${CMAKE_EXECUTABLE_SUFFIX}")
-
# In a non-scattered installation the following are equivalent to CMAKE_CUDA_COMPILER_TOOLKIT_ROOT.
# We first check for a non-scattered installation to prefer it over a scattered installation.
# CMAKE_CUDA_COMPILER_LIBRARY_ROOT contains the device library.
- if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/nvvm/libdevice")
+ if(DEFINED CMAKE_CUDA_COMPILER_LIBRARY_ROOT_FROM_NVVMIR_LIBRARY_DIR)
+ set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_CUDA_COMPILER_LIBRARY_ROOT_FROM_NVVMIR_LIBRARY_DIR}")
+ elseif(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/nvvm/libdevice")
set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}")
elseif(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/cuda/nvvm/libdevice")
set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "${CMAKE_SYSROOT_LINK}/usr/lib/cuda")
@@ -211,6 +225,7 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
else()
message(FATAL_ERROR "Couldn't find CUDA library root.")
endif()
+ unset(CMAKE_CUDA_COMPILER_LIBRARY_ROOT_FROM_NVVMIR_LIBRARY_DIR)
# CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT contains the linking stubs necessary for device linking and other low-level library files.
if(CMAKE_SYSROOT_LINK AND EXISTS "${CMAKE_SYSROOT_LINK}/usr/lib/nvidia-cuda-toolkit/bin/crt/link.stub")
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index e933cf4..16243c7 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -722,7 +722,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
# Check the result of compilation.
if(CMAKE_${lang}_COMPILER_ID_RESULT
# Intel Fortran warns and ignores preprocessor lines without /fpp
- OR CMAKE_${lang}_COMPILER_ID_OUTPUT MATCHES "Bad # preprocessor line"
+ OR CMAKE_${lang}_COMPILER_ID_OUTPUT MATCHES "warning #5117: Bad # preprocessor line"
)
# Compilation failed.
set(MSG
@@ -733,7 +733,10 @@ ${CMAKE_${lang}_COMPILER_ID_RESULT}
${CMAKE_${lang}_COMPILER_ID_OUTPUT}
")
- file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
+ # Log the output unless we recognize it as a known-bad case.
+ if(NOT CMAKE_${lang}_COMPILER_ID_OUTPUT MATCHES "warning #5117: Bad # preprocessor line")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
+ endif()
# Some languages may know the correct/desired set of flags and want to fail right away if they don't work.
# This is currently only used by CUDA.
diff --git a/Modules/CMakeFortranCompilerABI.F90 b/Modules/CMakeFortranCompilerABI.F90
new file mode 100644
index 0000000..4a17153
--- /dev/null
+++ b/Modules/CMakeFortranCompilerABI.F90
@@ -0,0 +1,48 @@
+program CMakeFortranCompilerABI
+
+implicit none
+
+integer :: i(1) = 0
+where (i==0) i=1
+if (any(i/=1)) stop 1
+! showing Fortran 90 syntax is OK
+
+#if 0
+! Address Size
+#endif
+#if defined(_LP64)
+PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(_M_IA64)
+PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(_M_X64)
+PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(_M_AMD64)
+PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(__x86_64__)
+PRINT *, 'INFO:sizeof_dptr[8]'
+
+#elif defined(_ILP32)
+PRINT *, 'INFO:sizeof_dptr[4]'
+#elif defined(_M_IX86)
+PRINT *, 'INFO:sizeof_dptr[4]'
+#elif defined(__i386__)
+PRINT *, 'INFO:sizeof_dptr[4]'
+
+#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8
+PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 4
+PRINT *, 'INFO:sizeof_dptr[4]'
+#elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ == 8
+PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ == 4
+PRINT *, 'INFO:sizeof_dptr[4]'
+#endif
+
+#if 0
+! Application Binary Interface
+#endif
+#if defined(__ELF__)
+PRINT *, 'INFO:abi[ELF]'
+#endif
+PRINT *, 'ABI Detection'
+end program
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 9a4ce63..0f71c6f 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -157,6 +157,15 @@ if(NOT CMAKE_INCLUDE_FLAG_Fortran)
set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
endif()
+if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ if(NOT DEFINED CMAKE_Fortran_LINK_WHAT_YOU_USE_FLAG)
+ set(CMAKE_Fortran_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
+ endif()
+ if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
+ set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
+ endif()
+endif()
+
set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
set(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
diff --git a/Modules/CMakeHIPInformation.cmake b/Modules/CMakeHIPInformation.cmake
index ec37e1c..9862f24 100644
--- a/Modules/CMakeHIPInformation.cmake
+++ b/Modules/CMakeHIPInformation.cmake
@@ -68,6 +68,15 @@ if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_CREATE_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS})
endif()
+if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ if(NOT DEFINED CMAKE_HIP_LINK_WHAT_YOU_USE_FLAG)
+ set(CMAKE_HIP_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
+ endif()
+ if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
+ set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
+ endif()
+endif()
+
# add the flags to the cache based
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time
diff --git a/Modules/CMakeOBJCInformation.cmake b/Modules/CMakeOBJCInformation.cmake
index ac67d01..4c697da 100644
--- a/Modules/CMakeOBJCInformation.cmake
+++ b/Modules/CMakeOBJCInformation.cmake
@@ -91,6 +91,15 @@ if(CMAKE_USER_MAKE_RULES_OVERRIDE_OBJC)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_OBJC "${_override}")
endif()
+if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ if(NOT DEFINED CMAKE_OBJC_LINK_WHAT_YOU_USE_FLAG)
+ set(CMAKE_OBJC_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
+ endif()
+ if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
+ set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
+ endif()
+endif()
+
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
diff --git a/Modules/CMakeOBJCXXInformation.cmake b/Modules/CMakeOBJCXXInformation.cmake
index 70e8579..a6d824f 100644
--- a/Modules/CMakeOBJCXXInformation.cmake
+++ b/Modules/CMakeOBJCXXInformation.cmake
@@ -189,6 +189,15 @@ foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
endif()
endforeach()
+if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ if(NOT DEFINED CMAKE_OBJCXX_LINK_WHAT_YOU_USE_FLAG)
+ set(CMAKE_OBJCXX_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
+ endif()
+ if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
+ set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
+ endif()
+endif()
+
# add the flags to the cache based
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 8f0909c..ecad1d5 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -70,6 +70,15 @@ set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g")
set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")
+if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ if(NOT DEFINED CMAKE_Swift_LINK_WHAT_YOU_USE_FLAG)
+ set(CMAKE_Swift_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
+ endif()
+ if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
+ set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
+ endif()
+endif()
+
cmake_initialize_per_config_variable(CMAKE_Swift_FLAGS "Swift Compiler Flags")
# NOTE(compnerd) we do not have an object compile rule since we build the objects as part of the link step
diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake
index f25788d..579f83f 100644
--- a/Modules/CMakeTestFortranCompiler.cmake
+++ b/Modules/CMakeTestFortranCompiler.cmake
@@ -17,11 +17,18 @@ unset(CMAKE_Fortran_COMPILER_WORKS CACHE)
# Try to identify the ABI and configure it into CMakeFortranCompiler.cmake
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
-CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
+CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F90)
if(CMAKE_Fortran_ABI_COMPILED)
# The compiler worked so skip dedicated test below.
set(CMAKE_Fortran_COMPILER_WORKS TRUE)
+ set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
message(STATUS "Check for working Fortran compiler: ${CMAKE_Fortran_COMPILER} - skipped")
+else()
+ cmake_determine_compiler_abi(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
+ if(CMAKE_Fortran_ABI_COMPILED)
+ set(CMAKE_Fortran_COMPILER_WORKS TRUE)
+ message(STATUS "Check for working Fortran 77 compiler: ${CMAKE_Fortran_COMPILER} - skipped")
+ endif()
endif()
# This file is used by EnableLanguage in cmGlobalGenerator to
diff --git a/Modules/Compiler/ARMClang-C.cmake b/Modules/Compiler/ARMClang-C.cmake
index 0a64a8a..01c4cea 100644
--- a/Modules/Compiler/ARMClang-C.cmake
+++ b/Modules/Compiler/ARMClang-C.cmake
@@ -2,6 +2,14 @@ include(Compiler/Clang-C)
include(Compiler/ARMClang)
__compiler_armclang(C)
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_C)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_C_DEPFILE_FORMAT gcc)
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+endif()
+
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
diff --git a/Modules/Compiler/ARMClang-CXX.cmake b/Modules/Compiler/ARMClang-CXX.cmake
index 5dfb401..045b783 100644
--- a/Modules/Compiler/ARMClang-CXX.cmake
+++ b/Modules/Compiler/ARMClang-CXX.cmake
@@ -1,3 +1,11 @@
include(Compiler/Clang-CXX)
include(Compiler/ARMClang)
__compiler_armclang(CXX)
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_CXX)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_CXX_DEPFILE_FORMAT gcc)
+ set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+endif()
diff --git a/Modules/Compiler/MSVC-C.cmake b/Modules/Compiler/MSVC-C.cmake
index 9a5104b..73cca36 100644
--- a/Modules/Compiler/MSVC-C.cmake
+++ b/Modules/Compiler/MSVC-C.cmake
@@ -63,3 +63,9 @@ endmacro()
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
set(CMAKE_C_COMPILE_OPTIONS_JMC "-JMC")
endif()
+
+# The `/external:I` flag was made non-experimental in 19.29.30036.3.
+if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29.30036.3)
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-external:I ")
+ set(_CMAKE_INCLUDE_SYSTEM_FLAG_C_WARNING "-external:W0 ")
+endif ()
diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake
index f1c7450..09fe851 100644
--- a/Modules/Compiler/MSVC-CXX.cmake
+++ b/Modules/Compiler/MSVC-CXX.cmake
@@ -79,3 +79,9 @@ endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
set(CMAKE_CXX_COMPILE_OPTIONS_JMC "-JMC")
endif()
+
+# The `/external:I` flag was made non-experimental in 19.29.30036.3.
+if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29.30036.3)
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-external:I ")
+ set(_CMAKE_INCLUDE_SYSTEM_FLAG_CXX_WARNING "-external:W0 ")
+endif ()
diff --git a/Modules/Compiler/PGI.cmake b/Modules/Compiler/PGI.cmake
index 4f8b90b..d111be9 100644
--- a/Modules/Compiler/PGI.cmake
+++ b/Modules/Compiler/PGI.cmake
@@ -26,7 +26,7 @@ macro(__compiler_pgi lang)
endif()
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
- set(CMAKE_${lang}_LINKER_WRAPPER_FLAG ",")
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")
set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ppc64le AND (NOT CMAKE_HOST_WIN32 OR CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 16.3))
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 726ff75..a44af4d 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -109,7 +109,8 @@ BLAS/LAPACK Vendors
``Goto``
GotoBLAS
-``IBMESSL``
+``IBMESSL``, ``IBMESSL_SMP``
+
IBM Engineering and Scientific Subroutine Library
``Intel``
@@ -150,7 +151,7 @@ BLAS/LAPACK Vendors
``PhiPACK``
Portable High Performance ANSI C (PHiPAC)
-``SCSL``
+``SCSL``, ``SCSL_mp``
Scientific Computing Software Library
``SGIMATH``
@@ -386,6 +387,8 @@ if(BLA_VENDOR STREQUAL "All")
)
endif()
if(BLAS_WORKS)
+ # Give a more helpful "found" message
+ set(BLAS_WORKS "implicitly linked")
set(_blas_fphsa_req_var BLAS_WORKS)
endif()
endif()
@@ -439,7 +442,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if(BLA_F95)
set(BLAS_mkl_SEARCH_SYMBOL "sgemm_f95")
- set(_LIBRARIES BLAS95_LIBRARIES)
+ set(_BLAS_LIBRARIES BLAS95_LIBRARIES)
if(WIN32)
# Find the main file (32-bit or 64-bit)
set(BLAS_SEARCH_LIBS_WIN_MAIN "")
@@ -501,7 +504,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endif()
else()
set(BLAS_mkl_SEARCH_SYMBOL sgemm)
- set(_LIBRARIES BLAS_LIBRARIES)
+ set(_BLAS_LIBRARIES BLAS_LIBRARIES)
if(WIN32)
# Find the main file (32-bit or 64-bit)
set(BLAS_SEARCH_LIBS_WIN_MAIN "")
@@ -613,15 +616,15 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
"lib/${BLAS_mkl_ARCH_NAME}"
)
- foreach(IT ${BLAS_SEARCH_LIBS})
- string(REPLACE " " ";" SEARCH_LIBS ${IT})
- if(NOT ${_LIBRARIES})
+ foreach(_search ${BLAS_SEARCH_LIBS})
+ string(REPLACE " " ";" _search ${_search})
+ if(NOT ${_BLAS_LIBRARIES})
check_blas_libraries(
- ${_LIBRARIES}
+ ${_BLAS_LIBRARIES}
BLAS
${BLAS_mkl_SEARCH_SYMBOL}
""
- "${SEARCH_LIBS}"
+ "${_search}"
"${CMAKE_THREAD_LIBS_INIT};${BLAS_mkl_LM};${BLAS_mkl_LDL}"
"${BLAS_mkl_MKLROOT}"
"${BLAS_mkl_LIB_PATH_SUFFIXES}"
@@ -629,6 +632,7 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endif()
endforeach()
+ unset(_search)
unset(BLAS_mkl_ILP_MODE)
unset(BLAS_mkl_INTFACE)
unset(BLAS_mkl_THREADING)
@@ -734,14 +738,14 @@ if(BLA_VENDOR MATCHES "Arm" OR BLA_VENDOR STREQUAL "All")
# Check for 64bit Integer support
if(BLA_VENDOR MATCHES "_ilp64")
- set(BLAS_armpl_LIB "armpl_ilp64")
+ set(_blas_armpl_lib "armpl_ilp64")
else()
- set(BLAS_armpl_LIB "armpl_lp64")
+ set(_blas_armpl_lib "armpl_lp64")
endif()
# Check for OpenMP support, VIA BLA_VENDOR of Arm_mp or Arm_ipl64_mp
if(BLA_VENDOR MATCHES "_mp")
- set(BLAS_armpl_LIB "${BLAS_armpl_LIB}_mp")
+ set(_blas_armpl_lib "${_blas_armpl_lib}_mp")
endif()
if(NOT BLAS_LIBRARIES)
@@ -750,13 +754,13 @@ if(BLA_VENDOR MATCHES "Arm" OR BLA_VENDOR STREQUAL "All")
BLAS
sgemm
""
- "${BLAS_armpl_LIB}"
+ "${_blas_armpl_lib}"
""
""
""
)
endif()
-
+ unset(_blas_armpl_lib)
endif()
# FLAME's blis library? (https://github.com/flame/blis)
@@ -859,19 +863,27 @@ if(BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
endif()
# BLAS in SCSL library? (SGI/Cray Scientific Library)
-if(BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
+if(BLA_VENDOR MATCHES "SCSL" OR BLA_VENDOR STREQUAL "All")
+ set(_blas_scsl_lib "scs")
+
+ if(BLA_VENDOR MATCHES "_mp")
+ set(_blas_scsl_lib "${_blas_scsl_lib}_mp")
+ endif()
+
if(NOT BLAS_LIBRARIES)
check_blas_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
- "scsl"
+ "${_blas_scsl_lib}"
""
""
""
)
endif()
+
+ unset(_blas_scsl_lib)
endif()
# BLAS in SGIMATH library?
@@ -890,20 +902,27 @@ if(BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
-# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
-if(BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
+# BLAS in IBM ESSL library?
+if(BLA_VENDOR MATCHES "IBMESSL" OR BLA_VENDOR STREQUAL "All")
+ set(_blas_essl_lib "essl")
+
+ if(BLA_VENDOR MATCHES "_SMP")
+ set(_blas_essl_lib "${_blas_essl_lib}smp")
+ endif()
if(NOT BLAS_LIBRARIES)
check_blas_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
- "essl;blas"
+ "${_blas_essl_lib}"
""
""
""
)
endif()
+
+ unset(_blas_essl_lib)
endif()
# BLAS in acml library?
@@ -1087,11 +1106,11 @@ endif()
# Elbrus Math Library?
if(BLA_VENDOR MATCHES "EML" OR BLA_VENDOR STREQUAL "All")
- set(BLAS_EML_LIB "eml")
+ set(_blas_eml_lib "eml")
# Check for OpenMP support, VIA BLA_VENDOR of eml_mt
if(BLA_VENDOR MATCHES "_mt")
- set(BLAS_EML_LIB "${BLAS_EML_LIB}_mt")
+ set(_blas_eml_lib "${_blas_eml_lib}_mt")
endif()
if(NOT BLAS_LIBRARIES)
@@ -1100,13 +1119,13 @@ if(BLA_VENDOR MATCHES "EML" OR BLA_VENDOR STREQUAL "All")
BLAS
sgemm
""
- "${BLAS_EML_LIB}"
+ "${_blas_eml_lib}"
""
""
""
)
endif()
-
+ unset(_blas_eml_lib)
endif()
# Fujitsu SSL2 Library?
@@ -1163,3 +1182,5 @@ if(NOT BLA_F95)
endif()
_add_blas_target()
+unset(_blas_fphsa_req_var)
+unset(_BLAS_LIBRARIES)
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index 89b8c99..92042d2 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -844,14 +844,17 @@ if(CUDAToolkit_FOUND)
HINTS ${CUDAToolkit_LIBRARY_DIR}
ENV CUDA_PATH
PATH_SUFFIXES lib64/stubs lib/x64/stubs lib/stubs stubs
+ # Support NVHPC splayed math library layout
+ ../../math_libs/${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}/lib64
+ ../../math_libs/lib64
)
mark_as_advanced(CUDA_${lib_name}_LIBRARY)
if (NOT TARGET CUDA::${lib_name} AND CUDA_${lib_name}_LIBRARY)
- add_library(CUDA::${lib_name} IMPORTED INTERFACE)
+ add_library(CUDA::${lib_name} UNKNOWN IMPORTED)
target_include_directories(CUDA::${lib_name} SYSTEM INTERFACE "${CUDAToolkit_INCLUDE_DIRS}")
- target_link_libraries(CUDA::${lib_name} INTERFACE "${CUDA_${lib_name}_LIBRARY}")
+ set_property(TARGET CUDA::${lib_name} PROPERTY IMPORTED_LOCATION "${CUDA_${lib_name}_LIBRARY}")
foreach(dep ${arg_DEPS})
if(TARGET CUDA::${dep})
target_link_libraries(CUDA::${lib_name} INTERFACE CUDA::${dep})
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index 2770c60..dd0975d 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -41,8 +41,43 @@ Also defined, but not for general use are:
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-if (WIN32)
+function(_add_glut_target_simple)
+ if(TARGET GLUT::GLUT)
+ return()
+ endif()
+ add_library(GLUT::GLUT INTERFACE IMPORTED)
+ if(GLUT_INCLUDE_DIRS)
+ target_include_directories(GLUT::GLUT SYSTEM
+ INTERFACE "${GLUT_INCLUDE_DIRS}")
+ endif()
+ if(GLUT_LIBRARIES)
+ target_link_libraries(GLUT::GLUT INTERFACE ${GLUT_LIBRARIES})
+ endif()
+ if(GLUT_LDFLAGS)
+ target_link_options(GLUT::GLUT INTERFACE ${GLUT_LDFLAGS})
+ endif()
+ if(GLUT_CFLAGS)
+ separate_arguments(GLUT_CFLAGS_SPLIT UNIX_COMMAND "${GLUT_CFLAGS}")
+ target_compile_options(GLUT::GLUT INTERFACE ${GLUT_CFLAGS_SPLIT})
+ endif()
+
+ set_property(TARGET GLUT::GLUT APPEND PROPERTY
+ IMPORTED_LOCATION "${GLUT_glut_LIBRARY}")
+endfunction()
+
+find_package(PkgConfig)
+if(PKG_CONFIG_FOUND)
+ pkg_check_modules(GLUT glut)
+ if(GLUT_FOUND)
+ _add_glut_target_simple()
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_FOUND)
+ return()
+ endif()
+endif()
+
+if(WIN32)
find_path( GLUT_INCLUDE_DIR NAMES GL/glut.h
PATHS ${GLUT_ROOT_PATH}/include )
find_library( GLUT_glut_LIBRARY_RELEASE NAMES glut glut32 freeglut
@@ -57,85 +92,75 @@ if (WIN32)
)
mark_as_advanced(GLUT_glut_LIBRARY_RELEASE GLUT_glut_LIBRARY_DEBUG)
select_library_configurations(GLUT_glut)
-else ()
-
- if (APPLE)
- find_path(GLUT_INCLUDE_DIR glut.h ${OPENGL_LIBRARY_DIR})
- find_library(GLUT_glut_LIBRARY GLUT DOC "GLUT library for OSX")
- find_library(GLUT_cocoa_LIBRARY Cocoa DOC "Cocoa framework for OSX")
- mark_as_advanced(GLUT_glut_LIBRARY GLUT_cocoa_LIBRARY)
-
- if(GLUT_cocoa_LIBRARY AND NOT TARGET GLUT::Cocoa)
- add_library(GLUT::Cocoa UNKNOWN IMPORTED)
- # Cocoa should always be a Framework, but we check to make sure.
- if(GLUT_cocoa_LIBRARY MATCHES "/([^/]+)\\.framework$")
- set(_glut_cocoa "${GLUT_cocoa_LIBRARY}/${CMAKE_MATCH_1}")
- if(EXISTS "${_glut_cocoa}.tbd")
- string(APPEND _glut_cocoa ".tbd")
- endif()
- set_target_properties(GLUT::Cocoa PROPERTIES
- IMPORTED_LOCATION "${_glut_cocoa}")
- else()
- set_target_properties(GLUT::Cocoa PROPERTIES
- IMPORTED_LOCATION "${GLUT_cocoa_LIBRARY}")
+elseif(APPLE)
+ find_path(GLUT_INCLUDE_DIR glut.h ${OPENGL_LIBRARY_DIR})
+ find_library(GLUT_glut_LIBRARY GLUT DOC "GLUT library for OSX")
+ find_library(GLUT_cocoa_LIBRARY Cocoa DOC "Cocoa framework for OSX")
+ mark_as_advanced(GLUT_glut_LIBRARY GLUT_cocoa_LIBRARY)
+
+ if(GLUT_cocoa_LIBRARY AND NOT TARGET GLUT::Cocoa)
+ add_library(GLUT::Cocoa UNKNOWN IMPORTED)
+ # Cocoa should always be a Framework, but we check to make sure.
+ if(GLUT_cocoa_LIBRARY MATCHES "/([^/]+)\\.framework$")
+ set(_glut_cocoa "${GLUT_cocoa_LIBRARY}/${CMAKE_MATCH_1}")
+ if(EXISTS "${_glut_cocoa}.tbd")
+ string(APPEND _glut_cocoa ".tbd")
endif()
- endif()
- else ()
-
- if (BEOS)
-
- set(_GLUT_INC_DIR /boot/develop/headers/os/opengl)
- set(_GLUT_glut_LIB_DIR /boot/develop/lib/x86)
-
+ set_target_properties(GLUT::Cocoa PROPERTIES
+ IMPORTED_LOCATION "${_glut_cocoa}")
else()
-
- find_library( GLUT_Xi_LIBRARY Xi
- /usr/openwin/lib
- )
- mark_as_advanced(GLUT_Xi_LIBRARY)
-
- find_library( GLUT_Xmu_LIBRARY Xmu
- /usr/openwin/lib
- )
- mark_as_advanced(GLUT_Xmu_LIBRARY)
-
- if(GLUT_Xi_LIBRARY AND NOT TARGET GLUT::Xi)
- add_library(GLUT::Xi UNKNOWN IMPORTED)
- set_target_properties(GLUT::Xi PROPERTIES
- IMPORTED_LOCATION "${GLUT_Xi_LIBRARY}")
- endif()
-
- if(GLUT_Xmu_LIBRARY AND NOT TARGET GLUT::Xmu)
- add_library(GLUT::Xmu UNKNOWN IMPORTED)
- set_target_properties(GLUT::Xmu PROPERTIES
- IMPORTED_LOCATION "${GLUT_Xmu_LIBRARY}")
- endif()
-
- endif ()
-
- find_path( GLUT_INCLUDE_DIR GL/glut.h
- /usr/include/GL
- /usr/openwin/share/include
- /usr/openwin/include
- /opt/graphics/OpenGL/include
- /opt/graphics/OpenGL/contrib/libglut
- ${_GLUT_INC_DIR}
+ set_target_properties(GLUT::Cocoa PROPERTIES
+ IMPORTED_LOCATION "${GLUT_cocoa_LIBRARY}")
+ endif()
+ endif()
+else()
+ if(BEOS)
+ set(_GLUT_INC_DIR /boot/develop/headers/os/opengl)
+ set(_GLUT_glut_LIB_DIR /boot/develop/lib/x86)
+ else()
+ find_library( GLUT_Xi_LIBRARY Xi
+ /usr/openwin/lib
)
+ mark_as_advanced(GLUT_Xi_LIBRARY)
- find_library( GLUT_glut_LIBRARY glut
+ find_library( GLUT_Xmu_LIBRARY Xmu
/usr/openwin/lib
- ${_GLUT_glut_LIB_DIR}
)
- mark_as_advanced(GLUT_glut_LIBRARY)
+ mark_as_advanced(GLUT_Xmu_LIBRARY)
- unset(_GLUT_INC_DIR)
- unset(_GLUT_glut_LIB_DIR)
+ if(GLUT_Xi_LIBRARY AND NOT TARGET GLUT::Xi)
+ add_library(GLUT::Xi UNKNOWN IMPORTED)
+ set_target_properties(GLUT::Xi PROPERTIES
+ IMPORTED_LOCATION "${GLUT_Xi_LIBRARY}")
+ endif()
+
+ if(GLUT_Xmu_LIBRARY AND NOT TARGET GLUT::Xmu)
+ add_library(GLUT::Xmu UNKNOWN IMPORTED)
+ set_target_properties(GLUT::Xmu PROPERTIES
+ IMPORTED_LOCATION "${GLUT_Xmu_LIBRARY}")
+ endif()
endif ()
-endif ()
+ find_path( GLUT_INCLUDE_DIR GL/glut.h
+ /usr/include/GL
+ /usr/openwin/share/include
+ /usr/openwin/include
+ /opt/graphics/OpenGL/include
+ /opt/graphics/OpenGL/contrib/libglut
+ ${_GLUT_INC_DIR}
+ )
+
+ find_library( GLUT_glut_LIBRARY glut
+ /usr/openwin/lib
+ ${_GLUT_glut_LIB_DIR}
+ )
+
+ unset(_GLUT_INC_DIR)
+ unset(_GLUT_glut_LIB_DIR)
+endif()
+mark_as_advanced(GLUT_glut_LIBRARY)
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
if (GLUT_FOUND)
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 3146e06..f36acfd 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -298,7 +298,7 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
if(BLA_F95)
set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95")
- set(_LIBRARIES LAPACK95_LIBRARIES)
+ set(_LAPACK_LIBRARIES LAPACK95_LIBRARIES)
set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES})
# old
@@ -311,7 +311,7 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
"mkl_lapack95_${LAPACK_mkl_ILP_MODE}")
else()
set(LAPACK_mkl_SEARCH_SYMBOL "cheev")
- set(_LIBRARIES LAPACK_LIBRARIES)
+ set(_LAPACK_LIBRARIES LAPACK_LIBRARIES)
set(_BLAS_LIBRARIES ${BLAS_LIBRARIES})
# old and new >= 10.3
@@ -350,10 +350,10 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
"lib/${LAPACK_mkl_ARCH_NAME}"
)
- # First try empty lapack libs
- if(NOT ${_LIBRARIES})
+ # First try empty lapack libs (implicitly linked or automatic from BLAS)
+ if(NOT ${_LAPACK_LIBRARIES})
check_lapack_libraries(
- ${_LIBRARIES}
+ ${_LAPACK_LIBRARIES}
LAPACK
${LAPACK_mkl_SEARCH_SYMBOL}
""
@@ -363,18 +363,23 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
"${LAPACK_mkl_LIB_PATH_SUFFIXES}"
"${_BLAS_LIBRARIES}"
)
+ if(LAPACK_WORKS AND NOT _BLAS_LIBRARIES)
+ # Give a more helpful "found" message
+ set(LAPACK_WORKS "implicitly linked")
+ set(_lapack_fphsa_req_var LAPACK_WORKS)
+ endif()
endif()
# Then try the search libs
- foreach(IT ${LAPACK_SEARCH_LIBS})
- string(REPLACE " " ";" SEARCH_LIBS ${IT})
- if(NOT ${_LIBRARIES})
+ foreach(_search ${LAPACK_SEARCH_LIBS})
+ string(REPLACE " " ";" _search ${_search})
+ if(NOT ${_LAPACK_LIBRARIES})
check_lapack_libraries(
- ${_LIBRARIES}
+ ${_LAPACK_LIBRARIES}
LAPACK
${LAPACK_mkl_SEARCH_SYMBOL}
""
- "${SEARCH_LIBS}"
+ "${_search}"
"${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}"
"${LAPACK_mkl_MKLROOT}"
"${LAPACK_mkl_LIB_PATH_SUFFIXES}"
@@ -383,6 +388,7 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
endif()
endforeach()
+ unset(_search)
unset(LAPACK_mkl_ILP_MODE)
unset(LAPACK_mkl_SEARCH_SYMBOL)
unset(LAPACK_mkl_LM)
@@ -485,6 +491,30 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
)
endif()
+ # LAPACK in SCSL library? (SGI/Cray Scientific Library)
+ if(NOT LAPACK_LIBRARIES
+ AND (BLA_VENDOR MATCHES "SCSL" OR BLA_VENDOR STREQUAL "All"))
+ set(_lapack_scsl_lib "scs")
+
+ # Check for OpenMP support, VIA BLA_VENDOR of scs_mp
+ if(BLA_VENDOR MATCHES "_mp")
+ set(_lapack_scsl_lib "${_lapack_scsl_lib}_mp")
+ endif()
+
+ check_lapack_libraries(
+ LAPACK_LIBRARIES
+ LAPACK
+ cheev
+ ""
+ "${_lapack_scsl_lib}"
+ ""
+ ""
+ ""
+ "${BLAS_LIBRARIES}"
+ )
+ unset(_lapack_scsl_lib)
+ endif()
+
# BLAS in acml library?
if(BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
if(BLAS_LIBRARIES MATCHES ".+acml.+")
@@ -580,6 +610,30 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
unset(_ssl2_suffix)
endif()
+ # LAPACK in IBM ESSL library?
+ if(NOT LAPACK_LIBRARIES
+ AND (BLA_VENDOR MATCHES "IBMESSL" OR BLA_VENDOR STREQUAL "All"))
+ set(_lapack_essl_lib "essl")
+
+ # Check for OpenMP support, VIA BLA_VENDOR of esslsmp
+ if(BLA_VENDOR MATCHES "_SMP")
+ set(_lapack_essl_lib "${_lapack_essl_lib}smp")
+ endif()
+
+ check_lapack_libraries(
+ LAPACK_LIBRARIES
+ LAPACK
+ cheev
+ ""
+ "${_lapack_essl_lib}"
+ ""
+ ""
+ ""
+ "${BLAS_LIBRARIES}"
+ )
+ unset(_lapack_essl_lib)
+ endif()
+
# NVHPC Library?
if(NOT LAPACK_LIBRARIES
AND (BLA_VENDOR MATCHES "NVHPC" OR BLA_VENDOR STREQUAL "All"))
@@ -646,3 +700,5 @@ if(LAPACK_LIBRARIES STREQUAL "LAPACK_LIBRARIES-PLACEHOLDER-FOR-EMPTY-LIBRARIES")
endif()
_add_lapack_target()
+unset(_lapack_fphsa_req_var)
+unset(_LAPACK_LIBRARIES)
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index c48decb..f64c4b8 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -105,7 +105,7 @@ This module performs a four step search for an MPI implementation:
1. Search for ``MPIEXEC_EXECUTABLE`` and, if found, use its base directory.
2. Check if the compiler has MPI support built-in. This is the case if the user passed a
- compiler wrapper as ``CMAKE_<LANG>_COMPILER`` or if they're on a Cray system.
+ compiler wrapper as ``CMAKE_<LANG>_COMPILER`` or if they use Cray system compiler wrappers.
3. Attempt to find an MPI compiler wrapper and determine the compiler information from it.
4. Try to find an MPI implementation that does not ship such a wrapper by guessing settings.
Currently, only Microsoft MPI and MPICH2 on Windows are supported.
@@ -333,6 +333,11 @@ set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95
mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r
mpixlf mpixlf_r mpxlf mpxlf_r)
+# Cray Compiler names
+set(_MPI_Cray_C_COMPILER_NAMES cc)
+set(_MPI_Cray_CXX_COMPILER_NAMES CC)
+set(_MPI_Cray_Fortran_COMPILER_NAMES ftn)
+
# Prepend vendor-specific compiler wrappers to the list. If we don't know the compiler,
# attempt all of them.
# By attempting vendor-specific compiler names first, we should avoid situations where the compiler wrapper
@@ -488,6 +493,26 @@ function (_MPI_interrogate_compiler LANG)
endif()
endif()
+ # Cray compiler wrappers come usually without a separate mpicc/c++/ftn, but offer
+ # --cray-print-opts=...
+ if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ _MPI_check_compiler(${LANG} "--cray-print-opts=cflags"
+ MPI_COMPILE_CMDLINE MPI_COMPILER_RETURN)
+
+ if (MPI_COMPILER_RETURN EQUAL 0)
+ # Pass --no-as-needed so the mpi library is always linked. Otherwise, the
+ # Cray compiler wrapper puts an --as-needed flag around the mpi library,
+ # and it is not linked unless code directly refers to it.
+ _MPI_check_compiler(${LANG} "--no-as-needed;--cray-print-opts=libs"
+ MPI_LINK_CMDLINE MPI_COMPILER_RETURN)
+
+ if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ unset(MPI_COMPILE_CMDLINE)
+ unset(MPI_LINK_CMDLINE)
+ endif()
+ endif()
+ endif()
+
# MPICH, MVAPICH2 and Intel MPI just use "-show". Open MPI also offers this, but the
# -showme commands are more specialized.
if (NOT MPI_COMPILER_RETURN EQUAL 0)
@@ -1440,9 +1465,10 @@ foreach(LANG IN ITEMS C CXX Fortran)
endif()
if(_MPI_FIND_${LANG})
if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS )
- set(MPI_CXX_SKIP_MPICXX FALSE CACHE BOOL "If true, the MPI-2 C++ bindings are disabled using definitions.")
+ option(MPI_CXX_SKIP_MPICXX "If true, the MPI-2 C++ bindings are disabled using definitions." FALSE)
mark_as_advanced(MPI_CXX_SKIP_MPICXX)
endif()
+ _MPI_adjust_compile_definitions(${LANG})
if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_COMPILER_INCLUDE_DIRS)))
set(MPI_${LANG}_TRIED_IMPLICIT FALSE)
set(MPI_${LANG}_WORKS_IMPLICIT FALSE)
@@ -1519,6 +1545,29 @@ foreach(LANG IN ITEMS C CXX Fortran)
endif()
endif()
+ # We are on a Cray, environment identfier: PE_ENV is set (CRAY), and
+ # have NOT found an mpic++-like compiler wrapper (previous block),
+ # and we do NOT use the Cray cc/CC compiler wrappers as CC/CXX CMake
+ # compiler.
+ # So as a last resort, we now interrogate cc/CC/ftn for MPI flags.
+ if(DEFINED ENV{PE_ENV} AND NOT "${MPI_${LANG}_COMPILER}")
+ set(MPI_PINNED_COMPILER TRUE)
+ find_program(MPI_${LANG}_COMPILER
+ NAMES ${_MPI_Cray_${LANG}_COMPILER_NAMES}
+ PATH_SUFFIXES bin sbin
+ DOC "MPI compiler for ${LANG}"
+ )
+
+ # If we haven't made the implicit compiler test yet, perform it now.
+ if(NOT MPI_${LANG}_TRIED_IMPLICIT)
+ _MPI_create_imported_target(${LANG})
+ _MPI_check_lang_works(${LANG} TRUE)
+ endif()
+
+ set(MPI_${LANG}_WORKS_IMPLICIT TRUE)
+ _MPI_interrogate_compiler(${LANG})
+ endif()
+
if(NOT MPI_PINNED_COMPILER AND NOT MPI_${LANG}_WRAPPER_FOUND)
# If MPI_PINNED_COMPILER wasn't given, and the MPI compiler we potentially found didn't work, we withdraw it.
set(MPI_${LANG}_COMPILER "MPI_${LANG}_COMPILER-NOTFOUND" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE)
@@ -1547,7 +1596,6 @@ foreach(LANG IN ITEMS C CXX Fortran)
endif()
_MPI_assemble_libraries(${LANG})
- _MPI_adjust_compile_definitions(${LANG})
# We always create imported targets even if they're empty
_MPI_create_imported_target(${LANG})
diff --git a/Modules/FindMPI/test_mpi.c b/Modules/FindMPI/test_mpi.c
index 7c96d54..70d7e1d 100644
--- a/Modules/FindMPI/test_mpi.c
+++ b/Modules/FindMPI/test_mpi.c
@@ -7,15 +7,15 @@
#endif
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
-const char mpiver_str[] = { 'I', 'N',
- 'F', 'O',
- ':', 'M',
- 'P', 'I',
- '-', 'V',
- 'E', 'R',
- '[', ('0' + MPI_VERSION),
- '.', ('0' + MPI_SUBVERSION),
- ']', '\0' };
+const static char mpiver_str[] = { 'I', 'N',
+ 'F', 'O',
+ ':', 'M',
+ 'P', 'I',
+ '-', 'V',
+ 'E', 'R',
+ '[', ('0' + MPI_VERSION),
+ '.', ('0' + MPI_SUBVERSION),
+ ']', '\0' };
#endif
int main(int argc, char* argv[])
diff --git a/Modules/FindPatch.cmake b/Modules/FindPatch.cmake
index 4108651..f4fe4a6 100644
--- a/Modules/FindPatch.cmake
+++ b/Modules/FindPatch.cmake
@@ -43,7 +43,7 @@ endif()
# First search the PATH
find_program(Patch_EXECUTABLE
- NAME patch
+ NAMES patch
PATHS ${_patch_path}
DOC ${_doc}
)
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 3bc9dba..a28f6bc 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -15,6 +15,8 @@ following variables will also be set:
if pkg-config executable was found
``PKG_CONFIG_EXECUTABLE``
pathname of the pkg-config program
+``PKG_CONFIG_ARGN``
+ list of arguments to pass to pkg-config
``PKG_CONFIG_VERSION_STRING``
version of pkg-config (since CMake 2.8.8)
@@ -29,13 +31,22 @@ set(PKG_CONFIG_VERSION 1)
# find pkg-config, use PKG_CONFIG if set
if((NOT PKG_CONFIG_EXECUTABLE) AND (NOT "$ENV{PKG_CONFIG}" STREQUAL ""))
- set(PKG_CONFIG_EXECUTABLE "$ENV{PKG_CONFIG}" CACHE FILEPATH "pkg-config executable")
+ separate_arguments(PKG_CONFIG_FROM_ENV_SPLIT NATIVE_COMMAND PROGRAM SEPARATE_ARGS "$ENV{PKG_CONFIG}")
+ list(LENGTH PKG_CONFIG_FROM_ENV_SPLIT PKG_CONFIG_FROM_ENV_SPLIT_ARGC)
+ if(PKG_CONFIG_FROM_ENV_SPLIT_ARGC GREATER 0)
+ list(GET PKG_CONFIG_FROM_ENV_SPLIT 0 PKG_CONFIG_FROM_ENV_ARGV0)
+ if(PKG_CONFIG_FROM_ENV_SPLIT_ARGC GREATER 1)
+ list(SUBLIST PKG_CONFIG_FROM_ENV_SPLIT 1 -1 PKG_CONFIG_ARGN)
+ endif()
+ set(PKG_CONFIG_EXECUTABLE "${PKG_CONFIG_FROM_ENV_ARGV0}" CACHE FILEPATH "pkg-config executable")
+ endif()
endif()
set(PKG_CONFIG_NAMES "pkg-config")
if(CMAKE_HOST_WIN32)
list(PREPEND PKG_CONFIG_NAMES "pkg-config.bat")
endif()
+list(PREPEND PKG_CONFIG_NAMES "pkgconf")
find_program(PKG_CONFIG_EXECUTABLE
NAMES ${PKG_CONFIG_NAMES}
@@ -43,9 +54,12 @@ find_program(PKG_CONFIG_EXECUTABLE
DOC "pkg-config executable")
mark_as_advanced(PKG_CONFIG_EXECUTABLE)
+set(PKG_CONFIG_ARGN "${PKG_CONFIG_ARGN}" CACHE STRING "Arguments to supply to pkg-config")
+mark_as_advanced(PKG_CONFIG_ARGN)
+
set(_PKG_CONFIG_FAILURE_MESSAGE "")
if (PKG_CONFIG_EXECUTABLE)
- execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --version
+ execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} ${PKG_CONFIG_ARGN} --version
OUTPUT_VARIABLE PKG_CONFIG_VERSION_STRING OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE _PKG_CONFIG_VERSION_ERROR ERROR_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _PKG_CONFIG_VERSION_RESULT
@@ -53,14 +67,18 @@ if (PKG_CONFIG_EXECUTABLE)
if (NOT _PKG_CONFIG_VERSION_RESULT EQUAL 0)
string(REPLACE "\n" "\n " _PKG_CONFIG_VERSION_ERROR " ${_PKG_CONFIG_VERSION_ERROR}")
+ if(PKG_CONFIG_ARGN)
+ string(REPLACE ";" " " PKG_CONFIG_ARGN " ${PKG_CONFIG_ARGN}")
+ endif()
string(APPEND _PKG_CONFIG_FAILURE_MESSAGE
"The command\n"
- " \"${PKG_CONFIG_EXECUTABLE}\" --version\n"
+ " \"${PKG_CONFIG_EXECUTABLE}\"${PKG_CONFIG_ARGN} --version\n"
" failed with output:\n${PKG_CONFIG_VERSION_STRING}\n"
" stderr: \n${_PKG_CONFIG_VERSION_ERROR}\n"
" result: \n${_PKG_CONFIG_VERSION_RESULT}"
)
set(PKG_CONFIG_EXECUTABLE "")
+ set(PKG_CONFIG_ARGN "")
unset(PKG_CONFIG_VERSION_STRING)
endif ()
unset(_PKG_CONFIG_VERSION_RESULT)
@@ -91,7 +109,7 @@ macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
set(_pkgconfig_invoke_result)
execute_process(
- COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist}
+ COMMAND ${PKG_CONFIG_EXECUTABLE} ${PKG_CONFIG_ARGN} ${ARGN} ${_pkglist}
OUTPUT_VARIABLE _pkgconfig_invoke_result
RESULT_VARIABLE _pkgconfig_failed
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -385,6 +403,14 @@ macro(_pkg_set_path_internal)
unset(_lib_dirs)
unset(_pkgconfig_path)
endif()
+
+ # Tell pkg-config not to strip any -L paths so we can search them all.
+ if(DEFINED ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS})
+ set(_pkgconfig_allow_system_libs_old "$ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS}")
+ else()
+ unset(_pkgconfig_allow_system_libs_old)
+ endif()
+ set(ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS} 0)
endmacro()
macro(_pkg_restore_path_internal)
@@ -392,6 +418,10 @@ macro(_pkg_restore_path_internal)
# Restore the environment variable
set(ENV{PKG_CONFIG_PATH} "${_pkgconfig_path_old}")
endif()
+ if(DEFINED _pkgconfig_allow_system_libs_old)
+ set(ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS} "${_pkgconfig_allow_system_libs_old}")
+ unset(_pkgconfig_allow_system_libs_old)
+ endif()
unset(_extra_paths)
unset(_pkgconfig_path_old)
@@ -533,7 +563,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
# execute the query
execute_process(
- COMMAND ${PKG_CONFIG_EXECUTABLE} ${_pkg_check_modules_exist_query}
+ COMMAND ${PKG_CONFIG_EXECUTABLE} ${PKG_CONFIG_ARGN} ${_pkg_check_modules_exist_query}
RESULT_VARIABLE _pkgconfig_retval
ERROR_VARIABLE _pkgconfig_error
ERROR_STRIP_TRAILING_WHITESPACE)
@@ -892,6 +922,18 @@ Variables Affecting Behavior
.. versionadded:: 3.1
The ``PKG_CONFIG`` environment variable can be used as a hint.
+.. variable:: PKG_CONFIG_ARGN
+
+ .. versionadded:: 3.22
+
+ This can be set to a list of arguments to additionally pass to pkg-config
+ if needed. If not provided, it will be an empty string, however, if the
+ environment variable ``PKG_CONFIG`` is provided, this will be set to the
+ result of splitting the variable.
+
+ The ``PKG_CONFIG`` environment variable can be used to provide both
+ ``PKG_CONFIG_EXECUTABLE`` and ``PKG_CONFIG_ARGN``
+
.. variable:: PKG_CONFIG_USE_CMAKE_PREFIX_PATH
.. versionadded:: 3.1
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index d480fc4..fd5ee53 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -828,6 +828,12 @@ if (UNIX)
X11_Xau_INCLUDE_PATH
X11_xcb_LIB
X11_xcb_INCLUDE_PATH
+ X11_xcb_icccm_LIB
+ X11_xcb_icccm_INCLUDE_PATH
+ X11_xcb_util_LIB
+ X11_xcb_util_INCLUDE_PATH
+ X11_xcb_xfixes_LIB
+ X11_xcb_xfixes_INCLUDE_PATH
X11_xcb_xkb_LIB
X11_X11_xcb_LIB
X11_X11_xcb_INCLUDE_PATH
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake
index 80d8e23..a483c03 100644
--- a/Modules/GoogleTest.cmake
+++ b/Modules/GoogleTest.cmake
@@ -151,6 +151,7 @@ same as the Google Test name (i.e. ``suite.testcase``); see also
[WORKING_DIRECTORY dir]
[TEST_PREFIX prefix]
[TEST_SUFFIX suffix]
+ [TEST_FILTER expr]
[NO_PRETTY_TYPES] [NO_PRETTY_VALUES]
[PROPERTIES name1 value1...]
[TEST_LIST var]
@@ -204,6 +205,12 @@ same as the Google Test name (i.e. ``suite.testcase``); see also
every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may
be specified.
+ ``TEST_FILTER expr``
+ .. versionadded:: 3.22
+
+ Filter expression to pass to ``--gtest_filter`` argument during test
+ discovery.
+
``NO_PRETTY_TYPES``
By default, the type index of type-parameterized tests is replaced by the
actual type name in the CTest test name. If this behavior is undesirable
@@ -411,7 +418,7 @@ function(gtest_discover_tests TARGET)
""
"NO_PRETTY_TYPES;NO_PRETTY_VALUES"
"TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;DISCOVERY_TIMEOUT;XML_OUTPUT_DIR;DISCOVERY_MODE"
- "EXTRA_ARGS;PROPERTIES"
+ "EXTRA_ARGS;PROPERTIES;TEST_FILTER"
${ARGN}
)
@@ -475,6 +482,7 @@ function(gtest_discover_tests TARGET)
-D "TEST_PROPERTIES=${_PROPERTIES}"
-D "TEST_PREFIX=${_TEST_PREFIX}"
-D "TEST_SUFFIX=${_TEST_SUFFIX}"
+ -D "TEST_FILTER=${_TEST_FILTER}"
-D "NO_PRETTY_TYPES=${_NO_PRETTY_TYPES}"
-D "NO_PRETTY_VALUES=${_NO_PRETTY_VALUES}"
-D "TEST_LIST=${_TEST_LIST}"
@@ -515,6 +523,7 @@ function(gtest_discover_tests TARGET)
" TEST_PROPERTIES" " [==[" "${_PROPERTIES}" "]==]" "\n"
" TEST_PREFIX" " [==[" "${_TEST_PREFIX}" "]==]" "\n"
" TEST_SUFFIX" " [==[" "${_TEST_SUFFIX}" "]==]" "\n"
+ " TEST_FILTER" " [==[" "${_TEST_FILTER}" "]==]" "\n"
" NO_PRETTY_TYPES" " [==[" "${_NO_PRETTY_TYPES}" "]==]" "\n"
" NO_PRETTY_VALUES" " [==[" "${_NO_PRETTY_VALUES}" "]==]" "\n"
" TEST_LIST" " [==[" "${_TEST_LIST}" "]==]" "\n"
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index 0f79c9a..6b3bf34 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -44,7 +44,7 @@ function(gtest_discover_tests_impl)
cmake_parse_arguments(
""
""
- "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"
+ "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_FILTER"
"TEST_EXTRA_ARGS;TEST_PROPERTIES;TEST_EXECUTOR"
${ARGN}
)
@@ -58,6 +58,12 @@ function(gtest_discover_tests_impl)
set(tests)
set(tests_buffer)
+ if(_TEST_FILTER)
+ set(filter "--gtest_filter=${_TEST_FILTER}")
+ else()
+ set(filter)
+ endif()
+
# Run test executable to get list of available tests
if(NOT EXISTS "${_TEST_EXECUTABLE}")
message(FATAL_ERROR
@@ -66,7 +72,7 @@ function(gtest_discover_tests_impl)
)
endif()
execute_process(
- COMMAND ${_TEST_EXECUTOR} "${_TEST_EXECUTABLE}" --gtest_list_tests
+ COMMAND ${_TEST_EXECUTOR} "${_TEST_EXECUTABLE}" --gtest_list_tests ${filter}
WORKING_DIRECTORY "${_TEST_WORKING_DIR}"
TIMEOUT ${_TEST_DISCOVERY_TIMEOUT}
OUTPUT_VARIABLE output
@@ -178,6 +184,7 @@ if(CMAKE_SCRIPT_MODE_FILE)
TEST_WORKING_DIR ${TEST_WORKING_DIR}
TEST_PREFIX ${TEST_PREFIX}
TEST_SUFFIX ${TEST_SUFFIX}
+ TEST_FILTER ${TEST_FILTER}
TEST_LIST ${TEST_LIST}
CTEST_FILE ${CTEST_FILE}
TEST_DISCOVERY_TIMEOUT ${TEST_DISCOVERY_TIMEOUT}
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index fa7b125..b2af6c9 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -80,19 +80,34 @@ foreach(LANG IN ITEMS C CXX Fortran)
set(_Intel_archdir ia32)
endif()
set(_Intel_compiler_ver ${CMAKE_${LANG}_COMPILER_VERSION})
- if(WIN32 AND EXISTS "${_Intel_basedir}/../redist/${_Intel_archdir}_win/compiler")
- get_filename_component(_Intel_redistdir "${_Intel_basedir}/../redist/${_Intel_archdir}_win/compiler" ABSOLUTE)
- elseif(WIN32)
- get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../redist/${_Intel_archdir}/compiler" ABSOLUTE)
+ if(WIN32)
+ set(_Intel_possible_redistdirs
+ "${_Intel_basedir}/../redist/${_Intel_archdir}_win/compiler"
+ "${_Intel_basedir}/../../redist/${_Intel_archdir}/compiler"
+ )
elseif(APPLE)
- get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib" ABSOLUTE)
+ set(_Intel_possible_redistdirs
+ "${_Intel_basedir}/../../compiler/lib"
+ )
else()
- if(EXISTS "${_Intel_basedir}/../lib/${_Intel_archdir}_lin")
- get_filename_component(_Intel_redistdir "${_Intel_basedir}/../lib/${_Intel_archdir}" ABSOLUTE)
- else()
- get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib/${_Intel_archdir}_lin" ABSOLUTE)
+ set(_Intel_possible_redistdirs
+ "${_Intel_basedir}/../lib/${_Intel_archdir}"
+ "${_Intel_basedir}/../../compiler/lib/${_Intel_archdir}_lin"
+ )
+ endif()
+
+ set(_Intel_redistdir NOT-FOUND)
+ foreach(dir IN LISTS _Intel_possible_redistdirs)
+ if(EXISTS "${dir}")
+ set(_Intel_redistdir "${dir}")
+ break()
endif()
+ endforeach()
+ # Fall back to last dir
+ if(NOT _Intel_redistdir)
+ list(POP_BACK _Intel_possible_redistdirs _Intel_redistdir)
endif()
+ unset(_Intel_possible_redistdirs)
set(_IRSL_HAVE_Intel TRUE)
endif()
elseif("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "MSVC")
diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake
index 967ad7b..c115f00 100644
--- a/Modules/Internal/CPack/CPackDeb.cmake
+++ b/Modules/Internal/CPack/CPackDeb.cmake
@@ -662,10 +662,12 @@ function(cpack_deb_prepare_package_vars)
# add ldconfig call in default postrm and postint
set(CPACK_ADD_LDCONFIG_CALL 0)
+ # all files in CPACK_DEB_SHARED_OBJECT_FILES have dot at the beginning
+ set(_LDCONF_DEFAULTS "./lib" "./usr/lib")
foreach(_FILE IN LISTS CPACK_DEB_SHARED_OBJECT_FILES)
get_filename_component(_DIR ${_FILE} DIRECTORY)
- # all files in CPACK_DEB_SHARED_OBJECT_FILES have dot at the beginning
- if(_DIR STREQUAL "./lib" OR _DIR STREQUAL "./usr/lib")
+ get_filename_component(_PARENT_DIR ${_DIR} DIRECTORY)
+ if(_DIR IN_LIST _LDCONF_DEFAULTS OR _PARENT_DIR IN_LIST _LDCONF_DEFAULTS)
set(CPACK_ADD_LDCONFIG_CALL 1)
endif()
endforeach()
diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake
index cbd748b..c72bf6d 100644
--- a/Modules/Internal/CPack/CPackRPM.cmake
+++ b/Modules/Internal/CPack/CPackRPM.cmake
@@ -1160,6 +1160,16 @@ function(cpack_rpm_generate_package)
set(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
endif()
+ # CPACK_RPM_REQUIRES_EXCLUDE_FROM
+ # May be defined to keep the dependency generator from
+ # scanning specific files or directories for deps.
+ if(CPACK_RPM_REQUIRES_EXCLUDE_FROM)
+ if(CPACK_RPM_PACKAGE_DEBUG)
+ message("CPackRPM:Debug: User defined CPACK_RPM_REQUIRES_EXCLUDE_FROM = ${CPACK_RPM_REQUIRES_EXCLUDE_FROM}")
+ endif()
+ set(TMP_RPM_REQUIRES_EXCLUDE_FROM "%global __requires_exclude_from ${CPACK_RPM_REQUIRES_EXCLUDE_FROM}")
+ endif()
+
# CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE)
# CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE)
# CPACK_RPM_POST_TRANS_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_TRANS_SCRIPT_FILE)
@@ -1648,6 +1658,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
\@FILE_NAME_DEFINE\@
%define _unpackaged_files_terminate_build 0
\@TMP_RPM_SPEC_INSTALL_POST\@
+\@TMP_RPM_REQUIRES_EXCLUDE_FROM\@
\@CPACK_RPM_SPEC_MORE_DEFINE\@
\@CPACK_RPM_COMPRESSION_TYPE_TMP\@
@@ -1782,6 +1793,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
\@FILE_NAME_DEFINE\@
%define _unpackaged_files_terminate_build 0
\@TMP_RPM_SPEC_INSTALL_POST\@
+\@TMP_RPM_REQUIRES_EXCLUDE_FROM\@
\@CPACK_RPM_SPEC_MORE_DEFINE\@
\@CPACK_RPM_COMPRESSION_TYPE_TMP\@
diff --git a/Modules/Internal/CPack/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in
index 0a9c487..1df8a58 100644
--- a/Modules/Internal/CPack/NSIS.template.in
+++ b/Modules/Internal/CPack/NSIS.template.in
@@ -540,7 +540,7 @@ FunctionEnd
@CPACK_NSIS_INSTALLER_WELCOME_TITLE_3LINES_CODE@
!insertmacro MUI_PAGE_WELCOME
- !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
+ @CPACK_NSIS_LICENSE_PAGE@
Page custom InstallOptionsPage
!insertmacro MUI_PAGE_DIRECTORY
@@ -564,21 +564,27 @@ FunctionEnd
;Languages
!insertmacro MUI_LANGUAGE "English" ;first language is the default language
+ !insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_LANGUAGE "Albanian"
!insertmacro MUI_LANGUAGE "Arabic"
+ !insertmacro MUI_LANGUAGE "Asturian"
!insertmacro MUI_LANGUAGE "Basque"
!insertmacro MUI_LANGUAGE "Belarusian"
!insertmacro MUI_LANGUAGE "Bosnian"
!insertmacro MUI_LANGUAGE "Breton"
!insertmacro MUI_LANGUAGE "Bulgarian"
+ !insertmacro MUI_LANGUAGE "Catalan"
+ !insertmacro MUI_LANGUAGE "Corsican"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Dutch"
+ !insertmacro MUI_LANGUAGE "Esperanto"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Farsi"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "French"
+ !insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Hebrew"
@@ -597,22 +603,29 @@ FunctionEnd
!insertmacro MUI_LANGUAGE "Malay"
!insertmacro MUI_LANGUAGE "Mongolian"
!insertmacro MUI_LANGUAGE "Norwegian"
+ !insertmacro MUI_LANGUAGE "NorwegianNynorsk"
+ !insertmacro MUI_LANGUAGE "Pashto"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Russian"
+ !insertmacro MUI_LANGUAGE "ScotsGaelic"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "SerbianLatin"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Spanish"
+ !insertmacro MUI_LANGUAGE "SpanishInternational"
!insertmacro MUI_LANGUAGE "Swedish"
+ !insertmacro MUI_LANGUAGE "Tatar"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "TradChinese"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Ukrainian"
+ !insertmacro MUI_LANGUAGE "Uzbek"
+ !insertmacro MUI_LANGUAGE "Vietnamese"
!insertmacro MUI_LANGUAGE "Welsh"
;--------------------------------
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 5c8f152..9808861 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -192,12 +192,17 @@ ensure generated files will receive the required settings.
If set to ``TRUE``, implicit dependencies are generated by the ``swig`` tool
itself. This property is only meaningful for
:ref:`Makefile <Makefile Generators>`,
- :ref:`Ninja <Ninja Generators>` and :generator:`Xcode` generators. Default
- value is ``FALSE``.
+ :ref:`Ninja <Ninja Generators>`, :generator:`Xcode`, and
+ :ref:`Visual Studio <Visual Studio Generators>`
+ (:generator:`Visual Studio 11 2012` and above) generators. Default value is
+ ``FALSE``.
.. versionadded:: 3.21
Added the support of :generator:`Xcode` generator.
+ .. versionadded:: 3.22
+ Added the support of :ref:`Visual Studio Generators`.
+
``SWIG_MODULE_NAME``
Specify the actual import name of the module in the target language.
This is required if it cannot be scanned automatically from source
@@ -342,8 +347,10 @@ as well as ``SWIG``:
If set to ``TRUE``, implicit dependencies are generated by the ``swig`` tool
itself. This variable is only meaningful for
:ref:`Makefile <Makefile Generators>`,
- :ref:`Ninja <Ninja Generators>` and :generator:`Xcode` generators. Default
- value is ``FALSE``.
+ :ref:`Ninja <Ninja Generators>`, :generator:`Xcode`, and
+ :ref:`Visual Studio <Visual Studio Generators>`
+ (:generator:`Visual Studio 11 2012` and above) generators. Default value is
+ ``FALSE``.
Source file property ``USE_SWIG_DEPENDENCIES``, if not defined, will be
initialized with the value of this variable.
@@ -351,6 +358,9 @@ as well as ``SWIG``:
.. versionadded:: 3.21
Added the support of :generator:`Xcode` generator.
+ .. versionadded:: 3.22
+ Added the support of :ref:`Visual Studio Generators`.
+
#]=======================================================================]
cmake_policy(PUSH)
@@ -515,7 +525,7 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
endif()
set (use_swig_dependencies ${SWIG_USE_SWIG_DEPENDENCIES})
- if (CMAKE_GENERATOR MATCHES "Make|Ninja|Xcode")
+ if (CMAKE_GENERATOR MATCHES "Make|Ninja|Xcode|Visual Studio (1[1-9]|[2-9][0-9])")
get_property(use_swig_dependencies_set SOURCE "${infile}" PROPERTY USE_SWIG_DEPENDENCIES SET)
if (use_swig_dependencies_set)
get_property(use_swig_dependencies SOURCE "${infile}" PROPERTY USE_SWIG_DEPENDENCIES)
@@ -840,8 +850,9 @@ function(SWIG_ADD_LIBRARY name)
set(SWIG_SOURCE_FILE_EXTENSIONS ".i")
endif()
- if (CMAKE_GENERATOR MATCHES "Make|Ninja|Xcode")
- # For Makefiles and Ninja generators, use SWIG generated dependencies
+ if (CMAKE_GENERATOR MATCHES "Make|Ninja|Xcode|Visual Studio (1[1-9]|[2-9][0-9])")
+ # For Makefiles, Ninja, Xcode and Visual Studio generators,
+ # use SWIG generated dependencies if requested
if (NOT DEFINED SWIG_USE_SWIG_DEPENDENCIES)
set (SWIG_USE_SWIG_DEPENDENCIES OFF)
endif()
diff --git a/Modules/VTKCompatibility.cmake b/Modules/VTKCompatibility.cmake
index 1b0815e..4ee7643 100644
--- a/Modules/VTKCompatibility.cmake
+++ b/Modules/VTKCompatibility.cmake
@@ -1,6 +1,10 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
+# Not needed for "modern" VTK.
+if (EXISTS "${VTK_SOURCE_DIR}/CMake/vtkModule.cmake")
+ return ()
+endif ()
if(APPLE)
set(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY}")