Merge remote-tracking branch 'origin/maint'

This commit is contained in:
Kolan Sh 2016-03-12 02:00:13 +03:00
commit d64b37b168
429 changed files with 8872 additions and 3633 deletions

View File

@ -198,6 +198,17 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CPACK_WIX_UPGRADE_GUID "8ffd1d72-b7f1-11e2-8ee5-00238bca4991")
if(MSVC AND NOT "$ENV{WIX}" STREQUAL "")
set(WIX_CUSTOM_ACTION_ENABLED TRUE)
if(CMAKE_CONFIGURATION_TYPES)
set(WIX_CUSTOM_ACTION_MULTI_CONFIG TRUE)
else()
set(WIX_CUSTOM_ACTION_MULTI_CONFIG FALSE)
endif()
else()
set(WIX_CUSTOM_ACTION_ENABLED FALSE)
endif()
# Set the options file that needs to be included inside CMakeCPackOptions.cmake
set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"

View File

@ -194,9 +194,9 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX")
# Reset CPACK_PACKAGE_VERSION to deal with WiX restriction.
# But the file names still use the full CMake_VERSION value:
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-@CMake_VERSION@-${CPACK_SYSTEM_NAME}")
"cmake-@CMake_VERSION@-${CPACK_SYSTEM_NAME}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-@CMake_VERSION@-Source")
"cmake-@CMake_VERSION@")
if(NOT CPACK_WIX_SIZEOF_VOID_P)
set(CPACK_WIX_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
@ -234,10 +234,57 @@ if("${CPACK_GENERATOR}" STREQUAL "WIX")
set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-dcl:high")
set(CPACK_WIX_UI_BANNER
"@CMake_SOURCE_DIR@/Utilities/Release/cpack_wix_ui_banner.jpg"
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/ui_banner.jpg"
)
set(CPACK_WIX_UI_DIALOG
"@CMake_SOURCE_DIR@/Utilities/Release/cpack_wix_ui_dialog.jpg"
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/ui_dialog.jpg"
)
set(CPACK_WIX_EXTRA_SOURCES
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/install_dir.wxs"
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_extra_dialog.wxs"
)
set(_WIX_CUSTOM_ACTION_ENABLED "@WIX_CUSTOM_ACTION_ENABLED@")
if(_WIX_CUSTOM_ACTION_ENABLED)
list(APPEND CPACK_WIX_EXTRA_SOURCES
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs"
)
list(APPEND CPACK_WIX_CANDLE_EXTRA_FLAGS -dCHECK_NSIS=1)
set(_WIX_CUSTOM_ACTION_MULTI_CONFIG "@WIX_CUSTOM_ACTION_MULTI_CONFIG@")
if(_WIX_CUSTOM_ACTION_MULTI_CONFIG)
if(CPACK_BUILD_CONFIG)
set(_WIX_CUSTOM_ACTION_CONFIG "${CPACK_BUILD_CONFIG}")
else()
set(_WIX_CUSTOM_ACTION_CONFIG "Release")
endif()
list(APPEND CPACK_WIX_EXTRA_SOURCES
"@CMake_BINARY_DIR@/Utilities/Release/WiX/custom_action_dll-${_WIX_CUSTOM_ACTION_CONFIG}.wxs")
else()
list(APPEND CPACK_WIX_EXTRA_SOURCES
"@CMake_BINARY_DIR@/Utilities/Release/WiX/custom_action_dll.wxs")
endif()
endif()
set(CPACK_WIX_UI_REF "CMakeUI_InstallDir")
set(CPACK_WIX_PATCH_FILE
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/patch_path_env.xml"
)
set(CPACK_WIX_TEMPLATE
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/WIX.template.in"
)
set(BUILD_QtDialog "@BUILD_QtDialog@")
if(BUILD_QtDialog)
list(APPEND CPACK_WIX_PATCH_FILE
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/patch_desktop_shortcut.xml"
)
list(APPEND CPACK_WIX_CANDLE_EXTRA_FLAGS -dBUILD_QtDialog=1)
endif()
endif()

View File

@ -138,8 +138,13 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
option(CMAKE_USE_SYSTEM_FORM "Use system-installed libform" "${CMAKE_USE_SYSTEM_LIBRARY_FORM}")
option(CMAKE_USE_SYSTEM_JSONCPP "Use system-installed jsoncpp" "${CMAKE_USE_SYSTEM_LIBRARY_JSONCPP}")
# For now use system KWIML only if explicitly requested rather
# than activating via the general system libs options.
option(CMAKE_USE_SYSTEM_KWIML "Use system-installed KWIML" OFF)
mark_as_advanced(CMAKE_USE_SYSTEM_KWIML)
# Mention to the user what system libraries are being used.
foreach(util ${UTILITIES})
foreach(util ${UTILITIES} KWIML)
if(CMAKE_USE_SYSTEM_${util})
message(STATUS "Using system-installed ${util}")
endif()
@ -270,6 +275,20 @@ macro (CMAKE_BUILD_UTILITIES)
# (a macro defined in this file)
CMAKE_HANDLE_SYSTEM_LIBRARIES()
if(CMAKE_USE_SYSTEM_KWIML)
find_package(KWIML 1.0)
if(NOT KWIML_FOUND)
message(FATAL_ERROR "CMAKE_USE_SYSTEM_KWIML is ON but KWIML is not found!")
endif()
set(CMake_KWIML_LIBRARIES kwiml::kwiml)
else()
set(CMake_KWIML_LIBRARIES "")
if(BUILD_TESTING)
set(KWIML_TEST_ENABLE 1)
endif()
add_subdirectory(Utilities/KWIML)
endif()
#---------------------------------------------------------------------
# Build zlib library for Curl, CMake, and CTest.
set(CMAKE_ZLIB_HEADER "cm_zlib.h")
@ -538,10 +557,10 @@ if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
set(CMAKE_TESTS_CDASH_SERVER "http://open.cdash.org")
endif()
# Create the KWIML library for CMake.
set(KWIML cmIML)
set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities)
add_subdirectory(Utilities/KWIML)
if(CMake_TEST_EXTERNAL_CMAKE)
set(KWIML_TEST_ENABLE 1)
add_subdirectory(Utilities/KWIML)
endif()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
# build the utilities (a macro defined in this file)

View File

@ -21,7 +21,8 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"Utilities.cmcurl"
"Utilities.cmexpat."
"Utilities.cmlibarchive"
"/usr/include.*warning.*shadowed declaration is here"
"warning: declaration of .single. shadows a global declaration"
"/usr/include.*(warning|note).*shadowed declaration is here"
"/usr/bin/ld.*warning.*-..*directory.name.*bin.*does not exist"
"Redeclaration of .send..... with a different storage class specifier"
"is not used for resolving any symbol"
@ -36,7 +37,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"LINK : warning LNK4089: all references to.*SHELL32.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*USER32.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*ole32.dll.*discarded by /OPT:REF"
"Warning.*: .*/Utilities/KWIML/test/test_INT_format.h.* # Redundant preprocessing concatenation"
"Warning.*: .*/Utilities/KWIML/test/test_int_format.h.* # Redundant preprocessing concatenation"
"Warning: library was too large for page size.*"
"Warning: public.*_archive_.*in module.*archive_*clashes with prior module.*archive_.*"
"Warning: public.*BZ2_bz.*in module.*bzlib.*clashes with prior module.*bzlib.*"

View File

@ -1,5 +1,5 @@
CMake - Cross Platform Makefile Generator
Copyright 2000-2015 Kitware, Inc.
Copyright 2000-2016 Kitware, Inc.
Copyright 2000-2011 Insight Software Consortium
All rights reserved.

View File

@ -178,7 +178,7 @@ target is already built, the command will not execute.
::
add_custom_command(TARGET target
add_custom_command(TARGET <target>
PRE_BUILD | PRE_LINK | POST_BUILD
COMMAND command1 [ARGS] [args1...]
[COMMAND command2 [ARGS] [args2...] ...]
@ -188,7 +188,10 @@ target is already built, the command will not execute.
[VERBATIM] [USES_TERMINAL])
This defines a new command that will be associated with building the
specified target. When the command will happen is determined by which
specified ``<target>``. The ``<target>`` must be defined in the current
directory; targets defined in other directories may not be specified.
When the command will happen is determined by which
of the following is specified:
``PRE_BUILD``

View File

@ -5,7 +5,7 @@ Set the minimum required version of cmake for a project.
::
cmake_minimum_required(VERSION major[.minor[.patch[.tweak]]]
cmake_minimum_required(VERSION major.minor[.patch[.tweak]]
[FATAL_ERROR])
If the current version of CMake is lower than that required it will

View File

@ -0,0 +1,85 @@
cmake_parse_arguments
---------------------
``cmake_parse_arguments`` is intended to be used in macros or functions for
parsing the arguments given to that macro or function. It processes the
arguments and defines a set of variables which hold the values of the
respective options.
::
cmake_parse_arguments(<prefix> <options> <one_value_keywords>
<multi_value_keywords> args...)
The ``<options>`` argument contains all options for the respective macro,
i.e. keywords which can be used when calling the macro without any value
following, like e.g. the ``OPTIONAL`` keyword of the :command:`install`
command.
The ``<one_value_keywords>`` argument contains all keywords for this macro
which are followed by one value, like e.g. ``DESTINATION`` keyword of the
:command:`install` command.
The ``<multi_value_keywords>`` argument contains all keywords for this
macro which can be followed by more than one value, like e.g. the
``TARGETS`` or ``FILES`` keywords of the :command:`install` command.
.. note::
All keywords shall be unique. I.e. every keyword shall only be specified
once in either ``<options>``, ``<one_value_keywords>`` or
``<multi_value_keywords>``. A warning will be emitted if uniqueness is
violated.
When done, ``cmake_parse_arguments`` will have defined for each of the
keywords listed in ``<options>``, ``<one_value_keywords>`` and
``<multi_value_keywords>`` a variable composed of the given ``<prefix>``
followed by ``"_"`` and the name of the respective keyword. These
variables will then hold the respective value from the argument list.
For the ``<options>`` keywords this will be ``TRUE`` or ``FALSE``.
All remaining arguments are collected in a variable
``<prefix>_UNPARSED_ARGUMENTS``, this can be checked afterwards to see
whether your macro was called with unrecognized parameters.
As an example here a ``my_install()`` macro, which takes similar arguments
as the real :command:`install` command:
.. code-block:: cmake
function(MY_INSTALL)
set(options OPTIONAL FAST)
set(oneValueArgs DESTINATION RENAME)
set(multiValueArgs TARGETS CONFIGURATIONS)
cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )
# ...
Assume ``my_install()`` has been called like this:
.. code-block:: cmake
my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
After the ``cmake_parse_arguments`` call the macro will have set the
following variables::
MY_INSTALL_OPTIONAL = TRUE
MY_INSTALL_FAST = FALSE (was not used in call to my_install)
MY_INSTALL_DESTINATION = "bin"
MY_INSTALL_RENAME = "" (was not used)
MY_INSTALL_TARGETS = "foo;bar"
MY_INSTALL_CONFIGURATIONS = "" (was not used)
MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (nothing expected after "OPTIONAL")
You can then continue and process these variables.
Keywords terminate lists of values, e.g. if directly after a
one_value_keyword another recognized keyword follows, this is
interpreted as the beginning of the new option. E.g.
``my_install(TARGETS foo DESTINATION OPTIONAL)`` would result in
``MY_INSTALL_DESTINATION`` set to ``"OPTIONAL"``, but as ``OPTIONAL``
is a keyword itself ``MY_INSTALL_DESTINATION`` will be empty and
``MY_INSTALL_OPTIONAL`` will therefore be set to ``TRUE``.

View File

@ -13,6 +13,6 @@ the variable ``VAR``. If the property is not found, ``VAR`` will be set to
Properties are usually used to control how a target is built, but some
query the target instead. This command can get properties for any
target so far created. The targets do not need to be in the current
CMakeLists.txt file.
``CMakeLists.txt`` file.
See also the more general :command:`get_property` command.

View File

@ -67,9 +67,10 @@ Possible expressions are:
True if the given name is an existing policy (of the form ``CMP<NNNN>``).
``if(TARGET target-name)``
True if the given name is an existing logical target name such as those
created by the :command:`add_executable`, :command:`add_library`, or
:command:`add_custom_target` commands.
True if the given name is an existing logical target name created
by a call to the :command:`add_executable`, :command:`add_library`,
or :command:`add_custom_target` command that has already been invoked
(in any directory).
``if(TEST test-name)``
True if the given name is an existing test name created by the
@ -80,7 +81,7 @@ Possible expressions are:
only for full paths.
``if(file1 IS_NEWER_THAN file2)``
True if file1 is newer than file2 or if one of the two files doesn't
True if ``file1`` is newer than ``file2`` or if one of the two files doesn't
exist. Behavior is well-defined only for full paths. If the file
time stamps are exactly the same, an ``IS_NEWER_THAN`` comparison returns
true, so that any dependent build operations will occur in the event

View File

@ -72,12 +72,13 @@ Installing Targets
[[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|
PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]
[DESTINATION <dir>]
[INCLUDES DESTINATION [<dir> ...]]
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
[OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]
] [...])
] [...]
[INCLUDES DESTINATION [<dir> ...]]
)
The ``TARGETS`` form specifies rules for installing targets from a
project. There are five kinds of target files that may be installed:
@ -97,11 +98,7 @@ change the type of target to which the subsequent properties apply.
If none is given the installation properties apply to all target
types. If only one is given then only targets of that type will be
installed (which can be used to install just a DLL or just an import
library). The ``INCLUDES DESTINATION`` specifies a list of directories
which will be added to the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`
target property of the ``<targets>`` when exported by the
:command:`install(EXPORT)` command. If a relative path is
specified, it is treated as relative to the ``$<INSTALL_PREFIX>``.
library).
The ``PRIVATE_HEADER``, ``PUBLIC_HEADER``, and ``RESOURCE`` arguments
cause subsequent properties to be applied to installing a ``FRAMEWORK``
@ -131,6 +128,14 @@ option installs nothing. See the :prop_tgt:`VERSION` and
:prop_tgt:`SOVERSION` target properties for details on creating versioned
shared libraries.
The ``INCLUDES DESTINATION`` specifies a list of directories
which will be added to the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`
target property of the ``<targets>`` when exported by the
:command:`install(EXPORT)` command. If a relative path is
specified, it is treated as relative to the ``$<INSTALL_PREFIX>``.
This is independent of the rest of the argument groups and does
not actually install anything.
One or more groups of properties may be specified in a single call to
the ``TARGETS`` form of this command. A target may be installed more than
once to different locations. Consider hypothetical targets ``myExe``,
@ -271,9 +276,10 @@ will install the ``icons`` directory to ``share/myproj/icons`` and the
file permissions, the scripts will be given specific permissions, and any
``CVS`` directories will be excluded.
The install destination given to the directory install ``DESTINATION`` may
use "generator expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
The list of ``dirs...`` given to ``DIRECTORY`` and the install destination
given to the directory install ``DESTINATION`` may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions.
Custom Installation Logic
^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -86,6 +86,18 @@
Enable warnings that are meant for the author of the CMakeLists.txt
files. By default this will also turn on deprecation warnings.
``-Werror=dev``
Make developer warnings errors.
Make warnings that are meant for the author of the CMakeLists.txt files
errors. By default this will also turn on deprecated warnings as errors.
``-Wno-error=dev``
Make developer warnings not errors.
Make warnings that are meant for the author of the CMakeLists.txt files not
errors. By default this will also turn off deprecated warnings as errors.
``-Wdeprecated``
Enable deprecated functionality warnings.
@ -97,3 +109,15 @@
Suppress warnings for usage of deprecated functionality, that are meant
for the author of the CMakeLists.txt files.
``-Werror=deprecated``
Make deprecated macro and function warnings errors.
Make warnings for usage of deprecated macros and functions, that are meant
for the author of the CMakeLists.txt files, errors.
``-Wno-error=deprecated``
Make deprecated macro and function warnings not errors.
Make warnings for usage of deprecated macros and functions, that are meant
for the author of the CMakeLists.txt files, not errors.

