summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake5
-rw-r--r--Modules/CPackDeb.cmake43
-rw-r--r--Modules/CheckFortranSourceCompiles.cmake17
-rw-r--r--Modules/Compiler/GNU-Fortran.cmake3
-rw-r--r--Modules/Compiler/Intel-Fortran.cmake3
-rw-r--r--Modules/Compiler/SunPro-Fortran.cmake3
-rw-r--r--Modules/CompilerId/Xcode-3.pbxproj.in1
-rw-r--r--Modules/FindBoost.cmake16
-rw-r--r--Modules/FindMatlab.cmake47
-rw-r--r--Modules/FindOpenSSL.cmake12
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake6
11 files changed, 116 insertions, 40 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 64d9bed..3d1ca6d 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -266,6 +266,11 @@ Id flags: ${testflags}
else()
set(id_toolset "")
endif()
+ if("${lang}" STREQUAL "Swift")
+ set(id_lang_version "SWIFT_VERSION = 2.3;")
+ else()
+ set(id_lang_version "")
+ endif()
if(CMAKE_OSX_DEPLOYMENT_TARGET)
set(id_deployment_target
"MACOSX_DEPLOYMENT_TARGET = \"${CMAKE_OSX_DEPLOYMENT_TARGET}\";")
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 423bb00..1a7b923 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -156,18 +156,16 @@
# * Default : :code:`CPACK_PACKAGE_CONTACT`
#
# .. variable:: CPACK_DEBIAN_PACKAGE_DESCRIPTION
-# CPACK_DEBIAN_<COMPONENT>_PACKAGE_DESCRIPTION
+# CPACK_COMPONENT_<COMPONENT>_DESCRIPTION
#
# The Debian package description
#
# * Mandatory : YES
# * Default :
#
-# - :variable:`CPACK_COMPONENT_<compName>_DESCRIPTION` (component based installers only) if set,
-# - :variable:`CPACK_PACKAGE_DESCRIPTION_FILE` if set to non default location,
-# - :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY` if set,
-# - :variable:`CPACK_PACKAGE_DESCRIPTION_FILE` default value if set,
-# - or "no package description available"
+# - :variable:`CPACK_DEBIAN_PACKAGE_DESCRIPTION` if set or
+# - :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY`
+#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_SECTION
# CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION
@@ -831,23 +829,24 @@ function(cpack_deb_prepare_package_vars)
endif()
# Description: (mandatory)
- if(CPACK_DEB_PACKAGE_COMPONENT)
- if(CPACK_DEBIAN_${_local_component_name}_PACKAGE_DESCRIPTION)
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_DEBIAN_${_local_component_name}_PACKAGE_DESCRIPTION}")
- elseif(CPACK_COMPONENT_${_local_component_name}_DESCRIPTION)
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_COMPONENT_${_local_component_name}_DESCRIPTION}")
+ if(NOT CPACK_DEB_PACKAGE_COMPONENT)
+ if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
+ if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+ message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
+ endif()
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
endif()
- endif()
-
- if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
- if(CPACK_PACKAGE_DESCRIPTION_FILE AND NOT "${CPACK_PACKAGE_DESCRIPTION_FILE}" STREQUAL "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
- file(READ "${CPACK_PACKAGE_DESCRIPTION_FILE}" CPACK_DEBIAN_PACKAGE_DESCRIPTION)
- elseif(CPACK_PACKAGE_DESCRIPTION_SUMMARY)
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
- elseif(CPACK_PACKAGE_DESCRIPTION_FILE) # use default package description file content
- file(READ "${CPACK_PACKAGE_DESCRIPTION_FILE}" CPACK_DEBIAN_PACKAGE_DESCRIPTION)
- else()
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "no package description available")
+ else()
+ set(component_description_var CPACK_COMPONENT_${_local_component_name}_DESCRIPTION)
+
+ # component description overrides package description
+ if(${component_description_var})
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${${component_description_var}})
+ elseif(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
+ if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+ message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION or ${component_description_var}")
+ endif()
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
endif()
endif()
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index 0bdcffa..967b830 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -4,7 +4,8 @@
#
# Check if given Fortran source compiles and links into an executable::
#
-# CHECK_Fortran_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>])
+# CHECK_Fortran_SOURCE_COMPILES(<code> <var> [FAIL_REGEX <fail-regex>]
+# [SRC_EXT <ext>])
#
# The arguments are:
#
@@ -13,8 +14,10 @@
# ``<var>``
# Variable to store whether the source code compiled.
# Will be created as an internal cache variable.
-# ``<fail-regex>``
+# ``FAIL_REGEX <fail-regex>``
# Fail if test output matches this regex.
+# ``SRC_EXT <ext>``
+# Use source extension ``.<ext>`` instead of the default ``.F``.
#
# The following variables may be set before calling this macro to modify
# the way the check is run::
@@ -43,9 +46,10 @@
macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR)
if(NOT DEFINED "${VAR}")
set(_FAIL_REGEX)
+ set(_SRC_EXT)
set(_key)
foreach(arg ${ARGN})
- if("${arg}" MATCHES "^(FAIL_REGEX)$")
+ if("${arg}" MATCHES "^(FAIL_REGEX|SRC_EXT)$")
set(_key "${arg}")
elseif(_key)
list(APPEND _${_key} "${arg}")
@@ -53,6 +57,9 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR)
message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
endif()
endforeach()
+ if(NOT _SRC_EXT)
+ set(_SRC_EXT F)
+ endif()
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
if(CMAKE_REQUIRED_LIBRARIES)
@@ -67,7 +74,7 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR)
else()
set(CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES)
endif()
- file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.F"
+ file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}"
"${SOURCE}\n")
if(NOT CMAKE_REQUIRED_QUIET)
@@ -75,7 +82,7 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR)
endif()
try_compile(${VAR}
${CMAKE_BINARY_DIR}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.F
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index fc848ac..94dc275 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/GNU)
__compiler_gnu(Fortran)
+set(CMAKE_Fortran_PREPROCESS_SOURCE
+ "<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
+
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")
diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake
index ef7aa3a..a132055 100644
--- a/Modules/Compiler/Intel-Fortran.cmake
+++ b/Modules/Compiler/Intel-Fortran.cmake
@@ -7,3 +7,6 @@ set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+
+set(CMAKE_Fortran_PREPROCESS_SOURCE
+ "<CMAKE_Fortran_COMPILER> -fpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake
index a0e07d4..6607926 100644
--- a/Modules/Compiler/SunPro-Fortran.cmake
+++ b/Modules/Compiler/SunPro-Fortran.cmake
@@ -18,5 +18,8 @@ string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
set(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
set(CMAKE_Fortran_MODPATH_FLAG "-M")
+set(CMAKE_Fortran_PREPROCESS_SOURCE
+ "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -F <SOURCE> -o <PREPROCESSED_SOURCE>")
+
set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -F <SOURCE> -o <PREPROCESSED_SOURCE>")
set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in
index 20f3da3..22ad4f6 100644
--- a/Modules/CompilerId/Xcode-3.pbxproj.in
+++ b/Modules/CompilerId/Xcode-3.pbxproj.in
@@ -84,6 +84,7 @@
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
SYMROOT = .;
@id_toolset@
+ @id_lang_version@
@id_deployment_target@
@id_sdkroot@
};
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 1f03841..b3e8db9 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -742,6 +742,21 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 106200 AND Boost_VERSION VERSION_LESS 106300)
+ set(_Boost_CHRONO_DEPENDENCIES system)
+ set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
+ set(_Boost_COROUTINE_DEPENDENCIES context system)
+ set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
+ set(_Boost_FILESYSTEM_DEPENDENCIES system)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
+ set(_Boost_RANDOM_DEPENDENCIES system)
+ set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
else()
message(WARNING "Imported targets not available for Boost version ${Boost_VERSION}")
set(_Boost_IMPORTED_TARGETS FALSE)
@@ -777,6 +792,7 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
+ set(_Boost_FIBER_HEADERS "boost/fiber/all.hpp")
set(_Boost_FILESYSTEM_HEADERS "boost/filesystem/path.hpp")
set(_Boost_GRAPH_HEADERS "boost/graph/adjacency_list.hpp")
set(_Boost_GRAPH_PARALLEL_HEADERS "boost/graph/adjacency_list.hpp")
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index c813f8f..8b41bb9 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -18,6 +18,8 @@
# * ``MX_LIBRARY``, ``ENG_LIBRARY`` and ``MAT_LIBRARY``: respectively the MX,
# ENG and MAT libraries of Matlab
# * ``MAIN_PROGRAM`` the Matlab binary program.
+# * ``MEX_COMPILER`` the MEX compiler.
+# * ``SIMULINK`` the Simulink environment.
#
# .. note::
#
@@ -819,12 +821,13 @@ endfunction()
# order to produce a MEX file. The final name of the produced output may be
# specified, as well as additional link libraries, and a documentation entry
# for the MEX file. Remaining arguments of the call are passed to the
-# :command:`add_library` command.
+# :command:`add_library` or :command:`add_executable` command.
#
# ::
#
# matlab_add_mex(
# NAME <name>
+# [EXECUTABLE | MODULE | SHARED]
# SRC src1 [src2 ...]
# [OUTPUT_NAME output_name]
# [DOCUMENTATION file.txt]
@@ -835,7 +838,7 @@ endfunction()
# ``NAME``
# name of the target.
# ``SRC``
-# list of tje source files.
+# list of source files.
# ``LINK_TO``
# a list of additional link dependencies. The target links to ``libmex``
# by default. If ``Matlab_MX_LIBRARY`` is defined, it also
@@ -851,6 +854,10 @@ endfunction()
# mex file, and with extension `.m`. In that case, typing ``help <name>``
# in Matlab prints the documentation contained in this file.
#
+# ``MODULE`` or ``SHARED`` may be given to specify the type of library to be
+# created. ``EXECUTABLE`` may be given to create an executable instead of
+# a library. If no type is given explicitly, the type is ``SHARED``.
+#
# The documentation file is not processed and should be in the following
# format:
#
@@ -859,7 +866,7 @@ endfunction()
# % This is the documentation
# function ret = mex_target_output_name(input1)
#
-function(matlab_add_mex )
+function(matlab_add_mex)
if(NOT WIN32)
# we do not need all this on Windows
@@ -871,6 +878,7 @@ function(matlab_add_mex )
endif()
+ set(options EXECUTABLE MODULE SHARED)
set(oneValueArgs NAME DOCUMENTATION OUTPUT_NAME)
set(multiValueArgs LINK_TO SRC)
@@ -885,11 +893,25 @@ function(matlab_add_mex )
set(${prefix}_OUTPUT_NAME ${${prefix}_NAME})
endif()
- add_library(${${prefix}_NAME}
- SHARED
+ if(${prefix}_EXECUTABLE)
+ add_executable(${${prefix}_NAME}
+ ${${prefix}_SRC}
+ ${${prefix}_DOCUMENTATION}
+ ${${prefix}_UNPARSED_ARGUMENTS})
+ else()
+ if(${prefix}_MODULE)
+ set(type MODULE)
+ else()
+ set(type SHARED)
+ endif()
+
+ add_library(${${prefix}_NAME}
+ ${type}
${${prefix}_SRC}
${${prefix}_DOCUMENTATION}
${${prefix}_UNPARSED_ARGUMENTS})
+ endif()
+
target_include_directories(${${prefix}_NAME} PRIVATE ${Matlab_INCLUDE_DIRS})
if(DEFINED Matlab_MX_LIBRARY)
@@ -1463,6 +1485,21 @@ if(_matlab_find_mat GREATER -1)
endif()
unset(_matlab_find_mat)
+# Component Simulink
+list(FIND Matlab_FIND_COMPONENTS SIMULINK _matlab_find_simulink)
+if(_matlab_find_simulink GREATER -1)
+ find_path(
+ Matlab_SIMULINK_INCLUDE_DIR
+ simstruc.h
+ PATHS "${Matlab_ROOT_DIR}/simulink/include"
+ NO_DEFAULT_PATH
+ )
+ if(Matlab_SIMULINK_INCLUDE_DIR)
+ set(Matlab_SIMULINK_FOUND TRUE)
+ list(APPEND Matlab_INCLUDE_DIRS "${Matlab_SIMULINK_INCLUDE_DIR}")
+ endif()
+endif()
+unset(_matlab_find_simulink)
unset(_matlab_lib_dir_for_search)
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 7ddd783..034b0e6 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -142,15 +142,15 @@ if(WIN32 AND NOT CYGWIN)
if(OPENSSL_USE_STATIC_LIBS)
set(_OPENSSL_PATH_SUFFIXES
- "lib"
- "VC/static"
"lib/VC/static"
+ "VC/static"
+ "lib"
)
else()
set(_OPENSSL_PATH_SUFFIXES
- "lib"
- "VC"
"lib/VC"
+ "VC"
+ "lib"
)
endif ()
@@ -227,8 +227,8 @@ if(WIN32 AND NOT CYGWIN)
NAMES_PER_DIR
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
- "lib"
"lib/MinGW"
+ "lib"
)
find_library(SSL_EAY
@@ -237,8 +237,8 @@ if(WIN32 AND NOT CYGWIN)
NAMES_PER_DIR
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
- "lib"
"lib/MinGW"
+ "lib"
)
mark_as_advanced(SSL_EAY LIB_EAY)
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 91c2cf3..427909d 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -125,8 +125,10 @@ if(CMAKE_OSX_SYSROOT)
set(_CMAKE_OSX_SYSROOT_ORIG "")
endif()
set(_CMAKE_OSX_SYSROOT_PATH "${CMAKE_OSX_SYSROOT}")
- else()
- # Transform the sdk name into a path.
+ endif()
+
+ if(CMAKE_OSX_SYSROOT)
+ # Transform the (maybe unversioned) sysroot into a versioned path.
execute_process(
COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version Path
OUTPUT_VARIABLE _stdout