summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPackDeb.cmake8
-rw-r--r--Modules/CPackIFW.cmake68
-rw-r--r--Modules/CPackRPM.cmake30
-rw-r--r--Modules/Compiler/AppleClang-C.cmake10
-rw-r--r--Modules/Compiler/AppleClang-CXX.cmake10
-rw-r--r--Modules/Compiler/Clang-C.cmake10
-rw-r--r--Modules/Compiler/Clang-CXX.cmake10
-rw-r--r--Modules/Compiler/GNU-C.cmake10
-rw-r--r--Modules/Compiler/GNU-CXX.cmake10
-rw-r--r--Modules/Compiler/Intel-C-FeatureTests.cmake9
-rw-r--r--Modules/Compiler/Intel-C.cmake13
-rw-r--r--Modules/Compiler/Intel-CXX-FeatureTests.cmake73
-rw-r--r--Modules/Compiler/Intel-CXX.cmake50
-rw-r--r--Modules/Compiler/MSVC-CXX.cmake9
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake10
-rw-r--r--Modules/ExternalProject.cmake14
-rw-r--r--Modules/FindHDF5.cmake12
-rw-r--r--Modules/FindMatlab.cmake3
-rw-r--r--Modules/FindPkgConfig.cmake2
-rw-r--r--Modules/FindSDL.cmake7
-rw-r--r--Modules/FindSDL_sound.cmake7
-rw-r--r--Modules/FortranCInterface/CMakeLists.txt3
-rw-r--r--Modules/Internal/FeatureTesting.cmake12
-rw-r--r--Modules/MatlabTestsRedirect.cmake4
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake8
-rw-r--r--Modules/Platform/Darwin.cmake24
-rw-r--r--Modules/Platform/Fuchsia.cmake25
-rw-r--r--Modules/UseSWIG.cmake16
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake7
29 files changed, 275 insertions, 199 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 653283c..909a12b 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -32,11 +32,11 @@
# - https://cmake.org/Wiki/CMake:CPackConfiguration
# - https://cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
#
-# List of CPackRPM specific variables:
+# List of CPackDEB specific variables:
#
-# .. variable:: CPACK_DEB_PACKAGE_COMPONENT
+# .. variable:: CPACK_DEB_COMPONENT_INSTALL
#
-# Enable component packaging for CPackRPM
+# Enable component packaging for CPackDEB
#
# * Mandatory : NO
# * Default : OFF
@@ -616,7 +616,7 @@ function(cpack_deb_prepare_package_vars)
find_program(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps)
if(SHLIBDEPS_EXECUTABLE)
- # Check version of the dpkg-shlibdeps tool using CPackRPM method
+ # Check version of the dpkg-shlibdeps tool using CPackDEB method
execute_process(COMMAND env LC_ALL=C ${SHLIBDEPS_EXECUTABLE} --version
OUTPUT_VARIABLE _TMP_VERSION
ERROR_QUIET
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index 6c93ddb..08078cb 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -433,11 +433,15 @@
# Default path
-set(_CPACK_IFW_PATHS
- "${QTIFWDIR}"
- "$ENV{QTIFWDIR}"
- "${QTDIR}"
- "$ENV{QTIFWDIR}")
+foreach(_CPACK_IFW_PATH_VAR "QTIFWDIR" "QTDIR")
+ if(DEFINED ${_CPACK_IFW_PATH_VAR}
+ AND NOT "${${_CPACK_IFW_PATH_VAR}}" STREQUAL "")
+ list(APPEND _CPACK_IFW_PATHS "${${_CPACK_IFW_PATH_VAR}}")
+ endif()
+ if(NOT "$ENV{${_CPACK_IFW_PATH_VAR}}" STREQUAL "")
+ list(APPEND _CPACK_IFW_PATHS "$ENV{${_CPACK_IFW_PATH_VAR}}")
+ endif()
+endforeach()
if(WIN32)
list(APPEND _CPACK_IFW_PATHS
"$ENV{HOMEDRIVE}/Qt"
@@ -447,22 +451,44 @@ else()
"$ENV{HOME}/Qt"
"/opt/Qt")
endif()
-
-set(_CPACK_IFW_SUFFIXES
-# Common
- "bin"
-# Second branch
- "QtIFW2.3.0/bin"
- "QtIFW2.2.0/bin"
- "QtIFW2.1.0/bin"
- "QtIFW2.0.3/bin"
- "QtIFW2.0.1/bin"
- "QtIFW2.0.0/bin"
-# First branch
- "QtIFW-1.6.0/bin"
- "QtIFW-1.5.0/bin"
- "QtIFW-1.4.0/bin"
- "QtIFW-1.3.0/bin")
+list(REMOVE_DUPLICATES _CPACK_IFW_PATHS)
+
+set(_CPACK_IFW_PREFIXES
+ # QtSDK
+ "Tools/QtInstallerFramework/"
+ # Second branch
+ "QtIFW"
+ # First branch
+ "QtIFW-")
+
+set(_CPACK_IFW_VERSIONS
+ "2.3"
+ "2.3.0"
+ "2.2"
+ "2.2.0"
+ "2.1"
+ "2.1.0"
+ "2.0"
+ "2.0.3"
+ "2.0.2"
+ "2.0.1"
+ "2.0.0"
+ "1.6"
+ "1.6.0"
+ "1.5"
+ "1.5.0"
+ "1.4"
+ "1.4.0"
+ "1.3"
+ "1.3.0")
+
+set(_CPACK_IFW_SUFFIXES "bin")
+foreach(_CPACK_IFW_PREFIX ${_CPACK_IFW_PREFIXES})
+ foreach(_CPACK_IFW_VERSION ${_CPACK_IFW_VERSIONS})
+ list(APPEND
+ _CPACK_IFW_SUFFIXES "${_CPACK_IFW_PREFIX}${_CPACK_IFW_VERSION}/bin")
+ endforeach()
+endforeach()
# Look for 'binarycreator'
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 6017ce3..39697f0 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -45,7 +45,7 @@
#
# List of CPackRPM specific variables:
#
-# .. variable:: CPACK_RPM_PACKAGE_COMPONENT
+# .. variable:: CPACK_RPM_COMPONENT_INSTALL
#
# Enable component packaging for CPackRPM
#
@@ -472,7 +472,7 @@
# May be used to embed a pre (un)installation script in the spec file.
# The referred script file (or both) will be read and directly
# put after the ``%pre`` or ``%preun`` section
-# If :variable:`CPACK_RPM_PACKAGE_COMPONENT` is set to ON the (un)install
+# If :variable:`CPACK_RPM_COMPONENT_INSTALL` is set to ON the (un)install
# script for each component can be overridden with
# ``CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE`` and
# ``CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE``.
@@ -491,7 +491,7 @@
# May be used to embed a post (un)installation script in the spec file.
# The referred script file (or both) will be read and directly
# put after the ``%post`` or ``%postun`` section.
-# If :variable:`CPACK_RPM_PACKAGE_COMPONENT` is set to ON the (un)install
+# If :variable:`CPACK_RPM_COMPONENT_INSTALL` is set to ON the (un)install
# script for each component can be overridden with
# ``CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE`` and
# ``CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE``.
@@ -1844,6 +1844,12 @@ function(cpack_rpm_generate_package)
set(CPACK_RPM_PACKAGE_RELOCATABLE FALSE) # disable relocatable option if building source RPM
endif()
+ execute_process(
+ COMMAND "${RPMBUILD_EXECUTABLE}" --querytags
+ OUTPUT_VARIABLE RPMBUILD_TAG_LIST
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ string(REPLACE "\n" ";" RPMBUILD_TAG_LIST "${RPMBUILD_TAG_LIST}")
+
# Check if additional fields for RPM spec header are given
# There may be some COMPONENT specific variables as well
# If component specific var is not provided we use the global one
@@ -1852,6 +1858,7 @@ function(cpack_rpm_generate_package)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
endif()
+
if(CPACK_RPM_PACKAGE_COMPONENT)
cpack_rpm_variable_fallback("CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}"
"CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}"
@@ -1859,9 +1866,24 @@ function(cpack_rpm_generate_package)
endif()
if(DEFINED CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER})
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0057 NEW)
+ # Prefix can be replaced by Prefixes but the old version stil works so we'll ignore it for now
+ # Requires* is a special case because it gets transformed to Requires(pre/post/preun/postun)
+ # Auto* is a special case because the tags can not be queried by querytags rpmbuild flag
+ set(special_case_tags_ PREFIX REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN AUTOPROV AUTOREQ AUTOREQPROV)
+ if(NOT _RPM_SPEC_HEADER IN_LIST RPMBUILD_TAG_LIST AND NOT _RPM_SPEC_HEADER IN_LIST special_case_tags_)
+ cmake_policy(POP)
+ message(AUTHOR_WARNING "CPackRPM:Warning: ${_RPM_SPEC_HEADER} not "
+ "supported in provided rpmbuild. Tag will not be used.")
+ continue()
+ endif()
+ cmake_policy(POP)
+
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
endif()
+
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
endif()
@@ -2416,6 +2438,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
\@TMP_RPM_PROVIDES\@
\@TMP_RPM_OBSOLETES\@
\@TMP_RPM_CONFLICTS\@
+\@TMP_RPM_SUGGESTS\@
\@TMP_RPM_AUTOPROV\@
\@TMP_RPM_AUTOREQ\@
\@TMP_RPM_AUTOREQPROV\@
@@ -2470,6 +2493,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
\@TMP_RPM_PROVIDES\@
\@TMP_RPM_OBSOLETES\@
\@TMP_RPM_CONFLICTS\@
+\@TMP_RPM_SUGGESTS\@
\@TMP_RPM_AUTOPROV\@
\@TMP_RPM_AUTOREQ\@
\@TMP_RPM_AUTOREQPROV\@
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index 1cc72c0..fe39b3b 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -25,18 +25,14 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
endif()
macro(cmake_record_c_compile_features)
- macro(_get_appleclang_features std_version list)
- record_compiler_features(C "${std_version}" ${list})
- endmacro()
-
set(_result 0)
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
- _get_appleclang_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES)
+ _record_compiler_features_c(11)
if (_result EQUAL 0)
- _get_appleclang_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES)
+ _record_compiler_features_c(99)
endif()
if (_result EQUAL 0)
- _get_appleclang_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES)
+ _record_compiler_features_c(90)
endif()
endif()
endmacro()
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake
index 95bc79a..8dd6278 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -36,21 +36,17 @@ endif()
macro(cmake_record_cxx_compile_features)
- macro(_get_appleclang_features std_version list)
- record_compiler_features(CXX "${std_version}" ${list})
- endmacro()
-
set(_result 0)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
set(_result 0)
if(CMAKE_CXX14_STANDARD_COMPILE_OPTION)
- _get_appleclang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES)
+ _record_compiler_features_cxx(14)
endif()
if (_result EQUAL 0)
- _get_appleclang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
+ _record_compiler_features_cxx(11)
endif()
if (_result EQUAL 0)
- _get_appleclang_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES)
+ _record_compiler_features_cxx(98)
endif()
endif()
endmacro()
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index d8b7743..b3f3805 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -34,18 +34,14 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
endif()
macro(cmake_record_c_compile_features)
- macro(_get_clang_features std_version list)
- record_compiler_features(C "${std_version}" ${list})
- endmacro()
-
set(_result 0)
if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
- _get_clang_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES)
+ _record_compiler_features_c(11)
if (_result EQUAL 0)
- _get_clang_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES)
+ _record_compiler_features_c(99)
endif()
if (_result EQUAL 0)
- _get_clang_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES)
+ _record_compiler_features_c(90)
endif()
endif()
endmacro()
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index dc62711..dfe0628 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -44,18 +44,14 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
endif()
macro(cmake_record_cxx_compile_features)
- macro(_get_clang_features std_version list)
- record_compiler_features(CXX "${std_version}" ${list})
- endmacro()
-
set(_result 0)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
- _get_clang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES)
+ _record_compiler_features_cxx(14)
if (_result EQUAL 0)
- _get_clang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
+ _record_compiler_features_cxx(11)
endif()
if (_result EQUAL 0)
- _get_clang_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES)
+ _record_compiler_features_cxx(98)
endif()
endif()
endmacro()
diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake
index 2c478da..4dbf6ef 100644
--- a/Modules/Compiler/GNU-C.cmake
+++ b/Modules/Compiler/GNU-C.cmake
@@ -40,20 +40,16 @@ endif()
macro(cmake_record_c_compile_features)
- macro(_get_gcc_features std_version list)
- record_compiler_features(C "${std_version}" ${list})
- endmacro()
-
set(_result 0)
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
- _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES)
+ _record_compiler_features_c(11)
endif()
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
if (_result EQUAL 0)
- _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES)
+ _record_compiler_features_c(99)
endif()
if (_result EQUAL 0)
- _get_gcc_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES)
+ _record_compiler_features_c(90)
endif()
endif()
endmacro()
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index e1c555b..936f62b 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -47,20 +47,16 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
endif()
macro(cmake_record_cxx_compile_features)
- macro(_get_gcc_features std_version list)
- record_compiler_features(CXX "${std_version}" ${list})
- endmacro()
-
set(_result 0)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
- _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES)
+ _record_compiler_features_cxx(14)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
if (_result EQUAL 0)
- _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
+ _record_compiler_features_cxx(11)
endif()
if (_result EQUAL 0)
- _get_gcc_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES)
+ _record_compiler_features_cxx(98)
endif()
endif()
endmacro()
diff --git a/Modules/Compiler/Intel-C-FeatureTests.cmake b/Modules/Compiler/Intel-C-FeatureTests.cmake
index 34175c8..5d09767 100644
--- a/Modules/Compiler/Intel-C-FeatureTests.cmake
+++ b/Modules/Compiler/Intel-C-FeatureTests.cmake
@@ -3,15 +3,11 @@
# - https://software.intel.com/en-us/articles/c99-support-in-intel-c-compiler
# - https://software.intel.com/en-us/articles/c11-support-in-intel-c-compiler
-# FIXME: Intel C feature detection works only when simulating the GNU compiler.
-if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
- return()
-endif()
-
set(DETECT_C99 "defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L")
+set(DETECT_C11 "defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L")
#static assert is only around in version 1500 update 2 and above
-set(_cmake_feature_test_c_static_assert "(__INTEL_COMPILER > 1500 || (__INTEL_COMPILER == 1500 && __INTEL_COMPILER_UPDATE > 1) ) && ${DETECT_C99}")
+set(_cmake_feature_test_c_static_assert "(__INTEL_COMPILER > 1500 || (__INTEL_COMPILER == 1500 && __INTEL_COMPILER_UPDATE > 1) ) && (${DETECT_C11} || ${DETECT_C99} && !defined(_MSC_VER))")
set(_cmake_oldestSupported "__INTEL_COMPILER >= 1110")
set(Intel_C99 "${_cmake_oldestSupported} && ${DETECT_C99}")
@@ -21,3 +17,4 @@ set(_cmake_feature_test_c_function_prototypes "${_cmake_oldestSupported}")
unset(Intel_C99)
unset(DETECT_C99)
+unset(DETECT_C11)
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index 61adf40..5a79452 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -47,21 +47,16 @@ unset(_std)
unset(_ext)
macro(cmake_record_c_compile_features)
- macro(_get_intel_c_features std_version list)
- record_compiler_features(C "${std_version}" ${list})
- endmacro()
-
set(_result 0)
- if (NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" AND
- NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1)
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0)
- _get_intel_c_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES)
+ _record_compiler_features_C(11)
endif()
if (_result EQUAL 0)
- _get_intel_c_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES)
+ _record_compiler_features_C(99)
endif()
if (_result EQUAL 0)
- _get_intel_c_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES)
+ _record_compiler_features_C(90)
endif()
endif()
endmacro()
diff --git a/Modules/Compiler/Intel-CXX-FeatureTests.cmake b/Modules/Compiler/Intel-CXX-FeatureTests.cmake
index e111c07..e370647 100644
--- a/Modules/Compiler/Intel-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/Intel-CXX-FeatureTests.cmake
@@ -1,16 +1,19 @@
# References:
# - https://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler
# - https://software.intel.com/en-us/articles/c14-features-supported-by-intel-c-compiler
+# - http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0096r3.html
-# FIXME: Intel C++ feature detection works only when simulating the GNU compiler.
-# When simulating MSVC, Intel always sets __cplusplus to 199711L.
-if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
- return()
-endif()
+# Notes:
+# [1] Some Intel versions define some feature macros under -std=gnu++98
+# that do not work in that mode (or work with warnings):
+# - __cpp_attributes 200809
+# - __cpp_init_captures 201304
+# - __cpp_lambdas 200907
+# - __cpp_rvalue_references 200610
+# - __cpp_variadic_templates 200704
-# these are not implemented in any version at time of writing
-#set(_cmake_feature_test_cxx_variable_templates "${Intel15_CXX14}")
-#set(_cmake_feature_test_cxx_relaxed_constexpr "${Intel15_CXX14}")
+set(_cmake_feature_test_cxx_variable_templates "__cpp_variable_templates >= 201304")
+set(_cmake_feature_test_cxx_relaxed_constexpr "__cpp_constexpr >= 201304")
set(_cmake_oldestSupported "__INTEL_COMPILER >= 1210")
set(DETECT_CXX11 "((__cplusplus >= 201103L) || defined(__INTEL_CXX11_MODE__) || defined(__GXX_EXPERIMENTAL_CXX0X__))")
@@ -18,44 +21,50 @@ set(DETECT_CXX11 "((__cplusplus >= 201103L) || defined(__INTEL_CXX11_MODE__) ||
#if you are compiling as 98/11/14. So to properly detect C++14 with this version
#we look for the existence of __GXX_EXPERIMENTAL_CXX0X__ but not __INTEL_CXX11_MODE__
set(DETECT_BUGGY_ICC15 "((__INTEL_COMPILER == 1500) && (__INTEL_COMPILER_UPDATE == 1))")
-set(DETECT_CXX14 "((__cplusplus >= 201300L) || ((__cplusplus == 201103L) && !defined(__INTEL_CXX11_MODE__)) || ((${DETECT_BUGGY_ICC15}) && defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(__INTEL_CXX11_MODE__) ) )")
+set(DETECT_CXX14 "((__cplusplus >= 201300L) || ((__cplusplus == 201103L) && !defined(__INTEL_CXX11_MODE__)) || ((${DETECT_BUGGY_ICC15}) && defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(__INTEL_CXX11_MODE__) ) || (defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)) )")
+unset(DETECT_BUGGY_ICC15)
set(Intel16_CXX14 "__INTEL_COMPILER >= 1600 && ${DETECT_CXX14}")
set(_cmake_feature_test_cxx_aggregate_default_initializers "${Intel16_CXX14}")
set(_cmake_feature_test_cxx_contextual_conversions "${Intel16_CXX14}")
-set(_cmake_feature_test_cxx_generic_lambdas "${Intel16_CXX14}")
+set(_cmake_feature_test_cxx_generic_lambdas "__cpp_generic_lambdas >= 201304")
set(_cmake_feature_test_cxx_digit_separators "${Intel16_CXX14}")
# This test is supposed to work in Intel 14 but the compiler has a bug
# in versions 14 and 15::
# https://software.intel.com/en-us/forums/intel-c-compiler/topic/600514
-# It also appears to fail with an internal compiler error on Intel 16.
+# It also appears to fail with an internal compiler error on Intel 16 and 17.
#set(_cmake_feature_test_cxx_generalized_initializers "${Intel16_CXX14}")
+unset(Intel16_CXX14)
-set(Intel15_CXX14 "__INTEL_COMPILER >= 1500 && ${DETECT_CXX14}")
-set(_cmake_feature_test_cxx_decltype_auto "${Intel15_CXX14}")
-set(_cmake_feature_test_cxx_lambda_init_captures "${Intel15_CXX14}")
+set(Intel15 "__INTEL_COMPILER >= 1500")
+set(Intel15_CXX14 "${Intel15} && ${DETECT_CXX14}")
+set(_cmake_feature_test_cxx_decltype_auto "__cpp_decltype_auto >= 201304 || ${Intel15_CXX14}")
+set(_cmake_feature_test_cxx_lambda_init_captures "(__cpp_init_captures >= 201304 || ${Intel15}) && ${DETECT_CXX14}") # [1]
set(_cmake_feature_test_cxx_attribute_deprecated "${Intel15_CXX14}")
-set(_cmake_feature_test_cxx_return_type_deduction "${Intel15_CXX14}")
+set(_cmake_feature_test_cxx_return_type_deduction "__cpp_return_type_deduction >= 201304 || ${Intel15_CXX14}")
+unset(Intel15_CXX14)
+unset(Intel15)
set(Intel15_CXX11 "__INTEL_COMPILER >= 1500 && ${DETECT_CXX11}")
set(_cmake_feature_test_cxx_alignas "${Intel15_CXX11}")
set(_cmake_feature_test_cxx_alignof "${Intel15_CXX11}")
set(_cmake_feature_test_cxx_inheriting_constructors "${Intel15_CXX11}")
-set(_cmake_feature_test_cxx_user_literals "${Intel15_CXX11}")
+set(_cmake_feature_test_cxx_user_literals "__cpp_user_defined_literals >= 200809 || (${Intel15_CXX11} && (!defined(_MSC_VER) || __INTEL_COMPILER >= 1600))")
set(_cmake_feature_test_cxx_thread_local "${Intel15_CXX11}")
+unset(Intel15_CXX11)
set(Intel14_CXX11 "${DETECT_CXX11} && (__INTEL_COMPILER > 1400 || (__INTEL_COMPILER == 1400 && __INTEL_COMPILER_UPDATE >= 2))")
# Documented as 12.0+ but in testing it only works on 14.0.2+
-set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${Intel14_CXX11}")
+set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${Intel14_CXX11} && !defined(_MSC_VER)")
set(Intel14_CXX11 "__INTEL_COMPILER >= 1400 && ${DETECT_CXX11}")
set(_cmake_feature_test_cxx_delegating_constructors "${Intel14_CXX11}")
-set(_cmake_feature_test_cxx_constexpr "${Intel14_CXX11}")
+set(_cmake_feature_test_cxx_constexpr "__cpp_constexpr >= 200704 || ${Intel14_CXX11}")
set(_cmake_feature_test_cxx_sizeof_member "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_strong_enums "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_reference_qualified_functions "${Intel14_CXX11}")
-set(_cmake_feature_test_cxx_raw_string_literals "${Intel14_CXX11}")
-set(_cmake_feature_test_cxx_unicode_literals "${Intel14_CXX11}")
+set(_cmake_feature_test_cxx_raw_string_literals "__cpp_raw_strings >= 200710 || ${Intel14_CXX11}")
+set(_cmake_feature_test_cxx_unicode_literals "__cpp_unicode_literals >= 200710 || (${Intel14_CXX11} && (!defined(_MSC_VER) || __INTEL_COMPILER >= 1600))")
set(_cmake_feature_test_cxx_inline_namespaces "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_unrestricted_unions "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_nonstatic_member_init "${Intel14_CXX11}")
@@ -64,29 +73,32 @@ set(_cmake_feature_test_cxx_override "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_final "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_noexcept "${Intel14_CXX11}")
set(_cmake_feature_test_cxx_defaulted_move_initializers "${Intel14_CXX11}")
+unset(Intel14_CXX11)
set(Intel13_CXX11 "__INTEL_COMPILER >= 1300 && ${DETECT_CXX11}")
set(_cmake_feature_test_cxx_explicit_conversions "${Intel13_CXX11}")
set(_cmake_feature_test_cxx_range_for "${Intel13_CXX11}")
# Cannot find Intel documentation for N2640: cxx_uniform_initialization
set(_cmake_feature_test_cxx_uniform_initialization "${Intel13_CXX11}")
+unset(Intel13_CXX11)
-set(Intel121_CXX11 "${_cmake_oldestSupported} && ${DETECT_CXX11}")
-set(_cmake_feature_test_cxx_variadic_templates "${Intel121_CXX11}")
+set(Intel121 "${_cmake_oldestSupported}")
+set(Intel121_CXX11 "${Intel121} && ${DETECT_CXX11}")
+set(_cmake_feature_test_cxx_variadic_templates "(__cpp_variadic_templates >= 200704 || ${Intel121}) && ${DETECT_CXX11}") # [1]
set(_cmake_feature_test_cxx_alias_templates "${Intel121_CXX11}")
set(_cmake_feature_test_cxx_nullptr "${Intel121_CXX11}")
set(_cmake_feature_test_cxx_trailing_return_types "${Intel121_CXX11}")
-set(_cmake_feature_test_cxx_attributes "${Intel121_CXX11}")
+set(_cmake_feature_test_cxx_attributes "(__cpp_attributes >= 200809 || ${Intel121}) && ${DETECT_CXX11}") # [1]
set(_cmake_feature_test_cxx_default_function_template_args "${Intel121_CXX11}")
set(_cmake_feature_test_cxx_extended_friend_declarations "${Intel121_CXX11}")
-set(_cmake_feature_test_cxx_rvalue_references "${Intel121_CXX11}")
-set(_cmake_feature_test_cxx_decltype "${Intel121_CXX11}")
+set(_cmake_feature_test_cxx_rvalue_references "(__cpp_rvalue_references >= 200610 || ${Intel121}) && ${DETECT_CXX11}") # [1]
+set(_cmake_feature_test_cxx_decltype "__cpp_decltype >= 200707 || ${Intel121_CXX11}")
set(_cmake_feature_test_cxx_defaulted_functions "${Intel121_CXX11}")
set(_cmake_feature_test_cxx_deleted_functions "${Intel121_CXX11}")
set(_cmake_feature_test_cxx_local_type_template_args "${Intel121_CXX11}")
-set(_cmake_feature_test_cxx_lambdas "${Intel121_CXX11}")
-set(_cmake_feature_test_cxx_binary_literals "${Intel121_CXX11}")
-set(_cmake_feature_test_cxx_static_assert "${Intel121_CXX11}")
+set(_cmake_feature_test_cxx_lambdas "(__cpp_lambdas >= 200907 || ${Intel121}) && ${DETECT_CXX11}") # [1]
+set(_cmake_feature_test_cxx_binary_literals "__cpp_binary_literals >= 201304 || ${Intel121}")
+set(_cmake_feature_test_cxx_static_assert "(__cpp_static_assert >= 200410 || ${Intel121}) && ${DETECT_CXX11}")
set(_cmake_feature_test_cxx_right_angle_brackets "${Intel121_CXX11}")
set(_cmake_feature_test_cxx_auto_type "${Intel121_CXX11}")
set(_cmake_feature_test_cxx_extern_templates "${Intel121_CXX11}")
@@ -94,3 +106,8 @@ set(_cmake_feature_test_cxx_variadic_macros "${Intel121_CXX11}")
set(_cmake_feature_test_cxx_long_long_type "${Intel121_CXX11}")
set(_cmake_feature_test_cxx_func_identifier "${Intel121_CXX11}")
set(_cmake_feature_test_cxx_template_template_parameters "${Intel121_CXX11}")
+unset(Intel121_CXX11)
+unset(Intel121)
+
+unset(DETECT_CXX11)
+unset(DETECT_CXX14)
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index 73dd7fa..d01d38d 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -10,19 +10,23 @@ set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <OBJECT> -MF <DEPFILE>")
if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(_std -Qstd)
set(_ext c++)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Qstd=c++14")
+ # todo: there is no gnu++14 value supported; figure out what to do
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-Qstd=c++14")
+ endif()
else()
set(_std -std)
set(_ext gnu++)
-endif()
-
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2)
- set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "${_std}=c++14")
- # todo: there is no gnu++14 value supported; figure out what to do
- set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "${_std}=c++14")
-elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0)
- set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "${_std}=c++1y")
- # todo: there is no gnu++14 value supported; figure out what to do
- set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "${_std}=c++1y")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
+ # todo: there is no gnu++14 value supported; figure out what to do
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++14")
+ elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0)
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y")
+ # todo: there is no gnu++14 value supported; figure out what to do
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++1y")
+ endif()
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0)
@@ -34,8 +38,13 @@ elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
- set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "${_std}=c++98")
- set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "${_std}=${_ext}98")
+ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
+ else()
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "${_std}=c++98")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "${_std}=gnu++98")
+ endif()
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
@@ -55,21 +64,18 @@ unset(_std)
unset(_ext)
macro(cmake_record_cxx_compile_features)
- macro(_get_intel_features std_version list)
- record_compiler_features(CXX "${std_version}" ${list})
- endmacro()
-
set(_result 0)
- if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" AND
- NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0)
- _get_intel_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES)
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0
+ OR (NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" AND
+ NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0))
+ _record_compiler_features_cxx(14)
endif()
if (_result EQUAL 0)
- _get_intel_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
+ _record_compiler_features_cxx(11)
endif()
if (_result EQUAL 0)
- _get_intel_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES)
+ _record_compiler_features_cxx(98)
endif()
endif()
endmacro()
diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake
index 82ce069..f103832 100644
--- a/Modules/Compiler/MSVC-CXX.cmake
+++ b/Modules/Compiler/MSVC-CXX.cmake
@@ -5,5 +5,12 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
endif()
macro(cmake_record_cxx_compile_features)
- record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
+ list(APPEND CMAKE_CXX_COMPILE_FEATURES
+ cxx_std_98
+ cxx_std_11
+ cxx_std_14
+ )
+ _record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES)
+ endif()
endmacro()
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index ce01cdd..e83c896 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -32,6 +32,8 @@ set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_RANLIB> <TARGET> ")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11")
endif()
@@ -49,15 +51,11 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
endif()
macro(cmake_record_cxx_compile_features)
- macro(_get_solaris_studio_features std_version list)
- record_compiler_features(CXX "${std_version}" ${list})
- endmacro()
-
set(_result 0)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
- _get_solaris_studio_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
+ _record_compiler_features_cxx(11)
if (_result EQUAL 0)
- _get_solaris_studio_features("" CMAKE_CXX98_COMPILE_FEATURES)
+ _record_compiler_features_cxx(98)
endif()
endif()
endmacro()
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 1e0be09..1ba4a8f 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -73,6 +73,10 @@ Create custom targets to build projects in external trees
does not output anything which can make the build appear to have stalled.
This option forces Git to output progress information during the clone step
so that forward progress is indicated.
+ ``GIT_CONFIG <option>...``
+ Tell Git to clone with ``--config <option>``. Use additional configuration
+ parameters when cloning the project (``key=value`` as expected by ``git
+ config``).
``HG_REPOSITORY <url>``
URL of mercurial repo
``HG_TAG <tag>``
@@ -514,7 +518,7 @@ define_property(DIRECTORY PROPERTY "EP_UPDATE_DISCONNECTED" INHERITED
"ExternalProject module."
)
-function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name git_submodules git_shallow git_progress src_name work_dir gitclone_infofile gitclone_stampfile tls_verify)
+function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name git_submodules git_shallow git_progress git_config src_name work_dir gitclone_infofile gitclone_stampfile tls_verify)
if(NOT GIT_VERSION_STRING VERSION_LESS 1.7.10)
set(git_clone_shallow_options "--depth 1 --no-single-branch")
else()
@@ -565,6 +569,11 @@ if(git_progress)
list(APPEND git_clone_options --progress)
endif()
+set(git_config \"${git_config}\")
+foreach(config IN LISTS git_config)
+ list(APPEND git_clone_options --config \${config})
+endforeach()
+
# try the clone 3 times incase there is an odd git clone issue
set(error_code 1)
set(number_of_tries 0)
@@ -1812,6 +1821,7 @@ function(_ep_add_download_command name)
endif()
get_property(git_shallow TARGET ${name} PROPERTY _EP_GIT_SHALLOW)
get_property(git_progress TARGET ${name} PROPERTY _EP_GIT_PROGRESS)
+ get_property(git_config TARGET ${name} PROPERTY _EP_GIT_CONFIG)
# For the download step, and the git clone operation, only the repository
# should be recorded in a configured RepositoryInfo file. If the repo
@@ -1836,7 +1846,7 @@ function(_ep_add_download_command name)
# The script will delete the source directory and then call git clone.
#
_ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir}
- ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} "${git_submodules}" "${git_shallow}" "${git_progress}" ${src_name} ${work_dir}
+ ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} "${git_submodules}" "${git_shallow}" "${git_progress}" "${git_config}" ${src_name} ${work_dir}
${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt "${tls_verify}"
)
set(comment "Performing download step (git clone) for '${name}'")
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 1c2c443..16764e0 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -100,18 +100,10 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
set(HDF5_VALID_LANGUAGE_BINDINGS C CXX Fortran)
# Validate the list of find components.
-set(HDF5_LANGUAGE_BINDINGS)
if(NOT HDF5_FIND_COMPONENTS)
- get_property(__langs GLOBAL PROPERTY ENABLED_LANGUAGES)
- foreach(__lang IN LISTS __langs)
- if(__lang MATCHES "^(C|CXX|Fortran)$")
- list(APPEND HDF5_LANGUAGE_BINDINGS ${__lang})
- set(HDF5_FIND_REQUIRED_${__lang} True)
- endif()
- endforeach()
- set(FIND_HL ON)
- set(HDF5_FIND_REQUIRED_HL True)
+ set(HDF5_LANGUAGE_BINDINGS "C")
else()
+ set(HDF5_LANGUAGE_BINDINGS)
# add the extra specified components, ensuring that they are valid.
set(FIND_HL OFF)
foreach(component IN LISTS HDF5_FIND_COMPONENTS)
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index b7f2db5..eae1585 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -225,6 +225,7 @@ if(NOT MATLAB_ADDITIONAL_VERSIONS)
endif()
set(MATLAB_VERSIONS_MAPPING
+ "R2016b=9.1"
"R2016a=9.0"
"R2015b=8.6"
"R2015a=8.5"
@@ -793,7 +794,7 @@ function(matlab_add_unit_test)
"-Dworking_directory=${${prefix}_WORKING_DIRECTORY}"
"-DMatlab_PROGRAM=${Matlab_MAIN_PROGRAM}"
"-Dno_unittest_framework=${${prefix}_NO_UNITTEST_FRAMEWORK}"
- "-DMatlab_ADDITIONNAL_STARTUP_OPTIONS=${${prefix}_MATLAB_ADDITIONAL_STARTUP_OPTIONS}"
+ "-DMatlab_ADDITIONAL_STARTUP_OPTIONS=${${prefix}_MATLAB_ADDITIONAL_STARTUP_OPTIONS}"
"-Dunittest_file_to_run=${${prefix}_UNITTEST_FILE}"
"-Dcustom_Matlab_test_command=${${prefix}_CUSTOM_TEST_COMMAND}"
"-Dcmd_to_run_before_test=${${prefix}_UNITTEST_PRECOMMAND}"
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 072a27a..3f75b19 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -193,7 +193,7 @@ function(_pkg_create_imp_target _prefix _no_cmake_path _no_cmake_environment_pat
foreach (flag IN LISTS ${_prefix}_LDFLAGS)
if (flag MATCHES "^-L(.*)")
# only look into the given paths from now on
- set(_find_opts "HINTS ${${CMAKE_MATCH_1}} NO_DEFAULT_PATH")
+ set(_find_opts HINTS ${CMAKE_MATCH_1} NO_DEFAULT_PATH)
continue()
endif()
if (flag MATCHES "^-l(.*)")
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 4e4411f..3410018 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -94,6 +94,11 @@ find_library(SDL_LIBRARY_TEMP
PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
)
+# Hide this cache variable from the user, it's an internal implementation
+# detail. The documented library variable for the user is SDL_LIBRARY
+# which is derived from SDL_LIBRARY_TEMP further below.
+set_property(CACHE SDL_LIBRARY_TEMP PROPERTY TYPE INTERNAL)
+
if(NOT SDL_BUILDING_LIBRARY)
if(NOT SDL_INCLUDE_DIR MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to
@@ -162,8 +167,6 @@ if(SDL_LIBRARY_TEMP)
# Set the final string here so the GUI reflects the final state.
set(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
- # Set the temp variable to INTERNAL so it is not seen in the CMake GUI
- set(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
endif()
if(SDL_INCLUDE_DIR AND EXISTS "${SDL_INCLUDE_DIR}/SDL_version.h")
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 3198088..cf33a4c 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -19,7 +19,7 @@
# SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
# SDL_SOUND_FOUND, if false, do not try to link to SDL_sound
# SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
-# to link against. This is a read-only variable and is marked INTERNAL.
+# to link against.
# SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
# flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
# This is available mostly for cases this module failed to anticipate for
@@ -367,11 +367,10 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
endif()
endif()
+ set(SDL_SOUND_LIBRARIES ${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP})
else()
- set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARY}" CACHE INTERNAL "SDL_sound and dependent libraries")
+ set(SDL_SOUND_LIBRARIES ${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARY})
endif()
-
- set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries")
endif()
if(SDL_SOUND_INCLUDE_DIR AND EXISTS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h")
diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt
index dee57b5..3a66f68 100644
--- a/Modules/FortranCInterface/CMakeLists.txt
+++ b/Modules/FortranCInterface/CMakeLists.txt
@@ -94,6 +94,9 @@ add_library(myfort STATIC mysub.f my_sub.f ${myfort_modules})
# Provide symbols through C but fall back to Fortran.
add_library(symbols STATIC ${symbol_sources})
target_link_libraries(symbols myfort)
+# In case the Fortran compiler produces PIC by default make sure
+# the C compiler produces PIC even if it is not its default.
+set_property(TARGET symbols PROPERTY POSITION_INDEPENDENT_CODE 1)
# Require symbols through Fortran.
add_executable(FortranCInterface main.F call_sub.f ${call_mod})
diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake
index 86b89b2..50b8526 100644
--- a/Modules/Internal/FeatureTesting.cmake
+++ b/Modules/Internal/FeatureTesting.cmake
@@ -1,5 +1,5 @@
-macro(record_compiler_features lang compile_flags feature_list)
+macro(_record_compiler_features lang compile_flags feature_list)
include("${CMAKE_ROOT}/Modules/Compiler/${CMAKE_${lang}_COMPILER_ID}-${lang}-FeatureTests.cmake" OPTIONAL)
string(TOLOWER ${lang} lang_lc)
@@ -58,3 +58,13 @@ macro(record_compiler_features lang compile_flags feature_list)
"Detecting ${lang} [${compile_flags}] compiler features failed to compile with the following output:\n${_output}\n${_copy_error}\n\n")
endif()
endmacro()
+
+macro(_record_compiler_features_c std)
+ list(APPEND CMAKE_C${std}_COMPILE_FEATURES c_std_${std})
+ _record_compiler_features(C "${CMAKE_C${std}_STANDARD_COMPILE_OPTION}" CMAKE_C${std}_COMPILE_FEATURES)
+endmacro()
+
+macro(_record_compiler_features_cxx std)
+ list(APPEND CMAKE_CXX${std}_COMPILE_FEATURES cxx_std_${std})
+ _record_compiler_features(CXX "${CMAKE_CXX${std}_STANDARD_COMPILE_OPTION}" CMAKE_CXX${std}_COMPILE_FEATURES)
+endmacro()
diff --git a/Modules/MatlabTestsRedirect.cmake b/Modules/MatlabTestsRedirect.cmake
index a0c6621..64d580d 100644
--- a/Modules/MatlabTestsRedirect.cmake
+++ b/Modules/MatlabTestsRedirect.cmake
@@ -10,14 +10,14 @@
# -Dadditional_paths=""
# -Dno_unittest_framework=""
# -DMatlab_PROGRAM=matlab_exe_location
-# -DMatlab_ADDITIONNAL_STARTUP_OPTIONS=""
+# -DMatlab_ADDITIONAL_STARTUP_OPTIONS=""
# -Dtest_name=name_of_the_test
# -Dcustom_Matlab_test_command=""
# -Dcmd_to_run_before_test=""
# -Dunittest_file_to_run
# -P FindMatlab_TestsRedirect.cmake
-set(Matlab_UNIT_TESTS_CMD -nosplash -nodesktop -nodisplay ${Matlab_ADDITIONNAL_STARTUP_OPTIONS})
+set(Matlab_UNIT_TESTS_CMD -nosplash -nodesktop -nodisplay ${Matlab_ADDITIONAL_STARTUP_OPTIONS})
if(WIN32)
set(Matlab_UNIT_TESTS_CMD ${Matlab_UNIT_TESTS_CMD} -wait)
endif()
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 39374e1..b539e45 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -113,7 +113,6 @@ set(CMAKE_OSX_SYSROOT "${_CMAKE_OSX_SYSROOT_DEFAULT}" CACHE ${_CMAKE_OSX_SYSROOT
"The product will be built against the headers and libraries located inside the indicated SDK.")
# Transform the cached value to something we can use.
-set(_CMAKE_OSX_SYSROOT_ORIG "${CMAKE_OSX_SYSROOT}")
set(_CMAKE_OSX_SYSROOT_PATH "")
if(CMAKE_OSX_SYSROOT)
if("x${CMAKE_OSX_SYSROOT}" MATCHES "/")
@@ -122,13 +121,10 @@ if(CMAKE_OSX_SYSROOT)
message(WARNING "Ignoring CMAKE_OSX_SYSROOT value:\n ${CMAKE_OSX_SYSROOT}\n"
"because the directory does not exist.")
set(CMAKE_OSX_SYSROOT "")
- set(_CMAKE_OSX_SYSROOT_ORIG "")
endif()
set(_CMAKE_OSX_SYSROOT_PATH "${CMAKE_OSX_SYSROOT}")
- endif()
-
- if(CMAKE_OSX_SYSROOT)
- # Transform the (maybe unversioned) sysroot into a versioned path.
+ else()
+ # Transform the sdk name into a path.
execute_process(
COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version Path
OUTPUT_VARIABLE _stdout
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index c09bac4..727baa6 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -64,30 +64,6 @@ if(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
endif()
-# Make sure the combination of SDK and Deployment Target are allowed
-if(CMAKE_OSX_DEPLOYMENT_TARGET)
- if("${_CMAKE_OSX_SYSROOT_PATH}" MATCHES "/MacOSX([0-9]+\\.[0-9]+)[^/]*\\.sdk")
- set(_sdk_ver "${CMAKE_MATCH_1}")
- elseif("${_CMAKE_OSX_SYSROOT_ORIG}" MATCHES "^macosx([0-9]+\\.[0-9]+)$")
- set(_sdk_ver "${CMAKE_MATCH_1}")
- elseif("${_CMAKE_OSX_SYSROOT_ORIG}" STREQUAL "/")
- set(_sdk_ver "${_CURRENT_OSX_VERSION}")
- else()
- message(FATAL_ERROR
- "CMAKE_OSX_DEPLOYMENT_TARGET is '${CMAKE_OSX_DEPLOYMENT_TARGET}' "
- "but CMAKE_OSX_SYSROOT:\n \"${_CMAKE_OSX_SYSROOT_ORIG}\"\n"
- "is not set to a MacOSX SDK with a recognized version. "
- "Either set CMAKE_OSX_SYSROOT to a valid SDK or set "
- "CMAKE_OSX_DEPLOYMENT_TARGET to empty.")
- endif()
- if(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER "${_sdk_ver}")
- message(FATAL_ERROR
- "CMAKE_OSX_DEPLOYMENT_TARGET (${CMAKE_OSX_DEPLOYMENT_TARGET}) "
- "is greater than CMAKE_OSX_SYSROOT SDK:\n ${_CMAKE_OSX_SYSROOT_ORIG}\n"
- "Please set CMAKE_OSX_DEPLOYMENT_TARGET to ${_sdk_ver} or lower.")
- endif()
-endif()
-
# Enable shared library versioning.
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
diff --git a/Modules/Platform/Fuchsia.cmake b/Modules/Platform/Fuchsia.cmake
new file mode 100644
index 0000000..896da7b
--- /dev/null
+++ b/Modules/Platform/Fuchsia.cmake
@@ -0,0 +1,25 @@
+set(FUCHSIA 1)
+
+set(CMAKE_DL_LIBS "")
+set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
+set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
+set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
+set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
+
+# Shared libraries with no builtin soname may not be linked safely by
+# specifying the file path.
+set(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1)
+
+# Initialize C link type selection flags. These flags are used when
+# building a shared library, shared module, or executable that links
+# to other libraries to select whether to use the static or shared
+# versions of the libraries.
+foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+ set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+endforeach()
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index d242f87..2df0011 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -36,8 +36,11 @@
#
# CMAKE_SWIG_FLAGS can be used to add special flags to all swig calls.
#
-# Another special variable is CMAKE_SWIG_OUTDIR, it allows one to specify
-# where to write all the swig generated module (swig -outdir option)
+# CMAKE_SWIG_OUTDIR allows one to specify where to write
+# the language specific files (swig -outdir option).
+#
+# SWIG_OUTFILE_DIR allows one to specify where to write the output file
+# (swig -o option). If not specified, CMAKE_SWIG_OUTDIR is used.
#
# The name-specific variable SWIG_MODULE_<name>_EXTRA_DEPS may be used to specify extra
# dependencies for the generated modules.
@@ -142,6 +145,13 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
else()
set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
endif()
+
+ if(SWIG_OUTFILE_DIR)
+ set(swig_outfile_dir ${SWIG_OUTFILE_DIR})
+ else()
+ set(swig_outfile_dir ${swig_outdir})
+ endif()
+
if (NOT SWIG_MODULE_${name}_NOPROXY)
SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE}
swig_extra_generated_files
@@ -149,7 +159,7 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
"${swig_source_file_fullname}")
endif()
set(swig_generated_file_fullname
- "${swig_outdir}/${swig_source_file_name_we}")
+ "${swig_outfile_dir}/${swig_source_file_name_we}")
# add the language into the name of the file (i.e. TCL_wrap)
# this allows for the same .i file to be wrapped into different languages
string(APPEND swig_generated_file_fullname
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index 82e8fba..a390f4b 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -76,6 +76,7 @@
# Available features in this version of CMake are listed in the
# :prop_gbl:`CMAKE_C_KNOWN_FEATURES` and
# :prop_gbl:`CMAKE_CXX_KNOWN_FEATURES` global properties.
+# The ``{c,cxx}_std_*`` meta-features are ignored if requested.
#
# See the :manual:`cmake-compile-features(7)` manual for information on
# compile features.
@@ -358,7 +359,11 @@ function(write_compiler_detection_header
endif()
foreach(feature ${_WCD_FEATURES})
- if (feature MATCHES "^cxx_")
+ if (feature MATCHES "^c_std_")
+ # ignored
+ elseif (feature MATCHES "^cxx_std_")
+ # ignored
+ elseif (feature MATCHES "^cxx_")
list(APPEND _langs CXX)
list(APPEND CXX_features ${feature})
elseif (feature MATCHES "^c_")