View File

@ -427,7 +427,7 @@ specified will be calculated:
)
add_library(lib1Version3 SHARED lib1_v3.cpp)
set_property(TARGET lib1Version2 PROPERTY INTERFACE_CONTAINER_SIZE_REQUIRED 1000)
set_property(TARGET lib1Version3 PROPERTY INTERFACE_CONTAINER_SIZE_REQUIRED 1000)
add_executable(exe1 exe1.cpp)
# CONTAINER_SIZE_REQUIRED will be "200"

View File

@ -29,6 +29,7 @@ These commands may be used freely in CMake projects.
/command/build_command
/command/cmake_host_system_information
/command/cmake_minimum_required
/command/cmake_parse_arguments
/command/cmake_policy
/command/configure_file
/command/continue

View File

@ -718,7 +718,7 @@ same consideration applies to macros, functions and imported targets.
If False, do not try to use the relevant CMake wrapping command.
``Xxx_Yy_FOUND``
If False, optional Yy part of Xxx sytem is not available.
If False, optional Yy part of Xxx system is not available.
``Xxx_FOUND``
Set to false, or undefined, if we haven't found, or don't want to use

View File

@ -213,6 +213,7 @@ All Modules
/module/FindwxWidgets
/module/FindwxWindows
/module/FindXCTest
/module/FindXalanC
/module/FindXercesC
/module/FindX11
/module/FindXMLRPC

View File

@ -89,7 +89,7 @@ a package is to set the ``CMAKE_PREFIX_PATH`` cache variable.
Config-file packages are provided by upstream vendors as part of development
packages, that is, they belong with the header files and any other files
provided to assist downsteams in using the package.
provided to assist downstreams in using the package.
A set of variables which provide package status information are also set
automatically when using a config-file package. The ``<Package>_FOUND``
@ -352,7 +352,7 @@ version-specific variables ``<Package>_VERSION``, ``<Package>_VERSION_MAJOR``,
used to export the targets in the ``ClimbingStatsTargets`` export-set, defined
previously by the :command:`install(TARGETS)` command. This command generates
the ``ClimbingStatsTargets.cmake`` file to contain :prop_tgt:`IMPORTED`
targets, suitable for use by downsteams and arranges to install it to
targets, suitable for use by downstreams and arranges to install it to
``lib/cmake/ClimbingStats``. The generated ``ClimbingStatsConfigVersion.cmake``
and a ``cmake/ClimbingStatsConfig.cmake`` are installed to the same location,
completing the package.
@ -383,7 +383,7 @@ In this case, when using :command:`install(TARGETS)` the ``INCLUDES DESTINATION`
was specified. This causes the ``IMPORTED`` targets to have their
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` populated with the ``include``
directory in the :variable:`CMAKE_INSTALL_PREFIX`. When the ``IMPORTED``
target is used by downsteam, it automatically consumes the entries from
target is used by downstream, it automatically consumes the entries from
that property.
Creating a Package Configuration File
@ -412,7 +412,7 @@ This can also be extended to cover dependencies:
target_link_libraries(ClimbingStats PUBLIC Stats::Types)
As the ``Stats::Types`` target is a ``PUBLIC`` dependency of ``ClimbingStats``,
downsteams must also find the ``Stats`` package and link to the ``Stats::Types``
downstreams must also find the ``Stats`` package and link to the ``Stats::Types``
library. The ``Stats`` package should be found in the ``ClimbingStatsConfig.cmake``
file to ensure this. The ``find_dependency`` macro from the
:module:`CMakeFindDependencyMacro` helps with this by propagating
@ -464,7 +464,7 @@ Creating a Package Configuration File for the Build Tree
The :command:`export(EXPORT)` command creates an :prop_tgt:`IMPORTED` targets
definition file which is specific to the build-tree, and is not relocatable.
This can similiarly be used with a suitable package configuration file and
This can similarly be used with a suitable package configuration file and
package version file to define a package for the build tree which may be used
without installation. Consumers of the build tree can simply ensure that the
:variable:`CMAKE_PREFIX_PATH` contains the build directory, or set the

View File

@ -191,6 +191,7 @@ Properties on Targets
/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
/prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG
/prop_tgt/INTERPROCEDURAL_OPTIMIZATION
/prop_tgt/IOS_INSTALL_COMBINED
/prop_tgt/JOB_POOL_COMPILE
/prop_tgt/JOB_POOL_LINK
/prop_tgt/LABELS

View File

@ -118,6 +118,7 @@ Variables that Change Behavior
/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName
/variable/CMAKE_ERROR_DEPRECATED
/variable/CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
/variable/CMAKE_EXPORT_COMPILE_COMMANDS
/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY
/variable/CMAKE_SYSROOT
/variable/CMAKE_FIND_APPBUNDLE
@ -257,6 +258,7 @@ Variables that Control the Build
/variable/CMAKE_INSTALL_NAME_DIR
/variable/CMAKE_INSTALL_RPATH
/variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH
/variable/CMAKE_IOS_INSTALL_COMBINED
/variable/CMAKE_LANG_COMPILER_LAUNCHER
/variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE
/variable/CMAKE_LANG_VISIBILITY_PRESET

View File

@ -167,16 +167,23 @@ Available commands are:
Change the current working directory and run a command.
``compare_files <file1> <file2>``
Check if file1 is same as file2.
Check if ``<file1>`` is same as ``<file2>``. If files are the same,
then returns 0, if not itreturns 1.
``copy <file> <destination>``
Copy file to destination (either file or directory).
``copy <file>... <destination>``
Copy files to ``<destination>`` (either file or directory).
If multiple files are specified, the ``<destination>`` must be
directory and it must exist.
``copy_directory <source> <destination>``
Copy directory 'source' content to directory 'destination'.
``copy_directory <dir>... <destination>``
Copy directories to ``<destination>`` directory.
If ``<destination>`` directory does not exist it will be created.
``copy_if_different <in-file> <out-file>``
Copy file if input has changed.
``copy_if_different <file>... <destination>``
Copy files to ``<destination>`` (either file or directory) if
they have changed.
If multiple files are specified, the ``<destination>`` must be
directory and it must exist.
``echo [<string>...]``
Displays arguments as text.
@ -188,19 +195,23 @@ Available commands are:
Run command in a modified environment.
``environment``
Display the current environment.
Display the current environment variables.
``make_directory <dir>``
Create a directory.
``make_directory <dir>...``
Create ``<dir>`` directories. If necessary, create parent
directories too. If a directory already exists it will be
silently ignored.
``md5sum [<file>...]``
``md5sum <file>...``
Compute md5sum of files.
``remove [-f] [<file>...]``
Remove the file(s), use ``-f`` to force it.
``remove [-f] <file>...``
Remove the file(s), use ``-f`` to force it. If a file does
not exist it will be silently ignored.
``remove_directory <dir>``
Remove a directory and its contents.
Remove a directory and its contents. If a directory does
not exist it will be silently ignored.
``rename <oldname> <newname>``
Rename a file or directory (on one volume).
@ -233,7 +244,8 @@ Available commands are:
Touch a file.
``touch_nocreate <file>``
Touch a file if it exists but do not create it.
Touch a file if it exists but do not create it. If a file does
not exist it will be silently ignored.
UNIX-specific Command-Line Tools
--------------------------------

View File

@ -0,0 +1 @@
.. cmake-module:: ../../Modules/FindXalanC.cmake

View File

@ -1,18 +1,21 @@
CMP0040
-------
The target in the TARGET signature of add_custom_command() must exist.
The target in the ``TARGET`` signature of :command:`add_custom_command`
must exist and must be defined in current directory.
CMake 2.8.12 and lower silently ignored a custom command created with
the TARGET signature of :command:`add_custom_command`
if the target is unknown.
the ``TARGET`` signature of :command:`add_custom_command`
if the target is unknown or was defined outside the current directory.
The OLD behavior for this policy is to ignore custom commands
for unknown targets. The NEW behavior for this policy is to report an error
if the target referenced in :command:`add_custom_command` is unknown.
The ``OLD`` behavior for this policy is to ignore custom commands
for unknown targets. The ``NEW`` behavior for this policy is to report
an error if the target referenced in :command:`add_custom_command` is
unknown or was defined outside the current directory.
This policy was introduced in CMake version 3.0. CMake version
|release| warns when the policy is not set and uses OLD behavior. Use
the cmake_policy command to set it to OLD or NEW explicitly.
|release| warns when the policy is not set and uses ``OLD`` behavior.
Use the :command:`cmake_policy` command to set it to ``OLD`` or
``NEW`` explicitly.
.. include:: DEPRECATED.txt

View File

@ -0,0 +1,11 @@
IOS_INSTALL_COMBINED
--------------------
Build a combined (device and simulator) target when installing.
When this property is set to set to false (which is the default) then it will
either be built with the device SDK or the simulator SDK depending on the SDK
set. But if this property is set to true then the target will at install time
also be built for the corresponding SDK and combined into one library.
This feature requires at least Xcode version 6.

View File

@ -3,7 +3,7 @@ MACOSX_BUNDLE
Build an executable as an Application Bundle on OS X or iOS.
When this property is set to true the executable when built on OS X
When this property is set to ``TRUE`` the executable when built on OS X
or iOS will be created as an application bundle. This makes it
a GUI executable that can be launched from the Finder. See the
:prop_tgt:`MACOSX_FRAMEWORK_INFO_PLIST` target property for information about

View File

@ -3,8 +3,8 @@ MACOSX_RPATH
Whether this target on OS X or iOS is located at runtime using rpaths.
When this property is set to true, the directory portion of
the "install_name" field of this shared library will be ``@rpath``
When this property is set to ``TRUE``, the directory portion of
the ``install_name`` field of this shared library will be ``@rpath``
unless overridden by :prop_tgt:`INSTALL_NAME_DIR`. This indicates
the shared library is to be found at runtime using runtime
paths (rpaths).
@ -18,6 +18,6 @@ can be controlled by the :prop_tgt:`INSTALL_RPATH` target property on
the target linking to this target.
Policy :policy:`CMP0042` was introduced to change the default value of
``MACOSX_RPATH`` to ``TRUE. This is because use of ``@rpath`` is a
``MACOSX_RPATH`` to ``TRUE``. This is because use of ``@rpath`` is a
more flexible and powerful alternative to ``@executable_path`` and
``@loader_path``.

View File

@ -1,11 +1,61 @@
RESOURCE
--------
Specify resource files in a :prop_tgt:`FRAMEWORK` shared library target.
Specify resource files in a :prop_tgt:`FRAMEWORK` or :prop_tgt:`BUNDLE`.
Shared library targets marked with the :prop_tgt:`FRAMEWORK` property generate
frameworks on OS X, iOS and normal shared libraries on other platforms.
This property may be set to a list of files to be placed in the
``Resources`` directory inside the framework folder. On non-Apple
platforms these files may be installed using the ``RESOURCE`` option to
the ``install(TARGETS)`` command.
Target marked with the :prop_tgt:`FRAMEWORK` or :prop_tgt:`BUNDLE` property
generate framework or application bundle (both OS X and iOS is supported)
or normal shared libraries on other platforms.
This property may be set to a list of files to be placed in the corresponding
directory (eg. ``Resources`` directory for OS X) inside the bundle.
On non-Apple platforms these files may be installed using the ``RESOURCE``
option to the ``install(TARGETS)`` command.
Following example of Application Bundle:
.. code-block:: cmake
add_executable(ExecutableTarget
addDemo.c
resourcefile.txt
appresourcedir/appres.txt
)
target_link_libraries(ExecutableTarget heymath mul)
set(RESOURCE_FILES
resourcefile.txt
appresourcedir/appres.txt
)
set_target_properties(ExecutableTarget PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_FRAMEWORK_IDENTIFIER org.cmake.ExecutableTarget
RESOURCE "${RESOURCE_FILES}"
)
will produce flat structure for iOS systems::
ExecutableTarget.app
appres.txt
ExecutableTarget
Info.plist
resourcefile.txt
For OS X systems it will produce following directory structure::
ExecutableTarget.app/
Contents
Info.plist
MacOS
ExecutableTarget
Resources
appres.txt
resourcefile.txt
For Linux, such cmake script produce following files::
ExecutableTarget
Resources
appres.txt
resourcefile.txt

185
Help/release/3.5.rst Normal file
View File

@ -0,0 +1,185 @@
CMake 3.5 Release Notes
***********************
.. only:: html
.. contents::
Changes made since CMake 3.4 include the following.
New Features
============
GUI
---
* The :manual:`cmake-gui(1)` gained options to control warnings about
deprecated functionality.
* The :manual:`cmake-gui(1)` learned an option to set the toolset
to be used with VS IDE and Xcode generators, much like the
existing ``-T`` option to :manual:`cmake(1)`.
* The :manual:`cmake-gui(1)` gained a Regular Expression Explorer which
may be used to create and evaluate regular expressions in real-time.
The explorer window is available via the ``Tools`` menu.
Command-Line
------------
* The ``-Wdev`` and ``-Wno-dev`` :manual:`cmake(1)` options now also enable
and suppress the deprecated warnings output by default.
* The suppression of developer warnings as errors can now be controlled with
the new ``-Werror=dev`` and ``-Wno-error=dev`` :manual:`cmake(1)` options.
* The :manual:`cmake(1)` ``-E`` command-line tools ``copy``,
``copy_if_different``, ``copy_directory``, and ``make_directory``
learned to support multiple input files or directories.
Commands
--------
* The :command:`cmake_parse_arguments` command is now implemented natively.
The :module:`CMakeParseArguments` module remains as an empty placeholder
for compatibility.
* The :command:`install(DIRECTORY)` command learned to support
:manual:`generator expressions <cmake-generator-expressions(7)>`
in the list of directories.
Variables
---------
* The :variable:`CMAKE_ERROR_DEPRECATED` variable can now be set using the
``-Werror=deprecated`` and ``-Wno-error=deprecated`` :manual:`cmake(1)`
options.
* The :variable:`CMAKE_WARN_DEPRECATED` variable can now be set using the
``-Wdeprecated`` and ``-Wno-deprecated`` :manual:`cmake(1)` options.
Properties
----------
* The :prop_tgt:`VS_GLOBAL_<variable>` target property is now implemented
for VS 2010 and above. Previously it worked only in VS 2008 and below.
Modules
-------
* The :module:`ExternalProject` module learned a new ``GIT_REMOTE_NAME``
option to control the ``git clone --origin`` value.
* The :module:`FindBoost` module now provides imported targets
such as ``Boost::boost`` and ``Boost::filesystem``.
* The :module:`FindFLEX` module ``FLEX_TARGET`` macro learned a
new ``DEFINES_FILE`` option to specify a custom output header
to be generated.
* The :module:`FindGTest` module now provides imported targets.
* The :module:`FindGTK2` module, when ``GTK2_USE_IMPORTED_TARGETS`` is
enabled, now sets ``GTK2_LIBRARIES`` to contain the list of imported
targets instead of the paths to the libraries. Moreover it now sets
a new ``GTK2_TARGETS`` variable containing all the targets imported.
* The :module:`FindOpenMP` module learned to support Clang.
* The :module:`FindOpenSSL` module gained a new
``OPENSSL_MSVC_STATIC_RT`` option to search for libraries using
the MSVC static runtime.
* The :module:`FindPNG` module now provides imported targets.
* The :module:`FindTIFF` module now provides imported targets.
* A :module:`FindXalanC` module was introduced to find the
Apache Xalan-C++ XSL transform processing library.
* The :module:`FindXercesC` module now provides imported targets.
Platforms
---------
* Support was added for the ARM Compiler (arm.com) with compiler id ``ARMCC``.
* A new platform file for cross-compiling in the Cray Linux Environment to
target compute nodes was added. See
:ref:`Cross Compiling for the Cray Linux Environment <Cray Cross-Compile>`
for usage details.
* The :manual:`Compile Features <cmake-compile-features(7)>` functionality
is now aware of features supported by Clang compilers on Windows (MinGW).
* When building for embedded Apple platforms like iOS CMake learned to build and
install combined targets which contain both a device and a simulator build.
This behavior can be enabled by setting the :prop_tgt:`IOS_INSTALL_COMBINED`
target property.
CPack
-----
* The :module:`CPackDMG` module learned new variable to specify AppleScript
file run to customize appearance of ``DragNDrop`` installer folder,
including background image setting using supplied PNG or multi-resolution
TIFF file. See the :variable:`CPACK_DMG_DS_STORE_SETUP_SCRIPT` and
:variable:`CPACK_DMG_BACKGROUND_IMAGE` variables.
* The :module:`CPackDeb` module learned to set the optional config
file ``Source`` field using a monolithic or per-component variable.
See :variable:`CPACK_DEBIAN_PACKAGE_SOURCE`.
* The :module:`CPackDeb` module learned to set Package, Section
and Priority control fields per-component.
See variables :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION` and
:variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY`.
* The :module:`CPack DragNDrop generator <CPackDMG>` learned to add
multi-lingual SLAs to a DMG which is presented to the user when they try to
mount the DMG. See the :variable:`CPACK_DMG_SLA_LANGUAGES` and
:variable:`CPACK_DMG_SLA_DIR` variables for details.
* The :module:`CPackNSIS` module learned new variables to add bitmaps to the
installer. See the :variable:`CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP`
and :variable:`CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP` variables.
* The :module:`CPackRPM` module learned to set Name and Group
control fields per-component.
See :variable:`CPACK_RPM_<component>_PACKAGE_NAME`
and :variable:`CPACK_RPM_<component>_PACKAGE_GROUP`.
Other
-----
* Warnings about deprecated functionality are now enabled by default.
They may be suppressed with ``-Wno-deprecated`` or by setting the
:variable:`CMAKE_WARN_DEPRECATED` variable to false.
Deprecated and Removed Features
===============================
* The :manual:`cmake(1)` ``-E time`` command now properly passes arguments
with spaces or special characters through to the child process. This
may break scripts that worked around the bug with their own extra
quoting or escaping.
* The :generator:`Xcode` generator was fixed to escape backslashes in
strings consistently with other generators. Projects that previously
worked around the inconsistecy with an extra level of backslashes
conditioned on the Xcode generator must be updated to remove the
workaround for CMake 3.5 and greater.
Other Changes
=============
* The :generator:`Visual Studio 14 2015` generator learned to map the
``/debug:fastlink`` linker flag to the ``.vcxproj`` file property.
* The :module:`FindGTK2` module now configures the ``GTK2::sigc++`` imported
target to enable c++11 on its dependents when using sigc++ 2.5.1 or higher.
* The precompiled Windows binary provided on ``cmake.org`` is now a
``.msi`` package instead of an installer executable. One may need
to manually uninstall CMake versions lower than 3.5 before installing
the new package.

