summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPack.cmake4
-rw-r--r--Modules/Compiler/AppleClang-OBJCXX.cmake2
-rw-r--r--Modules/Compiler/GNU-OBJC.cmake4
-rw-r--r--Modules/Compiler/GNU-OBJCXX.cmake6
-rw-r--r--Modules/FindMatlab.cmake17
-rw-r--r--Modules/FindPython/Support.cmake5
-rw-r--r--Modules/Internal/CPack/CPackDeb.cmake11
-rw-r--r--Modules/Platform/Darwin.cmake4
-rw-r--r--Modules/Platform/Windows-GNU.cmake2
9 files changed, 39 insertions, 16 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 8a6a712..a1cc71d 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -470,8 +470,10 @@ if(CMAKE_PROJECT_HOMEPAGE_URL)
"${CMAKE_PROJECT_HOMEPAGE_URL}")
endif()
-_cpack_set_default(CPACK_PACKAGE_DESCRIPTION_FILE
+set(CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE
"${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
+_cpack_set_default(CPACK_PACKAGE_DESCRIPTION_FILE
+ "${CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE}")
_cpack_set_default(CPACK_RESOURCE_FILE_LICENSE
"${CMAKE_ROOT}/Templates/CPack.GenericLicense.txt")
_cpack_set_default(CPACK_RESOURCE_FILE_README
diff --git a/Modules/Compiler/AppleClang-OBJCXX.cmake b/Modules/Compiler/AppleClang-OBJCXX.cmake
index 7c6f763..2c084af 100644
--- a/Modules/Compiler/AppleClang-OBJCXX.cmake
+++ b/Modules/Compiler/AppleClang-OBJCXX.cmake
@@ -1,5 +1,7 @@
include(Compiler/Clang-OBJCXX)
+set(CMAKE_OBJCXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
+
if(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_OBJCXX98_STANDARD_COMPILE_OPTION "-std=c++98")
set(CMAKE_OBJCXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
diff --git a/Modules/Compiler/GNU-OBJC.cmake b/Modules/Compiler/GNU-OBJC.cmake
index 5fba801..fb9b0b2 100644
--- a/Modules/Compiler/GNU-OBJC.cmake
+++ b/Modules/Compiler/GNU-OBJC.cmake
@@ -1,6 +1,2 @@
include(Compiler/GNU)
__compiler_gnu(OBJC)
-
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2)
- set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
-endif()
diff --git a/Modules/Compiler/GNU-OBJCXX.cmake b/Modules/Compiler/GNU-OBJCXX.cmake
index 66a547e..06f0244 100644
--- a/Modules/Compiler/GNU-OBJCXX.cmake
+++ b/Modules/Compiler/GNU-OBJCXX.cmake
@@ -1,8 +1,8 @@
include(Compiler/GNU)
-__compiler_gnu(OBJC)
+__compiler_gnu(OBJCXX)
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2)
- set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
+if(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 4.2)
+ set(CMAKE_OBJCXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
if(NOT CMAKE_OBJCXX_LINK_FLAGS)
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 9f6eea9..92ee729 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -976,10 +976,19 @@ function(matlab_add_mex)
endif()
if(NOT Matlab_VERSION_STRING VERSION_LESS "9.1") # For 9.1 (R2016b) and newer, add version source file
- # TODO: check the file extensions in ${${prefix}_SRC} to see if they're C or C++ files
- # Currently, the C and C++ versions of the version files are identical, so this doesn't matter.
- set(MEX_VERSION_FILE "${Matlab_ROOT_DIR}/extern/version/c_mexapi_version.c")
- #set(MEX_VERSION_FILE "${Matlab_ROOT_DIR}/extern/version/cpp_mexapi_version.cpp")
+ # Add the correct version file depending on which languages are enabled in the project
+ if(CMAKE_C_COMPILER_LOADED)
+ # If C is enabled, use the .c file as it will work fine also with C++
+ set(MEX_VERSION_FILE "${Matlab_ROOT_DIR}/extern/version/c_mexapi_version.c")
+ elseif(CMAKE_CXX_COMPILER_LOADED)
+ # If C is not enabled, check if CXX is enabled and use the .cpp file
+ # to avoid that the .c file is silently ignored
+ set(MEX_VERSION_FILE "${Matlab_ROOT_DIR}/extern/version/cpp_mexapi_version.cpp")
+ else()
+ # If neither C or CXX is enabled, warn because we cannot add the source.
+ # TODO: add support for fortran mex files
+ message(WARNING "[MATLAB] matlab_add_mex requires that at least C or CXX are enabled languages")
+ endif()
endif()
if(NOT Matlab_VERSION_STRING VERSION_LESS "9.4") # For 9.4 (R2018a) and newer, add API macro
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index b67d563..3b15354 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -62,6 +62,9 @@ macro (_PYTHON_FIND_FRAMEWORKS)
${CMAKE_SYSTEM_FRAMEWORK_PATH})
list (REMOVE_DUPLICATES _pff_frameworks)
foreach (_pff_framework IN LISTS _pff_frameworks)
+ if (EXISTS ${_pff_framework}/Python${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR}.framework)
+ list (APPEND ${_PYTHON_PREFIX}_FRAMEWORKS ${_pff_framework}/Python${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR}.framework)
+ endif()
if (EXISTS ${_pff_framework}/Python.framework)
list (APPEND ${_PYTHON_PREFIX}_FRAMEWORKS ${_pff_framework}/Python.framework)
endif()
@@ -2269,7 +2272,7 @@ if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT")
endif()
else()
if (${_PYTHON_PREFIX}_LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_LIBRARY_DEBUG)
- set_property (TARGET ${_PYTHON_PREFIX}::Python PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
+ set_property (TARGET ${__name} PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
set_target_properties (${__name}
PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
IMPORTED_LOCATION_RELEASE "${${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake
index ad8e078..3927b1a 100644
--- a/Modules/Internal/CPack/CPackDeb.cmake
+++ b/Modules/Internal/CPack/CPackDeb.cmake
@@ -498,6 +498,11 @@ function(cpack_deb_prepare_package_vars)
# Description: (mandatory)
# Try package description first
+ if(CPACK_USED_DEFAULT_PACKAGE_DESCRIPTION_FILE)
+ set(_desc_fallback)
+ else()
+ set(_desc_fallback "CPACK_PACKAGE_DESCRIPTION")
+ endif()
if(CPACK_DEB_PACKAGE_COMPONENT)
cpack_deb_variable_fallback("CPACK_DEBIAN_PACKAGE_DESCRIPTION"
"CPACK_DEBIAN_${_local_component_name}_DESCRIPTION"
@@ -505,11 +510,13 @@ function(cpack_deb_prepare_package_vars)
else()
cpack_deb_variable_fallback("CPACK_DEBIAN_PACKAGE_DESCRIPTION"
"CPACK_DEBIAN_PACKAGE_DESCRIPTION"
- "CPACK_PACKAGE_DESCRIPTION")
+ ${_desc_fallback})
endif()
# Still no description? ... and description file has set ...
- if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION AND CPACK_PACKAGE_DESCRIPTION_FILE)
+ if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION
+ AND CPACK_PACKAGE_DESCRIPTION_FILE
+ AND NOT CPACK_PACKAGE_DESCRIPTION_FILE STREQUAL CPACK_DEFAULT_PACKAGE_DESCRIPTION_FILE)
# Read `CPACK_PACKAGE_DESCRIPTION_FILE` then...
file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_DEBIAN_PACKAGE_DESCRIPTION)
endif()
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 1482d76..e5a57b5 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -157,6 +157,10 @@ if(_CMAKE_OSX_SYSROOT_PATH)
endif()
endforeach()
endif()
+if (OSX_DEVELOPER_ROOT AND EXISTS "${OSX_DEVELOPER_ROOT}/Library/Frameworks")
+ list(APPEND CMAKE_SYSTEM_FRAMEWORK_PATH
+ ${OSX_DEVELOPER_ROOT}/Library/Frameworks)
+endif()
list(APPEND CMAKE_SYSTEM_FRAMEWORK_PATH
/Library/Frameworks
/Network/Library/Frameworks
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index 71189b1..6bf245c 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -152,7 +152,7 @@ macro(__windows_compiler_gnu_abi lang)
# Query the VS Installer tool for locations of VS 2017 and above.
set(_vs_installer_paths "")
- foreach(vs RANGE 15 15 -1) # change the first number to the largest supported version
+ foreach(vs RANGE 16 15 -1) # change the first number to the largest supported version
cmake_host_system_information(RESULT _vs_dir QUERY VS_${vs}_DIR)
if(_vs_dir)
list(APPEND _vs_installer_paths "${_vs_dir}/VC/Auxiliary/Build")