diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CPack.cmake | 4 | ||||
-rw-r--r-- | Modules/Compiler/AppleClang-OBJCXX.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/GNU-OBJC.cmake | 4 | ||||
-rw-r--r-- | Modules/Compiler/GNU-OBJCXX.cmake | 6 | ||||
-rw-r--r-- | Modules/FindMatlab.cmake | 19 | ||||
-rw-r--r-- | Modules/Internal/CPack/CPackDeb.cmake | 11 |
6 files changed, 32 insertions, 14 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 c8cae2e..92ee729 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -241,6 +241,8 @@ if(NOT MATLAB_ADDITIONAL_VERSIONS) endif() set(MATLAB_VERSIONS_MAPPING + "R2019b=9.7" + "R2019a=9.6" "R2018b=9.5" "R2018a=9.4" "R2017b=9.3" @@ -974,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/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() |