View File

@ -1,7 +0,0 @@
0-sample-topic
--------------
* This is a sample release note for the change in a topic.
Developers should add similar notes for each topic branch
making a noteworthy change. Each document should be named
and titled to match the topic name to avoid merge conflicts.

View File

@ -1,6 +0,0 @@
FindFLEX-DEFINES_FILE
---------------------
* The :module:`FindFLEX` module ``FLEX_TARGET`` macro learned a
new ``DEFINES_FILE`` option to specify a custom output header
to be generated.

View File

@ -1,7 +0,0 @@
FindGTK2_GTK2_TARGETS
---------------------
* The :module:`FindGTK2` module, when ``GTK2_USE_IMPORTED_TARGETS`` is
enabled, now sets ``GTK2_LIBRARIES`` to contain the list of imported
targets instead of the paths to the libraries. Moreover it now sets
a new ``GTK2_TARGETS`` variable containing all the targets imported.

View File

@ -1,7 +0,0 @@
FindGTK2_sigc++_c++11
---------------------
* Starting with sigc++ 2.5.1, c++11 must be enabled in order to use
sigc++. The GTK2::sigc++ imported target will automatically enable the
required build flags in order to build with the version found on the
system.

View File

@ -1,6 +0,0 @@
FindOpenSSL-msvc-static-rt
--------------------------
* The :module:`FindOpenSSL` module gained a new
``OPENSSL_MSVC_STATIC_RT`` option to search for libraries using
the MSVC static runtime.

View File

@ -1,4 +0,0 @@
FindXercesC-imported-targets
----------------------------
* The :module:`FindXercesC` module now provides imported targets.

View File

@ -1,4 +0,0 @@
add-armcc-toolchain
-------------------
* Support was added for the ARM Compiler (arm.com) with compiler id ``ARMCC``.

View File

@ -1,7 +0,0 @@
add-cray-linux-platform
-----------------------
* A new platform file for cross-compiling in the Cray Linux Environment to
target compute nodes was added. See
:ref:`Cross Compiling for the Cray Linux Environment <Cray Cross-Compile>`
for usage details.

View File

@ -1,8 +0,0 @@
better-looking-mac-packages
---------------------------
* The :module:`CPackDMG` module learned new variable to specify AppleScript
file run to customize appearance of ``DragNDrop`` installer folder,
including background image setting using supplied PNG or multi-resolution
TIFF file. See the :variable:`CPACK_DMG_DS_STORE_SETUP_SCRIPT` and
:variable:`CPACK_DMG_BACKGROUND_IMAGE` variables.

View File

@ -1,12 +0,0 @@
cmake-W-options
---------------
* The :variable:`CMAKE_WARN_DEPRECATED` variable can now be set using the
``-Wdeprecated`` and ``-Wno-deprecated`` :manual:`cmake(1)` options.
* The ``-Wdev`` and ``-Wno-dev`` :manual:`cmake(1)` options now also enable
and suppress the deprecated warnings output by default.
* Warnings about deprecated functionality are now enabled by default.
They may be suppressed with ``-Wno-deprecated`` or by setting the
:variable:`CMAKE_WARN_DEPRECATED` variable to false.

View File

@ -1,6 +0,0 @@
cmake-gui-select-toolset
------------------------
* The :manual:`cmake-gui(1)` learned an option to set the toolset
to be used with VS IDE and Xcode generators, much like the
existing ``-T`` option to :manual:`cmake(1)`.

View File

@ -1,6 +0,0 @@
cpack-deb-config-file-source-field
----------------------------------
* The :module:`CPackDeb` module learned to set optional config
file ``Source`` field - monolithic and per-component variable.
See :variable:`CPACK_DEBIAN_PACKAGE_SOURCE`.

View File

@ -1,7 +0,0 @@
cpack-deb-new-component-vars
----------------------------
* The :module:`CPackDeb` module learned to set Package, Section
and Priority control fields per-component.
See :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION`
and :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY`.

View File

@ -1,7 +0,0 @@
cpack-dmg-multilanguage-sla
---------------------------
* The :module:`CPack DragNDrop generator <CPackDMG>` learned to add
multi-lingual SLAs to a DMG which is presented to the user when they try to
mount the DMG. See the :variable:`CPACK_DMG_SLA_LANGUAGES` and
:variable:`CPACK_DMG_SLA_DIR` variables for details.

View File

@ -1,6 +0,0 @@
cpack-nsis-bitmap
-----------------
* The :module:`CPackNSIS` module learned new variables to add bitmaps to the
installer. See the :variable:`CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP`
and :variable:`CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP` variables.

View File

@ -1,5 +0,0 @@
deprecate-CMakeForceCompiler
----------------------------
* The :module:`CMakeForceCompiler` module and its macros are now deprecated.
See module documentation for an explanation.

View File

@ -5,14 +5,13 @@ CMake Release Notes
This file should include the adjacent "dev.txt" file
in development versions but not in release versions.
.. include:: dev.txt
Releases
========
.. toctree::
:maxdepth: 1
3.5 <3.5>
3.4 <3.4>
3.3 <3.3>
3.2 <3.2>

View File

@ -0,0 +1,30 @@
CMAKE_EXPORT_COMPILE_COMMANDS
-----------------------------
Enable/Disable output of compile commands during generation.
If enabled, generates a ``compile_commands.json`` file containing the exact
compiler calls for all translation units of the project in machine-readable
form. The format of the JSON file looks like:
.. code-block:: javascript
[
{
"directory": "/home/user/development/project",
"command": "/usr/bin/c++ ... -c ../foo/foo.cc",
"file": "../foo/foo.cc"
},
...
{
"directory": "/home/user/development/project",
"command": "/usr/bin/c++ ... -c ../foo/bar.cc",
"file": "../foo/bar.cc"
}
]
.. note::
This option is implemented only by :ref:`Makefile Generators`
and the :generator:`Ninja`. It is ignored on other generators.

View File

@ -0,0 +1,8 @@
CMAKE_IOS_INSTALL_COMBINED
--------------------------
Default value for :prop_tgt:`IOS_INSTALL_COMBINED` of targets.
This variable is used to initialize the :prop_tgt:`IOS_INSTALL_COMBINED`
property on all the targets. See that target property for additional
information.

View File

@ -8,4 +8,5 @@ specification of a target Windows version to select a corresponding SDK.
The :variable:`CMAKE_SYSTEM_VERSION` variable may be set to specify a
version. Otherwise CMake computes a default version based on the Windows
SDK versions available. The chosen Windows target version number is provided
in ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION``.
in ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION``. If no Windows 10 SDK
is available this value will be empty.

View File

@ -8,3 +8,9 @@ in the generated Xcode project. Ignored on other generators.
See the :prop_tgt:`XCODE_ATTRIBUTE_<an-attribute>` target property
to set attributes on a specific target.
Contents of ``CMAKE_XCODE_ATTRIBUTE_<an-attribute>`` may use
"generator expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available
expressions. See the :manual:`cmake-buildsystem(7)` manual
for more on defining buildsystem properties.

View File

@ -424,7 +424,9 @@ function(get_item_rpaths item rpaths_var)
string(REGEX MATCHALL "rpath [^\n]+" load_cmds_ov "${load_cmds_ov}")
string(REGEX REPLACE "rpath " "" load_cmds_ov "${load_cmds_ov}")
if(load_cmds_ov)
gp_append_unique(${rpaths_var} "${load_cmds_ov}")
foreach(rpath ${load_cmds_ov})
gp_append_unique(${rpaths_var} "${rpath}")
endforeach()
endif()
endif()

View File

@ -2,6 +2,7 @@ set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
set(CMAKE_C_COMPILER_WRAPPER "@CMAKE_C_COMPILER_WRAPPER@")
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "@CMAKE_C_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_C_COMPILE_FEATURES "@CMAKE_C_COMPILE_FEATURES@")
set(CMAKE_C90_COMPILE_FEATURES "@CMAKE_C90_COMPILE_FEATURES@")

View File

@ -21,6 +21,10 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
#if defined(__CRAYXE) || defined(__CRAYXC)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
@ -54,6 +58,9 @@ int main(int argc, char* argv[])
#endif
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
#if defined(__CRAYXE) || defined(__CRAYXC)
require += info_cray[argc];
#endif
require += info_language_dialect_default[argc];
(void)argv;

View File

@ -18,6 +18,8 @@
# It also loads a system - compiler - processor (or target hardware)
# specific file, which is mainly useful for crosscompiling and embedded systems.
include(CMakeLanguageInformation)
# some compilers use different extensions (e.g. sdcc uses .rel)
# so set the extension here first so it can be overridden by the compiler specific file
if(UNIX)
@ -60,6 +62,12 @@ if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif ()
# load any compiler-wrapper specific information
if (CMAKE_C_COMPILER_WRAPPER)
__cmake_include_compiler_wrapper(C)
endif ()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.

View File

@ -2,6 +2,7 @@ set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
set(CMAKE_CXX_COMPILER_WRAPPER "@CMAKE_CXX_COMPILER_WRAPPER@")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_CXX_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@")
set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@")

View File

@ -20,6 +20,10 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
#if defined(__CRAYXE) || defined(__CRAYXC)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@
@ -48,6 +52,9 @@ int main(int argc, char* argv[])
#endif
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
#if defined(__CRAYXE) || defined(__CRAYXC)
require += info_cray[argc];
#endif
require += info_language_dialect_default[argc];
(void)argv;

View File

@ -18,6 +18,8 @@
# It also loads a system - compiler - processor (or target hardware)
# specific file, which is mainly useful for crosscompiling and embedded systems.
include(CMakeLanguageInformation)
# some compilers use different extensions (e.g. sdcc uses .rel)
# so set the extension here first so it can be overridden by the compiler specific file
if(UNIX)
@ -59,6 +61,12 @@ if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE)
endif ()
# load any compiler-wrapper specific information
if (CMAKE_CXX_COMPILER_WRAPPER)
__cmake_include_compiler_wrapper(CXX)
endif ()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.

View File

@ -107,6 +107,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
PARENT_SCOPE)
set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX}" PARENT_SCOPE)
set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
set(CMAKE_${lang}_COMPILER_WRAPPER "${CMAKE_${lang}_COMPILER_WRAPPER}" PARENT_SCOPE)
set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE)
set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE)
set(CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT "${CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT}" PARENT_SCOPE)
@ -182,9 +183,6 @@ Id flags: ${testflags}
set(v 6)
set(ext dsp)
endif()
if("${id_platform}" STREQUAL "Itanium")
set(id_platform ia64)
endif()
if(CMAKE_VS_PLATFORM_TOOLSET)
if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android")
set(id_toolset "<NdkToolchainVersion>${CMAKE_VS_PLATFORM_TOOLSET}</NdkToolchainVersion>")
@ -435,6 +433,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
set(HAVE_COMPILER_VERSION_MINOR 0)
set(HAVE_COMPILER_VERSION_PATCH 0)
set(HAVE_COMPILER_VERSION_TWEAK 0)
set(COMPILER_WRAPPER)
set(DIGIT_VALUE_1 1)
set(DIGIT_VALUE_2 10)
set(DIGIT_VALUE_3 100)
@ -476,6 +475,9 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
endif()
endforeach()
endforeach()
if("${info}" MATCHES "INFO:compiler_wrapper\\[([^]\"]*)\\]")
set(COMPILER_WRAPPER "${CMAKE_MATCH_1}")
endif()
if("${info}" MATCHES "INFO:simulate\\[([^]\"]*)\\]")
set(SIMULATE_ID "${CMAKE_MATCH_1}")
endif()
@ -588,6 +590,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE)
set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
set(CMAKE_${lang}_COMPILER_WRAPPER "${COMPILER_WRAPPER}" PARENT_SCOPE)
set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE)
set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE)
set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)

View File

