diff options
47 files changed, 399 insertions, 273 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index 2495c44..fb55bfc 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -29,27 +29,23 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") set(CPACK_PACKAGE_VENDOR "Kitware") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") + set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_PACKAGE_VERSION "${CMake_VERSION}") - set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}") - # Make this explicit here, rather than accepting the CPack default value, - # so we can refer to it: - set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") - # Installers for 32- vs. 64-bit CMake: # - Root install directory (displayed to end user at installer-run time) # - "NSIS package/display name" (text used in the installer GUI) # - Registry key used to store info about the installation if(CMAKE_CL_64) set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") - set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)") - set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)") + set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)") else() set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") - set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") - set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") + set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") endif() + set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_NSIS_PACKAGE_NAME}") if(NOT DEFINED CPACK_SYSTEM_NAME) # make sure package is not Cygwin-unknown, for Cygwin just diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 008a102..3ff0188 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -13,14 +13,7 @@ if(CPACK_GENERATOR MATCHES "NSIS") set(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp") # tell cpack to create links to the doc files set(CPACK_NSIS_MENU_LINKS - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-gui.html" "cmake-gui Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html" - "CMake Properties and Variables Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/ctest.html" "CTest Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-modules.html" "CMake Modules Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-commands.html" "CMake Commands Help" - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cpack.html" "CPack Help" + "@CMAKE_DOC_DIR@/html/index.html" "CMake Documentation" "http://www.cmake.org" "CMake Web Site" ) # Use the icon from cmake-gui for add-remove programs diff --git a/CMakeLists.txt b/CMakeLists.txt index 25cd576..d6237b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -484,7 +484,6 @@ if(BUILD_QtDialog) if(APPLE) set(CMAKE_BUNDLE_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") - set(CMAKE_BUNDLE_NAME "CMake ${CMAKE_BUNDLE_VERSION}") set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}") # make sure CMAKE_INSTALL_PREFIX ends in / string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN) @@ -494,7 +493,7 @@ if(BUILD_QtDialog) set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") endif() set(CMAKE_INSTALL_PREFIX - "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents") + "${CMAKE_INSTALL_PREFIX}CMake.app/Contents") endif() set(QT_NEED_RPATH FALSE) diff --git a/Copyright.txt b/Copyright.txt index 83a2482..9342249 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -1,5 +1,6 @@ CMake - Cross Platform Makefile Generator -Copyright 2000-2011 Kitware, Inc., Insight Software Consortium +Copyright 2000-2013 Kitware, Inc. +Copyright 2000-2011 Insight Software Consortium All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/Help/policy/CMP0038.rst b/Help/policy/CMP0038.rst index c448ed6..e680780 100644 --- a/Help/policy/CMP0038.rst +++ b/Help/policy/CMP0038.rst @@ -1,7 +1,7 @@ CMP0038 ------- -Targets may not link directly to themselves +Targets may not link directly to themselves. CMake 2.8.12 and lower allowed a build target to link to itself directly with a :command:`target_link_libraries` call. This is an indicator of a bug in diff --git a/Help/policy/CMP0039.rst b/Help/policy/CMP0039.rst index 1d20f0c..fb62eea 100644 --- a/Help/policy/CMP0039.rst +++ b/Help/policy/CMP0039.rst @@ -1,7 +1,7 @@ CMP0039 ------- -Utility targets may not have link dependencies +Utility targets may not have link dependencies. CMake 2.8.12 and lower allowed using utility targets in the left hand side position of the :command:`target_link_libraries` command. This is an indicator diff --git a/Help/variable/CMAKE_EDIT_COMMAND.rst b/Help/variable/CMAKE_EDIT_COMMAND.rst index a5c13f4..562aa0b 100644 --- a/Help/variable/CMAKE_EDIT_COMMAND.rst +++ b/Help/variable/CMAKE_EDIT_COMMAND.rst @@ -1,7 +1,8 @@ CMAKE_EDIT_COMMAND ------------------ -Full path to cmake-gui or ccmake. +Full path to cmake-gui or ccmake. Defined only for Makefile generators +when not using an "extra" generator for an IDE. This is the full path to the CMake executable that can graphically edit the cache. For example, cmake-gui or ccmake. diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake index f4fcf6a..3f0978d 100644 --- a/Modules/CPackWIX.cmake +++ b/Modules/CPackWIX.cmake @@ -123,9 +123,31 @@ # This variable provides an optional list of extra WiX object (.wixobj) # and/or WiX library (.wixlib) files. The full path to objects and libraries # is required. +# +# .. variable:: CPACK_WIX_EXTENSIONS +# +# This variable provides a list of additional extensions for the WiX +# tools light and candle. +# +# .. variable:: CPACK_WIX_<TOOL>_EXTENSIONS +# +# This is the tool specific version of CPACK_WIX_EXTENSIONS. +# ``<TOOL>`` can be either LIGHT or CANDLE. +# +# .. variable:: CPACK_WIX_<TOOL>_EXTRA_FLAGS +# +# This list variable allows you to pass additional +# flags to the WiX tool ``<TOOL>``. +# +# Use it at your own risk. +# Future versions of CPack may generate flags which may be in conflict +# with your own flags. +# +# ``<TOOL>`` can be either LIGHT or CANDLE. +# #============================================================================= -# Copyright 2012 Kitware, Inc. +# Copyright 2013 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index 86a42ae..1e2698c 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -7,186 +7,178 @@ # Use this module to unambiguously reference data files stored outside # the source tree and fetch them at build time from arbitrary local and # remote content-addressed locations. Functions provided by this module -# recognize arguments with the syntax "DATA{<name>}" as references to +# recognize arguments with the syntax ``DATA{<name>}`` as references to # external data, replace them with full paths to local copies of those # data, and create build rules to fetch and update the local copies. # -# The DATA{} syntax is literal and the <name> is a full or relative path +# The ``DATA{}`` syntax is literal and the ``<name>`` is a full or relative path # within the source tree. The source tree must contain either a real -# data file at <name> or a "content link" at <name><ext> containing a -# hash of the real file using a hash algorithm corresponding to <ext>. -# For example, the argument "DATA{img.png}" may be satisfied by either a -# real "img.png" file in the current source directory or a "img.png.md5" +# data file at ``<name>`` or a "content link" at ``<name><ext>`` containing a +# hash of the real file using a hash algorithm corresponding to ``<ext>``. +# For example, the argument ``DATA{img.png}`` may be satisfied by either a +# real ``img.png`` file in the current source directory or a ``img.png.md5`` # file containing its MD5 sum. # -# The 'ExternalData_Expand_Arguments' function evaluates DATA{} +# The ``ExternalData_Expand_Arguments`` function evaluates ``DATA{}`` # references in its arguments and constructs a new list of arguments: # -# :: +# .. code-block:: cmake # -# ExternalData_Expand_Arguments( -# <target> # Name of data management target -# <outVar> # Output variable -# [args...] # Input arguments, DATA{} allowed -# ) +# ExternalData_Expand_Arguments( +# <target> # Name of data management target +# <outVar> # Output variable +# [args...] # Input arguments, DATA{} allowed +# ) # -# It replaces each DATA{} reference in an argument with the full path of -# a real data file on disk that will exist after the <target> builds. +# It replaces each ``DATA{}`` reference in an argument with the full path of +# a real data file on disk that will exist after the ``<target>`` builds. # -# The 'ExternalData_Add_Test' function wraps around the CMake add_test() -# command but supports DATA{} references in its arguments: +# The ``ExternalData_Add_Test`` function wraps around the CMake +# :command:`add_test` command but supports ``DATA{}`` references in +# its arguments: # -# :: +# .. code-block:: cmake # -# ExternalData_Add_Test( -# <target> # Name of data management target -# ... # Arguments of add_test(), DATA{} allowed -# ) +# ExternalData_Add_Test( +# <target> # Name of data management target +# ... # Arguments of add_test(), DATA{} allowed +# ) # -# It passes its arguments through ExternalData_Expand_Arguments and then -# invokes add_test() using the results. +# It passes its arguments through ``ExternalData_Expand_Arguments`` and then +# invokes the :command:`add_test` command using the results. # -# The 'ExternalData_Add_Target' function creates a custom target to +# The ``ExternalData_Add_Target`` function creates a custom target to # manage local instances of data files stored externally: # -# :: +# .. code-block:: cmake # -# ExternalData_Add_Target( -# <target> # Name of data management target -# ) +# ExternalData_Add_Target( +# <target> # Name of data management target +# ) # # It creates custom commands in the target as necessary to make data -# files available for each DATA{} reference previously evaluated by -# other functions provided by this module. A list of URL templates must -# be provided in the variable ExternalData_URL_TEMPLATES using the -# placeholders "%(algo)" and "%(hash)" in each template. Data fetch +# files available for each ``DATA{}`` reference previously evaluated by +# other functions provided by this module. A list of URL templates may +# be provided in the variable ``ExternalData_URL_TEMPLATES`` using the +# placeholders ``%(algo)`` and ``%(hash)`` in each template. Data fetch # rules try each URL template in order by substituting the hash -# algorithm name for "%(algo)" and the hash value for "%(hash)". +# algorithm name for ``%(algo)`` and the hash value for ``%(hash)``. # -# The following hash algorithms are supported: +# The following hash algorithms are supported:: # -# :: -# -# %(algo) <ext> Description -# ------- ----- ----------- -# MD5 .md5 Message-Digest Algorithm 5, RFC 1321 -# SHA1 .sha1 US Secure Hash Algorithm 1, RFC 3174 -# SHA224 .sha224 US Secure Hash Algorithms, RFC 4634 -# SHA256 .sha256 US Secure Hash Algorithms, RFC 4634 -# SHA384 .sha384 US Secure Hash Algorithms, RFC 4634 -# SHA512 .sha512 US Secure Hash Algorithms, RFC 4634 +# %(algo) <ext> Description +# ------- ----- ----------- +# MD5 .md5 Message-Digest Algorithm 5, RFC 1321 +# SHA1 .sha1 US Secure Hash Algorithm 1, RFC 3174 +# SHA224 .sha224 US Secure Hash Algorithms, RFC 4634 +# SHA256 .sha256 US Secure Hash Algorithms, RFC 4634 +# SHA384 .sha384 US Secure Hash Algorithms, RFC 4634 +# SHA512 .sha512 US Secure Hash Algorithms, RFC 4634 # # Note that the hashes are used only for unique data identification and # download verification. This is not security software. # # Example usage: # -# :: +# .. code-block:: cmake # -# include(ExternalData) -# set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)" -# "http://data.org/%(algo)/%(hash)") -# ExternalData_Add_Test(MyData -# NAME MyTest -# COMMAND MyExe DATA{MyInput.png} -# ) -# ExternalData_Add_Target(MyData) +# include(ExternalData) +# set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)" +# "file:////host/share/%(algo)/%(hash)" +# "http://data.org/%(algo)/%(hash)") +# ExternalData_Add_Test(MyData +# NAME MyTest +# COMMAND MyExe DATA{MyInput.png} +# ) +# ExternalData_Add_Target(MyData) # -# When test "MyTest" runs the "DATA{MyInput.png}" argument will be +# When test ``MyTest`` runs the ``DATA{MyInput.png}`` argument will be # replaced by the full path to a real instance of the data file -# "MyInput.png" on disk. If the source tree contains a content link -# such as "MyInput.png.md5" then the "MyData" target creates a real -# "MyInput.png" in the build tree. +# ``MyInput.png`` on disk. If the source tree contains a content link +# such as ``MyInput.png.md5`` then the ``MyData`` target creates a real +# ``MyInput.png`` in the build tree. # -# The DATA{} syntax can be told to fetch a file series using the form -# "DATA{<name>,:}", where the ":" is literal. If the source tree +# The ``DATA{}`` syntax can be told to fetch a file series using the form +# ``DATA{<name>,:}``, where the ``:`` is literal. If the source tree # contains a group of files or content links named like a series then a # reference to one member adds rules to fetch all of them. Although all # members of a series are fetched, only the file originally named by the -# DATA{} argument is substituted for it. The default configuration -# recognizes file series names ending with "#.ext", "_#.ext", ".#.ext", -# or "-#.ext" where "#" is a sequence of decimal digits and ".ext" is -# any single extension. Configure it with a regex that parses <number> -# and <suffix> parts from the end of <name>: -# -# :: +# ``DATA{}`` argument is substituted for it. The default configuration +# recognizes file series names ending with ``#.ext``, ``_#.ext``, ``.#.ext``, +# or ``-#.ext`` where ``#`` is a sequence of decimal digits and ``.ext`` is +# any single extension. Configure it with a regex that parses ``<number>`` +# and ``<suffix>`` parts from the end of ``<name>``:: # -# ExternalData_SERIES_PARSE = regex of the form (<number>)(<suffix>)$ +# ExternalData_SERIES_PARSE = regex of the form (<number>)(<suffix>)$ # -# For more complicated cases set: +# For more complicated cases set:: # -# :: -# -# ExternalData_SERIES_PARSE = regex with at least two () groups -# ExternalData_SERIES_PARSE_PREFIX = <prefix> regex group number, if any -# ExternalData_SERIES_PARSE_NUMBER = <number> regex group number -# ExternalData_SERIES_PARSE_SUFFIX = <suffix> regex group number +# ExternalData_SERIES_PARSE = regex with at least two () groups +# ExternalData_SERIES_PARSE_PREFIX = <prefix> regex group number, if any +# ExternalData_SERIES_PARSE_NUMBER = <number> regex group number +# ExternalData_SERIES_PARSE_SUFFIX = <suffix> regex group number # # Configure series number matching with a regex that matches the -# <number> part of series members named <prefix><number><suffix>: -# -# :: +# ``<number>`` part of series members named ``<prefix><number><suffix>``:: # -# ExternalData_SERIES_MATCH = regex matching <number> in all series members +# ExternalData_SERIES_MATCH = regex matching <number> in all series members # -# Note that the <suffix> of a series does not include a hash-algorithm +# Note that the ``<suffix>`` of a series does not include a hash-algorithm # extension. # -# The DATA{} syntax can alternatively match files associated with the +# The ``DATA{}`` syntax can alternatively match files associated with the # named file and contained in the same directory. Associated files may # be specified by options using the syntax -# DATA{<name>,<opt1>,<opt2>,...}. Each option may specify one file by +# ``DATA{<name>,<opt1>,<opt2>,...}``. Each option may specify one file by # name or specify a regular expression to match file names using the -# syntax REGEX:<regex>. For example, the arguments +# syntax ``REGEX:<regex>``. For example, the arguments:: # -# :: +# DATA{MyData/MyInput.mhd,MyInput.img} # File pair +# DATA{MyData/MyFrames00.png,REGEX:MyFrames[0-9]+\\.png} # Series # -# DATA{MyData/MyInput.mhd,MyInput.img} # File pair -# DATA{MyData/MyFrames00.png,REGEX:MyFrames[0-9]+\\.png} # Series -# -# will pass MyInput.mha and MyFrames00.png on the command line but +# will pass ``MyInput.mha`` and ``MyFrames00.png`` on the command line but # ensure that the associated files are present next to them. # -# The DATA{} syntax may reference a directory using a trailing slash and -# a list of associated files. The form DATA{<name>/,<opt1>,<opt2>,...} +# The ``DATA{}`` syntax may reference a directory using a trailing slash and +# a list of associated files. The form ``DATA{<name>/,<opt1>,<opt2>,...}`` # adds rules to fetch any files in the directory that match one of the # associated file options. For example, the argument -# DATA{MyDataDir/,REGEX:.*} will pass the full path to a MyDataDir +# ``DATA{MyDataDir/,REGEX:.*}`` will pass the full path to a ``MyDataDir`` # directory on the command line and ensure that the directory contains -# files corresponding to every file or content link in the MyDataDir +# files corresponding to every file or content link in the ``MyDataDir`` # source directory. # -# The variable ExternalData_LINK_CONTENT may be set to the name of a +# The variable ``ExternalData_LINK_CONTENT`` may be set to the name of a # supported hash algorithm to enable automatic conversion of real data -# files referenced by the DATA{} syntax into content links. For each -# such <file> a content link named "<file><ext>" is created. The -# original file is renamed to the form ".ExternalData_<algo>_<hash>" to +# files referenced by the ``DATA{}`` syntax into content links. For each +# such ``<file>`` a content link named ``<file><ext>`` is created. The +# original file is renamed to the form ``.ExternalData_<algo>_<hash>`` to # stage it for future transmission to one of the locations in the list # of URL templates (by means outside the scope of this module). The # data fetch rule created for the content link will use the staged # object if it cannot be found using any URL template. # -# The variable ExternalData_OBJECT_STORES may be set to a list of local -# directories that store objects using the layout <dir>/%(algo)/%(hash). +# The variable ``ExternalData_OBJECT_STORES`` may be set to a list of local +# directories that store objects using the layout ``<dir>/%(algo)/%(hash)``. # These directories will be searched first for a needed object. If the # object is not available in any store then it will be fetched remotely # using the URL templates and added to the first local store listed. If # no stores are specified the default is a location inside the build # tree. # -# The variable ExternalData_SOURCE_ROOT may be set to the highest source -# directory containing any path named by a DATA{} reference. The -# default is CMAKE_SOURCE_DIR. ExternalData_SOURCE_ROOT and -# CMAKE_SOURCE_DIR must refer to directories within a single source +# The variable ``ExternalData_SOURCE_ROOT`` may be set to the highest source +# directory containing any path named by a ``DATA{}`` reference. The +# default is ``CMAKE_SOURCE_DIR``. ``ExternalData_SOURCE_ROOT`` and +# ``CMAKE_SOURCE_DIR`` must refer to directories within a single source # distribution (e.g. they come together in one tarball). # -# The variable ExternalData_BINARY_ROOT may be set to the directory to -# hold the real data files named by expanded DATA{} references. The -# default is CMAKE_BINARY_DIR. The directory layout will mirror that of -# content links under ExternalData_SOURCE_ROOT. +# The variable ``ExternalData_BINARY_ROOT`` may be set to the directory to +# hold the real data files named by expanded ``DATA{}`` references. The +# default is ``CMAKE_BINARY_DIR``. The directory layout will mirror that of +# content links under ``ExternalData_SOURCE_ROOT``. # -# Variables ExternalData_TIMEOUT_INACTIVITY and -# ExternalData_TIMEOUT_ABSOLUTE set the download inactivity and absolute +# Variables ``ExternalData_TIMEOUT_INACTIVITY`` and +# ``ExternalData_TIMEOUT_ABSOLUTE`` set the download inactivity and absolute # timeouts, in seconds. The defaults are 60 seconds and 300 seconds, # respectively. Set either timeout to 0 seconds to disable enforcement. @@ -210,8 +202,9 @@ function(ExternalData_add_test target) endfunction() function(ExternalData_add_target target) - if(NOT ExternalData_URL_TEMPLATES) - message(FATAL_ERROR "ExternalData_URL_TEMPLATES is not set!") + if(NOT ExternalData_URL_TEMPLATES AND NOT ExternalData_OBJECT_STORES) + message(FATAL_ERROR + "Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set!") endif() if(NOT ExternalData_OBJECT_STORES) set(ExternalData_OBJECT_STORES ${CMAKE_BINARY_DIR}/ExternalData/Objects) @@ -633,8 +626,9 @@ endif() if(ExternalData_CONFIG) include(${ExternalData_CONFIG}) endif() -if(NOT ExternalData_URL_TEMPLATES) - message(FATAL_ERROR "No ExternalData_URL_TEMPLATES set!") +if(NOT ExternalData_URL_TEMPLATES AND NOT ExternalData_OBJECT_STORES) + message(FATAL_ERROR + "Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set!") endif() function(_ExternalData_link_or_copy src dst) @@ -762,6 +756,9 @@ function(_ExternalData_download_object name hash algo var_obj) set(obj "${staged}") message(STATUS "Staged object: \"${obj}\"") else() + if(NOT tried) + set(tried "\n (No ExternalData_URL_TEMPLATES given)") + endif() message(FATAL_ERROR "Object ${algo}=${hash} not found at:${tried}") endif() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index f6e0bd2..4340ad7 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 12) -set(CMake_VERSION_TWEAK 20131113) +set(CMake_VERSION_TWEAK 20131114) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 448d8d1..1d7681b 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -83,6 +83,15 @@ bool cmCPackWIXGenerator::RunCandleCommand( command << " -nologo"; command << " -arch " << GetArchitecture(); command << " -out " << QuotePath(objectFile); + + for(extension_set_t::const_iterator i = candleExtensions.begin(); + i != candleExtensions.end(); ++i) + { + command << " -ext " << QuotePath(*i); + } + + AddCustomFlags("CPACK_WIX_CANDLE_EXTRA_FLAGS", command); + command << " " << QuotePath(sourceFile); return RunWiXCommand(command.str()); @@ -100,12 +109,21 @@ bool cmCPackWIXGenerator::RunLightCommand(const std::string& objectFiles) command << QuotePath(executable); command << " -nologo"; command << " -out " << QuotePath(packageFileNames.at(0)); - command << " -ext WixUIExtension"; + + for(extension_set_t::const_iterator i = lightExtensions.begin(); + i != lightExtensions.end(); ++i) + { + command << " -ext " << QuotePath(*i); + } + const char* const cultures = GetOption("CPACK_WIX_CULTURES"); if(cultures) { command << " -cultures:" << cultures; } + + AddCustomFlags("CPACK_WIX_LIGHT_EXTRA_FLAGS", command); + command << " " << objectFiles; return RunWiXCommand(command.str()); @@ -172,14 +190,21 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration() if(GetOption("CPACK_PACKAGE_VENDOR") == 0) { - std::string defaultVendor = "Humanity"; - SetOption("CPACK_PACKAGE_VENDOR", defaultVendor.c_str()); + std::string defaultVendor = "Humanity"; + SetOption("CPACK_PACKAGE_VENDOR", defaultVendor.c_str()); - cmCPackLogger(cmCPackLog::LOG_VERBOSE, - "CPACK_PACKAGE_VENDOR implicitly set to " << defaultVendor << " . " - << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "CPACK_PACKAGE_VENDOR implicitly set to " << defaultVendor << " . " + << std::endl); } + CollectExtensions("CPACK_WIX_EXTENSIONS", candleExtensions); + CollectExtensions("CPACK_WIX_CANDLE_EXTENSIONS", candleExtensions); + + lightExtensions.insert("WixUIExtension"); + CollectExtensions("CPACK_WIX_EXTENSIONS", lightExtensions); + CollectExtensions("CPACK_WIX_LIGHT_EXTENSIONS", lightExtensions); + return true; } @@ -865,3 +890,35 @@ bool cmCPackWIXGenerator::IsLegalIdCharacter(char c) (c >= 'A' && c <= 'Z') || c == '_' || c == '.'; } + +void cmCPackWIXGenerator::CollectExtensions( + const std::string& variableName, extension_set_t& extensions) +{ + const char *variableContent = GetOption(variableName.c_str()); + if(!variableContent) return; + + std::vector<std::string> list; + cmSystemTools::ExpandListArgument(variableContent, list); + + for(std::vector<std::string>::const_iterator i = list.begin(); + i != list.end(); ++i) + { + extensions.insert(*i); + } +} + +void cmCPackWIXGenerator::AddCustomFlags( + const std::string& variableName, std::ostream& stream) +{ + const char *variableContent = GetOption(variableName.c_str()); + if(!variableContent) return; + + std::vector<std::string> list; + cmSystemTools::ExpandListArgument(variableContent, list); + + for(std::vector<std::string>::const_iterator i = list.begin(); + i != list.end(); ++i) + { + stream << " " << QuotePath(*i); + } +} diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h index c96ad5a..481a07d 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.h +++ b/Source/CPack/WiX/cmCPackWIXGenerator.h @@ -63,6 +63,7 @@ private: typedef std::map<std::string, std::string> id_map_t; typedef std::map<std::string, size_t> ambiguity_map_t; typedef std::map<std::string, cmWIXShortcut> shortcut_map_t; + typedef std::set<std::string> extension_set_t; bool InitializeWiXConfiguration(); @@ -129,10 +130,19 @@ private: static bool IsLegalIdCharacter(char c); + void CollectExtensions( + const std::string& variableName, extension_set_t& extensions); + + void AddCustomFlags( + const std::string& variableName, std::ostream& stream); + std::vector<std::string> wixSources; id_map_t pathToIdMap; ambiguity_map_t idAmbiguityCounter; shortcut_map_t shortcutMap; + + extension_set_t candleExtensions; + extension_set_t lightExtensions; }; #endif diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 88a9fc9..f1f4649 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -111,18 +111,21 @@ if(Qt_BIN_DIR) endif() if(APPLE) + file(STRINGS "${CMake_SOURCE_DIR}/Copyright.txt" copyright_line + LIMIT_COUNT 1 REGEX "^Copyright 2000-20[0-9][0-9] Kitware") + set_target_properties(cmake-gui PROPERTIES - OUTPUT_NAME ${CMAKE_BUNDLE_NAME} + OUTPUT_NAME CMake MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in" MACOSX_BUNDLE_SHORT_VERSION_STRING "${CMAKE_BUNDLE_VERSION}" # TBD: MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_BUNDLE_VERSION}" - MACOSX_BUNDLE_COPYRIGHT "Copyright 2000-2013 Kitware, Inc." + MACOSX_BUNDLE_COPYRIGHT "${copyright_line}" ) # Create a symlink in the build tree to provide a "cmake-gui" next # to the "cmake" executable that refers to the application bundle. add_custom_command(TARGET cmake-gui POST_BUILD - COMMAND ln -sf ${CMAKE_BUNDLE_NAME}.app/Contents/MacOS/${CMAKE_BUNDLE_NAME} + COMMAND ln -sf CMake.app/Contents/MacOS/CMake $<TARGET_FILE_DIR:cmake>/cmake-gui ) endif() @@ -148,7 +151,7 @@ if(APPLE) "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh") configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in" "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh") - install(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui + install(CODE "execute_process(COMMAND ln -s \"../MacOS/CMake\" cmake-gui WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)") endif() @@ -157,7 +160,7 @@ if(APPLE OR WIN32) # if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}") if(APPLE) - set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}") + set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/CMake") endif() install(CODE " include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\") diff --git a/Source/QtDialog/postflight.sh.in b/Source/QtDialog/postflight.sh.in index 33be352..0b96889 100755 --- a/Source/QtDialog/postflight.sh.in +++ b/Source/QtDialog/postflight.sh.in @@ -1,3 +1,3 @@ #!/bin/bash -"$2@CMAKE_INSTALL_SUBDIR@/@CMAKE_BUNDLE_NAME@.app/Contents/MacOS/@CMAKE_BUNDLE_NAME@" --mac-install +"$2@CMAKE_INSTALL_SUBDIR@/CMake.app/Contents/MacOS/CMake" --mac-install exit 0 diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 4c591b6..e9c5d6b 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -229,6 +229,7 @@ bool cmAddLibraryCommand yet its linker language. */ if ((type != cmTarget::STATIC_LIBRARY) && (type != cmTarget::OBJECT_LIBRARY) && + (type != cmTarget::INTERFACE_LIBRARY) && (this->Makefile->GetCMakeInstance()->GetPropertyAsBool( "TARGET_SUPPORTS_SHARED_LIBS") == false)) { diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 1e799b8..fce1284 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -329,31 +329,11 @@ void cmExtraCodeBlocksGenerator { case cmTarget::GLOBAL_TARGET: { - bool insertTarget = false; // Only add the global targets from CMAKE_BINARY_DIR, // not from the subdirs if (strcmp(makefile->GetStartOutputDirectory(), makefile->GetHomeOutputDirectory())==0) { - insertTarget = true; - // only add the "edit_cache" target if it's not ccmake, because - // this will not work within the IDE - if (ti->first == "edit_cache") - { - const char* editCommand = makefile->GetDefinition - ("CMAKE_EDIT_COMMAND"); - if (editCommand == 0) - { - insertTarget = false; - } - else if (strstr(editCommand, "ccmake")!=NULL) - { - insertTarget = false; - } - } - } - if (insertTarget) - { this->AppendTarget(fout, ti->first.c_str(), 0, make.c_str(), makefile, compiler.c_str()); } diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index a2dd903..676d4ed 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -995,30 +995,10 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const { case cmTarget::GLOBAL_TARGET: { - bool insertTarget = false; // Only add the global targets from CMAKE_BINARY_DIR, // not from the subdirs if (subdir.empty()) { - insertTarget = true; - // only add the "edit_cache" target if it's not ccmake, because - // this will not work within the IDE - if (ti->first == "edit_cache") - { - const char* editCommand = makefile->GetDefinition - ("CMAKE_EDIT_COMMAND"); - if (editCommand == 0) - { - insertTarget = false; - } - else if (strstr(editCommand, "ccmake")!=NULL) - { - insertTarget = false; - } - } - } - if (insertTarget) - { this->AppendTarget(fout, ti->first, make, makeArgs, subdir, ": "); } } diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index baed733..9cbdd7c 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -172,31 +172,11 @@ void cmExtraSublimeTextGenerator:: { case cmTarget::GLOBAL_TARGET: { - bool insertTarget = false; // Only add the global targets from CMAKE_BINARY_DIR, // not from the subdirs if (strcmp(makefile->GetStartOutputDirectory(), makefile->GetHomeOutputDirectory())==0) { - insertTarget = true; - // only add the "edit_cache" target if it's not ccmake, because - // this will not work within the IDE - if (ti->first == "edit_cache") - { - const char* editCommand = makefile->GetDefinition - ("CMAKE_EDIT_COMMAND"); - if (editCommand == 0) - { - insertTarget = false; - } - else if (strstr(editCommand, "ccmake")!=NULL) - { - insertTarget = false; - } - } - } - if (insertTarget) - { this->AppendTarget(fout, ti->first.c_str(), *lg, 0, make.c_str(), makefile, compiler.c_str(), sourceFileFlags, false); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4ea5895..b2a0ef7 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2158,11 +2158,11 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) singleLine.erase(singleLine.begin(), singleLine.end()); depends.erase(depends.begin(), depends.end()); - // Use CMAKE_EDIT_COMMAND for the edit_cache rule if it is defined. - // Otherwise default to the interactive command-line interface. - if(mf->GetDefinition("CMAKE_EDIT_COMMAND")) + // Use generator preference for the edit_cache rule if it is defined. + std::string edit_cmd = this->GetEditCacheCommand(); + if (!edit_cmd.empty()) { - singleLine.push_back(mf->GetDefinition("CMAKE_EDIT_COMMAND")); + singleLine.push_back(edit_cmd); singleLine.push_back("-H$(CMAKE_SOURCE_DIR)"); singleLine.push_back("-B$(CMAKE_BINARY_DIR)"); cpackCommandLines.push_back(singleLine); @@ -2174,13 +2174,14 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) else { singleLine.push_back(cmakeCommand); - singleLine.push_back("-i"); - singleLine.push_back("."); + singleLine.push_back("-E"); + singleLine.push_back("echo"); + singleLine.push_back("No interactive CMake dialog available."); cpackCommandLines.push_back(singleLine); (*targets)[editCacheTargetName] = this->CreateGlobalTarget( editCacheTargetName, - "Running interactive CMake command-line interface...", + "No interactive CMake dialog available...", &cpackCommandLines, depends, 0); } } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 8a753b7..2761158 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -139,8 +139,7 @@ public: void SetCMakeInstance(cmake *cm); ///! Get the CMake instance - cmake *GetCMakeInstance() { return this->CMakeInstance; } - const cmake *GetCMakeInstance() const { return this->CMakeInstance; } + cmake *GetCMakeInstance() const { return this->CMakeInstance; } void SetConfiguredFilesPath(cmGlobalGenerator* gen); const std::vector<cmLocalGenerator *>& GetLocalGenerators() const { @@ -252,6 +251,9 @@ public: virtual const char* GetRebuildCacheTargetName() const { return 0; } virtual const char* GetCleanTargetName() const { return 0; } + // Lookup edit_cache target command preferred by this generator. + virtual std::string GetEditCacheCommand() const { return ""; } + // Class to track a set of dependencies. typedef cmTargetDependSet TargetDependSet; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index d262397..e938065 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -637,6 +637,13 @@ bool cmGlobalNinjaGenerator::HasRule(const std::string &name) //---------------------------------------------------------------------------- // Private virtual overrides +std::string cmGlobalNinjaGenerator::GetEditCacheCommand() const +{ + // Ninja by design does not run interactive tools in the terminal, + // so our only choice is cmake-gui. + return cmSystemTools::GetCMakeGUICommand(); +} + // TODO: Refactor to combine with cmGlobalUnixMakefileGenerator3 impl. void cmGlobalNinjaGenerator::ComputeTargetObjects(cmGeneratorTarget* gt) const { diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index be58df1..e9c8684 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -306,6 +306,7 @@ protected: private: + virtual std::string GetEditCacheCommand() const; /// @see cmGlobalGenerator::ComputeTargetObjects virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const; diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index ce95c08..cfd93c2 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -68,6 +68,42 @@ void cmGlobalUnixMakefileGenerator3 } //---------------------------------------------------------------------------- +std::string cmGlobalUnixMakefileGenerator3::GetEditCacheCommand() const +{ + // If generating for an extra IDE, the edit_cache target cannot + // launch a terminal-interactive tool, so always use cmake-gui. + if(this->GetExtraGeneratorName()) + { + return cmSystemTools::GetCMakeGUICommand(); + } + + // Use an internal cache entry to track the latest dialog used + // to edit the cache, and use that for the edit_cache target. + cmake* cm = this->GetCMakeInstance(); + std::string editCacheCommand = cm->GetCMakeEditCommand(); + if(!cm->GetCacheDefinition("CMAKE_EDIT_COMMAND") || + !editCacheCommand.empty()) + { + if(editCacheCommand.empty()) + { + editCacheCommand = cmSystemTools::GetCMakeCursesCommand(); + } + if(editCacheCommand.empty()) + { + editCacheCommand = cmSystemTools::GetCMakeGUICommand(); + } + if(!editCacheCommand.empty()) + { + cm->AddCacheEntry + ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(), + "Path to cache edit program executable.", cmCacheManager::INTERNAL); + } + } + const char* edit_cmd = cm->GetCacheDefinition("CMAKE_EDIT_COMMAND"); + return edit_cmd? edit_cmd : ""; +} + +//---------------------------------------------------------------------------- void cmGlobalUnixMakefileGenerator3 ::ComputeTargetObjects(cmGeneratorTarget* gt) const @@ -99,6 +135,14 @@ cmGlobalUnixMakefileGenerator3 } } +void cmGlobalUnixMakefileGenerator3::Configure() +{ + // Initialize CMAKE_EDIT_COMMAND cache entry. + this->GetEditCacheCommand(); + + this->cmGlobalGenerator::Configure(); +} + void cmGlobalUnixMakefileGenerator3::Generate() { // first do superclass method diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 5e9dce3..608f643 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -77,6 +77,8 @@ public: virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); + virtual void Configure(); + /** * Generate the all required files for building this project/tree. This * basically creates a series of LocalGenerators for each directory and @@ -186,6 +188,7 @@ protected: cmGeneratedFileStream *CommandDatabase; private: + virtual std::string GetEditCacheCommand() const; virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const; }; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 508eca1..8ed8d0a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -699,17 +699,6 @@ cmLocalUnixMakefileGenerator3 << "# Escaping for special characters.\n" << "EQUALS = =\n" << "\n"; - - if(const char* edit_cmd = - this->Makefile->GetDefinition("CMAKE_EDIT_COMMAND")) - { - makefileStream - << "# The program to use to edit the cache.\n" - << "CMAKE_EDIT_COMMAND = " - << this->ConvertShellCommand(edit_cmd, FULL) << "\n" - << "\n"; - } - makefileStream << "# The top-level source directory on which CMake was run.\n" << "CMAKE_SOURCE_DIR = " diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 3881c54..7b80d14 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -299,7 +299,7 @@ cmPolicies::cmPolicies() this->DefinePolicy( CMP0039, "CMP0039", - "Utility targets may not have link dependencies", + "Utility targets may not have link dependencies.", 3,0,0,0, cmPolicies::WARN); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 8bde300..f0f9ef7 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -944,38 +944,6 @@ int cmake::AddCMakePaths() ("CMAKE_CPACK_COMMAND", cmSystemTools::GetCPackCommand().c_str(), "Path to cpack program executable.", cmCacheManager::INTERNAL); #endif - // if the edit command is not yet in the cache, - // or if CMakeEditCommand has been set on this object, - // then set the CMAKE_EDIT_COMMAND in the cache - // This will mean that the last gui to edit the cache - // will be the one that make edit_cache uses. - if(!this->GetCacheDefinition("CMAKE_EDIT_COMMAND") - || !this->CMakeEditCommand.empty()) - { - // Find and save the command to edit the cache - std::string editCacheCommand; - if(!this->CMakeEditCommand.empty()) - { - editCacheCommand = this->CMakeEditCommand; - } - if(!cmSystemTools::FileExists(editCacheCommand.c_str()) && - !cmSystemTools::GetCMakeCursesCommand().empty()) - { - editCacheCommand = cmSystemTools::GetCMakeCursesCommand(); - } - if(!cmSystemTools::FileExists(editCacheCommand.c_str()) && - !cmSystemTools::GetCMakeGUICommand().empty()) - { - editCacheCommand = cmSystemTools::GetCMakeGUICommand(); - } - if(cmSystemTools::FileExists(editCacheCommand.c_str())) - { - this->CacheManager->AddCacheEntry - ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(), - "Path to cache edit program executable.", cmCacheManager::INTERNAL); - } - } - if(!cmSystemTools::FileExists( (cmSystemTools::GetCMakeRoot()+"/Modules/CMake.cmake").c_str())) { diff --git a/Source/cmake.h b/Source/cmake.h index d461fbd..dfec55c 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -335,9 +335,10 @@ class cmake std::vector<std::string> const& GetDebugConfigs(); void SetCMakeEditCommand(std::string const& s) - { - this->CMakeEditCommand = s; - } + { this->CMakeEditCommand = s; } + std::string const& GetCMakeEditCommand() const + { return this->CMakeEditCommand; } + void SetSuppressDevWarnings(bool v) { this->SuppressDevWarnings = v; diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in index 03916bf..82537ef 100644 --- a/Templates/TestDriver.cxx.in +++ b/Templates/TestDriver.cxx.in @@ -18,7 +18,7 @@ typedef struct MainFuncPointer func; } functionMapEntry; -functionMapEntry cmakeGeneratedFunctionMapEntries[] = { +static functionMapEntry cmakeGeneratedFunctionMapEntries[] = { @CMAKE_FUNCTION_TABLE_ENTIRES@ {0,0} }; @@ -26,7 +26,7 @@ functionMapEntry cmakeGeneratedFunctionMapEntries[] = { /* Allocate and create a lowercased copy of string (note that it has to be free'd manually) */ -char* lowercase(const char *string) +static char* lowercase(const char *string) { char *new_string, *p; diff --git a/Tests/CMakeCopyright.cmake b/Tests/CMakeCopyright.cmake new file mode 100644 index 0000000..a7201e9 --- /dev/null +++ b/Tests/CMakeCopyright.cmake @@ -0,0 +1,22 @@ +if(CMAKE_VERSION MATCHES "\\.(20[0-9][0-9])[0-9][0-9][0-9][0-9](-|$)") + set(version_year "${CMAKE_MATCH_1}") + set(copyright_line_regex "^Copyright 2000-(20[0-9][0-9]) Kitware") + file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../Copyright.txt" copyright_line + LIMIT_COUNT 1 REGEX "${copyright_line_regex}") + if(copyright_line MATCHES "${copyright_line_regex}") + set(copyright_year "${CMAKE_MATCH_1}") + if(copyright_year LESS version_year) + message(FATAL_ERROR "Copyright.txt contains\n" + " ${copyright_line}\n" + "but the current version year is ${version_year}.") + else() + message(STATUS "PASSED: Copyright.txt contains\n" + " ${copyright_line}\n" + "and the current version year is ${version_year}.") + endif() + else() + message(FATAL_ERROR "Copyright.txt has no Copyright line of expected format!") + endif() +else() + message(STATUS "SKIPPED: CMAKE_VERSION does not know the year: ${CMAKE_VERSION}") +endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 404b0fa..6426b3a 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -161,6 +161,9 @@ if(BUILD_TESTING) set(CMAKE_LONG_TEST_TIMEOUT 1500) endif() + add_test(NAME CMake.Copyright + COMMAND cmake -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeCopyright.cmake) + # add a bunch of standard build-and-test style tests ADD_TEST_MACRO(CommandLineTest CommandLineTest) ADD_TEST_MACRO(FindPackageTest FindPackageTest) diff --git a/Tests/Module/ExternalData/CMakeLists.txt b/Tests/Module/ExternalData/CMakeLists.txt index 8312dca..5a6f3d5 100644 --- a/Tests/Module/ExternalData/CMakeLists.txt +++ b/Tests/Module/ExternalData/CMakeLists.txt @@ -42,3 +42,4 @@ ExternalData_Add_Target(Data1) add_subdirectory(Data2) add_subdirectory(Data3) +add_subdirectory(Data4) diff --git a/Tests/Module/ExternalData/Data4/CMakeLists.txt b/Tests/Module/ExternalData/Data4/CMakeLists.txt new file mode 100644 index 0000000..ac977fb --- /dev/null +++ b/Tests/Module/ExternalData/Data4/CMakeLists.txt @@ -0,0 +1,15 @@ +set(Store0 ${CMAKE_BINARY_DIR}/ExternalData/Other) +set(Store1 ${CMAKE_BINARY_DIR}/ExternalData/Objects) +set(ExternalData_OBJECT_STORES ${Store0} ${Store1}) +unset(ExternalData_URL_TEMPLATES) # All objects already in stores! +ExternalData_Add_Test(Data4 + NAME Data4Check + COMMAND ${CMAKE_COMMAND} + -D Data=DATA{Data.dat} + -D Other=DATA{Other.dat} + -D Store0=${Store0} + -D Store1=${Store1} + -P ${CMAKE_CURRENT_SOURCE_DIR}/Data4Check.cmake + ) +ExternalData_Add_Target(Data4) +add_dependencies(Data4 Data3) diff --git a/Tests/Module/ExternalData/Data4/Data.dat.md5 b/Tests/Module/ExternalData/Data4/Data.dat.md5 new file mode 100644 index 0000000..70e39bd --- /dev/null +++ b/Tests/Module/ExternalData/Data4/Data.dat.md5 @@ -0,0 +1 @@ +8c018830e3efa5caf3c7415028335a57 diff --git a/Tests/Module/ExternalData/Data4/Data4Check.cmake b/Tests/Module/ExternalData/Data4/Data4Check.cmake new file mode 100644 index 0000000..e614cc4 --- /dev/null +++ b/Tests/Module/ExternalData/Data4/Data4Check.cmake @@ -0,0 +1,26 @@ +if(NOT EXISTS "${Data}") + message(SEND_ERROR "Input file:\n ${Data}\ndoes not exist!") +endif() +if(NOT EXISTS "${Other}") + message(SEND_ERROR "Input file:\n ${Other}\ndoes not exist!") +endif() +# Verify that the 'Data' object was found in the second store location left +# from Data1 target downloads and that the 'Other' object was found in the +# first store location left from Data3 target downloads. Neither object +# should exist in the opposite store. +foreach(should_exist + "${Store0}/MD5/aaad162b85f60d1eb57ca71a23e8efd7" + "${Store1}/MD5/8c018830e3efa5caf3c7415028335a57" + ) + if(NOT EXISTS ${should_exist}) + message(SEND_ERROR "Store file:\n ${should_exist}\nshould exist!") + endif() +endforeach() +foreach(should_not_exist + "${Store0}/MD5/8c018830e3efa5caf3c7415028335a57" + "${Store1}/MD5/aaad162b85f60d1eb57ca71a23e8efd7" + ) + if(EXISTS ${should_not_exist}) + message(SEND_ERROR "Store file:\n ${should_not_exist}\nshould not exist!") + endif() +endforeach() diff --git a/Tests/Module/ExternalData/Data4/Other.dat.md5 b/Tests/Module/ExternalData/Data4/Other.dat.md5 new file mode 100644 index 0000000..5312faa --- /dev/null +++ b/Tests/Module/ExternalData/Data4/Other.dat.md5 @@ -0,0 +1 @@ +aaad162b85f60d1eb57ca71a23e8efd7 diff --git a/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt b/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt index 1496c05..821c4f8 100644 --- a/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt +++ b/Tests/RunCMake/CMP0039/CMP0039-NEW-stderr.txt @@ -1,5 +1,5 @@ CMake Error at CMP0039-NEW.cmake:7 \(target_link_libraries\): - Policy CMP0039 is not set: Utility targets may not have link dependencies + Policy CMP0039 is not set: Utility targets may not have link dependencies. Run "cmake --help-policy CMP0039" for policy details. Use the cmake_policy command to set the policy and suppress this warning. diff --git a/Tests/RunCMake/CMP0039/CMP0039-WARN-stderr.txt b/Tests/RunCMake/CMP0039/CMP0039-WARN-stderr.txt index 9387f8c..a8e6c70 100644 --- a/Tests/RunCMake/CMP0039/CMP0039-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0039/CMP0039-WARN-stderr.txt @@ -1,5 +1,5 @@ CMake Warning \(dev\) at CMP0039-WARN.cmake:5 \(target_link_libraries\): - Policy CMP0039 is not set: Utility targets may not have link dependencies + Policy CMP0039 is not set: Utility targets may not have link dependencies. Run "cmake --help-policy CMP0039" for policy details. Use the cmake_policy command to set the policy and suppress this warning. diff --git a/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt b/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt index ad059d4..ccbaf5a 100644 --- a/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt +++ b/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt @@ -1,5 +1,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): - ExternalData_URL_TEMPLATES is not set! + Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set! Call Stack \(most recent call first\): NoURLTemplates.cmake:2 \(ExternalData_Add_Target\) CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ExternalData/ObjectStoreOnly.cmake b/Tests/RunCMake/ExternalData/ObjectStoreOnly.cmake new file mode 100644 index 0000000..5e66101 --- /dev/null +++ b/Tests/RunCMake/ExternalData/ObjectStoreOnly.cmake @@ -0,0 +1,3 @@ +include(ExternalData) +set(ExternalData_OBJECT_STORES "${CMAKE_CURRENT_BINARY_DIR}") +ExternalData_Add_Target(Data) diff --git a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake index 8fba82c..93ff08f 100644 --- a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake @@ -22,6 +22,7 @@ run_cmake(NormalData2) run_cmake(NormalData3) run_cmake(NormalDataSub1) run_cmake(NotUnderRoot) +run_cmake(ObjectStoreOnly) run_cmake(Semicolon1) run_cmake(Semicolon2) run_cmake(Semicolon3) diff --git a/Tests/RunCMake/interface_library/RunCMakeTest.cmake b/Tests/RunCMake/interface_library/RunCMakeTest.cmake index 56caf68..7375888 100644 --- a/Tests/RunCMake/interface_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/interface_library/RunCMakeTest.cmake @@ -2,3 +2,4 @@ include(RunCMake) run_cmake(invalid_name) run_cmake(target_commands) +run_cmake(no_shared_libs) diff --git a/Tests/RunCMake/interface_library/no_shared_libs-stderr.txt b/Tests/RunCMake/interface_library/no_shared_libs-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/interface_library/no_shared_libs-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/interface_library/no_shared_libs.cmake b/Tests/RunCMake/interface_library/no_shared_libs.cmake new file mode 100644 index 0000000..ed81878 --- /dev/null +++ b/Tests/RunCMake/interface_library/no_shared_libs.cmake @@ -0,0 +1,5 @@ + +cmake_minimum_required(VERSION 2.8.12.20131009) +set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) +add_library(foo INTERFACE) +target_compile_definitions(foo INTERFACE FOO_DEFINE) diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index 3b0b335..5e0ef87 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -36,6 +36,15 @@ elseif(NOT SPHINX_EXECUTABLE) message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!") endif() +set(copyright_line_regex "^Copyright (2000-20[0-9][0-9] Kitware.*)") +file(STRINGS "${CMake_SOURCE_DIR}/Copyright.txt" copyright_line + LIMIT_COUNT 1 REGEX "${copyright_line_regex}") +if(copyright_line MATCHES "${copyright_line_regex}") + set(conf_copyright "${CMAKE_MATCH_1}") +else() + set(conf_copyright "Kitware, Inc.") +endif() + set(conf_docs "${CMake_SOURCE_DIR}/Help") set(conf_path "${CMAKE_CURRENT_SOURCE_DIR}") set(conf_version "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") diff --git a/Utilities/Sphinx/conf.py.in b/Utilities/Sphinx/conf.py.in index 52f4a31..ef622fd 100644 --- a/Utilities/Sphinx/conf.py.in +++ b/Utilities/Sphinx/conf.py.in @@ -13,7 +13,6 @@ import sys import os import re import glob -import time sys.path.insert(0, r'@conf_path@') @@ -21,7 +20,7 @@ source_suffix = '.rst' master_doc = 'index' project = 'CMake' -copyright = '2000-%s Kitware, Inc.' % time.strftime('%Y') +copyright = '@conf_copyright@' version = '@conf_version@' # feature version release = '@conf_release@' # full version string @@ -62,6 +62,8 @@ if [ "$cmake_version_rc" != "" ]; then cmake_version="${cmake_version}-rc${cmake_version_rc}" fi +cmake_copyright="`grep '^Copyright .* Kitware' "${cmake_source_dir}/Copyright.txt"`" + cmake_data_dir_keyword="OTHER" cmake_doc_dir_keyword="OTHER" cmake_man_dir_keyword="OTHER" @@ -402,7 +404,7 @@ Directory and file names: # Display CMake bootstrap usage cmake_version_display() { - echo "CMake ${cmake_version}, Copyright 2000-2012 Kitware, Inc." + echo "CMake ${cmake_version}, ${cmake_copyright}" } # Display CMake bootstrap error, display the log file and exit |