summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeCUDACompiler.cmake.in1
-rw-r--r--Modules/CMakeFindBinUtils.cmake1
-rw-r--r--Modules/CPack.cmake24
-rw-r--r--Modules/CPackComponent.cmake87
-rw-r--r--Modules/CheckFortranSourceCompiles.cmake6
-rw-r--r--Modules/CheckFortranSourceRuns.cmake6
-rw-r--r--Modules/CheckTypeSize.c.in8
-rw-r--r--Modules/Compiler/XL-Fortran.cmake1
-rw-r--r--Modules/ExternalProject.cmake9
-rw-r--r--Modules/FetchContent.cmake7
-rw-r--r--Modules/FindHDF5.cmake104
-rw-r--r--Modules/FindOpenAL.cmake99
-rw-r--r--Modules/FindOpenCL.cmake6
-rw-r--r--Modules/FindPython.cmake16
-rw-r--r--Modules/FindPython/Support.cmake41
-rw-r--r--Modules/FindPython2.cmake16
-rw-r--r--Modules/FindPython3.cmake16
-rw-r--r--Modules/FindSWIG.cmake71
-rw-r--r--Modules/FindX11.cmake94
-rw-r--r--Modules/FortranCInterface/CMakeLists.txt4
-rw-r--r--Modules/FortranCInterface/Detect.cmake10
-rw-r--r--Modules/GoogleTestAddTests.cmake45
-rw-r--r--Modules/Internal/CPack/CPackNuGet.cmake16
-rw-r--r--Modules/Internal/CPack/CPackRPM.cmake18
-rw-r--r--Modules/Platform/Windows-Intel.cmake2
-rw-r--r--Modules/Platform/Windows-MSVC.cmake2
-rw-r--r--Modules/Platform/Windows-NVIDIA-CUDA.cmake2
-rw-r--r--Modules/UseSWIG.cmake20
28 files changed, 529 insertions, 203 deletions
diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in
index 4a615a3..14a39a9 100644
--- a/Modules/CMakeCUDACompiler.cmake.in
+++ b/Modules/CMakeCUDACompiler.cmake.in
@@ -54,4 +54,5 @@ set(CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES@
set(CMAKE_CUDA_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_MT "@CMAKE_MT@")
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index c23e447..de9ef9a 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -75,6 +75,7 @@ if(("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC" AND
endif()
find_program(CMAKE_LINKER NAMES ${_CMAKE_ADDITIONAL_LINKER_NAMES} link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+ find_program(CMAKE_AR NAMES lib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_MT NAMES mt HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
list(APPEND _CMAKE_TOOL_VARS LINKER MT)
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index baf7e47..6234b9d 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -5,7 +5,7 @@
CPack
-----
-Configure the binary and source package installers.
+Configure generators for binary installers and source packages.
Introduction
^^^^^^^^^^^^
@@ -19,13 +19,17 @@ Depending on the CMake generator, the CPack module may also add two new build
targets, ``package`` and ``package_source``. See the `packaging targets`_
section below for details.
-The generated binary installers contain everything installed via CMake's
-:command:`install` command (and the deprecated commands :command:`install_files`,
-:command:`install_programs`, and :command:`install_targets`).
-For certain kinds of binary installers (including the graphical
-installers on macOS and Windows), CPack generates installers that
-allow users to select individual application components to install.
-See :module:`CPackComponent` module for further details.
+The generated binary installers will contain all files that have been installed
+via CMake's :command:`install` command (and the deprecated commands
+:command:`install_files`, :command:`install_programs`, and
+:command:`install_targets`). Certain kinds of binary installers can be
+configured such that users can select individual application components to
+install. See the :module:`CPackComponent` module for further details.
+
+Source packages (configured through ``CPackSourceConfig.cmake`` and generated
+by the :cpack_gen:`CPack Archive Generator`) will contain all source files in
+the project directory except those specified in
+:variable:`CPACK_SOURCE_IGNORE_FILES`.
CPack Generators
^^^^^^^^^^^^^^^^
@@ -38,10 +42,6 @@ generator. In a :variable:`CPACK_PROJECT_CONFIG_FILE`,
:variable:`CPACK_GENERATOR` is a *string naming a single generator*. If you
need per-cpack-generator logic to control *other* cpack settings, then you
need a :variable:`CPACK_PROJECT_CONFIG_FILE`.
-
-The CMake source tree itself contains a :variable:`CPACK_PROJECT_CONFIG_FILE`.
-See the top level file ``CMakeCPackOptions.cmake.in`` for an example.
-
If set, the :variable:`CPACK_PROJECT_CONFIG_FILE` is included automatically
on a per-generator basis. It only need contain overrides.
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index 211d767..1f8c38c 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -5,29 +5,34 @@
CPackComponent
--------------
-Build binary and source package installers
+Configure components for binary installers and source packages.
-Variables concerning CPack Components
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. only:: html
-The CPackComponent module is the module which handles the component
-part of CPack. See CPack module for general information about CPack.
+ .. contents::
-For certain kinds of binary installers (including the graphical
-installers on macOS and Windows), CPack generates installers that
-allow users to select individual application components to install.
-The contents of each of the components are identified by the COMPONENT
-argument of CMake's INSTALL command. These components can be
+Introduction
+^^^^^^^^^^^^
+
+This module is automatically included by :module:`CPack`.
+
+Certain binary installers (especially the graphical installers) generated
+by CPack allow users to select individual application *components* to install.
+This module allows developers to configure the packaging of such components.
+
+Contents is assigned to components by the ``COMPONENT``
+argument of CMake's :command:`install` command. Components can be
annotated with user-friendly names and descriptions, inter-component
dependencies, etc., and grouped in various ways to customize the
-resulting installer. See the cpack_add_* commands, described below,
-for more information about component-specific installations.
+resulting installer, using the commands described below.
+
+To specify different groupings for different CPack generators use
+a CPACK_PROJECT_CONFIG_FILE.
-Component-specific installation allows users to select specific sets
-of components to install during the install process. Installation
-components are identified by the COMPONENT argument of CMake's INSTALL
-commands, and should be further described by the following CPack
-commands:
+Variables
+^^^^^^^^^
+
+The following variables influence the component-specific packaging:
.. variable:: CPACK_COMPONENTS_ALL
@@ -61,16 +66,14 @@ commands:
Specify how components are grouped for multi-package component-aware CPack
generators.
- Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates
- several packages files when asked for component packaging. They group
- the component differently depending on the value of this variable:
-
- * ONE_PER_GROUP (default): creates one package file per component group
- * ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) components
- * IGNORE : creates one package per component, i.e. IGNORE component group
+ Some generators like RPM or ARCHIVE (TGZ, ZIP, ...) may generate
+ several packages files when there are components, depending
+ on the value of this variable:
- One can specify different grouping for different CPack generator by
- using a CPACK_PROJECT_CONFIG_FILE.
+ * ONE_PER_GROUP (default): create one package per component group
+ * IGNORE : create one package per component (ignore the groups)
+ * ALL_COMPONENTS_IN_ONE : create a single package with all requested
+ components
.. variable:: CPACK_COMPONENT_<compName>_DISPLAY_NAME
@@ -100,10 +103,15 @@ commands:
True if this component is not selected to be installed by default.
+Commands
+^^^^^^^^
+
+Add component
+"""""""""""""
+
.. command:: cpack_add_component
-Describes a CPack installation
-component named by the COMPONENT argument to a CMake INSTALL command.
+Describe an installation component.
::
@@ -118,13 +126,11 @@ component named by the COMPONENT argument to a CMake INSTALL command.
[ARCHIVE_FILE filename]
[PLIST filename])
-
-
-The cmake_add_component command describes an installation component,
-which the user can opt to install or remove as part of the graphical
-installation process. compname is the name of the component, as
-provided to the COMPONENT argument of one or more CMake INSTALL
-commands.
+``compname`` is the name of an installation component, as defined by the
+``COMPONENT`` argument of one or more CMake :command:`install` commands.
+With the ``cpack_add_component`` command one can set a name, a description,
+and other attributes of an installation component.
+One can also assign a component to a component group.
DISPLAY_NAME is the displayed name of the component, used in graphical
installers to display the component name. This value can be any
@@ -177,6 +183,9 @@ the component. See cpack_configure_downloads for more information.
PLIST gives a filename that is passed to pkgbuild with the
``--component-plist`` argument when using the productbuild generator.
+Add component group
+"""""""""""""""""""
+
.. command:: cpack_add_component_group
Describes a group of related CPack installation components.
@@ -225,6 +234,9 @@ single entry.
BOLD_TITLE indicates that the group title should appear in bold, to
call the user's attention to the group.
+Add installation type
+"""""""""""""""""""""
+
.. command:: cpack_add_install_type
Add a new installation type containing
@@ -249,6 +261,9 @@ DISPLAY_NAME is the displayed name of the install type, which will
typically show up in a drop-down box within a graphical installer.
This value can be any string.
+Configure downloads
+"""""""""""""""""""
+
.. command:: cpack_configure_downloads
Configure CPack to download
@@ -281,8 +296,6 @@ requires the ZipDLL plug-in for NSIS, available at:
http://nsis.sourceforge.net/ZipDLL_plug-in
-
-
On macOS, installers that download components on-the-fly can only
be built and installed on system using macOS 10.5 or later.
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index f0fde8d..3354bfb 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -103,8 +103,6 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR)
if(NOT _SRC_EXT)
set(_SRC_EXT F)
endif()
- set(MACRO_CHECK_FUNCTION_DEFINITIONS
- "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
if(CMAKE_REQUIRED_LINK_OPTIONS)
set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS
LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
@@ -132,10 +130,10 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR)
try_compile(${VAR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}
- COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ COMPILE_DEFINITIONS -D${VAR} ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS}
${CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES}
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}
"${CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake
index a3e5d5d..f858b84 100644
--- a/Modules/CheckFortranSourceRuns.cmake
+++ b/Modules/CheckFortranSourceRuns.cmake
@@ -98,8 +98,6 @@ macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
if(NOT _SRC_EXT)
set(_SRC_EXT F90)
endif()
- set(MACRO_CHECK_FUNCTION_DEFINITIONS
- "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
if(CMAKE_REQUIRED_LINK_OPTIONS)
set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS
LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
@@ -127,10 +125,10 @@ macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
try_run(${VAR}_EXITCODE ${VAR}_COMPILED
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}
- COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ COMPILE_DEFINITIONS -D${VAR} ${CMAKE_REQUIRED_DEFINITIONS}
${CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS}
${CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES}
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
"${CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES}"
COMPILE_OUTPUT_VARIABLE OUTPUT
diff --git a/Modules/CheckTypeSize.c.in b/Modules/CheckTypeSize.c.in
index 82035a3..fb93073 100644
--- a/Modules/CheckTypeSize.c.in
+++ b/Modules/CheckTypeSize.c.in
@@ -5,10 +5,14 @@
# define KEY '_','_','i','3','8','6'
#elif defined(__x86_64)
# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
+#elif defined(__PPC64__)
+# define KEY '_','_','P','P','C','6','4','_','_'
#elif defined(__ppc64__)
# define KEY '_','_','p','p','c','6','4','_','_'
+#elif defined(__PPC__)
+# define KEY '_','_','P','P','C','_','_'
+#elif defined(__ppc__)
+# define KEY '_','_','p','p','c','_','_'
#elif defined(__aarch64__)
# define KEY '_','_','a','a','r','c','h','6','4','_','_'
#elif defined(__ARM_ARCH_7A__)
diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake
index 1683dff..e01ec8e 100644
--- a/Modules/Compiler/XL-Fortran.cmake
+++ b/Modules/Compiler/XL-Fortran.cmake
@@ -8,6 +8,7 @@ set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-qfixed") # [=<right_margin>]
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-qfree") # [=f90|ibm]
set(CMAKE_Fortran_MODDIR_FLAG "-qmoddir=")
+set(CMAKE_Fortran_MODDIR_INCLUDE_FLAG "-I") # -qmoddir= does not affect search path
set(CMAKE_Fortran_DEFINE_FLAG "-WF,-D")
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 5bac0d8..326ee06 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -9,8 +9,11 @@ ExternalProject
.. contents::
+Commands
+^^^^^^^^
+
External Project Definition
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
+"""""""""""""""""""""""""""
.. command:: ExternalProject_Add
@@ -665,7 +668,7 @@ External Project Definition
automatic substitutions that are supported for some options.
Obtaining Project Properties
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+""""""""""""""""""""""""""""
.. command:: ExternalProject_Get_Property
@@ -686,7 +689,7 @@ Obtaining Project Properties
message("Source dir of myExtProj = ${SOURCE_DIR}")
Explicit Step Management
-^^^^^^^^^^^^^^^^^^^^^^^^
+""""""""""""""""""""""""
The ``ExternalProject_Add()`` function on its own is often sufficient for
incorporating an external project into the main build. Certain scenarios
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index f3e1b51..0e98f49 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -76,8 +76,11 @@ sometimes useful as part of implementing some higher level feature or to
populate some content in CMake's script mode.
+Commands
+^^^^^^^^
+
Declaring Content Details
-^^^^^^^^^^^^^^^^^^^^^^^^^
+"""""""""""""""""""""""""
.. command:: FetchContent_Declare
@@ -130,7 +133,7 @@ Declaring Content Details
)
Populating The Content
-^^^^^^^^^^^^^^^^^^^^^^
+""""""""""""""""""""""
For most common scenarios, population means making content available to the
main build according to previously declared details for that dependency.
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index b488418..c1888a4 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -19,9 +19,12 @@ The module will optionally accept the ``COMPONENTS`` argument. If no
``COMPONENTS`` are specified, then the find module will default to finding
only the ``HDF5`` C library. If one or more ``COMPONENTS`` are specified, the
module will attempt to find the language bindings for the specified
-components. The only valid components are ``C``, ``CXX``, ``Fortran``, ``HL``,
-and ``Fortran_HL``. If the ``COMPONENTS`` argument is not given, the module will
+components. The valid components are ``C``, ``CXX``, ``Fortran``, ``HL``.
+``HL`` refers to the "high-level" HDF5 functions for C and Fortran.
+If the ``COMPONENTS`` argument is not given, the module will
attempt to find only the C bindings.
+For example, to use Fortran HDF5 and HDF5-HL functions, do:
+``find_package(HDF5 COMPONENTS Fortran HL)``.
This module will read the variable
``HDF5_USE_STATIC_LIBRARIES`` to determine whether or not to prefer a
@@ -29,11 +32,6 @@ static link to a dynamic link for ``HDF5`` and all of it's dependencies.
To use this feature, make sure that the ``HDF5_USE_STATIC_LIBRARIES``
variable is set before the call to find_package.
-To provide the module with a hint about where to find your ``HDF5``
-installation, you can set the environment variable ``HDF5_ROOT``. The
-Find module will then look in this path when searching for ``HDF5``
-executables, paths, and libraries.
-
Both the serial and parallel ``HDF5`` wrappers are considered and the first
directory to contain either one will be used. In the event that both appear
in the same directory the serial version is preferentially selected. This
@@ -115,10 +113,10 @@ also be defined. With all components enabled, the following variables will be d
Hints
^^^^^
-The following variable can be set to guide the search for HDF5 libraries and includes:
+The following variables can be set to guide the search for HDF5 libraries and includes:
-``HDF5_ROOT``
- Specify the path to the HDF5 installation to use.
+``HDF5_PREFER_PARALLEL``
+ set ``true`` to prefer parallel HDF5 (by default, serial is preferred)
``HDF5_FIND_DEBUG``
Set ``true`` to get extra debugging output.
@@ -343,35 +341,46 @@ macro( _HDF5_invoke_compiler language output return_value version is_parallel)
elseif("${language}" STREQUAL "Fortran")
set(test_file ${scratch_dir}/cmake_hdf5_test.f90)
endif()
+ # Verify that the compiler wrapper can actually compile: sometimes the compiler
+ # wrapper exists, but not the compiler. E.g. Miniconda / Anaconda Python
execute_process(
- COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} ${test_file}
- OUTPUT_VARIABLE ${output}
- ERROR_VARIABLE ${output}
+ COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} ${test_file}
RESULT_VARIABLE ${return_value}
)
if(NOT ${${return_value}} EQUAL 0)
- message(STATUS
- "Unable to determine HDF5 ${language} flags from HDF5 wrapper.")
- endif()
- execute_process(
- COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -showconfig
- OUTPUT_VARIABLE config_output
- ERROR_VARIABLE config_output
- RESULT_VARIABLE config_return
- )
- if(NOT ${return_value} EQUAL 0)
- message( STATUS
- "Unable to determine HDF5 ${language} version from HDF5 wrapper.")
- endif()
- string(REGEX MATCH "HDF5 Version: ([a-zA-Z0-9\\.\\-]*)" version_match "${config_output}")
- if(version_match)
- string(REPLACE "HDF5 Version: " "" ${version} "${version_match}")
- string(REPLACE "-patch" "." ${version} "${${version}}")
- endif()
- if(config_output MATCHES "Parallel HDF5: yes")
- set(${is_parallel} TRUE)
+ message(STATUS
+ "HDF5 ${language} compiler wrapper is unable to compile a minimal HDF5 program.")
else()
- set(${is_parallel} FALSE)
+ execute_process(
+ COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} ${test_file}
+ OUTPUT_VARIABLE ${output}
+ ERROR_VARIABLE ${output}
+ RESULT_VARIABLE ${return_value}
+ )
+ if(NOT ${${return_value}} EQUAL 0)
+ message(STATUS
+ "Unable to determine HDF5 ${language} flags from HDF5 wrapper.")
+ endif()
+ execute_process(
+ COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -showconfig
+ OUTPUT_VARIABLE config_output
+ ERROR_VARIABLE config_output
+ RESULT_VARIABLE config_return
+ )
+ if(NOT ${return_value} EQUAL 0)
+ message( STATUS
+ "Unable to determine HDF5 ${language} version from HDF5 wrapper.")
+ endif()
+ string(REGEX MATCH "HDF5 Version: ([a-zA-Z0-9\\.\\-]*)" version_match "${config_output}")
+ if(version_match)
+ string(REPLACE "HDF5 Version: " "" ${version} "${version_match}")
+ string(REPLACE "-patch" "." ${version} "${${version}}")
+ endif()
+ if(config_output MATCHES "Parallel HDF5: yes")
+ set(${is_parallel} TRUE)
+ else()
+ set(${is_parallel} FALSE)
+ endif()
endif()
endmacro()
@@ -769,6 +778,17 @@ if( NOT HDF5_FOUND )
set(HDF5_Fortran_LIBRARY_NAMES hdf5_fortran ${HDF5_C_LIBRARY_NAMES})
set(HDF5_Fortran_HL_LIBRARY_NAMES hdf5hl_fortran ${HDF5_C_HL_LIBRARY_NAMES} ${HDF5_Fortran_LIBRARY_NAMES})
+ # suffixes as seen on Linux, MSYS2, ...
+ set(_lib_suffixes hdf5)
+ if(NOT HDF5_PREFER_PARALLEL)
+ list(APPEND _lib_suffixes hdf5/serial)
+ endif()
+ if(HDF5_USE_STATIC_LIBRARIES)
+ set(_inc_suffixes include/static)
+ else()
+ set(_inc_suffixes include/shared)
+ endif()
+
foreach(__lang IN LISTS HDF5_LANGUAGE_BINDINGS)
# find the HDF5 include directories
if("${__lang}" STREQUAL "Fortran")
@@ -782,7 +802,7 @@ if( NOT HDF5_FOUND )
find_path(HDF5_${__lang}_INCLUDE_DIR ${HDF5_INCLUDE_FILENAME}
HINTS ${HDF5_ROOT}
PATHS $ENV{HOME}/.local/include
- PATH_SUFFIXES include Include
+ PATH_SUFFIXES include Include ${_inc_suffixes} ${_lib_suffixes}
${_HDF5_SEARCH_OPTS}
)
mark_as_advanced(HDF5_${__lang}_INCLUDE_DIR)
@@ -811,14 +831,15 @@ if( NOT HDF5_FOUND )
endif()
find_library(HDF5_${LIB}_LIBRARY_DEBUG
NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
- HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
+ HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib ${_lib_suffixes}
${_HDF5_SEARCH_OPTS}
)
- find_library( HDF5_${LIB}_LIBRARY_RELEASE
+ find_library(HDF5_${LIB}_LIBRARY_RELEASE
NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
- HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
+ HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib ${_lib_suffixes}
${_HDF5_SEARCH_OPTS}
)
+
select_library_configurations( HDF5_${LIB} )
list(APPEND HDF5_${__lang}_LIBRARIES ${HDF5_${LIB}_LIBRARY})
endforeach()
@@ -848,14 +869,15 @@ if( NOT HDF5_FOUND )
endif()
find_library(HDF5_${LIB}_LIBRARY_DEBUG
NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
- HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
+ HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib ${_lib_suffixes}
${_HDF5_SEARCH_OPTS}
)
- find_library( HDF5_${LIB}_LIBRARY_RELEASE
+ find_library(HDF5_${LIB}_LIBRARY_RELEASE
NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
- HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
+ HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib ${_lib_suffixes}
${_HDF5_SEARCH_OPTS}
)
+
select_library_configurations( HDF5_${LIB} )
list(APPEND HDF5_${__lang}_HL_LIBRARIES ${HDF5_${LIB}_LIBRARY})
endforeach()
diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake
index 27dcaf5..c9c0903 100644
--- a/Modules/FindOpenAL.cmake
+++ b/Modules/FindOpenAL.cmake
@@ -5,27 +5,45 @@
FindOpenAL
----------
-
Finds Open Audio Library (OpenAL).
-This module defines ``OPENAL_LIBRARY OPENAL_FOUND``, if
-false, do not try to link to OpenAL ``OPENAL_INCLUDE_DIR``, where to find
-the headers.
-``$OPENALDIR`` is an environment variable that would correspond to the
-``./configure --prefix=$OPENALDIR`` used in building OpenAL.
+Projects using this module should use ``#include <al.h>`` to include the OpenAL
+header file, **not** ``#include <AL.al.h>``. The reason for this is that the
+latter is not entirely portable. Windows/Creative Labs does not by default put
+their headers in ``AL/`` and macOS uses the convention ``<OpenAL/al.h>``.
+
+Hints
+^^^^^
+
+Environment variable ``$OPENALDIR`` can be used to set the prefix of OpenAL
+installation to be found.
+
+By default on macOS, system framework is search first. In other words,
+OpenAL is searched in the following order:
+
+1. System framework: ``/System/Library/Frameworks``, whose priority can be
+ changed via setting the :variable:`CMAKE_FIND_FRAMEWORK` variable.
+2. Environment variable ``$OPENALDIR``.
+3. System paths.
+4. User-compiled framework: ``~/Library/Frameworks``.
+5. Manually compiled framework: ``/Library/Frameworks``.
+6. Add-on package: ``/opt``.
+
+Result Variables
+^^^^^^^^^^^^^^^^
-Created by Eric Wing. This was influenced by the ``FindSDL.cmake``
-module.
+This module defines the following variables:
+
+``OPENAL_FOUND``
+ If false, do not try to link to OpenAL
+``OPENAL_INCLUDE_DIR``
+ OpenAL include directory
+``OPENAL_LIBRARY``
+ Path to the OpenAL library
+``OPENAL_VERSION_STRING``
+ Human-readable string containing the version of OpenAL
#]=======================================================================]
-# This makes the presumption that you are include al.h like
-# #include "al.h"
-# and not
-# #include <AL/al.h>
-# The reason for this is that the latter is not entirely portable.
-# Windows/Creative Labs does not by default put their headers in AL/ and
-# OS X uses the convention <OpenAL/al.h>.
-#
# For Windows, Creative Labs seems to have added a registry key for their
# OpenAL 1.1 installer. I have added that key to the list of search paths,
# however, the key looks like it could be a little fragile depending on
@@ -36,36 +54,17 @@ module.
# platforms are introduced.
# The OpenAL 1.0 installer doesn't seem to have a useful key I can use.
# I do not know if the Nvidia OpenAL SDK has a registry key.
-#
-# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger).
-# To support the framework, I originally wrote special framework detection
-# code in this module which I have now removed with CMake's introduction
-# of native support for frameworks.
-# In addition, OpenAL is open source, and it is possible to compile on Panther.
-# Furthermore, due to bugs in the initial OpenAL release, and the
-# transition to OpenAL 1.1, it is common to need to override the built-in
-# framework.
-# Per my request, CMake should search for frameworks first in
-# the following order:
-# ~/Library/Frameworks/OpenAL.framework/Headers
-# /Library/Frameworks/OpenAL.framework/Headers
-# /System/Library/Frameworks/OpenAL.framework/Headers
-#
-# On OS X, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of
-# OPENAL_LIBRARY to override this selection or set the CMake environment
-# CMAKE_INCLUDE_PATH to modify the search paths.
find_path(OPENAL_INCLUDE_DIR al.h
HINTS
ENV OPENALDIR
- PATH_SUFFIXES include/AL include/OpenAL include AL OpenAL
PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /opt
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
-)
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /opt
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
+ PATH_SUFFIXES include/AL include/OpenAL include AL OpenAL
+ )
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_OpenAL_ARCH_DIR libs/Win64)
@@ -77,17 +76,21 @@ find_library(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
HINTS
ENV OPENALDIR
- PATH_SUFFIXES libx32 lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /opt
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
-)
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /opt
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
+ PATH_SUFFIXES libx32 lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
+ )
unset(_OpenAL_ARCH_DIR)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
+find_package_handle_standard_args(
+ OpenAL
+ REQUIRED_VARS OPENAL_LIBRARY OPENAL_INCLUDE_DIR
+ VERSION_VAR OPENAL_VERSION_STRING
+ )
mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
index 9891724..34a203e 100644
--- a/Modules/FindOpenCL.cmake
+++ b/Modules/FindOpenCL.cmake
@@ -78,6 +78,8 @@ find_path(OpenCL_INCLUDE_DIR
ENV CUDA_PATH
ENV ATISTREAMSDKROOT
ENV OCL_ROOT
+ /usr/local/cuda
+ /opt/cuda
PATH_SUFFIXES
include
OpenCL/common/inc
@@ -126,6 +128,8 @@ else()
PATHS
ENV AMDAPPSDKROOT
ENV CUDA_PATH
+ /usr/local/cuda
+ /opt/cuda
PATH_SUFFIXES
lib/x86
lib)
@@ -135,6 +139,8 @@ else()
PATHS
ENV AMDAPPSDKROOT
ENV CUDA_PATH
+ /usr/local/cuda
+ /opt/cuda
PATH_SUFFIXES
lib/x86_64
lib/x64
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index 9dfa222..6132693 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -288,6 +288,22 @@ setting the following variables:
If more than one artifact is specified, it is the user's responsability to
ensure the consistency of the various artifacts.
+By default, this module supports multiple calls in different directories of a
+project with different version/component requirements while providing correct
+and consistent results for each call. To support this behavior, ``CMake`` cache
+is not used in the traditional way which can be problematic for interactive
+specification. So, to enable also interactive specification, module behavior
+can be controled with the following variable:
+
+``Python_ARTIFACTS_INTERACTIVE``
+ Selects the behavior of the module. This is a boolean variable:
+
+ * If set to ``TRUE``: Create CMake cache entries for the above artifact
+ specification variables so that users can edit them interactively.
+ This disables support for multiple version/component requirements.
+ * If set to ``FALSE`` or undefined: Enable multiple version/component
+ requirements.
+
Commands
^^^^^^^^
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index bf55bf5..e903f2a 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -75,22 +75,20 @@ macro (_PYTHON_SELECT_LIBRARY_CONFIGURATIONS _PYTHON_BASENAME)
(_PYTHON_isMultiConfig OR CMAKE_BUILD_TYPE))
# if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
# single-config generators, set optimized and debug libraries
- set (${_PYTHON_BASENAME}_LIBRARY "")
- foreach (_PYTHON_libname IN LISTS ${_PYTHON_BASENAME}_LIBRARY_RELEASE )
- list( APPEND ${_PYTHON_BASENAME}_LIBRARY optimized "${_PYTHON_libname}" )
+ set (${_PYTHON_BASENAME}_LIBRARIES "")
+ foreach (_PYTHON_libname IN LISTS ${_PYTHON_BASENAME}_LIBRARY_RELEASE)
+ list( APPEND ${_PYTHON_BASENAME}_LIBRARIES optimized "${_PYTHON_libname}")
endforeach()
- foreach (_PYTHON_libname IN LISTS ${_PYTHON_BASENAME}_LIBRARY_DEBUG )
- list( APPEND ${_PYTHON_BASENAME}_LIBRARY debug "${_PYTHON_libname}" )
+ foreach (_PYTHON_libname IN LISTS ${_PYTHON_BASENAME}_LIBRARY_DEBUG)
+ list( APPEND ${_PYTHON_BASENAME}_LIBRARIES debug "${_PYTHON_libname}")
endforeach()
elseif (${_PYTHON_BASENAME}_LIBRARY_RELEASE)
- set (${_PYTHON_BASENAME}_LIBRARY "${${_PYTHON_BASENAME}_LIBRARY_RELEASE}")
+ set (${_PYTHON_BASENAME}_LIBRARIES "${${_PYTHON_BASENAME}_LIBRARY_RELEASE}")
elseif (${_PYTHON_BASENAME}_LIBRARY_DEBUG)
- set (${_PYTHON_BASENAME}_LIBRARY "${${_PYTHON_BASENAME}_LIBRARY_DEBUG}")
+ set (${_PYTHON_BASENAME}_LIBRARIES "${${_PYTHON_BASENAME}_LIBRARY_DEBUG}")
else()
- set (${_PYTHON_BASENAME}_LIBRARY "${_PYTHON_BASENAME}_LIBRARY-NOTFOUND")
+ set (${_PYTHON_BASENAME}_LIBRARIES "${_PYTHON_BASENAME}_LIBRARY-NOTFOUND")
endif()
-
- set (${_PYTHON_BASENAME}_LIBRARIES "${${_PYTHON_BASENAME}_LIBRARY}")
endmacro()
@@ -1412,6 +1410,10 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
endif()
endif()
+ if (${_PYTHON_PREFIX}_ARTIFACTS_INTERACTIVE)
+ set (${_PYTHON_PREFIX}_EXECUTABLE "${_${_PYTHON_PREFIX}_EXECUTABLE}" CACHE FILEPATH "${_PYTHON_PREFIX} Interpreter")
+ endif()
+
_python_mark_as_internal (_${_PYTHON_PREFIX}_EXECUTABLE
_${_PYTHON_PREFIX}_INTERPRETER_PROPERTIES
_${_PYTHON_PREFIX}_INTERPRETER_SIGNATURE)
@@ -1607,6 +1609,10 @@ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
unset (${_PYTHON_PREFIX}_COMPILER_ID)
endif()
+ if (${_PYTHON_PREFIX}_ARTIFACTS_INTERACTIVE)
+ set (${_PYTHON_PREFIX}_COMPILER "${_${_PYTHON_PREFIX}_COMPILER}" CACHE FILEPATH "${_PYTHON_PREFIX} Compiler")
+ endif()
+
_python_mark_as_internal (_${_PYTHON_PREFIX}_COMPILER
_${_PYTHON_PREFIX}_COMPILER_SIGNATURE)
endif()
@@ -2298,6 +2304,11 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
set (CMAKE_FIND_LIBRARY_SUFFIXES ${_${_PYTHON_PREFIX}_CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
+ if (${_PYTHON_PREFIX}_ARTIFACTS_INTERACTIVE)
+ set (${_PYTHON_PREFIX}_LIBRARY "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}" CACHE FILEPATH "${_PYTHON_PREFIX} Library")
+ set (${_PYTHON_PREFIX}_INCLUDE_DIR "${_${_PYTHON_PREFIX}_INCLUDE_DIR}" CACHE FILEPATH "${_PYTHON_PREFIX} Include Directory")
+ endif()
+
_python_mark_as_internal (_${_PYTHON_PREFIX}_LIBRARY_RELEASE
_${_PYTHON_PREFIX}_LIBRARY_DEBUG
_${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE
@@ -2376,6 +2387,10 @@ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Inte
unset (_${_PYTHON_PREFIX}_NUMPY_SIGNATURE CACHE)
endif()
+ if (${_PYTHON_PREFIX}_ARTIFACTS_INTERACTIVE)
+ set (${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR "${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}" CACHE FILEPATH "${_PYTHON_PREFIX} NumPy Include Directory")
+ endif()
+
_python_mark_as_internal (_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR
_${_PYTHON_PREFIX}_NUMPY_SIGNATURE)
endif()
@@ -2451,8 +2466,8 @@ if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT")
else()
set_target_properties (${__name}
PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C"
- IMPORTED_IMPLIB "${${_PYTHON_PREFIX}_LIBRARY}"
- IMPORTED_LOCATION "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY}")
+ IMPORTED_IMPLIB "${${_PYTHON_PREFIX}_LIBRARIES}"
+ IMPORTED_LOCATION "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE}")
endif()
else()
if (${_PYTHON_PREFIX}_LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_LIBRARY_DEBUG)
@@ -2466,7 +2481,7 @@ if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT")
else()
set_target_properties (${__name}
PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C"
- IMPORTED_LOCATION "${${_PYTHON_PREFIX}_LIBRARY}")
+ IMPORTED_LOCATION "${${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
endif()
endif()
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index af8ad39..10fe211 100644
--- a/Modules/FindPython2.cmake
+++ b/Modules/FindPython2.cmake
@@ -237,6 +237,22 @@ setting the following variables:
If more than one artifact is specified, it is the user's responsability to
ensure the consistency of the various artifacts.
+By default, this module supports multiple calls in different directories of a
+project with different version/component requirements while providing correct
+and consistent results for each call. To support this behavior, ``CMake`` cache
+is not used in the traditional way which can be problematic for interactive
+specification. So, to enable also interactive specification, module behavior
+can be controled with the following variable:
+
+``Python2_ARTIFACTS_INTERACTIVE``
+ Selects the behavior of the module. This is a boolean variable:
+
+ * If set to ``TRUE``: Create CMake cache entries for the above artifact
+ specification variables so that users can edit them interactively.
+ This disables support for multiple version/component requirements.
+ * If set to ``FALSE`` or undefined: Enable multiple version/component
+ requirements.
+
Commands
^^^^^^^^
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index 66f4f75..211f982 100644
--- a/Modules/FindPython3.cmake
+++ b/Modules/FindPython3.cmake
@@ -285,6 +285,22 @@ setting the following variables:
If more than one artifact is specified, it is the user's responsability to
ensure the consistency of the various artifacts.
+By default, this module supports multiple calls in different directories of a
+project with different version/component requirements while providing correct
+and consistent results for each call. To support this behavior, ``CMake`` cache
+is not used in the traditional way which can be problematic for interactive
+specification. So, to enable also interactive specification, module behavior
+can be controled with the following variable:
+
+``Python3_ARTIFACTS_INTERACTIVE``
+ Selects the behavior of the module. This is a boolean variable:
+
+ * If set to ``TRUE``: Create CMake cache entries for the above artifact
+ specification variables so that users can edit them interactively.
+ This disables support for multiple version/component requirements.
+ * If set to ``FALSE`` or undefined: Enable multiple version/component
+ requirements.
+
Commands
^^^^^^^^
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index ae6ae56..2fded49 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -5,25 +5,49 @@
FindSWIG
--------
-Find Simplified Wrapper and Interface Generator (SWIG)
+Find the Simplified Wrapper and Interface Generator (SWIG_) executable.
-This module finds an installed SWIG. It sets the following variables:
-
-::
-
- SWIG_FOUND - set to "True" if SWIG is found
- SWIG_DIR - the directory where swig is installed
- SWIG_EXECUTABLE - the path to the swig executable
- SWIG_VERSION - the version number of the swig executable
+This module finds an installed SWIG and determines its version. If a
+``COMPONENTS`` or ``OPTIONAL_COMPONENTS`` argument is given to ``find_package``,
+it will also determine supported target languages. The module sents the
+following variables:
+``SWIG_FOUND``
+ Whether SWIG and any required components were found on the system.
+``SWIG_EXECUTABLE``
+ Path to the SWIG executable.
+``SWIG_DIR``
+ Path to the installed SWIG ``Lib`` directory (result of ``swig -swiglib``).
+``SWIG_VERSION``
+ SWIG executable version (result of ``swig -version``).
+``SWIG_<lang>_FOUND``
+ If ``COMPONENTS`` or ``OPTIONAL_COMPONENTS`` are requested, each available
+ target language ``<lang>`` (lowercase) will be set to TRUE.
-The minimum required version of SWIG can be specified using the
-standard syntax, e.g. :command:`find_package(SWIG 1.1)`
+Any ``COMPONENTS`` given to ``find_package`` should be the names of supported
+target languages as provided to the LANGUAGE argument of ``swig_add_library``,
+such as ``python`` or ``perl5``. Language names *must* be lowercase.
All information is collected from the ``SWIG_EXECUTABLE``, so the version
to be found can be changed from the command line by means of setting
-``SWIG_EXECUTABLE``
+``SWIG_EXECUTABLE``.
+
+Example usage requiring SWIG 4.0 or higher and Python language support, with
+optional Fortran support:
+
+.. code-block:: cmake
+
+ find_package(SWIG 4.0 COMPONENTS python OPTIONAL_COMPONENTS fortran)
+ if(SWIG_FOUND)
+ message("SWIG found: ${SWIG_EXECUTABLE}")
+ if(NOT SWIG_fortran_FOUND)
+ message(WARNING "SWIG Fortran bindings cannot be generated")
+ endif()
+ endif()
+
+.. _`SWIG`: http://swig.org
+
#]=======================================================================]
find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig)
@@ -58,10 +82,29 @@ if(SWIG_EXECUTABLE)
endif()
endif()
endif()
+
+ if(SWIG_FIND_COMPONENTS)
+ execute_process(COMMAND ${SWIG_EXECUTABLE} -help
+ OUTPUT_VARIABLE SWIG_swighelp_output
+ ERROR_VARIABLE SWIG_swighelp_error
+ RESULT_VARIABLE SWIG_swighelp_result)
+ if(SWIG_swighelp_result)
+ message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -help\" failed with output:\n${SWIG_swiglib_error}")
+ else()
+ string(REPLACE "\n" ";" SWIG_swighelp_output "${SWIG_swighelp_output}")
+ foreach(SWIG_line IN LISTS SWIG_swighelp_output)
+ if(SWIG_line MATCHES "-([A-Za-z0-9_]+) +- *Generate.*wrappers")
+ set(SWIG_${CMAKE_MATCH_1}_FOUND TRUE)
+ endif()
+ endforeach()
+ endif()
+ endif()
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
- VERSION_VAR SWIG_VERSION )
+find_package_handle_standard_args(
+ SWIG HANDLE_COMPONENTS
+ REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
+ VERSION_VAR SWIG_VERSION)
mark_as_advanced(SWIG_DIR SWIG_VERSION SWIG_EXECUTABLE)
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index b28dd12..aa83575 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -25,6 +25,10 @@ and also the following more fine grained variables and targets:
X11_Xaccessrules_INCLUDE_PATH,
X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND
X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND, X11::Xau
+ X11_xcb_INCLUDE_PATH, X11_xcb_LIB, X11_xcb_FOUND, X11::xcb
+ X11_X11_xcb_INCLUDE_PATH, X11_X11_xcb_LIB, X11_X11_xcb_FOUND, X11::X11_xcb
+ X11_xcb_icccm_INCLUDE_PATH, X11_xcb_icccm_LIB, X11_xcb_icccm_FOUND, X11::xcb_icccm
+ X11_xcb_xkb_INCLUDE_PATH, X11_xcb_xkb_LIB, X11_xcb_xkb_FOUND, X11::xcb_xkb
X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND, X11::Xcomposite
X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND, X11::Xcursor
X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND, X11::Xdamage
@@ -38,6 +42,8 @@ and also the following more fine grained variables and targets:
X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND, X11::Xinerama
X11_Xkb_INCLUDE_PATH,
X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND, X11::Xkb
+ X11_xkbcommon_INCLUDE_PATH, X11_xkbcommon_LIB, X11_xkbcommon_FOUND, X11::xkbcommon
+ X11_xkbcommon_X11_INCLUDE_PATH,X11_xkbcommon_X11_LIB,X11_xkbcommon_X11_FOUND,X11::xkbcommon_X11
X11_xkbfile_INCLUDE_PATH, X11_xkbfile_LIB, X11_xkbfile_FOUND, X11::xkbfile
X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND, X11::Xmu
X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND, X11::Xpm
@@ -94,6 +100,9 @@ if (UNIX)
find_path(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_xcb_INCLUDE_PATH xcb/xcb.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_X11_xcb_INCLUDE_PATH X11/Xlib-xcb.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_xcb_icccm_INCLUDE_PATH xcb/xcb_icccm.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH})
@@ -107,6 +116,8 @@ if (UNIX)
find_path(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_xkbcommon_INCLUDE_PATH xkbcommon/xkbcommon.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_xkbcommon_X11_INCLUDE_PATH xkbcommon/xkbcommon-x11.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH})
find_path(X11_xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH})
@@ -137,6 +148,10 @@ if (UNIX)
find_library(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH})
find_library(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH})
find_library(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH})
+ find_library(X11_xcb_LIB xcb ${X11_LIB_SEARCH_PATH})
+ find_library(X11_X11_xcb_LIB X11-xcb ${X11_LIB_SEARCH_PATH})
+ find_library(X11_xcb_icccm_LIB xcb-icccm ${X11_LIB_SEARCH_PATH})
+ find_library(X11_xcb_xkb_LIB xcb-xkb ${X11_LIB_SEARCH_PATH})
find_library(X11_Xcomposite_LIB Xcomposite ${X11_LIB_SEARCH_PATH})
find_library(X11_Xcursor_LIB Xcursor ${X11_LIB_SEARCH_PATH})
find_library(X11_Xdamage_LIB Xdamage ${X11_LIB_SEARCH_PATH})
@@ -146,6 +161,8 @@ if (UNIX)
find_library(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH})
find_library(X11_Xi_LIB Xi ${X11_LIB_SEARCH_PATH})
find_library(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH})
+ find_library(X11_xkbcommon_LIB xkbcommon ${X11_LIB_SEARCH_PATH})
+ find_library(X11_xkbcommon_X11_LIB xkbcommon-x11 ${X11_LIB_SEARCH_PATH})
find_library(X11_xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH})
find_library(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH})
find_library(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH})
@@ -221,6 +238,22 @@ if (UNIX)
set(X11_Xau_FOUND TRUE)
endif ()
+ if (X11_xcb_LIB AND X11_xcb_INCLUDE_PATH)
+ set(X11_xcb_FOUND TRUE)
+ endif ()
+
+ if (X11_X11_xcb_LIB AND X11_X11_xcb_INCLUDE_PATH)
+ set(X11_X11_xcb_FOUND TRUE)
+ endif ()
+
+ if (X11_xcb_icccm_LIB AND X11_xcb_icccm_INCLUDE_PATH)
+ set(X11_xcb_icccm_FOUND TRUE)
+ endif ()
+
+ if (X11_xcb_xkb_LIB)
+ set(X11_xcb_xkb_FOUND TRUE)
+ endif ()
+
if (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
set(X11_Xdmcp_FOUND TRUE)
list(APPEND X11_INCLUDE_DIR ${X11_Xdmcp_INCLUDE_PATH})
@@ -326,6 +359,14 @@ if (UNIX)
list(APPEND X11_INCLUDE_DIR ${X11_Xkb_INCLUDE_PATH} )
endif ()
+ if (X11_xkbcommon_INCLUDE_PATH AND X11_xkbcommon_LIB)
+ set(X11_xkbcommon_FOUND TRUE)
+ endif ()
+
+ if (X11_xkbcommon_X11_INCLUDE_PATH AND X11_xkbcommon_X11_LIB)
+ set(X11_xkbcommon_X11_FOUND TRUE)
+ endif ()
+
if (X11_xkbfile_INCLUDE_PATH AND X11_xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
set(X11_xkbfile_FOUND TRUE)
# Backwards compatibility.
@@ -478,6 +519,35 @@ if (UNIX)
INTERFACE_INCLUDE_DIRECTORIES "${X11_Xau_INCLUDE_PATH}")
endif ()
+ if (X11_xcb_FOUND AND NOT TARGET X11::xcb)
+ add_library(X11::xcb UNKNOWN IMPORTED)
+ set_target_properties(X11::xcb PROPERTIES
+ IMPORTED_LOCATION "${X11_xcb_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_xcb_INCLUDE_PATH}")
+ endif ()
+
+ if (X11_X11_xcb_FOUND AND NOT TARGET X11::X11_xcb)
+ add_library(X11::X11_xcb UNKNOWN IMPORTED)
+ set_target_properties(X11::X11_xcb PROPERTIES
+ IMPORTED_LOCATION "${X11_X11_xcb_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_X11_xcb_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::xcb;X11::X11")
+ endif ()
+
+ if (X11_xcb_icccm_FOUND AND NOT TARGET X11::xcb_icccm)
+ add_library(X11::xcb_icccm UNKNOWN IMPORTED)
+ set_target_properties(X11::xcb_icccm PROPERTIES
+ IMPORTED_LOCATION "${X11_xcb_icccm_LIB}"
+ INTERFACE_LINK_LIBRARIES "X11::xcb")
+ endif ()
+
+ if (X11_xcb_xkb_FOUND AND NOT TARGET X11::xcb_xkb)
+ add_library(X11::xcb_xkb UNKNOWN IMPORTED)
+ set_target_properties(X11::xcb_xkb PROPERTIES
+ IMPORTED_LOCATION "${X11_xcb_xkb_LIB}"
+ INTERFACE_LINK_LIBRARIES "X11::xcb")
+ endif ()
+
if (X11_Xcomposite_FOUND AND NOT TARGET X11::Xcomposite)
add_library(X11::Xcomposite UNKNOWN IMPORTED)
set_target_properties(X11::Xcomposite PROPERTIES
@@ -572,6 +642,21 @@ if (UNIX)
INTERFACE_LINK_LIBRARIES "X11::X11")
endif ()
+ if (X11_xkbcommon_FOUND AND NOT TARGET X11::xkbcommon)
+ add_library(X11::xkbcommon UNKNOWN IMPORTED)
+ set_target_properties(X11::xkbcommon PROPERTIES
+ IMPORTED_LOCATION "${X11_xkbcommon_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_xkbcommon_INCLUDE_PATH}")
+ endif ()
+
+ if (X11_xkbcommon_X11_FOUND AND NOT TARGET X11::xkbcommon_X11)
+ add_library(X11::xkbcommon_X11 UNKNOWN IMPORTED)
+ set_target_properties(X11::xkbcommon_X11 PROPERTIES
+ IMPORTED_LOCATION "${X11_xkbcommon_X11_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_xkbcommon_X11_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::X11;X11::xkbcommon")
+ endif ()
+
if (X11_xkbfile_FOUND AND NOT TARGET X11::xkbfile)
add_library(X11::xkbfile UNKNOWN IMPORTED)
set_target_properties(X11::xkbfile PROPERTIES
@@ -668,6 +753,11 @@ if (UNIX)
X11_Xext_LIB
X11_Xau_LIB
X11_Xau_INCLUDE_PATH
+ X11_xcb_LIB
+ X11_xcb_INCLUDE_PATH
+ X11_xcb_xkb_LIB
+ X11_X11_xcb_LIB
+ X11_X11_xcb_INCLUDE_PATH
X11_Xlib_INCLUDE_PATH
X11_Xutil_INCLUDE_PATH
X11_Xcomposite_INCLUDE_PATH
@@ -704,6 +794,10 @@ if (UNIX)
X11_Xdmcp_INCLUDE_PATH
X11_Xkb_INCLUDE_PATH
X11_Xkblib_INCLUDE_PATH
+ X11_xkbcommon_INCLUDE_PATH
+ X11_xkbcommon_LIB
+ X11_xkbcommon_X11_INCLUDE_PATH
+ X11_xkbcommon_X11_LIB
X11_xkbfile_INCLUDE_PATH
X11_xkbfile_LIB
X11_Xmu_INCLUDE_PATH
diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt
index 381080b..13e4498 100644
--- a/Modules/FortranCInterface/CMakeLists.txt
+++ b/Modules/FortranCInterface/CMakeLists.txt
@@ -101,3 +101,7 @@ set_property(TARGET symbols PROPERTY POSITION_INDEPENDENT_CODE 1)
# Require symbols through Fortran.
add_executable(FortranCInterface main.F call_sub.f ${call_mod})
target_link_libraries(FortranCInterface PUBLIC symbols)
+
+file(GENERATE OUTPUT exe-$<CONFIG>.cmake CONTENT [[
+set(FortranCInterface_EXE "$<TARGET_FILE:FortranCInterface>")
+]])
diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake
index 33de6c6..c75067b 100644
--- a/Modules/FortranCInterface/Detect.cmake
+++ b/Modules/FortranCInterface/Detect.cmake
@@ -43,17 +43,11 @@ set(FortranCInterface_COMPILED ${FortranCInterface_COMPILED})
unset(FortranCInterface_COMPILED CACHE)
# Locate the sample project executable.
+set(FortranCInterface_EXE)
if(FortranCInterface_COMPILED)
- find_program(FortranCInterface_EXE
- NAMES FortranCInterface${CMAKE_EXECUTABLE_SUFFIX}
- PATHS ${FortranCInterface_BINARY_DIR} ${FortranCInterface_BINARY_DIR}/Release
- NO_DEFAULT_PATH
- )
- set(FortranCInterface_EXE ${FortranCInterface_EXE})
- unset(FortranCInterface_EXE CACHE)
+ include(${FortranCInterface_BINARY_DIR}/exe-Release.cmake OPTIONAL)
else()
set(_result "Failed to compile")
- set(FortranCInterface_EXE)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Fortran/C interface test project failed with the following output:\n"
"${FortranCInterface_OUTPUT}\n")
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index 4abbbec..4f52ad2 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -1,6 +1,8 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
+cmake_minimum_required(VERSION ${CMAKE_VERSION})
+
set(prefix "${TEST_PREFIX}")
set(suffix "${TEST_SUFFIX}")
set(extra_args ${TEST_EXTRA_ARGS})
@@ -8,18 +10,41 @@ set(properties ${TEST_PROPERTIES})
set(script)
set(suite)
set(tests)
+set(tests_buffer)
+
+# Overwrite possibly existing ${CTEST_FILE} with empty file
+file(WRITE "${CTEST_FILE}" "")
+
+# Flushes script to ${CTEST_FILE}
+macro(flush_script)
+ file(APPEND "${CTEST_FILE}" "${script}")
+ set(script "")
+endmacro()
+
+# Flushes tests_buffer to tests
+macro(flush_tests_buffer)
+ list(APPEND tests "${tests_buffer}")
+ set(tests_buffer "")
+endmacro()
-function(add_command NAME)
+macro(add_command NAME)
set(_args "")
foreach(_arg ${ARGN})
if(_arg MATCHES "[^-./:a-zA-Z0-9_]")
- set(_args "${_args} [==[${_arg}]==]")
+ string(APPEND _args " [==[${_arg}]==]")
else()
- set(_args "${_args} ${_arg}")
+ string(APPEND _args " ${_arg}")
endif()
endforeach()
- set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE)
-endfunction()
+ string(APPEND script "${NAME}(${_args})\n")
+ string(LENGTH "${script}" _script_len)
+ if(${_script_len} GREATER "50000")
+ flush_script()
+ endif()
+ # Unsets macro local variables to prevent leakage outside of this macro.
+ unset(_args)
+ unset(_script_len)
+endmacro()
# Run test executable to get list of available tests
if(NOT EXISTS "${TEST_EXECUTABLE}")
@@ -93,14 +118,20 @@ foreach(line ${output})
WORKING_DIRECTORY "${TEST_WORKING_DIR}"
${properties}
)
- list(APPEND tests "${prefix}${pretty_suite}.${pretty_test}${suffix}")
+ list(APPEND tests_buffer "${prefix}${pretty_suite}.${pretty_test}${suffix}")
+ list(LENGTH tests_buffer tests_buffer_length)
+ if(${tests_buffer_length} GREATER "250")
+ flush_tests_buffer()
+ endif()
endif()
endif()
endforeach()
+
# Create a list of all discovered tests, which users may use to e.g. set
# properties on the tests
+flush_tests_buffer()
add_command(set ${TEST_LIST} ${tests})
# Write CTest script
-file(WRITE "${CTEST_FILE}" "${script}")
+flush_script()
diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake
index 1f4bcfd..20eed2e 100644
--- a/Modules/Internal/CPack/CPackNuGet.cmake
+++ b/Modules/Internal/CPack/CPackNuGet.cmake
@@ -287,7 +287,11 @@ if(CPACK_NUGET_ORDINAL_MONOLITIC)
execute_process(
COMMAND "${NUGET_EXECUTABLE}" pack ${CPACK_NUGET_PACK_ADDITIONAL_OPTIONS}
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ RESULT_VARIABLE _nuget_result
)
+ if(NOT _nuget_result EQUAL 0)
+ message(FATAL_ERROR "Nuget pack failed")
+ endif()
elseif(CPACK_NUGET_ALL_IN_ONE)
# This variable `CPACK_NUGET_ALL_IN_ONE` set by C++ code:
@@ -300,7 +304,11 @@ elseif(CPACK_NUGET_ALL_IN_ONE)
execute_process(
COMMAND "${NUGET_EXECUTABLE}" pack ${CPACK_NUGET_PACK_ADDITIONAL_OPTIONS}
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ RESULT_VARIABLE _nuget_result
)
+ if(NOT _nuget_result EQUAL 0)
+ message(FATAL_ERROR "Nuget pack failed")
+ endif()
else()
# Is there any grouped component?
@@ -322,7 +330,11 @@ else()
execute_process(
COMMAND "${NUGET_EXECUTABLE}" pack ${CPACK_NUGET_PACK_ADDITIONAL_OPTIONS}
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ RESULT_VARIABLE _nuget_result
)
+ if(NOT _nuget_result EQUAL 0)
+ message(FATAL_ERROR "Nuget pack failed")
+ endif()
endforeach()
endif()
# Is there any single component package needed?
@@ -341,7 +353,11 @@ else()
execute_process(
COMMAND "${NUGET_EXECUTABLE}" pack ${CPACK_NUGET_PACK_ADDITIONAL_OPTIONS}
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
+ RESULT_VARIABLE _nuget_result
)
+ if(NOT _nuget_result EQUAL 0)
+ message(FATAL_ERROR "Nuget pack failed")
+ endif()
endforeach()
endif()
endif()
diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake
index 3485e7d..08bbc68 100644
--- a/Modules/Internal/CPack/CPackRPM.cmake
+++ b/Modules/Internal/CPack/CPackRPM.cmake
@@ -1099,16 +1099,18 @@ function(cpack_rpm_generate_package)
# 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)
- # May be used to embed a post (un)installation script in the spec file.
+ # CPACK_RPM_POST_TRANS_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_TRANS_SCRIPT_FILE)
+ # May be used to embed a post installation/uninstallation/transaction script in the spec file.
# The referred script file(s) will be read and directly
- # put after the %post or %postun section
+ # put after the %post or %postun or %posttrans section
# ----------------------------------------------------------------
# CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE)
# CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE)
- # May be used to embed a pre (un)installation script in the spec file.
+ # CPACK_RPM_PRE_TRANS_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_TRANS_SCRIPT_FILE)
+ # May be used to embed a pre installation/uninstallation/transaction script in the spec file.
# The referred script file(s) will be read and directly
- # put after the %pre or %preun section
- foreach(RPM_SCRIPT_FILE_TYPE_ "INSTALL" "UNINSTALL")
+ # put after the %pre or %preun or %pretrans section
+ foreach(RPM_SCRIPT_FILE_TYPE_ "INSTALL" "UNINSTALL" "TRANS")
foreach(RPM_SCRIPT_FILE_TIME_ "PRE" "POST")
set("CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_READ_FILE"
"${CPACK_RPM_${RPM_SCRIPT_FILE_TIME_}_${RPM_SCRIPT_FILE_TYPE_}_SCRIPT_FILE}")
@@ -1727,12 +1729,18 @@ mv %_topdir/tmpBBroot $RPM_BUILD_ROOT
\@RPM_SYMLINK_POSTINSTALL\@
\@CPACK_RPM_SPEC_POSTINSTALL\@
+%posttrans
+\@CPACK_RPM_SPEC_POSTTRANS\@
+
%postun
\@CPACK_RPM_SPEC_POSTUNINSTALL\@
%pre
\@CPACK_RPM_SPEC_PREINSTALL\@
+%pretrans
+\@CPACK_RPM_SPEC_PRETRANS\@
+
%preun
\@CPACK_RPM_SPEC_PREUNINSTALL\@
diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake
index 96b1760..5d8f7fc 100644
--- a/Modules/Platform/Windows-Intel.cmake
+++ b/Modules/Platform/Windows-Intel.cmake
@@ -11,7 +11,7 @@ set(__WINDOWS_INTEL 1)
include(Platform/Windows-MSVC)
macro(__windows_compiler_intel lang)
__windows_compiler_msvc(${lang})
- string(REPLACE "<CMAKE_LINKER> /lib" "xilib" CMAKE_${lang}_CREATE_STATIC_LIBRARY "${CMAKE_${lang}_CREATE_STATIC_LIBRARY}")
+ string(REPLACE "<CMAKE_AR>" "xilib" CMAKE_${lang}_CREATE_STATIC_LIBRARY "${CMAKE_${lang}_CREATE_STATIC_LIBRARY}")
foreach(rule CREATE_SHARED_LIBRARY CREATE_SHARED_MODULE LINK_EXECUTABLE)
string(REPLACE "<CMAKE_LINKER>" "xilink" CMAKE_${lang}_${rule} "${CMAKE_${lang}_${rule}}")
endforeach()
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index e1d6733..7ee501b 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -316,7 +316,7 @@ macro(__windows_compiler_msvc lang)
"${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
- set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
set(CMAKE_${lang}_COMPILE_OBJECT
"<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <DEFINES> <INCLUDES> <FLAGS> /Fo<OBJECT> /Fd<TARGET_COMPILE_PDB>${_FS_${lang}} -c <SOURCE>${CMAKE_END_TEMP_FILE}")
diff --git a/Modules/Platform/Windows-NVIDIA-CUDA.cmake b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
index f809094..af43f46 100644
--- a/Modules/Platform/Windows-NVIDIA-CUDA.cmake
+++ b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
@@ -23,7 +23,7 @@ set(CMAKE_CUDA_CREATE_SHARED_LIBRARY
"${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICT_LINKS} ${CMAKE_END_TEMP_FILE}")
set(CMAKE_CUDA_CREATE_SHARED_MODULE ${CMAKE_CUDA_CREATE_SHARED_LIBRARY})
-set(CMAKE_CUDA_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+set(CMAKE_CUDA_CREATE_STATIC_LIBRARY "<CMAKE_AR> ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
set(CMAKE_CUDA_LINKER_SUPPORTS_PDB ON)
set(CMAKE_CUDA_LINK_EXECUTABLE
"${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICT_LINKS} ${CMAKE_END_TEMP_FILE}")
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 78522da..f6a20f8 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -341,6 +341,23 @@ function(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
list(APPEND files "${extra_file}")
endforeach()
+ if (language STREQUAL "FORTRAN" AND CMAKE_Fortran_COMPILER_LOADED)
+ # Process possible user-supplied extension in flags (obtained via parent
+ # scope variable) to determine the source file name.
+ list(FIND SWIG_COMPILATION_FLAGS "-fext" fext_idx)
+ if (fext_idx EQUAL -1)
+ # Default Fortran generated extension
+ set(fext "f90")
+ else()
+ # Get extension from user-provided flag
+ math(EXPR fext_idx "${fext_idx} + 1")
+ list(GET SWIG_COMPILATION_FLAGS "${fext_idx}" fext)
+ endif()
+ set(extra_file "${generatedpath}/${module_basename}.${fext}")
+ set_source_files_properties("${extra_file}" PROPERTIES LANGUAGE "Fortran")
+ list(APPEND files "${extra_file}")
+ endif()
+
set (${outfiles} ${files} PARENT_SCOPE)
endfunction()
@@ -415,6 +432,7 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
get_filename_component(swig_source_file_fullname "${infile}" ABSOLUTE)
if (NOT SWIG_MODULE_${name}_NOPROXY)
+ set(SWIG_COMPILATION_FLAGS ${swig_source_file_flags})
SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE}
swig_extra_generated_files
"${outdir}"
@@ -787,6 +805,8 @@ function(SWIG_ADD_LIBRARY name)
if (APPLE)
set_target_properties (${target_name} PROPERTIES SUFFIX ".dylib")
endif ()
+ elseif (swig_lowercase_language STREQUAL "fortran")
+ # Do *not* override the target's library prefix
else()
# assume empty prefix because we expect the module to be dynamically loaded
set_target_properties (${target_name} PROPERTIES PREFIX "")