@ -54,6 +54,7 @@ else()
if(NOT CMAKE_Fortran_COMPILER_INIT)
# Known compilers:
# f77/f90/f95: generic compiler names
# ftn: Cray fortran compiler wrapper
# g77: GNU Fortran 77 compiler
# gfortran: putative GNU Fortran 95+ compiler (in progress)
# fort77: native F77 compiler under HP-UX (and some older Crays)
@ -73,6 +74,7 @@ else()
# then 77 or older compilers, gnu is always last in the group,
# so if you paid for a compiler it is picked by default.
set(CMAKE_Fortran_COMPILER_LIST
ftn
ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
frt pgf77 xlf fl32 af77 g77 f77

View File

@ -2,7 +2,9 @@
# CMakeForceCompiler
# ------------------
#
# Deprecated. Do not use.
# Discouraged. Avoid using this module if possible. It will be deprecated
# by a future version of CMake once alternatives have been provided for all
# toolchain file use cases.
#
# The macros provided by this module were once intended for use by
# cross-compiling toolchain files when CMake was not able to automatically
@ -12,6 +14,12 @@
# CMake detects from a compiler is now too extensive to be provided by
# toolchain files using these macros.
#
# The only known remaining use case for these macros is to write toolchain
# files for cross-compilers that cannot link binaries without special flags or
# custom linker scripts. These macros cause CMake to skip checks it normally
# performs as part of enabling a language and introspecting the toolchain.
# However, skipping these checks may limit some generation functionality.
#
# -------------------------------------------------------------------------
#
# Macro CMAKE_FORCE_C_COMPILER has the following signature:
@ -70,8 +78,6 @@
# License text for the above reference.)
macro(CMAKE_FORCE_C_COMPILER compiler id)
message(DEPRECATION "The CMAKE_FORCE_C_COMPILER macro is deprecated. "
"Instead just set CMAKE_C_COMPILER and allow CMake to identify the compiler.")
set(CMAKE_C_COMPILER "${compiler}")
set(CMAKE_C_COMPILER_ID_RUN TRUE)
set(CMAKE_C_COMPILER_ID ${id})
@ -84,8 +90,6 @@ macro(CMAKE_FORCE_C_COMPILER compiler id)
endmacro()
macro(CMAKE_FORCE_CXX_COMPILER compiler id)
message(DEPRECATION "The CMAKE_FORCE_CXX_COMPILER macro is deprecated. "
"Instead just set CMAKE_CXX_COMPILER and allow CMake to identify the compiler.")
set(CMAKE_CXX_COMPILER "${compiler}")
set(CMAKE_CXX_COMPILER_ID_RUN TRUE)
set(CMAKE_CXX_COMPILER_ID ${id})
@ -98,8 +102,6 @@ macro(CMAKE_FORCE_CXX_COMPILER compiler id)
endmacro()
macro(CMAKE_FORCE_Fortran_COMPILER compiler id)
message(DEPRECATION "The CMAKE_FORCE_Fortran_COMPILER macro is deprecated. "
"Instead just set CMAKE_Fortran_COMPILER and allow CMake to identify the compiler.")
set(CMAKE_Fortran_COMPILER "${compiler}")
set(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
set(CMAKE_Fortran_COMPILER_ID ${id})

View File

@ -2,6 +2,7 @@ set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
set(CMAKE_Fortran_COMPILER_VERSION "@CMAKE_Fortran_COMPILER_VERSION@")
set(CMAKE_Fortran_COMPILER_WRAPPER "@CMAKE_Fortran_COMPILER_WRAPPER@")
set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@")
set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@")

View File

@ -110,6 +110,9 @@
# endif
PRINT *, 'INFO:compiler[]'
#endif
#if defined(__CRAYXE) || defined(__CRAYXC)
PRINT *, 'INFO:compiler_wrapper[CrayPrgEnv]'
#endif
#if 0
! Identify the platform

View File

@ -12,6 +12,8 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CMakeLanguageInformation)
# This file sets the basic flags for the Fortran language in CMake.
# It also loads the available platform file for the system-compiler
# if it exists.
@ -36,6 +38,12 @@ if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE)
endif ()
# load any compiler-wrapper specific information
if (CMAKE_Fortran_COMPILER_WRAPPER)
__cmake_include_compiler_wrapper(Fortran)
endif ()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.

View File

@ -0,0 +1,297 @@
#=============================================================================
# Copyright 2014-2015 Ruslan Baratov, Gregor Jasny
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Function to print messages of this module
function(_ios_install_combined_message)
message("[iOS combined] " ${ARGN})
endfunction()
# Get build settings for the current target/config/SDK by running
# `xcodebuild -sdk ... -showBuildSettings` and parsing it's output
function(_ios_install_combined_get_build_setting sdk variable resultvar)
if("${sdk}" STREQUAL "")
message(FATAL_ERROR "`sdk` is empty")
endif()
if("${variable}" STREQUAL "")
message(FATAL_ERROR "`variable` is empty")
endif()
if("${resultvar}" STREQUAL "")
message(FATAL_ERROR "`resultvar` is empty")
endif()
set(
cmd
xcodebuild -showBuildSettings
-sdk "${sdk}"
-target "${CURRENT_TARGET}"
-config "${CURRENT_CONFIG}"
)
execute_process(
COMMAND ${cmd}
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
)
if(NOT result EQUAL 0)
message(FATAL_ERROR "Command failed (${result}): ${cmd}")
endif()
if(NOT output MATCHES " ${variable} = ([^\n]*)")
message(FATAL_ERROR "${variable} not found.")
endif()
set("${resultvar}" "${CMAKE_MATCH_1}" PARENT_SCOPE)
endfunction()
# Get architectures of given SDK (iphonesimulator/iphoneos)
function(_ios_install_combined_get_valid_archs sdk resultvar)
cmake_policy(SET CMP0007 NEW)
if("${resultvar}" STREQUAL "")
message(FATAL_ERROR "`resultvar` is empty")
endif()
_ios_install_combined_get_build_setting("${sdk}" "VALID_ARCHS" valid_archs)
separate_arguments(valid_archs)
list(REMOVE_ITEM valid_archs "") # remove empty elements
list(REMOVE_DUPLICATES valid_archs)
set("${resultvar}" "${valid_archs}" PARENT_SCOPE)
endfunction()
# Final target can contain more architectures that specified by SDK. This
# function will run 'lipo -info' and parse output. Result will be returned
# as a CMake list.
function(_ios_install_combined_get_real_archs filename resultvar)
set(cmd "${_lipo_path}" -info "${filename}")
execute_process(
COMMAND ${cmd}
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE output
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT result EQUAL 0)
message(
FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}"
)
endif()
if(NOT output MATCHES "(Architectures in the fat file: [^\n]+ are|Non-fat file: [^\n]+ is architecture): ([^\n]*)")
message(FATAL_ERROR "Could not detect architecture from: ${output}")
endif()
separate_arguments(CMAKE_MATCH_2)
set(${resultvar} ${CMAKE_MATCH_2} PARENT_SCOPE)
endfunction()
# Run build command for the given SDK
function(_ios_install_combined_build sdk)
if("${sdk}" STREQUAL "")
message(FATAL_ERROR "`sdk` is empty")
endif()
_ios_install_combined_message("Build `${CURRENT_TARGET}` for `${sdk}`")
execute_process(
COMMAND
"${CMAKE_COMMAND}"
--build
.
--target "${CURRENT_TARGET}"
--config ${CURRENT_CONFIG}
--
-sdk "${sdk}"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
RESULT_VARIABLE result
)
if(NOT result EQUAL 0)
message(FATAL_ERROR "Build failed")
endif()
endfunction()
# Remove given architecture from file. This step needed only in rare cases
# when target was built in "unusual" way. Emit warning message.
function(_ios_install_combined_remove_arch lib arch)
_ios_install_combined_message(
"Warning! Unexpected architecture `${arch}` detected and will be removed "
"from file `${lib}`")
set(cmd "${_lipo_path}" -remove ${arch} -output ${lib} ${lib})
execute_process(
COMMAND ${cmd}
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE output
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT result EQUAL 0)
message(
FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}"
)
endif()
endfunction()
# Check that 'lib' contains only 'archs' architectures (remove others).
function(_ios_install_combined_keep_archs lib archs)
_ios_install_combined_get_real_archs("${lib}" real_archs)
set(archs_to_remove ${real_archs})
list(REMOVE_ITEM archs_to_remove ${archs})
foreach(x ${archs_to_remove})
_ios_install_combined_remove_arch("${lib}" "${x}")
endforeach()
endfunction()
function(_ios_install_combined_detect_sdks this_sdk_var corr_sdk_var)
cmake_policy(SET CMP0057 NEW)
set(this_sdk "$ENV{PLATFORM_NAME}")
if("${this_sdk}" STREQUAL "")
message(FATAL_ERROR "Environment variable PLATFORM_NAME is empty")
endif()
set(all_platforms "$ENV{SUPPORTED_PLATFORMS}")
if("${all_platforms}" STREQUAL "")
message(FATAL_ERROR "Environment variable SUPPORTED_PLATFORMS is empty")
endif()
separate_arguments(all_platforms)
if(NOT this_sdk IN_LIST all_platforms)
message(FATAL_ERROR "`${this_sdk}` not found in `${all_platforms}`")
endif()
list(REMOVE_ITEM all_platforms "" "${this_sdk}")
list(LENGTH all_platforms all_platforms_length)
if(NOT all_platforms_length EQUAL 1)
message(FATAL_ERROR "Expected one element: ${all_platforms}")
endif()
set(${this_sdk_var} "${this_sdk}" PARENT_SCOPE)
set(${corr_sdk_var} "${all_platforms}" PARENT_SCOPE)
endfunction()
# Create combined binary for the given target.
#
# Preconditions:
# * Target already installed at ${destination}
# for the ${PLATFORM_NAME} platform
#
# This function will:
# * Run build for the lacking platform, i.e. opposite to the ${PLATFORM_NAME}
# * Fuse both libraries by running lipo
function(ios_install_combined target destination)
if("${target}" STREQUAL "")
message(FATAL_ERROR "`target` is empty")
endif()
if("${destination}" STREQUAL "")
message(FATAL_ERROR "`destination` is empty")
endif()
if(NOT IS_ABSOLUTE "${destination}")
message(FATAL_ERROR "`destination` is not absolute: ${destination}")
endif()
if(IS_DIRECTORY "${destination}" OR IS_SYMLINK "${destination}")
message(FATAL_ERROR "`destination` is no regular file: ${destination}")
endif()
if("${CMAKE_BINARY_DIR}" STREQUAL "")
message(FATAL_ERROR "`CMAKE_BINARY_DIR` is empty")
endif()
if(NOT IS_DIRECTORY "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "Is not a directory: ${CMAKE_BINARY_DIR}")
endif()
if("${CMAKE_INSTALL_CONFIG_NAME}" STREQUAL "")
message(FATAL_ERROR "CMAKE_INSTALL_CONFIG_NAME is empty")
endif()
set(cmd xcrun -f lipo)
execute_process(
COMMAND ${cmd}
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE output
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT result EQUAL 0)
message(
FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}"
)
endif()
set(_lipo_path ${output})
set(CURRENT_CONFIG "${CMAKE_INSTALL_CONFIG_NAME}")
set(CURRENT_TARGET "${target}")
_ios_install_combined_message("Target: ${CURRENT_TARGET}")
_ios_install_combined_message("Config: ${CURRENT_CONFIG}")
_ios_install_combined_message("Destination: ${destination}")
# Get SDKs
_ios_install_combined_detect_sdks(this_sdk corr_sdk)
# Get architectures of the target
_ios_install_combined_get_valid_archs("${corr_sdk}" corr_valid_archs)
_ios_install_combined_get_valid_archs("${this_sdk}" this_valid_archs)
# Return if there are no valid architectures for the SDK.
# (note that library already installed)
if("${corr_valid_archs}" STREQUAL "")
_ios_install_combined_message(
"No architectures detected for `${corr_sdk}` (skip)"
)
return()
endif()
# Trigger build of corresponding target
_ios_install_combined_build("${corr_sdk}")
# Get location of the library in build directory
_ios_install_combined_get_build_setting(
"${corr_sdk}" "CONFIGURATION_BUILD_DIR" corr_build_dir)
_ios_install_combined_get_build_setting(
"${corr_sdk}" "EXECUTABLE_PATH" corr_executable_path)
set(corr "${corr_build_dir}/${corr_executable_path}")
_ios_install_combined_keep_archs("${corr}" "${corr_valid_archs}")
_ios_install_combined_keep_archs("${destination}" "${this_valid_archs}")
_ios_install_combined_message("Current: ${destination}")
_ios_install_combined_message("Corresponding: ${corr}")
set(cmd "${_lipo_path}" -create ${corr} ${destination} -output ${destination})
execute_process(
COMMAND ${cmd}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
RESULT_VARIABLE result
)
if(NOT result EQUAL 0)
message(FATAL_ERROR "Command failed: ${cmd}")
endif()
_ios_install_combined_message("Install done: ${destination}")
endfunction()

View File

@ -0,0 +1,37 @@
#=============================================================================
# Copyright 2015 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file contains common code blocks used by all the language information
# files
# load any compiler-wrapper specific information
macro(__cmake_include_compiler_wrapper lang)
set(_INCLUDED_WRAPPER_FILE 0)
if (CMAKE_${lang}_COMPILER_ID)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
endif()
if (NOT _INCLUDED_WRAPPER_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
endif ()
# No platform - wrapper - lang information so maybe there's just wrapper - lang information
if(NOT _INCLUDED_WRAPPER_FILE)
if (CMAKE_${lang}_COMPILER_ID)
include(Compiler/${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
endif()
if (NOT _INCLUDED_WRAPPER_FILE)
include(Compiler/${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
endif ()
endif ()
endmacro ()

View File

@ -2,86 +2,10 @@
# CMakeParseArguments
# -------------------
#
#
#
# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords>
# <multi_value_keywords> args...)
#
# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions
# for parsing the arguments given to that macro or function. It
# processes the arguments and defines a set of variables which hold the
# values of the respective options.
#
# The <options> argument contains all options for the respective macro,
# i.e. keywords which can be used when calling the macro without any
# value following, like e.g. the OPTIONAL keyword of the install()
# command.
#
# The <one_value_keywords> argument contains all keywords for this macro
# which are followed by one value, like e.g. DESTINATION keyword of the
# install() command.
#
# The <multi_value_keywords> argument contains all keywords for this
# macro which can be followed by more than one value, like e.g. the
# TARGETS or FILES keywords of the install() command.
#
# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
# keywords listed in <options>, <one_value_keywords> and
# <multi_value_keywords> a variable composed of the given <prefix>
# followed by "_" and the name of the respective keyword. These
# variables will then hold the respective value from the argument list.
# For the <options> keywords this will be TRUE or FALSE.
#
# All remaining arguments are collected in a variable
# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see
# whether your macro was called with unrecognized parameters.
#
# As an example here a my_install() macro, which takes similar arguments
# as the real install() command:
#
# ::
#
# function(MY_INSTALL)
# set(options OPTIONAL FAST)
# set(oneValueArgs DESTINATION RENAME)
# set(multiValueArgs TARGETS CONFIGURATIONS)
# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}"
# "${multiValueArgs}" ${ARGN} )
# ...
#
#
#
# Assume my_install() has been called like this:
#
# ::
#
# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
#
#
#
# After the cmake_parse_arguments() call the macro will have set the
# following variables:
#
# ::
#
# MY_INSTALL_OPTIONAL = TRUE
# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
# MY_INSTALL_DESTINATION = "bin"
# MY_INSTALL_RENAME = "" (was not used)
# MY_INSTALL_TARGETS = "foo;bar"
# MY_INSTALL_CONFIGURATIONS = "" (was not used)
# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
#
#
#
# You can then continue and process these variables.
#
# Keywords terminate lists of values, e.g. if directly after a
# one_value_keyword another recognized keyword follows, this is
# interpreted as the beginning of the new option. E.g.
# my_install(TARGETS foo DESTINATION OPTIONAL) would result in
# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION
# would be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
# This module once implemented the :command:`cmake_parse_arguments` command
# that is now implemented natively by CMake. It is now an empty placeholder
# for compatibility with projects that include it to get the command from
# CMake 3.4 and lower.
#=============================================================================
# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
@ -95,67 +19,3 @@
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
return()
endif()
set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
# first set all result variables to empty/FALSE
foreach(arg_name ${_singleArgNames} ${_multiArgNames})
set(${prefix}_${arg_name})
endforeach()
foreach(option ${_optionNames})
set(${prefix}_${option} FALSE)
endforeach()
set(${prefix}_UNPARSED_ARGUMENTS)
set(insideValues FALSE)
set(currentArgName)
# now iterate over all arguments and fill the result variables
foreach(currentArg ${ARGN})
list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
if(insideValues)
if("${insideValues}" STREQUAL "SINGLE")
set(${prefix}_${currentArgName} ${currentArg})
set(insideValues FALSE)
elseif("${insideValues}" STREQUAL "MULTI")
list(APPEND ${prefix}_${currentArgName} ${currentArg})
endif()
else()
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
endif()
else()
if(NOT ${optionIndex} EQUAL -1)
set(${prefix}_${currentArg} TRUE)
set(insideValues FALSE)
elseif(NOT ${singleArgIndex} EQUAL -1)
set(currentArgName ${currentArg})
set(${prefix}_${currentArgName})
set(insideValues "SINGLE")
elseif(NOT ${multiArgIndex} EQUAL -1)
set(currentArgName ${currentArg})
set(${prefix}_${currentArgName})
set(insideValues "MULTI")
endif()
endif()
endforeach()
# propagate the result variables to the caller:
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
endforeach()
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
endfunction()

View File

@ -37,6 +37,7 @@
# * Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
#
# .. variable:: CPACK_RPM_PACKAGE_NAME
# CPACK_RPM_<component>_PACKAGE_NAME
#
# The RPM package name.
#
@ -81,6 +82,7 @@
# * Default : "unknown"
#
# .. variable:: CPACK_RPM_PACKAGE_GROUP
# CPACK_RPM_<component>_PACKAGE_GROUP
#
# The RPM package group.
#
@ -1106,10 +1108,7 @@ function(cpack_rpm_generate_package)
# Are we packaging components ?
if(CPACK_RPM_PACKAGE_COMPONENT)
set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
string(TOUPPER ${CPACK_RPM_PACKAGE_COMPONENT} CPACK_RPM_PACKAGE_COMPONENT_UPPER)
else()
set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
endif()
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}")
@ -1143,10 +1142,19 @@ function(cpack_rpm_generate_package)
endif()
# CPACK_RPM_PACKAGE_NAME (mandatory)
if(NOT CPACK_RPM_PACKAGE_NAME)
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
endif()
if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_NAME)
set(CPACK_RPM_PACKAGE_NAME ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_NAME})
else()
set(CPACK_RPM_PACKAGE_NAME ${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_COMPONENT})
endif()
endif()
# CPACK_RPM_PACKAGE_VERSION (mandatory)
if(NOT CPACK_RPM_PACKAGE_VERSION)
if(NOT CPACK_PACKAGE_VERSION)
@ -1206,6 +1214,15 @@ function(cpack_rpm_generate_package)
endif()
# CPACK_RPM_PACKAGE_GROUP
#Check for component group first.
#If not set, it will use regular package group logic.
if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_GROUP)
set(CPACK_RPM_PACKAGE_GROUP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_GROUP})
endif()
endif()
if(NOT CPACK_RPM_PACKAGE_GROUP)
set(CPACK_RPM_PACKAGE_GROUP "unknown")
endif()
@ -1613,7 +1630,7 @@ function(cpack_rpm_generate_package)
)
# The name of the final spec file to be used by rpmbuild
set(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec")
set(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec")
# Print out some debug information if we were asked for that
if(CPACK_RPM_PACKAGE_DEBUG)
@ -1645,7 +1662,7 @@ function(cpack_rpm_generate_package)
"# -*- rpm-spec -*-
BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH\@
Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@
Name: \@CPACK_RPM_PACKAGE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_NAME\@
Name: \@CPACK_RPM_PACKAGE_NAME\@
Version: \@CPACK_RPM_PACKAGE_VERSION\@
Release: \@CPACK_RPM_PACKAGE_RELEASE\@
License: \@CPACK_RPM_PACKAGE_LICENSE\@
@ -1749,15 +1766,15 @@ mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" $RPM_BUILD_ROOT
"${CPACK_RPM_BINARY_SPECFILE}"
WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
RESULT_VARIABLE CPACK_RPMBUILD_EXEC_RESULT
ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err"
OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.err"
OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.out")
if(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err RPMBUILDERR)
file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out RPMBUILDOUT)
file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.err RPMBUILDERR)
file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.out RPMBUILDOUT)
message("CPackRPM:Debug: You may consult rpmbuild logs in: ")
message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.err")
message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_NAME}.out")
message("CPackRPM:Debug: *** ${RPMBUILDOUT} ***")
endif()
else()

View File

@ -119,7 +119,8 @@
#
# .. variable:: CPACK_WIX_PATCH_FILE
#
# Optional XML file with fragments to be inserted into generated WiX sources
# Optional list of XML files with fragments to be inserted into
# generated WiX sources
#
# This optional variable can be used to specify an XML file that the
# WiX generator will use to inject fragments into its generated

View File

@ -6,7 +6,7 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
endif()
cmake_policy(GET CMP0025 appleClangPolicy)
if(WIN32 OR (APPLE AND NOT appleClangPolicy STREQUAL NEW))
if(APPLE AND NOT appleClangPolicy STREQUAL NEW)
return()
endif()
@ -49,7 +49,7 @@ macro(cmake_record_cxx_compile_features)
endmacro()
set(_result 0)
if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
_get_clang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES)
if (_result EQUAL 0)
_get_clang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)

View File

@ -0,0 +1,11 @@
if(__craylinux_crayprgenv_c)
return()
endif()
set(__craylinux_crayprgenv_c 1)
include(Compiler/CrayPrgEnv)
macro(__CrayPrgEnv_setup_C compiler_cmd link_cmd)
__CrayPrgEnv_setup(C
${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c
${compiler_cmd} ${link_cmd})
endmacro()

View File

@ -0,0 +1,11 @@
if(__craylinux_crayprgenv_cxx)
return()
endif()
set(__craylinux_crayprgenv_cxx 1)
include(Compiler/CrayPrgEnv)
macro(__CrayPrgEnv_setup_CXX compiler_cmd link_cmd)
__CrayPrgEnv_setup(CXX
${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp
${compiler_cmd} ${link_cmd})
endmacro()

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_cray_c)
return()
endif()
set(__craylinux_crayprgenv_cray_c 1)
include(Compiler/CrayPrgEnv-C)
__CrayPrgEnv_setup_C("/opt/cray/cce/.*/ccfe" "/opt/cray/cce/.*/ld")

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_cray_cxx)
return()
endif()
set(__craylinux_crayprgenv_cray_cxx 1)
include(Compiler/CrayPrgEnv-CXX)
__CrayPrgEnv_setup_CXX("/opt/cray/cce/.*/ccfe" "/opt/cray/cce/.*/ld")

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_cray_fortran)
return()
endif()
set(__craylinux_crayprgenv_cray_fortran 1)
include(Compiler/CrayPrgEnv-Fortran)
__CrayPrgEnv_setup_Fortran("/opt/cray/cce/.*/ftnfe" "/opt/cray/cce/.*/ld")

View File

@ -0,0 +1,11 @@
if(__craylinux_crayprgenv_fortran)
return()
endif()
set(__craylinux_crayprgenv_fortran 1)
include(Compiler/CrayPrgEnv)
macro(__CrayPrgEnv_setup_Fortran compiler_cmd link_cmd)
__CrayPrgEnv_setup(Fortran
${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F
${compiler_cmd} ${link_cmd})
endmacro()

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_gnu_c)
return()
endif()
set(__craylinux_crayprgenv_gnu_c 1)
include(Compiler/CrayPrgEnv-C)
__CrayPrgEnv_setup_C("/opt/gcc/.*/cc1" "/opt/gcc/.*/collect2")

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_gnu_cxx)
return()
endif()
set(__craylinux_crayprgenv_gnu_cxx 1)
include(Compiler/CrayPrgEnv-CXX)
__CrayPrgEnv_setup_CXX("/opt/gcc/.*/cc1plus" "/opt/gcc/.*/collect2")

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_gnu_fortran)
return()
endif()
set(__craylinux_crayprgenv_gnu_fortran 1)
include(Compiler/CrayPrgEnv-Fortran)
__CrayPrgEnv_setup_Fortran("/opt/gcc/.*/f951" "/opt/gcc/.*/collect2")

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_intel_c)
return()
endif()
set(__craylinux_crayprgenv_intel_c 1)
include(Compiler/CrayPrgEnv-C)
__CrayPrgEnv_setup_C("/opt/intel/.*/mcpcom" "^ld ")

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_intel_cxx)
return()
endif()
set(__craylinux_crayprgenv_intel_cxx 1)
include(Compiler/CrayPrgEnv-CXX)
__CrayPrgEnv_setup_CXX("/opt/intel/.*/mcpcom" "^ld ")

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_intel_fortran)
return()
endif()
set(__craylinux_crayprgenv_intel_fortran 1)
include(Compiler/CrayPrgEnv-Fortran)
__CrayPrgEnv_setup_Fortran("/opt/intel/.*/fortcom" "^ld ")

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_pgi_c)
return()
endif()
set(__craylinux_crayprgenv_pgi_c 1)
include(Compiler/CrayPrgEnv-C)
__CrayPrgEnv_setup_C("/opt/pgi/[^ ]*/pgc" "/usr/bin/ld")

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_pgi_cxx)
return()
endif()
set(__craylinux_crayprgenv_pgi_cxx 1)
include(Compiler/CrayPrgEnv-CXX)
__CrayPrgEnv_setup_CXX("/opt/pgi/[^ ]*/pgcpp" "/usr/bin/ld")

View File

@ -0,0 +1,7 @@
if(__craylinux_crayprgenv_pgi_fortran)
return()
endif()
set(__craylinux_crayprgenv_pgi_fortran 1)
include(Compiler/CrayPrgEnv-Fortran)
__CrayPrgEnv_setup_Fortran("/opt/pgi/[^ ]*/pgf" "/usr/bin/ld")

View File

@ -0,0 +1,91 @@
# Guard against multiple inclusions
if(__craylinux_crayprgenv)
return()
endif()
set(__craylinux_crayprgenv 1)
macro(__cray_extract_args cmd tag_regex out_var make_absolute)
string(REGEX MATCHALL "${tag_regex}" args "${cmd}")
foreach(arg IN LISTS args)
string(REGEX REPLACE "^${tag_regex}$" "\\2" param "${arg}")
if(make_absolute)
get_filename_component(param "${param}" ABSOLUTE)
endif()
list(APPEND ${out_var} ${param})
endforeach()
endmacro()
function(__cray_extract_implicit src compiler_cmd link_cmd lang include_dirs_var link_dirs_var link_libs_var)
set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CrayExtractImplicit_${lang}.bin")
execute_process(
COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_VERBOSE_FLAG} -o ${BIN}
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error
)
if(EXISTS "${BIN}")
file(REMOVE "${BIN}")
endif()
set(include_dirs)
set(link_dirs)
set(link_libs)
string(REGEX REPLACE "\r?\n" ";" output_lines "${output}\n${error}")
foreach(line IN LISTS output_lines)
if("${line}" MATCHES "${compiler_cmd}")
__cray_extract_args("${line}" " -(I ?|isystem )([^ ]*)" include_dirs 1)
set(processed_include 1)
endif()
if("${line}" MATCHES "${link_cmd}")
__cray_extract_args("${line}" " -(L ?)([^ ]*)" link_dirs 1)
__cray_extract_args("${line}" " -(l ?)([^ ]*)" link_libs 0)
set(processed_link 1)
endif()
if(processed_include AND processed_link)
break()
endif()
endforeach()
set(${include_dirs_var} "${include_dirs}" PARENT_SCOPE)
set(${link_dirs_var} "${link_dirs}" PARENT_SCOPE)
set(${link_libs_var} "${link_libs}" PARENT_SCOPE)
set(CRAY_${lang}_EXTRACTED_IMPLICIT 1 CACHE INTERNAL "" FORCE)
endfunction()
macro(__CrayPrgEnv_setup lang test_src compiler_cmd link_cmd)
if(DEFINED ENV{CRAYPE_VERSION})
message(STATUS "Cray Programming Environment $ENV{CRAYPE_VERSION} ${lang}")
elseif(DEFINED ENV{ASYNCPE_VERSION})
message(STATUS "Cray XT Programming Environment $ENV{ASYNCPE_VERSION} ${lang}")
endif()
# Flags for the Cray wrappers
set(CMAKE_STATIC_LIBRARY_LINK_${lang}_FLAGS "-static")
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "")
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-dynamic")
# If the link type is not explicitly specified in the environment then
# the Cray wrappers assume that the code will be built staticly so
# we check the following condition(s) are NOT met
# Compiler flags are explicitly dynamic
# Env var is dynamic and compiler flags are not explicitly static
if(NOT (((CMAKE_${lang}_FLAGS MATCHES "(^| )-dynamic($| )") OR
(CMAKE_EXE_LINKER_FLAGS MATCHES "(^| )-dynamic($| )"))
OR
(("$ENV{CRAYPE_LINK_TYPE}" STREQUAL "dynamic") AND
NOT ((CMAKE_${lang}_FLAGS MATCHES "(^| )-static($| )") OR
(CMAKE_EXE_LINKER_FLAGS MATCHES "(^| )-static($| )")))))
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
set(BUILD_SHARED_LIBS FALSE CACHE BOOL "")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_LINK_SEARCH_START_STATIC TRUE)
endif()
if(NOT CRAY_${lang}_EXTRACTED_IMPLICIT)
__cray_extract_implicit(
${test_src} ${compiler_cmd} ${link_cmd} ${lang}
CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES
CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES
CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES
)
endif()
endmacro()

View File

@ -4,4 +4,4 @@ set(_compiler_id_pp_test "defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__
set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__CODEGEARC_VERSION__>>24 & 0x00FF)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__CODEGEARC_VERSION__>>16 & 0x00FF)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__CODEGEARC_VERSION__ & 0xFFFF)")
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__CODEGEARC_VERSION__ & 0xFFFF)")

View File

@ -57,6 +57,8 @@ Create custom targets to build projects in external trees
URL of git repo
``GIT_TAG <tag>``
Git branch name, commit id or tag
``GIT_REMOTE_NAME <name>``
The optional name of the remote, default to ``origin``
``GIT_SUBMODULES <module>...``
Git submodules that shall be updated, all if empty
``HG_REPOSITORY <url>``
@ -494,7 +496,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_submodules src_name work_dir gitclone_infofile gitclone_stampfile)
function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name git_submodules src_name work_dir gitclone_infofile gitclone_stampfile)
file(WRITE ${script_filename}
"if(\"${git_tag}\" STREQUAL \"\")
message(FATAL_ERROR \"Tag for git checkout should not be empty.\")
@ -524,7 +526,7 @@ set(error_code 1)
set(number_of_tries 0)
while(error_code AND number_of_tries LESS 3)
execute_process(
COMMAND \"${git_EXECUTABLE}\" clone \"${git_repository}\" \"${src_name}\"
COMMAND \"${git_EXECUTABLE}\" clone --origin \"${git_remote_name}\" \"${git_repository}\" \"${src_name}\"
WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code
)
@ -645,7 +647,7 @@ endif()
endfunction()
function(_ep_write_gitupdate_script script_filename git_EXECUTABLE git_tag git_submodules git_repository work_dir)
function(_ep_write_gitupdate_script script_filename git_EXECUTABLE git_tag git_remote_name git_submodules git_repository work_dir)
if(NOT GIT_VERSION_STRING VERSION_LESS 1.7.6)
set(git_stash_save_options --all --quiet)
else()
@ -687,7 +689,7 @@ if(\"\${show_ref_output}\" MATCHES \"refs/remotes/${git_tag}\")
set(git_remote \"\${CMAKE_MATCH_1}\")
set(git_tag \"\${CMAKE_MATCH_2}\")
else()
set(git_remote \"origin\")
set(git_remote \"${git_remote_name}\")
set(git_tag \"${git_tag}\")
endif()
@ -1228,9 +1230,24 @@ function(_ep_get_build_command name step cmd_var)
set(cmd "${CMAKE_COMMAND}")
endif()
set(args --build ".")
if (CMAKE_CFG_INTDIR AND NOT CMAKE_CFG_INTDIR STREQUAL ".")
list(APPEND args --config "${CMAKE_CFG_INTDIR}")
endif ()
if(CMAKE_CONFIGURATION_TYPES)
if (CMAKE_CFG_INTDIR AND
NOT CMAKE_CFG_INTDIR STREQUAL "." AND
NOT CMAKE_CFG_INTDIR MATCHES "\\$")
# CMake 3.4 and below used the CMAKE_CFG_INTDIR placeholder value
# provided by multi-configuration generators. Some projects were
# taking advantage of that undocumented implementation detail to
# specify a specific configuration here. They should use
# BUILD_COMMAND to change the default command instead, but for
# compatibility honor the value.
set(config ${CMAKE_CFG_INTDIR})
message(AUTHOR_WARNING "CMAKE_CFG_INTDIR should not be set by project code.\n"
"To get a non-default build command, use the BUILD_COMMAND option.")
else()
set(config $<CONFIG>)
endif()
list(APPEND args --config ${config})
endif()
if(step STREQUAL "INSTALL")
list(APPEND args --target install)
endif()
@ -1238,6 +1255,9 @@ function(_ep_get_build_command name step cmd_var)
if("x${step}x" STREQUAL "xTESTx")
string(REGEX REPLACE "^(.*/)cmake([^/]*)$" "\\1ctest\\2" cmd "${cmd}")
set(args "")
if(CMAKE_CONFIGURATION_TYPES)
list(APPEND args -C ${config})
endif()
endif()
endif()
else()
@ -1749,6 +1769,11 @@ function(_ep_add_download_command name)
endif()
get_property(git_submodules TARGET ${name} PROPERTY _EP_GIT_SUBMODULES)
get_property(git_remote_name TARGET ${name} PROPERTY _EP_GIT_REMOTE_NAME)
if(NOT git_remote_name)
set(git_remote_name "origin")
endif()
# For the download step, and the git clone operation, only the repository
# should be recorded in a configured RepositoryInfo file. If the repo
# changes, the clone script should be run again. But if only the tag
@ -1772,7 +1797,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_submodules}" ${src_name} ${work_dir}
${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} "${git_submodules}" ${src_name} ${work_dir}
${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt
)
set(comment "Performing download step (git clone) for '${name}'")
@ -1993,9 +2018,13 @@ function(_ep_add_update_command name)
if(NOT git_tag)
set(git_tag "master")
endif()
get_property(git_remote_name TARGET ${name} PROPERTY _EP_GIT_REMOTE_NAME)
if(NOT git_remote_name)
set(git_remote_name "origin")
endif()
get_property(git_submodules TARGET ${name} PROPERTY _EP_GIT_SUBMODULES)
_ep_write_gitupdate_script(${tmp_dir}/${name}-gitupdate.cmake
${GIT_EXECUTABLE} ${git_tag} "${git_submodules}" ${git_repository} ${work_dir}
${GIT_EXECUTABLE} ${git_tag} ${git_remote_name} "${git_submodules}" ${git_repository} ${work_dir}
)
set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitupdate.cmake)
set(always 1)

View File

@ -494,18 +494,18 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_blas95${BLAS_mkl_DLL_SUFFIX} mkl_intel_c${BLAS_mkl_DLL_SUFFIX}")
endif()
if (BLA_VENDOR STREQUAL "Intel10_64lp*" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR MATCHES "^Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_blas95_lp64${BLAS_mkl_DLL_SUFFIX} mkl_intel_lp64${BLAS_mkl_DLL_SUFFIX}")
endif ()
# Add threading/sequential libs
set(BLAS_SEARCH_LIBS_WIN_THREAD "")
if (BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential${BLAS_mkl_DLL_SUFFIX}")
endif()
if (NOT BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All")
if (NOT BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libguide40 mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}")
@ -561,14 +561,14 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_intel_c${BLAS_mkl_DLL_SUFFIX}")
endif()
if (BLA_VENDOR STREQUAL "Intel10_64lp*" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR MATCHES "^Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_intel_lp64${BLAS_mkl_DLL_SUFFIX}")
endif ()
# Add threading/sequential libs
set(BLAS_SEARCH_LIBS_WIN_THREAD "")
if (NOT BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All")
if (NOT BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libguide40 mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}")
@ -576,7 +576,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libiomp5md mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}")
endif()
if (BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR MATCHES "_seq$" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential${BLAS_mkl_DLL_SUFFIX}")
endif()

View File

@ -54,6 +54,33 @@
# Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
# Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
#
# The following :prop_tgt:`IMPORTED` targets are also defined::
#
# Boost::boost - Target for header-only dependencies
# (Boost include directory)
# Boost::<C> - Target for specific component dependency
# (shared or static library); <C> is lower-
# case
# Boost::diagnostic_definitions - interface target to enable diagnostic
# information about Boost's automatic linking
# during compilation (adds BOOST_LIB_DIAGNOSTIC)
# Boost::disable_autolinking - interface target to disable automatic
# linking with MSVC (adds BOOST_ALL_NO_LIB)
# Boost::dynamic_linking - interface target to enable dynamic linking
# linking with MSVC (adds BOOST_ALL_DYN_LINK)
#
# Implicit dependencies such as Boost::filesystem requiring
# Boost::system will be automatically detected and satisfied, even
# if system is not specified when using find_package and if
# Boost::system is not added to target_link_libraries. If using
# Boost::thread, then Thread::Thread will also be added automatically.
#
# It is important to note that the imported targets behave differently
# than variables created by this module: multiple calls to
# find_package(Boost) in the same directory or sub-directories with
# different options (e.g. static or shared) will not override the
# values of the targets created by the first call.
#
# Users may set these hints or results as cache entries. Projects
# should not read these entries directly but instead use the above
# result variables. Note that some hint names start in upper-case
@ -142,6 +169,14 @@
# add_executable(foo foo.cc)
# endif()
#
# Example to find Boost libraries and use imported targets::
#
# find_package(Boost 1.56 REQUIRED COMPONENTS
# date_time filesystem iostreams)
# add_executable(foo foo.cc)
# target_link_libraries(foo Boost::date_time Boost::filesystem
# Boost::iostreams)
#
# Example to find Boost headers and some *static* libraries::
#
# set(Boost_USE_STATIC_LIBS ON) # only find static libs
@ -471,6 +506,276 @@ function(_Boost_GUESS_COMPILER_PREFIX _ret)
set(${_ret} ${_boost_COMPILER} PARENT_SCOPE)
endfunction()
#
# Get component dependencies. Requires the dependencies to have been
# defined for the Boost release version.
#
# component - the component to check
# _ret - list of library dependencies
#
function(_Boost_COMPONENT_DEPENDENCIES component _ret)
# Note: to add a new Boost release, run
#
# % cmake -DBOOST_DIR=/path/to/boost/source -P Utilities/Scripts/BoostScanDeps.cmake
#
# The output may be added in a new block below. If it's the same as
# the previous release, simply update the version range of the block
# for the previous release.
#
# This information was originally generated by running
# BoostScanDeps.cmake against every boost release to date supported
# by FindBoost:
#
# % for version in /path/to/boost/sources/*
# do
# cmake -DBOOST_DIR=$version -P Utilities/Scripts/BoostScanDeps.cmake
# done
#
# The output was then updated by search and replace with these regexes:
#
# - Strip message(STATUS) prefix dashes
# s;^-- ;;
# - Indent
# s;^set(; set(;;
# - Add conditionals
# s;Scanning /path/to/boost/sources/boost_\(.*\)_\(.*\)_\(.*); elseif(NOT Boost_VERSION VERSION_LESS \10\20\3 AND Boost_VERSION VERSION_LESS xxxx);
#
# This results in the logic seen below, but will require the xxxx
# replacing with the following Boost release version (or the next
# minor version to be released, e.g. 1.59 was the latest at the time
# of writing, making 1.60 the next, so 106000 is the needed version
# number). Identical consecutive releases were then merged together
# by updating the end range of the first block and removing the
# following redundant blocks.
#
# Running the script against all historical releases should be
# required only if the BoostScanDeps.cmake script logic is changed.
# The addition of a new release should only require it to be run
# against the new release.
set(_Boost_IMPORTED_TARGETS TRUE)
if(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
set(_Boost_IOSTREAMS_DEPENDENCIES regex thread)
set(_Boost_REGEX_DEPENDENCIES thread)
set(_Boost_WAVE_DEPENDENCIES filesystem thread)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 103500 AND Boost_VERSION VERSION_LESS 103600)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 103600 AND Boost_VERSION VERSION_LESS 103800)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 103800 AND Boost_VERSION VERSION_LESS 104300)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 104300 AND Boost_VERSION VERSION_LESS 104400)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 104400 AND Boost_VERSION VERSION_LESS 104500)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random serialization)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_WAVE_DEPENDENCIES serialization filesystem system thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 104500 AND Boost_VERSION VERSION_LESS 104700)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 104700 AND Boost_VERSION VERSION_LESS 104800)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 104800 AND Boost_VERSION VERSION_LESS 105000)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES date_time)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105000 AND Boost_VERSION VERSION_LESS 105300)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105300 AND Boost_VERSION VERSION_LESS 105400)
set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105400 AND Boost_VERSION VERSION_LESS 105500)
set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105500 AND Boost_VERSION VERSION_LESS 105600)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
set(_Boost_MPI_DEPENDENCIES serialization)
set(_Boost_MPI_PYTHON_DEPENDENCIES python mpi serialization)
set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105600 AND Boost_VERSION VERSION_LESS 105900)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
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_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 105900 AND Boost_VERSION VERSION_LESS 106000)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_COROUTINE_DEPENDENCIES context system)
set(_Boost_FILESYSTEM_DEPENDENCIES system)
set(_Boost_IOSTREAMS_DEPENDENCIES regex)
set(_Boost_LOG_DEPENDENCIES log_setup date_time 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_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
elseif(NOT Boost_VERSION VERSION_LESS 106000 AND Boost_VERSION VERSION_LESS 106200)
set(_Boost_CHRONO_DEPENDENCIES system)
set(_Boost_COROUTINE_DEPENDENCIES context system)
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_TIMER_DEPENDENCIES chrono system)
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)
endif()
string(TOUPPER ${component} uppercomponent)
set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
string(REGEX REPLACE ";" " " _boost_DEPS_STRING "${_Boost_${uppercomponent}_DEPENDENCIES}")
if (NOT _boost_DEPS_STRING)
set(_boost_DEPS_STRING "(none)")
endif()
# message(STATUS "Dependencies for Boost::${component}: ${_boost_DEPS_STRING}")
endfunction()
#
# Determine if any missing dependencies require adding to the component list.
#
# Sets _Boost_${COMPONENT}_DEPENDENCIES for each required component,
# plus _Boost_IMPORTED_TARGETS (TRUE if imported targets should be
# defined; FALSE if dependency information is unavailable).
#
# componentvar - the component list variable name
#
#
function(_Boost_MISSING_DEPENDENCIES componentvar)
# _boost_unprocessed_components - list of components requiring processing
# _boost_processed_components - components already processed (or currently being processed)
# _boost_new_components - new components discovered for future processing
#
list(APPEND _boost_unprocessed_components ${${componentvar}})
while(_boost_unprocessed_components)
list(APPEND _boost_processed_components ${_boost_unprocessed_components})
foreach(component ${_boost_unprocessed_components})
string(TOUPPER ${component} uppercomponent)
set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
_Boost_COMPONENT_DEPENDENCIES("${component}" _Boost_${uppercomponent}_DEPENDENCIES)
set(_Boost_${uppercomponent}_DEPENDENCIES ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES})
list(FIND _boost_processed_components "${componentdep}" _boost_component_found)
list(FIND _boost_new_components "${componentdep}" _boost_component_new)
if (_boost_component_found EQUAL -1 AND _boost_component_new EQUAL -1)
list(APPEND _boost_new_components ${componentdep})
endif()
endforeach()
endforeach()
set(_boost_unprocessed_components ${_boost_new_components})
unset(_boost_new_components)
endwhile()
set(${componentvar} ${_boost_processed_components} PARENT_SCOPE)
endfunction()
#
# End functions/macros
#
@ -511,8 +816,12 @@ if(Boost_FIND_VERSION_EXACT)
else()
# The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request.
#
# Note: When adding a new Boost release, also update the dependency
# information in _Boost_COMPONENT_DEPENDENCIES. See the
# instructions at the top of _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
"1.61.0" "1.61" "1.60.0" "1.60"
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
"1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
"1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1"
@ -562,6 +871,16 @@ if(Boost_DEBUG)
"Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}")
endif()
# Supply Boost_LIB_DIAGNOSTIC_DEFINITIONS as a convenience target. It
# will only contain any interface definitions on WIN32, but is created
# on all platforms to keep end user code free from platform dependent
# code. Also provide convenience targets to disable autolinking and
# enable dynamic linking.
if(NOT TARGET Boost::diagnostic_definitions)
add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
add_library(Boost::disable_autolinking INTERFACE IMPORTED)
add_library(Boost::dynamic_linking INTERFACE IMPORTED)
endif()
if(WIN32)
# In windows, automatic linking is performed, so you do not have
# to specify the libraries. If you are linking to a dynamic
@ -581,6 +900,12 @@ if(WIN32)
# code to emit a #pragma message each time a library is selected
# for linking.
set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
set_target_properties(Boost::diagnostic_definitions PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC")
set_target_properties(Boost::disable_autolinking PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB")
set_target_properties(Boost::dynamic_linking PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
endif()
_Boost_CHECK_SPELLING(Boost_ROOT)
@ -979,6 +1304,17 @@ if(Boost_VERSION AND Boost_FIND_COMPONENTS)
endif()
endif()
# Additional components may be required via component dependencies.
# Add any missing components to the list.
_Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS)
# If thread is required, get the thread libs as a dependency
list(FIND Boost_FIND_COMPONENTS thread _Boost_THREAD_DEPENDENCY_LIBS)
if(NOT _Boost_THREAD_DEPENDENCY_LIBS EQUAL -1)
include(CMakeFindDependencyMacro)
find_dependency(Threads)
endif()
# If the user changed any of our control inputs flush previous results.
if(_Boost_CHANGE_LIBDIR OR _Boost_CHANGE_LIBNAME)
foreach(COMPONENT ${_Boost_COMPONENTS_SEARCHED})
@ -1221,6 +1557,70 @@ else()
endforeach()
endif()
# ------------------------------------------------------------------------
# Add imported targets
# ------------------------------------------------------------------------
if(Boost_FOUND AND _Boost_IMPORTED_TARGETS)
# For header-only libraries
if(NOT TARGET Boost::boost)
add_library(Boost::boost INTERFACE IMPORTED)
if(Boost_INCLUDE_DIRS)
set_target_properties(Boost::boost PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
endif()
endif()
foreach(COMPONENT ${Boost_FIND_COMPONENTS})
if(NOT TARGET Boost::${COMPONENT})
string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
if(Boost_${UPPERCOMPONENT}_FOUND)
if(Boost_USE_STATIC_LIBS)
add_library(Boost::${COMPONENT} STATIC IMPORTED)
else()
# Even if Boost_USE_STATIC_LIBS is OFF, we might have static
# libraries as a result.
add_library(Boost::${COMPONENT} UNKNOWN IMPORTED)
endif()
if(Boost_INCLUDE_DIRS)
set_target_properties(Boost::${COMPONENT} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
endif()
if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY}")
set_target_properties(Boost::${COMPONENT} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${Boost_${UPPERCOMPONENT}_LIBRARY}")
endif()
if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Boost::${COMPONENT} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
IMPORTED_LOCATION_DEBUG "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
endif()
if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Boost::${COMPONENT} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LOCATION_RELEASE "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
endif()
if(_Boost_${UPPERCOMPONENT}_DEPENDENCIES)
unset(_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES)
foreach(dep ${_Boost_${UPPERCOMPONENT}_DEPENDENCIES})
list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Boost::${dep})
endforeach()
if(COMPONENT STREQUAL "thread")
list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Threads::Threads)
endif()
set_target_properties(Boost::${COMPONENT} PROPERTIES
INTERFACE_LINK_LIBRARIES "${_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES}")
endif()
endif()
endif()
endforeach()
endif()
# ------------------------------------------------------------------------
# Notification to end user about what was found
# ------------------------------------------------------------------------

View File

@ -1456,6 +1456,11 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
set(cuda_build_comment_string "Building NVCC (${cuda_build_type}) object ${generated_file_relative_path}")
endif()
set(_verbatim VERBATIM)
if(ccbin_flags MATCHES "\\$\\(VCInstallDir\\)")
set(_verbatim "")
endif()
# Build the generated file and dependency file ##########################
add_custom_command(
OUTPUT ${generated_file}
@ -1474,6 +1479,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
-P "${custom_target_script}"
WORKING_DIRECTORY "${cuda_compile_intermediate_directory}"
COMMENT "${cuda_build_comment_string}"
${_verbatim}
)
# Make sure the build system knows the file is generated.
@ -1585,6 +1591,11 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
set(do_obj_build_rule FALSE)
endif()
set(_verbatim VERBATIM)
if(nvcc_flags MATCHES "\\$\\(VCInstallDir\\)")
set(_verbatim "")
endif()
if (do_obj_build_rule)
add_custom_command(
OUTPUT ${output_file}
@ -1592,6 +1603,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} -dlink ${object_files} -o ${output_file}
${flags}
COMMENT "Building NVCC intermediate link file ${output_file_relative_path}"
${_verbatim}
)
else()
get_filename_component(output_file_dir "${output_file}" DIRECTORY)
@ -1601,6 +1613,7 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options
COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}"
COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}"
${_verbatim}
)
endif()
endif()

View File

@ -2,17 +2,78 @@
# FindDCMTK
# ---------
#
# find DCMTK libraries and applications
# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK
# Find DCMTK libraries and applications
#
# The module defines the following variables::
#
# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK
# DCMTK_LIBRARIES - Files to link against to use DCMTK
# DCMTK_FOUND - If false, don't try to use DCMTK
# DCMTK_DIR - (optional) Source directory for DCMTK
#
# DCMTK_DIR can be used to make it simpler to find the various include
# directories and compiled libraries if you've just compiled it in the
# source tree. Just set it to the root of the tree where you extracted
# the source (default to /usr/include/dcmtk/)
# Compatibility
# ^^^^^^^^^^^^^
#
# This module is able to find a version of DCMTK that does or does not export
# a *DCMTKConfig.cmake* file. It applies a two step process:
#
# * Step 1: Attempt to find DCMTK version providing a *DCMTKConfig.cmake* file.
# * Step 2: If step 1 failed, rely on *FindDCMTK.cmake* to set `DCMTK_*` variables details below.
#
#
# `Recent DCMTK
# <http://git.dcmtk.org/web?p=dcmtk.git;a=commit;h=662ae187c493c6b9a73dd5e3875372cebd0c11fe>`_
# provides a *DCMTKConfig.cmake* :manual:`package configuration file
# <cmake-packages(7)>`. To exclusively use the package configuration file
# (recommended when possible), pass the `NO_MODULE` option to
# :command:`find_package`. For example, `find_package(DCMTK NO_MODULE)`.
# This requires official DCMTK snapshot *3.6.1_20140617* or newer.
#
#
# Until all clients update to the more recent DCMTK, build systems will need
# to support different versions of DCMTK.
#
# On any given system, the following combinations of DCMTK versions could be
# considered:
#
# +--------+---------------------+-----------------------+-------------------+
# | | SYSTEM DCMTK | LOCAL DCMTK | Supported ? |
# +--------+---------------------+-----------------------+-------------------+
# | Case A | NA | [ ] DCMTKConfig | YES |
# +--------+---------------------+-----------------------+-------------------+
# | Case B | NA | [X] DCMTKConfig | YES |
# +--------+---------------------+-----------------------+-------------------+
# | Case C | [ ] DCMTKConfig | NA | YES |
# +--------+---------------------+-----------------------+-------------------+
# | Case D | [X] DCMTKConfig | NA | YES |
# +--------+---------------------+-----------------------+-------------------+
# | Case E | [ ] DCMTKConfig | [ ] DCMTKConfig | YES (*) |
# +--------+---------------------+-----------------------+-------------------+
# | Case F | [X] DCMTKConfig | [ ] DCMTKConfig | NO |
# +--------+---------------------+-----------------------+-------------------+
# | Case G | [ ] DCMTKConfig | [X] DCMTKConfig | YES |
# +--------+---------------------+-----------------------+-------------------+
# | Case H | [X] DCMTKConfig | [X] DCMTKConfig | YES |
# +--------+---------------------+-----------------------+-------------------+
#
# (*) See Troubleshooting section.
#
# Legend:
#
# NA ...............: Means that no System or Local DCMTK is available
#
# [ ] DCMTKConfig ..: Means that the version of DCMTK does NOT export a DCMTKConfig.cmake file.
#
# [X] DCMTKConfig ..: Means that the version of DCMTK exports a DCMTKConfig.cmake file.
#
#
# Troubleshooting
# ^^^^^^^^^^^^^^^
#
# What to do if my project finds a different version of DCMTK?
#
# Remove DCMTK entry from the CMake cache per :command:`find_package`
# documentation.
#=============================================================================
# Copyright 2004-2009 Kitware, Inc.
@ -35,50 +96,142 @@
# Modified for EasyViz by Thomas Sondergaard.
#
if(NOT DCMTK_FOUND AND NOT DCMTK_DIR)
set(DCMTK_DIR
"/usr/include/dcmtk/"
CACHE
PATH
"Root of DCMTK source tree (optional).")
mark_as_advanced(DCMTK_DIR)
set(_dcmtk_dir_description "The directory of DCMTK build or install tree.")
# Ensure that DCMTK_DIR is set to a reasonable default value
# so that DCMTK libraries can be found on a standard Unix distribution.
# It also overwrite the value of DCMTK_DIR after this one has been
# set by a successful discovery of DCMTK by the unpatched FindDCMTK.cmake module
# distributed with CMake (as of 0167cea)
if(NOT DCMTK_DIR OR DCMTK_DIR STREQUAL "/usr/include/dcmtk")
set(DCMTK_DIR "/usr" CACHE PATH ${_dcmtk_dir_description} FORCE)
endif()
set(_SAVED_DCMTK_DIR ${DCMTK_DIR})
#
# Step1: Attempt to find a version of DCMTK providing a DCMTKConfig.cmake file.
#
if(NOT DCMTK_FIND_QUIETLY)
message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake")
endif()
find_package(DCMTK QUIET NO_MODULE)
if(DCMTK_FOUND
AND NOT "x" STREQUAL "x${DCMTK_LIBRARIES}"
AND NOT "x" STREQUAL "x${DCMTK_INCLUDE_DIRS}")
if(NOT DCMTK_FIND_QUIETLY)
message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake - ok")
endif()
return()
else()
if(NOT DCMTK_FIND_QUIETLY)
message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake - failed")
endif()
endif()
if(NOT DCMTK_FIND_QUIETLY)
message(STATUS "Trying to find DCMTK relying on FindDCMTK.cmake")
endif()
# Restore the value reset by the previous call to 'find_package(DCMTK QUIET NO_MODULE)'
set(DCMTK_DIR ${_SAVED_DCMTK_DIR} CACHE PATH ${_dcmtk_dir_description} FORCE)
#
# Step2: Attempt to find a version of DCMTK that does NOT provide a DCMTKConfig.cmake file.
#
# prefer DCMTK_DIR over default system paths like /usr/lib
if(DCMTK_DIR)
set(CMAKE_PREFIX_PATH ${DCMTK_DIR}/lib ${CMAKE_PREFIX_PATH}) # this is given to FIND_LIBRARY or FIND_PATH
endif()
# Find all libraries, store debug and release separately
foreach(lib
dcmdata
dcmpstat
dcmsr
dcmsign
dcmtls
dcmqrdb
dcmnet
dcmjpeg
dcmimage
dcmimgle
dcmjpeg
dcmnet
dcmpstat
dcmqrdb
dcmsign
dcmsr
dcmtls
dcmdata
oflog
ofstd
ijg12
ijg16
ijg8
ofstd)
)
find_library(DCMTK_${lib}_LIBRARY
# Find Release libraries
find_library(DCMTK_${lib}_LIBRARY_RELEASE
${lib}
PATHS
${DCMTK_DIR}/${lib}/libsrc
${DCMTK_DIR}/${lib}/libsrc/Release
${DCMTK_DIR}/${lib}/libsrc/Debug
${DCMTK_DIR}/${lib}/Release
${DCMTK_DIR}/lib
${DCMTK_DIR}/lib/Release
${DCMTK_DIR}/dcmjpeg/lib${lib}/Release
NO_DEFAULT_PATH
)
# Find Debug libraries
find_library(DCMTK_${lib}_LIBRARY_DEBUG
${lib}${DCMTK_CMAKE_DEBUG_POSTFIX}
PATHS
${DCMTK_DIR}/${lib}/libsrc
${DCMTK_DIR}/${lib}/libsrc/Debug
${DCMTK_DIR}/${lib}/Debug
${DCMTK_DIR}/lib)
${DCMTK_DIR}/lib
${DCMTK_DIR}/lib/Debug
${DCMTK_DIR}/dcmjpeg/lib${lib}/Debug
NO_DEFAULT_PATH
)
mark_as_advanced(DCMTK_${lib}_LIBRARY)
mark_as_advanced(DCMTK_${lib}_LIBRARY_RELEASE)
mark_as_advanced(DCMTK_${lib}_LIBRARY_DEBUG)
if(DCMTK_${lib}_LIBRARY)
list(APPEND DCMTK_LIBRARIES ${DCMTK_${lib}_LIBRARY})
# Add libraries to variable according to build type
if(DCMTK_${lib}_LIBRARY_RELEASE)
list(APPEND DCMTK_LIBRARIES optimized ${DCMTK_${lib}_LIBRARY_RELEASE})
endif()
if(DCMTK_${lib}_LIBRARY_DEBUG)
list(APPEND DCMTK_LIBRARIES debug ${DCMTK_${lib}_LIBRARY_DEBUG})
endif()
endforeach()
set(CMAKE_THREAD_LIBS_INIT)
if(DCMTK_oflog_LIBRARY_RELEASE OR DCMTK_oflog_LIBRARY_DEBUG)
# Hack - Not having a DCMTKConfig.cmake file to read the settings from, we will attempt to
# find the library in all cases.
# Ideally, pthread library should be discovered only if DCMTK_WITH_THREADS is enabled.
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads)
endif()
if(CMAKE_THREAD_LIBS_INIT)
list(APPEND DCMTK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif()
#
# SPECIFIC CASE FOR DCMTK BUILD DIR as DCMTK_DIR
# (as opposed to a DCMTK install dir)
# Have to find the source directory.
if(EXISTS ${DCMTK_DIR}/CMakeCache.txt)
load_cache(${DCMTK_DIR} READ_WITH_PREFIX "EXT"
DCMTK_SOURCE_DIR)
if(NOT EXISTS ${EXTDCMTK_SOURCE_DIR})
message(FATAL_ERROR
"DCMTK build directory references
nonexistant DCMTK source directory ${EXTDCMTK_SOURCE_DIR}")
endif()
endif()
set(DCMTK_config_TEST_HEADER osconfig.h)
set(DCMTK_dcmdata_TEST_HEADER dctypes.h)
@ -92,6 +245,10 @@ set(DCMTK_dcmsign_TEST_HEADER sicert.h)
set(DCMTK_dcmsr_TEST_HEADER dsrtree.h)
set(DCMTK_dcmtls_TEST_HEADER tlslayer.h)
set(DCMTK_ofstd_TEST_HEADER ofstdinc.h)
set(DCMTK_oflog_TEST_HEADER oflog.h)
set(DCMTK_dcmjpls_TEST_HEADER djlsutil.h)
set(DCMTK_INCLUDE_DIR_NAMES)
foreach(dir
config
@ -99,31 +256,47 @@ foreach(dir
dcmimage
dcmimgle
dcmjpeg
dcmjpls
dcmnet
dcmpstat
dcmqrdb
dcmsign
dcmsr
dcmtls
ofstd)
ofstd
oflog)
if(EXTDCMTK_SOURCE_DIR)
set(SOURCE_DIR_PATH
${EXTDCMTK_SOURCE_DIR}/${dir}/include/dcmtk/${dir})
endif()
find_path(DCMTK_${dir}_INCLUDE_DIR
${DCMTK_${dir}_TEST_HEADER}
PATHS
${DCMTK_DIR}/${dir}/include
${DCMTK_DIR}/${dir}
${DCMTK_DIR}/include/${dir}
${DCMTK_DIR}/include/dcmtk/${dir}
${DCMTK_DIR}/${dir}/include/dcmtk/${dir}
${DCMTK_DIR}/include/${dir}
${SOURCE_DIR_PATH}
)
mark_as_advanced(DCMTK_${dir}_INCLUDE_DIR)
list(APPEND DCMTK_INCLUDE_DIR_NAMES DCMTK_${dir}_INCLUDE_DIR)
if(DCMTK_${dir}_INCLUDE_DIR)
# add the 'include' path so eg
#include "dcmtk/dcmimgle/dcmimage.h"
# works
get_filename_component(_include ${DCMTK_${dir}_INCLUDE_DIR} PATH)
get_filename_component(_include ${_include} PATH)
list(APPEND
DCMTK_INCLUDE_DIRS
${DCMTK_${dir}_INCLUDE_DIR})
${DCMTK_${dir}_INCLUDE_DIR}
${_include})
endif()
endforeach()
list(APPEND DCMTK_INCLUDE_DIRS ${DCMTK_DIR}/include)
if(WIN32)
list(APPEND DCMTK_LIBRARIES netapi32 wsock32)
endif()
@ -137,21 +310,31 @@ if(DCMTK_ofstd_INCLUDE_DIR)
mark_as_advanced(DCMTK_dcmtk_INCLUDE_DIR)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(DCMTK DEFAULT_MSG
DCMTK_config_INCLUDE_DIR
DCMTK_ofstd_INCLUDE_DIR
DCMTK_ofstd_LIBRARY
DCMTK_dcmdata_INCLUDE_DIR
DCMTK_dcmdata_LIBRARY
DCMTK_dcmimgle_INCLUDE_DIR
DCMTK_dcmimgle_LIBRARY)
# Compatibility: This variable is deprecated
set(DCMTK_INCLUDE_DIR ${DCMTK_INCLUDE_DIRS})
foreach(executable dcmdump dcmdjpeg dcmdrle)
string(TOUPPER ${executable} EXECUTABLE)
find_program(DCMTK_${EXECUTABLE}_EXECUTABLE ${executable} ${DCMTK_DIR}/bin)
mark_as_advanced(DCMTK_${EXECUTABLE}_EXECUTABLE)
endforeach()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DCMTK
REQUIRED_VARS ${DCMTK_INCLUDE_DIR_NAMES} DCMTK_LIBRARIES
FAIL_MESSAGE "Please set DCMTK_DIR and re-run configure")
# Workaround bug in packaging of DCMTK 3.6.0 on Debian.
# See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637687
if(DCMTK_FOUND AND UNIX AND NOT APPLE)
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_FLAGS )
set(CMAKE_REQUIRED_DEFINITIONS )
set(CMAKE_REQUIRED_INCLUDES ${DCMTK_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${DCMTK_LIBRARIES})
set(CMAKE_REQUIRED_QUIET ${DCMTK_FIND_QUIETLY})
check_cxx_source_compiles("#include <dcmtk/config/osconfig.h>\n#include <dcmtk/ofstd/ofstream.h>\nint main(int,char*[]){return 0;}"
DCMTK_HAVE_CONFIG_H_OPTIONAL
)
if(NOT DCMTK_HAVE_CONFIG_H_OPTIONAL)
set(DCMTK_DEFINITIONS "HAVE_CONFIG_H")
endif()
endif()
if(NOT DCMTK_FIND_QUIETLY)
message(STATUS "Trying to find DCMTK relying on FindDCMTK.cmake - ok")
endif()

View File

@ -4,88 +4,89 @@
#
# Locate the Google C++ Testing Framework.
#
# Defines the following variables:
# Imported targets
# ^^^^^^^^^^^^^^^^
#
# ::
# This module defines the following :prop_tgt:`IMPORTED` targets:
#
# GTEST_FOUND - Found the Google Testing framework
# GTEST_INCLUDE_DIRS - Include directories
# ``GTest::GTest``
# The Google Test ``gtest`` library, if found; adds Thread::Thread
# automatically
# ``GTest::Main``
# The Google Test ``gtest_main`` library, if found
#
#
# Result variables
# ^^^^^^^^^^^^^^^^
#
# Also defines the library variables below as normal variables. These
# This module will set the following variables in your project:
#
# ``GTEST_FOUND``
# Found the Google Testing framework
# ``GTEST_INCLUDE_DIRS``
# the directory containing the Google Test headers
#
# The library variables below are set as normal variables. These
# contain debug/optimized keywords when a debugging library is found.
#
# ::
# ``GTEST_LIBRARIES``
# The Google Test ``gtest`` library; note it also requires linking
# with an appropriate thread library
# ``GTEST_MAIN_LIBRARIES``
# The Google Test ``gtest_main`` library
# ``GTEST_BOTH_LIBRARIES``
# Both ``gtest`` and ``gtest_main``
#
# GTEST_BOTH_LIBRARIES - Both libgtest & libgtest-main
# GTEST_LIBRARIES - libgtest
# GTEST_MAIN_LIBRARIES - libgtest-main
# Cache variables
# ^^^^^^^^^^^^^^^
#
# The following cache variables may also be set:
#
# ``GTEST_ROOT``
# The root directory of the Google Test installation (may also be
# set as an environment variable)
# ``GTEST_MSVC_SEARCH``
# If compiling with MSVC, this variable can be set to ``MD`` or
# ``MT`` (the default) to enable searching a GTest build tree
#
#
#
# Accepts the following variables as input:
#
# ::
#
# GTEST_ROOT - (as a CMake or environment variable)
# The root directory of the gtest install prefix
#
#
#
# ::
#
# GTEST_MSVC_SEARCH - If compiling with MSVC, this variable can be set to
# "MD" or "MT" to enable searching a GTest build tree
# (defaults: "MD")
#
#
#
# Example Usage:
# Example usage
# ^^^^^^^^^^^^^
#
# ::
#
# enable_testing()
# find_package(GTest REQUIRED)
# include_directories(${GTEST_INCLUDE_DIRS})
#
#
#
# ::
#
# add_executable(foo foo.cc)
# target_link_libraries(foo ${GTEST_BOTH_LIBRARIES})
#
#
#
# ::
# target_link_libraries(foo GTest::GTest GTest::Main)
#
# add_test(AllTestsInFoo foo)
#
#
#
#
# Deeper integration with CTest
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
# If you would like each Google test to show up in CTest as a test you
# may use the following macro. NOTE: It will slow down your tests by
# running an executable for each test and test fixture. You will also
# have to rerun CMake after adding or removing tests or test fixtures.
# may use the following macro::
#
# GTEST_ADD_TESTS(executable extra_args ARGN)
# GTEST_ADD_TESTS(executable extra_args files...)
#
# ::
# ``executable``
# the path to the test executable
# ``extra_args``
# a list of extra arguments to be passed to executable enclosed in
# quotes (or ``""`` for none)
# ``files...``
# a list of source files to search for tests and test fixtures. Or
# ``AUTO`` to find them from executable target
#
# executable = The path to the test executable
# extra_args = Pass a list of extra arguments to be passed to
# executable enclosed in quotes (or "" for none)
# ARGN = A list of source files to search for tests & test
# fixtures. Or AUTO to find them from executable target.
# However, note that this macro will slow down your tests by running
# an executable for each test and test fixture. You will also have to
# re-run CMake after adding or removing tests or test fixtures.
#
# Example usage::
#
#
# ::
#
# Example:
# set(FooTestArgs --foo 1 --bar 2)
# add_executable(FooTest FooUnitTest.cc)
# GTEST_ADD_TESTS(FooTest "${FooTestArgs}" AUTO)
@ -208,5 +209,60 @@ if(GTEST_FOUND)
_gtest_append_debugs(GTEST_LIBRARIES GTEST_LIBRARY)
_gtest_append_debugs(GTEST_MAIN_LIBRARIES GTEST_MAIN_LIBRARY)
set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
endif()
include(CMakeFindDependencyMacro)
find_dependency(Threads)
if(NOT TARGET GTest::GTest)
add_library(GTest::GTest UNKNOWN IMPORTED)
set_target_properties(GTest::GTest PROPERTIES
INTERFACE_LINK_LIBRARIES "Threads::Threads")
if(GTEST_INCLUDE_DIRS)
set_target_properties(GTest::GTest PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIRS}")
endif()
if(EXISTS "${GTEST_LIBRARY}")
set_target_properties(GTest::GTest PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GTEST_LIBRARY}")
endif()
if(EXISTS "${GTEST_LIBRARY_DEBUG}")
set_property(TARGET GTest::GTest APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(GTest::GTest PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
IMPORTED_LOCATION_DEBUG "${GTEST_LIBRARY_DEBUG}")
endif()
if(EXISTS "${GTEST_LIBRARY_RELEASE}")
set_property(TARGET GTest::GTest APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(GTest::GTest PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LOCATION_RELEASE "${GTEST_LIBRARY_RELEASE}")
endif()
endif()
if(NOT TARGET GTest::Main)
add_library(GTest::Main UNKNOWN IMPORTED)
set_target_properties(GTest::Main PROPERTIES
INTERFACE_LINK_LIBRARIES "GTest::GTest")
if(EXISTS "${GTEST_MAIN_LIBRARY}")
set_target_properties(GTest::Main PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${GTEST_MAIN_LIBRARY}")
endif()
if(EXISTS "${GTEST_MAIN_LIBRARY_DEBUG}")
set_property(TARGET GTest::Main APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(GTest::Main PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
IMPORTED_LOCATION_DEBUG "${GTEST_MAIN_LIBRARY_DEBUG}")
endif()
if(EXISTS "${GTEST_MAIN_LIBRARY_RELEASE}")
set_property(TARGET GTest::Main APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(GTest::Main PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LOCATION_RELEASE "${GTEST_MAIN_LIBRARY_RELEASE}")
endif()
endif()
endif()

View File

@ -2,27 +2,26 @@
# FindGit
# -------
#
#
#
# The module defines the following variables:
#
# ::
#
# GIT_EXECUTABLE - path to git command line client
# GIT_FOUND - true if the command line client was found
# GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)
# ``GIT_EXECUTABLE``
# Path to Git command-line client.
# ``Git_FOUND``, ``GIT_FOUND``
# True if the Git command-line client was found.
# ``GIT_VERSION_STRING``
# The version of Git found.
#
# Example usage:
#
# ::
# .. code-block:: cmake
#
# find_package(Git)
# if(GIT_FOUND)
# message("git found: ${GIT_EXECUTABLE}")
# if(Git_FOUND)
# message("Git found: ${GIT_EXECUTABLE}")
# endif()
#=============================================================================
# Copyright 2010 Kitware, Inc.
# Copyright 2010-2016 Kitware, Inc.
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
#
# Distributed under the OSI-approved BSD License (the "License");
@ -57,10 +56,11 @@ find_program(GIT_EXECUTABLE
NAMES ${git_names}
PATHS ${github_path} ${_git_sourcetree_path}
PATH_SUFFIXES Git/cmd Git/bin
DOC "git command line client"
DOC "Git command line client"
)
mark_as_advanced(GIT_EXECUTABLE)
unset(git_names)
unset(_git_sourcetree_path)
if(GIT_EXECUTABLE)
@ -74,7 +74,7 @@ if(GIT_EXECUTABLE)
unset(git_version)
endif()
# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
# Handle the QUIETLY and REQUIRED arguments and set Git_FOUND to TRUE if
# all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)

View File

@ -63,7 +63,7 @@ macro(java_append_library_directories _var)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
set(_java_libarch "ppc64" "ppc")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
set(_java_libarch "ppc")
set(_java_libarch "ppc" "ppc64")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
# Both flavours can run on the same processor
set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
@ -271,7 +271,8 @@ find_path(JAVA_INCLUDE_PATH jni.h
${JAVA_AWT_INCLUDE_DIRECTORIES}
)
find_path(JAVA_INCLUDE_PATH2 jni_md.h
find_path(JAVA_INCLUDE_PATH2 NAMES jni_md.h jniport.h
PATHS
${JAVA_INCLUDE_PATH}
${JAVA_INCLUDE_PATH}/darwin
${JAVA_INCLUDE_PATH}/win32
@ -281,6 +282,7 @@ find_path(JAVA_INCLUDE_PATH2 jni_md.h
${JAVA_INCLUDE_PATH}/solaris
${JAVA_INCLUDE_PATH}/hp-ux
${JAVA_INCLUDE_PATH}/alpha
${JAVA_INCLUDE_PATH}/aix
)
find_path(JAVA_AWT_INCLUDE_PATH jawt.h

View File

@ -228,12 +228,12 @@ if(Java_FIND_COMPONENTS)
endif()
elseif(component STREQUAL "IdlJ")
list(APPEND _JAVA_REQUIRED_VARS Java_IDLJ_EXECUTABLE)
if(Java_IdlJ_EXECUTABLE)
set(Java_Extra_FOUND TRUE)
if(Java_IDLJ_EXECUTABLE)
set(Java_IdlJ_FOUND TRUE)
endif()
elseif(component STREQUAL "JarSigner")
list(APPEND _JAVA_REQUIRED_VARS Java_JARSIGNER_EXECUTABLE)
if(Java_IDLJ_EXECUTABLE)
if(Java_JARSIGNER_EXECUTABLE)
set(Java_JarSigner_FOUND TRUE)
endif()
else()

View File

@ -79,11 +79,17 @@ find_path(OPENAL_INCLUDE_DIR al.h
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_OpenAL_ARCH_DIR libs/Win64)
else()
set(_OpenAL_ARCH_DIR libs/Win32)
endif()
find_library(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
HINTS
ENV OPENALDIR
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
PATH_SUFFIXES lib64 lib libs64 libs ${_OpenAL_ARCH_DIR}
PATHS
~/Library/Frameworks
/Library/Frameworks
@ -94,6 +100,7 @@ find_library(OPENAL_LIBRARY
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
)
unset(_OpenAL_ARCH_DIR)
# handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if
# all listed variables are TRUE

View File

@ -71,9 +71,11 @@ elseif (WIN32)
elseif (APPLE)
find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL lib for OSX")
find_library(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX")
find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX")
# The OpenGL.framework provides both gl and glu
find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X")
find_library(OPENGL_glu_LIBRARY OpenGL DOC
"GLU library for OS X (usually same as OpenGL library)")
find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OS X")
list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
else()
@ -149,7 +151,9 @@ if(OPENGL_gl_LIBRARY)
set( OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_LIBRARIES})
if(OPENGL_glu_LIBRARY)
set( OPENGL_GLU_FOUND "YES" )
set( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} )
if(NOT "${OPENGL_glu_LIBRARY}" STREQUAL "${OPENGL_gl_LIBRARY}")
set( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} )
endif()
else()
set( OPENGL_GLU_FOUND "NO" )
endif()

View File

@ -50,6 +50,8 @@ function(_OPENMP_FLAG_CANDIDATES LANG)
" "
#GNU
"-fopenmp"
#Clang
"-fopenmp=libomp"
#Microsoft Visual Studio
"/openmp"
#Intel windows
@ -67,6 +69,7 @@ function(_OPENMP_FLAG_CANDIDATES LANG)
)
set(OMP_FLAG_GNU "-fopenmp")
set(OMP_FLAG_Clang "-fopenmp=libomp")
set(OMP_FLAG_HP "+Oopenmp")
if(WIN32)
set(OMP_FLAG_Intel "-Qopenmp")

View File

@ -2,13 +2,20 @@
# FindPNG
# -------
#
# Find the native PNG includes and library
# Find libpng, the official reference library for the PNG image format.
#
# Imported targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the following :prop_tgt:`IMPORTED` target:
#
# This module searches libpng, the library for working with PNG images.
# ``PNG::PNG``
# The libpng library, if found.
#
# It defines the following variables
# Result variables
# ^^^^^^^^^^^^^^^^
#
# This module will set the following variables in your project:
#
# ``PNG_INCLUDE_DIRS``
# where to find png.h, etc.
@ -22,19 +29,22 @@
# ``PNG_VERSION_STRING``
# the version of the PNG library found (since CMake 2.8.8)
#
# Also defined, but not for general use are
# Obsolete variables
# ^^^^^^^^^^^^^^^^^^
#
# The following variables may also be set, for backwards compatibility:
#
# ``PNG_LIBRARY``
# where to find the PNG library.
#
# For backward compatiblity the variable PNG_INCLUDE_DIR is also set.
# It has the same value as PNG_INCLUDE_DIRS.
# ``PNG_INCLUDE_DIR``
# where to find the PNG headers (same as PNG_INCLUDE_DIRS)
#
# Since PNG depends on the ZLib compression library, none of the above
# will be defined unless ZLib can be found.
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
# Copyright 2016 Raumfeld
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@ -105,6 +115,32 @@ if(ZLIB_FOUND)
endif()
endif ()
if(NOT TARGET PNG::PNG)
add_library(PNG::PNG UNKNOWN IMPORTED)
set_target_properties(PNG::PNG PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${PNG_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
if(EXISTS "${PNG_LIBRARY}")
set_target_properties(PNG::PNG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${PNG_LIBRARY}")
endif()
if(EXISTS "${PNG_LIBRARY_DEBUG}")
set_property(TARGET PNG::PNG APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(PNG::PNG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
IMPORTED_LOCATION_DEBUG "${PNG_LIBRARY_DEBUG}")
endif()
if(EXISTS "${PNG_LIBRARY_RELEASE}")
set_property(TARGET PNG::PNG APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(PNG::PNG PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
IMPORTED_LOCATION_RELEASE "${PNG_LIBRARY_RELEASE}")
endif()
endif()
endif ()
if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")

View File

@ -238,8 +238,8 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
if(NOT "${_extra_paths}" STREQUAL "")
# Save the PKG_CONFIG_PATH environment variable, and add paths
# from the CMAKE_PREFIX_PATH variables
set(_pkgconfig_path_old $ENV{PKG_CONFIG_PATH})
set(_pkgconfig_path ${_pkgconfig_path_old})
set(_pkgconfig_path_old "$ENV{PKG_CONFIG_PATH}")
set(_pkgconfig_path "${_pkgconfig_path_old}")
if(NOT "${_pkgconfig_path}" STREQUAL "")
file(TO_CMAKE_PATH "${_pkgconfig_path}" _pkgconfig_path)
endif()
@ -263,6 +263,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
endif()
endif()
list(APPEND _lib_dirs "lib/pkgconfig")
list(APPEND _lib_dirs "share/pkgconfig")
# Check if directories exist and eventually append them to the
# pkgconfig path list
@ -284,7 +285,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
string(REPLACE ";" ":" _pkgconfig_path "${_pkgconfig_path}")
string(REPLACE "\\ " " " _pkgconfig_path "${_pkgconfig_path}")
endif()
set(ENV{PKG_CONFIG_PATH} ${_pkgconfig_path})
set(ENV{PKG_CONFIG_PATH} "${_pkgconfig_path}")
endif()
# Unset variables
@ -381,6 +382,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
pkg_get_variable("${_pkg_check_prefix}_PREFIX" ${_pkg_check_modules_pkg} "prefix")
pkg_get_variable("${_pkg_check_prefix}_INCLUDEDIR" ${_pkg_check_modules_pkg} "includedir")
pkg_get_variable("${_pkg_check_prefix}_LIBDIR" ${_pkg_check_modules_pkg} "libdir")
foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR)
_pkgconfig_set("${_pkg_check_modules_pkg}_${variable}" "${${_pkg_check_modules_pkg}_${variable}}")
endforeach ()
if (NOT ${_is_silent})
message(STATUS " Found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}")
@ -400,7 +404,7 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
if(NOT "${_extra_paths}" STREQUAL "")
# Restore the environment variable
set(ENV{PKG_CONFIG_PATH} ${_pkgconfig_path})
set(ENV{PKG_CONFIG_PATH} "${_pkgconfig_path_old}")
endif()
unset(_extra_paths)

View File

@ -305,7 +305,7 @@ mark_as_advanced(PROTOBUF_PROTOC_EXECUTABLE)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROTOBUF DEFAULT_MSG
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Protobuf DEFAULT_MSG
PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)
if(PROTOBUF_FOUND)

View File

@ -28,9 +28,10 @@
# for Python. You need to set this variable before calling
# find_package(PythonInterp).
#
# If also calling find_package(PythonLibs), call find_package(PythonInterp)
# first to get the currently active Python version by default with a consistent
# version of PYTHON_LIBRARIES.
# If calling both ``find_package(PythonInterp)`` and
# ``find_package(PythonLibs)``, call ``find_package(PythonInterp)`` first to
# get the currently active Python version by default with a consistent version
# of PYTHON_LIBRARIES.
#=============================================================================
# Copyright 2005-2010 Kitware, Inc.

Some files were not shown because too many files have changed in this diff Show More