summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/variable/CMAKE_EDIT_COMMAND.rst3
-rw-r--r--Modules/CPackWIX.cmake24
-rw-r--r--Modules/ExternalData.cmake206
-rw-r--r--Source/CMakeLists.txt6
-rw-r--r--Source/CMakeSourceDir.txt.in1
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx69
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.h10
-rw-r--r--Source/CPack/cmCPackGenerator.cxx32
-rw-r--r--Source/CPack/cmCPackGenerator.h7
-rw-r--r--Source/CPack/cpack.cxx3
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx2
-rw-r--r--Source/CTest/cmCTestConfigureCommand.cxx2
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx8
-rw-r--r--Source/CursesDialog/ccmake.cxx3
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx4
-rw-r--r--Source/QtDialog/CMakeLists.txt7
-rw-r--r--Source/QtDialog/CMakeSetup.cxx3
-rw-r--r--Source/QtDialog/QCMake.cxx25
-rw-r--r--Source/cmAddLibraryCommand.cxx1
-rw-r--r--Source/cmCTest.cxx27
-rw-r--r--Source/cmCTest.h9
-rw-r--r--Source/cmConfigure.cmake.h.in2
-rw-r--r--Source/cmDocumentation.cxx5
-rw-r--r--Source/cmDocumentation.h4
-rw-r--r--Source/cmExportSetMap.cxx8
-rw-r--r--Source/cmExportSetMap.h3
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx2
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx20
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx20
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx20
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h8
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx31
-rw-r--r--Source/cmGlobalGenerator.cxx32
-rw-r--r--Source/cmGlobalGenerator.h8
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx7
-rw-r--r--Source/cmGlobalNinjaGenerator.h1
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx44
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h3
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx11
-rw-r--r--Source/cmMakefile.cxx1
-rw-r--r--Source/cmSystemTools.cxx152
-rw-r--r--Source/cmSystemTools.h17
-rw-r--r--Source/cmTarget.cxx29
-rw-r--r--Source/cmTarget.h12
-rw-r--r--Source/cmake.cxx229
-rw-r--r--Source/cmake.h24
-rw-r--r--Source/cmakemain.cxx3
-rw-r--r--Source/ctest.cxx3
-rw-r--r--Templates/TestDriver.cxx.in4
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-NEW-colon-result.txt (renamed from Tests/RunCMake/CMP0037/CMP0037-NEW-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt19
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake5
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-NEW-space-result.txt1
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt19
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-NEW-space.cmake (renamed from Tests/RunCMake/CMP0037/CMP0037-NEW.cmake)2
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-NEW-stderr.txt39
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-OLD-space-result.txt (renamed from Tests/RunCMake/CMP0037/CMP0037-WARN-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-OLD-space-stderr.txt (renamed from Tests/RunCMake/CMP0037/CMP0037-OLD-stderr.txt)0
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-OLD-space.cmake (renamed from Tests/RunCMake/CMP0037/CMP0037-OLD.cmake)0
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-WARN-colon-result.txt (renamed from Tests/RunCMake/CMP0037/CMP0037-OLD-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-WARN-colon-stderr.txt21
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-WARN-colon.cmake3
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-WARN-space-result.txt1
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-WARN-space-stderr.txt21
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-WARN-space.cmake (renamed from Tests/RunCMake/CMP0037/CMP0037-WARN.cmake)2
-rw-r--r--Tests/RunCMake/CMP0037/CMP0037-WARN-stderr.txt43
-rw-r--r--Tests/RunCMake/CMP0037/RunCMakeTest.cmake11
-rw-r--r--Tests/RunCMake/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/interface_library/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/interface_library/no_shared_libs-stderr.txt1
-rw-r--r--Tests/RunCMake/interface_library/no_shared_libs.cmake5
72 files changed, 635 insertions, 720 deletions
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..1e1d32f 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
+# 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
+# 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>:
-#
-# ::
-#
-# ExternalData_SERIES_PARSE = regex of the form (<number>)(<suffix>)$
+# ``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>``::
#
-# For more complicated cases set:
+# ExternalData_SERIES_PARSE = regex of the form (<number>)(<suffix>)$
#
-# ::
+# 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.
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index c01245c..570b7e2 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -38,6 +38,12 @@ configure_file(
"${CMake_BINARY_DIR}/Source/CPack/cmCPackConfigure.h"
)
+# Tell CMake executable in the build tree where to find the source tree.
+configure_file(
+ "${CMake_SOURCE_DIR}/Source/CMakeSourceDir.txt.in"
+ "${CMake_BINARY_DIR}/CMakeFiles/CMakeSourceDir.txt" @ONLY
+ )
+
# add the include path to find the .h
include_directories(
"${CMake_BINARY_DIR}/Source"
diff --git a/Source/CMakeSourceDir.txt.in b/Source/CMakeSourceDir.txt.in
new file mode 100644
index 0000000..5e6a988
--- /dev/null
+++ b/Source/CMakeSourceDir.txt.in
@@ -0,0 +1 @@
+@CMake_SOURCE_DIR@
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index c96930f..f6e0bd2 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 20131111)
+set(CMake_VERSION_TWEAK 20131113)
#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/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 63a7596..0e16a40 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1143,12 +1143,6 @@ int cmCPackGenerator::Initialize(const char* name, cmMakefile* mf)
{
this->MakefileMap = mf;
this->Name = name;
- if ( !this->SetCMakeRoot() )
- {
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Cannot initialize the generator" << std::endl);
- return 0;
- }
// set the running generator name
this->SetOption("CPACK_GENERATOR", this->Name.c_str());
// Load the project specific config file
@@ -1205,32 +1199,6 @@ const char* cmCPackGenerator::GetOption(const char* op) const
}
//----------------------------------------------------------------------
-int cmCPackGenerator::SetCMakeRoot()
-{
- // use the CMAKE_ROOT from cmake which should have been
- // found by now
- const char* root=
- this->MakefileMap->GetDefinition("CMAKE_ROOT");
-
- if(root)
- {
- this->CMakeRoot = root;
- cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: "
- << this->CMakeRoot.c_str() << std::endl);
- this->SetOption("CMAKE_ROOT", this->CMakeRoot.c_str());
- return 1;
- }
- cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Could not find CMAKE_ROOT !!!"
- << std::endl
- << "CMake has most likely not been installed correctly."
- << std::endl
- <<"Modules directory not found in"
- << std::endl);
- return 0;
-}
-
-//----------------------------------------------------------------------
int cmCPackGenerator::PackageFiles()
{
return 0;
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index 5cb2280..bb33aa0 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -105,9 +105,6 @@ public:
bool IsSet(const char* name) const;
bool IsOn(const char* name) const;
- //! Set all the variables
- int SetCMakeRoot();
-
//! Set the logger
void SetLogger(cmCPackLog* log) { this->Logger = log; }
@@ -285,10 +282,6 @@ protected:
*/
std::vector<std::string> files;
- std::string CPackSelf;
- std::string CMakeSelf;
- std::string CMakeRoot;
-
std::map<std::string, cmCPackInstallationType> InstallationTypes;
/**
* The set of components.
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 9f8cc14..438b16d 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -99,7 +99,7 @@ int cpackDefinitionArgument(const char* argument, const char* cValue,
// this is CPack.
int main (int argc, char *argv[])
{
- cmSystemTools::FindExecutableDirectory(argv[0]);
+ cmSystemTools::FindCMakeResources(argv[0]);
cmCPackLog log;
log.SetErrorPrefix("CPack Error: ");
@@ -228,7 +228,6 @@ int main (int argc, char *argv[])
// This part is used for cpack documentation lookup as well.
cminst.AddCMakePaths();
- doc.SetCMakeRoot(cminst.GetCacheDefinition("CMAKE_ROOT"));
if ( parsed && !help )
{
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 4fa3c53..5e53dbe 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -59,7 +59,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
{
unsigned int k;
std::vector<std::string> args;
- args.push_back(this->CTest->GetCMakeExecutable());
+ args.push_back(cmSystemTools::GetCMakeCommand());
args.push_back(this->SourceDir);
if(this->BuildGenerator.size())
{
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx
index db33cb6..5eed409 100644
--- a/Source/CTest/cmCTestConfigureCommand.cxx
+++ b/Source/CTest/cmCTestConfigureCommand.cxx
@@ -86,7 +86,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
}
std::string cmakeConfigureCommand = "\"";
- cmakeConfigureCommand += this->CTest->GetCMakeExecutable();
+ cmakeConfigureCommand += cmSystemTools::GetCMakeCommand();
cmakeConfigureCommand += "\"";
std::vector<std::string>::const_iterator it;
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 7d33cf3..00a0a09 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -222,13 +222,13 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
// execute the script passing in the arguments to the script as well as the
// arguments from this invocation of cmake
std::vector<const char*> argv;
- argv.push_back(this->CTest->GetCTestExecutable());
+ argv.push_back(cmSystemTools::GetCTestCommand().c_str());
argv.push_back("-SR");
argv.push_back(total_script_arg.c_str());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Executable for CTest is: " <<
- this->CTest->GetCTestExecutable() << "\n");
+ cmSystemTools::GetCTestCommand() << "\n");
// now pass through all the other arguments
std::vector<cmStdString> &initArgs =
@@ -397,9 +397,9 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
this->Makefile->AddDefinition("CTEST_SCRIPT_NAME",
cmSystemTools::GetFilenameName(script).c_str());
this->Makefile->AddDefinition("CTEST_EXECUTABLE_NAME",
- this->CTest->GetCTestExecutable());
+ cmSystemTools::GetCTestCommand().c_str());
this->Makefile->AddDefinition("CMAKE_EXECUTABLE_NAME",
- this->CTest->GetCMakeExecutable());
+ cmSystemTools::GetCMakeCommand().c_str());
this->Makefile->AddDefinition("CTEST_RUN_CURRENT_SCRIPT", true);
this->UpdateElapsedTime();
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index fdfe331..ce50845 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -80,14 +80,13 @@ void CMakeErrorHandler(const char* message, const char* title, bool&, void* clie
int main(int argc, char** argv)
{
- cmSystemTools::FindExecutableDirectory(argv[0]);
+ cmSystemTools::FindCMakeResources(argv[0]);
cmDocumentation doc;
doc.addCMakeStandardDocSections();
if(doc.CheckOptions(argc, argv))
{
cmake hcm;
hcm.AddCMakePaths();
- doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
std::vector<cmDocumentationEntry> generators;
hcm.GetGeneratorDocumentation(generators);
doc.SetName("ccmake");
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 4fee0bb..d94cd37 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -43,14 +43,14 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args,
this->HelpMessage.push_back("");
this->HelpMessage.push_back(s_ConstHelpMessage);
this->CMakeInstance = new cmake;
- this->CMakeInstance->SetCMakeEditCommand("ccmake");
+ this->CMakeInstance->SetCMakeEditCommand(
+ cmSystemTools::GetCMakeCursesCommand());
// create the arguments for the cmake object
std::string whereCMake = cmSystemTools::GetProgramPath(this->Args[0].c_str());
whereCMake += "/cmake";
this->Args[0] = whereCMake;
this->CMakeInstance->SetArgs(this->Args);
- this->CMakeInstance->SetCMakeCommand(whereCMake.c_str());
this->SearchString = "";
this->OldSearchString = "";
this->SearchMode = false;
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 15f9ef1..88a9fc9 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -118,6 +118,13 @@ if(APPLE)
# TBD: MACOSX_BUNDLE_BUNDLE_VERSION "${CMAKE_BUNDLE_VERSION}"
MACOSX_BUNDLE_COPYRIGHT "Copyright 2000-2013 Kitware, Inc."
)
+
+ # 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}
+ $<TARGET_FILE_DIR:cmake>/cmake-gui
+ )
endif()
set(CMAKE_INSTALL_DESTINATION_ARGS
BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}")
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 095aeb6..408bb4c 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -48,7 +48,7 @@ static const char * cmDocumentationOptions[][2] =
int main(int argc, char** argv)
{
- cmSystemTools::FindExecutableDirectory(argv[0]);
+ cmSystemTools::FindCMakeResources(argv[0]);
// check docs first so that X is not need to get docs
// do docs, if args were given
cmDocumentation doc;
@@ -58,7 +58,6 @@ int main(int argc, char** argv)
// Construct and print requested documentation.
cmake hcm;
hcm.AddCMakePaths();
- doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
std::vector<cmDocumentationEntry> generators;
hcm.GetGeneratorDocumentation(generators);
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 0d01181..0fe5f8c 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -33,34 +33,13 @@ QCMake::QCMake(QObject* p)
qRegisterMetaType<QCMakeProperty>();
qRegisterMetaType<QCMakePropertyList>();
- QDir execDir(QCoreApplication::applicationDirPath());
-
-#if defined(Q_OS_MAC)
- if(execDir.exists("../bin/cmake"))
- {
- execDir.cd("../bin");
- }
- else
- {
- execDir.cd("../../../"); // path to cmake in build directory (need to fix for deployment)
- }
-#endif
-
- QString cmakeCommand = QString("cmake")+QString::fromLocal8Bit(cmSystemTools::GetExecutableExtension());
- cmakeCommand = execDir.filePath(cmakeCommand);
-
cmSystemTools::DisableRunCommandOutput();
cmSystemTools::SetRunCommandHideConsole(true);
cmSystemTools::SetErrorCallback(QCMake::errorCallback, this);
- cmSystemTools::FindExecutableDirectory(cmakeCommand.toLocal8Bit().data());
this->CMakeInstance = new cmake;
- this->CMakeInstance->SetCMakeCommand(cmakeCommand.toLocal8Bit().data());
-#if defined(Q_OS_MAC)
- this->CMakeInstance->SetCMakeEditCommand("cmake-gui.app/Contents/MacOS/cmake-gui");
-#else
- this->CMakeInstance->SetCMakeEditCommand("cmake-gui");
-#endif
+ this->CMakeInstance->SetCMakeEditCommand(
+ cmSystemTools::GetCMakeGUICommand());
this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
cmSystemTools::SetInterruptCallback(QCMake::interruptCallback, this);
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/cmCTest.cxx b/Source/cmCTest.cxx
index 98f19cc..bfabc9f 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1298,7 +1298,8 @@ int cmCTest::RunTest(std::vector<const char*> argv,
}
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT,
"Test timeout computed to be: " << timeout << "\n");
- if(cmSystemTools::SameFile(argv[0], this->CTestSelf.c_str()) &&
+ if(cmSystemTools::SameFile(
+ argv[0], cmSystemTools::GetCTestCommand().c_str()) &&
!this->ForceNewCTestProcess)
{
cmCTest inst;
@@ -2257,7 +2258,6 @@ bool cmCTest::AddVariableDefinition(const std::string &arg)
// the main entry point of ctest, called from main
int cmCTest::Run(std::vector<std::string> &args, std::string* output)
{
- this->FindRunningCMake();
const char* ctestExec = "ctest";
bool cmakeAndTest = false;
bool executeTests = true;
@@ -2498,29 +2498,6 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
}
//----------------------------------------------------------------------
-void cmCTest::FindRunningCMake()
-{
- // Find our own executable.
- this->CTestSelf = cmSystemTools::GetExecutableDirectory();
- this->CTestSelf += "/ctest";
- this->CTestSelf += cmSystemTools::GetExecutableExtension();
- if(!cmSystemTools::FileExists(this->CTestSelf.c_str()))
- {
- cmSystemTools::Error("CTest executable cannot be found at ",
- this->CTestSelf.c_str());
- }
-
- this->CMakeSelf = cmSystemTools::GetExecutableDirectory();
- this->CMakeSelf += "/cmake";
- this->CMakeSelf += cmSystemTools::GetExecutableExtension();
- if(!cmSystemTools::FileExists(this->CMakeSelf.c_str()))
- {
- cmSystemTools::Error("CMake executable cannot be found at ",
- this->CMakeSelf.c_str());
- }
-}
-
-//----------------------------------------------------------------------
void cmCTest::SetNotesFiles(const char* notes)
{
if ( !notes )
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 5dd35ce..c0a06c5 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -287,10 +287,6 @@ public:
//source directory, it will become /.../relative/path/to/file
std::string GetShortPathToFile(const char* fname);
- //! Get the path to CTest
- const char* GetCTestExecutable() { return this->CTestSelf.c_str(); }
- const char* GetCMakeExecutable() { return this->CMakeSelf.c_str(); }
-
enum {
EXPERIMENTAL,
NIGHTLY,
@@ -490,8 +486,6 @@ private:
int CompatibilityMode;
// information for the --build-and-test options
- std::string CMakeSelf;
- std::string CTestSelf;
std::string BinaryDir;
std::string NotesFiles;
@@ -546,9 +540,6 @@ private:
int GenerateCTestNotesOutput(std::ostream& os,
const VectorOfStrings& files);
- ///! Find the running cmake
- void FindRunningCMake();
-
//! Check if the argument is the one specified
bool CheckArgument(const std::string& arg, const char* varg1,
const char* varg2 = 0);
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index 348f5d3..c5e95d0 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -16,6 +16,4 @@
#cmakedefine HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE
#cmakedefine HAVE_UNSETENV
#cmakedefine CMAKE_USE_ELF_PARSER
-#define CMAKE_ROOT_DIR "${CMake_SOURCE_DIR}"
-#define CMAKE_BUILD_DIR "${CMake_BINARY_DIR}"
#define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 682478e..8029577 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -605,7 +605,8 @@ void cmDocumentation::GlobHelp(std::vector<std::string>& files,
std::string const& pattern)
{
cmsys::Glob gl;
- std::string findExpr = this->CMakeRoot + "/Help/" + pattern + ".rst";
+ std::string findExpr =
+ cmSystemTools::GetCMakeRoot() + "/Help/" + pattern + ".rst";
if(gl.FindFiles(findExpr))
{
files = gl.GetFiles();
@@ -649,7 +650,7 @@ bool cmDocumentation::PrintFiles(std::ostream& os,
std::vector<std::string> files;
this->GlobHelp(files, pattern);
std::sort(files.begin(), files.end());
- cmRST r(os, this->CMakeRoot + "/Help");
+ cmRST r(os, cmSystemTools::GetCMakeRoot() + "/Help");
for (std::vector<std::string>::const_iterator i = files.begin();
i != files.end(); ++i)
{
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index 07e614d..209cc27 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -83,9 +83,6 @@ public:
void AppendSection(const char *sectionName,
cmDocumentationEntry &docs);
- /** Set cmake root so we can find installed files */
- void SetCMakeRoot(const char* root) { this->CMakeRoot = root? root:"";}
-
/** Add common (to all tools) documentation section(s) */
void addCommonStandardDocSections();
@@ -127,7 +124,6 @@ private:
std::string NameString;
std::map<std::string,cmDocumentationSection*> AllSections;
- std::string CMakeRoot;
std::string CurrentArgument;
struct RequestedHelpItem
diff --git a/Source/cmExportSetMap.cxx b/Source/cmExportSetMap.cxx
index 96fdb3e..5174118 100644
--- a/Source/cmExportSetMap.cxx
+++ b/Source/cmExportSetMap.cxx
@@ -23,7 +23,7 @@ cmExportSet* cmExportSetMap::operator[](const std::string &name)
return it->second;
}
-cmExportSetMap::~cmExportSetMap()
+void cmExportSetMap::clear()
{
for(std::map<std::string, cmExportSet*>::iterator it = this->begin();
it != this->end();
@@ -31,4 +31,10 @@ cmExportSetMap::~cmExportSetMap()
{
delete it->second;
}
+ this->derived::clear();
+}
+
+cmExportSetMap::~cmExportSetMap()
+{
+ this->clear();
}
diff --git a/Source/cmExportSetMap.h b/Source/cmExportSetMap.h
index 4663c55..965046c 100644
--- a/Source/cmExportSetMap.h
+++ b/Source/cmExportSetMap.h
@@ -18,6 +18,7 @@ class cmExportSet;
/// A name -> cmExportSet map with overloaded operator[].
class cmExportSetMap : public std::map<std::string, cmExportSet*>
{
+ typedef std::map<std::string, cmExportSet*> derived;
public:
/** \brief Overloaded operator[].
*
@@ -26,6 +27,8 @@ public:
*/
cmExportSet* operator[](const std::string &name);
+ void clear();
+
/// Overloaded destructor deletes all member export sets.
~cmExportSetMap();
};
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index b70fed6..d9bc04c 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -32,7 +32,7 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
ImportPropertyMap properties;
#define FIND_TARGETS(PROPERTY) \
- this->FindTargets(#PROPERTY, te, emittedDeps);
+ this->FindTargets("INTERFACE_" #PROPERTY, te, emittedDeps);
CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS)
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/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 0b7ef02..c8594e7 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -23,10 +23,10 @@
F(EvaluatingCompileOptions)
#define CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(F) \
- F(INTERFACE_INCLUDE_DIRECTORIES) \
- F(INTERFACE_SYSTEM_INCLUDE_DIRECTORIES) \
- F(INTERFACE_COMPILE_DEFINITIONS) \
- F(INTERFACE_COMPILE_OPTIONS)
+ F(INCLUDE_DIRECTORIES) \
+ F(SYSTEM_INCLUDE_DIRECTORIES) \
+ F(COMPILE_DEFINITIONS) \
+ F(COMPILE_OPTIONS)
//----------------------------------------------------------------------------
struct cmGeneratorExpressionDAGChecker
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 107ef73..2ae5a22 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -652,7 +652,7 @@ static const struct JoinNode : public cmGeneratorExpressionNode
} joinNode;
#define TRANSITIVE_PROPERTY_NAME(PROPERTY) \
- , #PROPERTY
+ , "INTERFACE_" #PROPERTY
//----------------------------------------------------------------------------
static const char* targetPropertyTransitiveWhitelist[] = {
@@ -893,26 +893,21 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
std::string interfacePropertyName;
- if (propertyName == "INTERFACE_INCLUDE_DIRECTORIES"
- || propertyName == "INCLUDE_DIRECTORIES")
- {
- interfacePropertyName = "INTERFACE_INCLUDE_DIRECTORIES";
- }
- else if (propertyName == "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES")
- {
- interfacePropertyName = "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES";
- }
- else if (propertyName == "INTERFACE_COMPILE_DEFINITIONS"
- || propertyName == "COMPILE_DEFINITIONS"
- || strncmp(propertyName.c_str(), "COMPILE_DEFINITIONS_", 20) == 0)
+#define POPULATE_INTERFACE_PROPERTY_NAME(prop) \
+ if (propertyName == #prop || propertyName == "INTERFACE_" #prop) \
+ { \
+ interfacePropertyName = "INTERFACE_" #prop; \
+ } \
+ else
+
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(POPULATE_INTERFACE_PROPERTY_NAME)
+ // Note that the above macro terminates with an else
+ /* else */ if (strncmp(propertyName.c_str(),
+ "COMPILE_DEFINITIONS_", 20) == 0)
{
interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
}
- else if (propertyName == "INTERFACE_COMPILE_OPTIONS"
- || propertyName == "COMPILE_OPTIONS")
- {
- interfacePropertyName = "INTERFACE_COMPILE_OPTIONS";
- }
+#undef POPULATE_INTERFACE_PROPERTY_NAME
cmTarget const* headTarget = context->HeadTarget
? context->HeadTarget : target;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 71dd897..b2a0ef7 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1059,7 +1059,7 @@ void cmGlobalGenerator::Generate()
return;
}
- this->FinalizeTargetCompileDefinitions();
+ this->FinalizeTargetCompileInfo();
#ifdef CMAKE_BUILD_WITH_CMAKE
// Iterate through all targets and set up automoc for those which have
@@ -1084,11 +1084,6 @@ void cmGlobalGenerator::Generate()
(*targets)[tit->first] = tit->second;
(*targets)[tit->first].SetMakefile(mf);
}
-
- for ( tit = targets->begin(); tit != targets->end(); ++ tit )
- {
- tit->second.AppendBuildInterfaceIncludes();
- }
}
// Add generator specific helper commands
@@ -1270,7 +1265,7 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
}
//----------------------------------------------------------------------------
-void cmGlobalGenerator::FinalizeTargetCompileDefinitions()
+void cmGlobalGenerator::FinalizeTargetCompileInfo()
{
// Construct per-target generator information.
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
@@ -1289,6 +1284,8 @@ void cmGlobalGenerator::FinalizeTargetCompileDefinitions()
{
cmTarget* t = &ti->second;
+ t->AppendBuildInterfaceIncludes();
+
for (std::vector<cmValueWithOrigin>::const_iterator it
= noconfig_compile_definitions.begin();
it != noconfig_compile_definitions.end(); ++it)
@@ -2068,7 +2065,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
cmCustomCommandLines cpackCommandLines;
std::vector<std::string> depends;
cmCustomCommandLine singleLine;
- singleLine.push_back(this->GetCMakeInstance()->GetCPackCommand());
+ singleLine.push_back(cmSystemTools::GetCPackCommand());
if ( cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.' )
{
singleLine.push_back("-C");
@@ -2109,7 +2106,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
cpackCommandLines.end());
singleLine.erase(singleLine.begin(), singleLine.end());
depends.erase(depends.begin(), depends.end());
- singleLine.push_back(this->GetCMakeInstance()->GetCPackCommand());
+ singleLine.push_back(cmSystemTools::GetCPackCommand());
singleLine.push_back("--config");
configFile = mf->GetStartOutputDirectory();;
configFile += "/CPackSourceConfig.cmake";
@@ -2135,7 +2132,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
cpackCommandLines.end());
singleLine.erase(singleLine.begin(), singleLine.end());
depends.erase(depends.begin(), depends.end());
- singleLine.push_back(this->GetCMakeInstance()->GetCTestCommand());
+ singleLine.push_back(cmSystemTools::GetCTestCommand());
singleLine.push_back("--force-new-ctest-process");
if(cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.')
{
@@ -2161,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);
@@ -2177,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 1b8daa9..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;
@@ -397,7 +399,7 @@ private:
void WriteSummary();
void WriteSummary(cmTarget* target);
- void FinalizeTargetCompileDefinitions();
+ void FinalizeTargetCompileInfo();
virtual void PrintCompilerAdvice(std::ostream& os, std::string lang,
const char* envVar);
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/cmMakefile.cxx b/Source/cmMakefile.cxx
index c18a7eb..ac8381c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3072,7 +3072,6 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir,
cm.SetHomeOutputDirectory(bindir);
cm.SetStartDirectory(srcdir);
cm.SetStartOutputDirectory(bindir);
- cm.SetCMakeCommand(cmakeCommand.c_str());
cm.SetGeneratorToolset(this->GetCMakeInstance()->GetGeneratorToolset());
cm.LoadCache();
if(!gg->IsMultiConfig())
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 1ecda88..f5376eb 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -43,6 +43,10 @@
# include <sys/wait.h>
#endif
+#if defined(__APPLE__)
+# include <mach-o/dyld.h>
+#endif
+
#include <sys/stat.h>
#if defined(_WIN32) && \
@@ -2011,16 +2015,59 @@ unsigned int cmSystemTools::RandomSeed()
}
//----------------------------------------------------------------------------
-static std::string cmSystemToolsExecutableDirectory;
-void cmSystemTools::FindExecutableDirectory(const char* argv0)
-{
+static std::string cmSystemToolsCMakeCommand;
+static std::string cmSystemToolsCTestCommand;
+static std::string cmSystemToolsCPackCommand;
+static std::string cmSystemToolsCMakeCursesCommand;
+static std::string cmSystemToolsCMakeGUICommand;
+static std::string cmSystemToolsCMakeRoot;
+void cmSystemTools::FindCMakeResources(const char* argv0)
+{
+ std::string exe_dir;
#if defined(_WIN32) && !defined(__CYGWIN__)
(void)argv0; // ignore this on windows
char modulepath[_MAX_PATH];
::GetModuleFileName(NULL, modulepath, sizeof(modulepath));
- cmSystemToolsExecutableDirectory =
- cmSystemTools::GetFilenamePath(modulepath);
- return;
+ exe_dir = cmSystemTools::GetFilenamePath(modulepath);
+#elif defined(__APPLE__)
+ (void)argv0; // ignore this on OS X
+# define CM_EXE_PATH_LOCAL_SIZE 16384
+ char exe_path_local[CM_EXE_PATH_LOCAL_SIZE];
+# if defined(MAC_OS_X_VERSION_10_3) && !defined(MAC_OS_X_VERSION_10_4)
+ unsigned long exe_path_size = CM_EXE_PATH_LOCAL_SIZE;
+# else
+ uint32_t exe_path_size = CM_EXE_PATH_LOCAL_SIZE;
+# endif
+# undef CM_EXE_PATH_LOCAL_SIZE
+ char* exe_path = exe_path_local;
+ if(_NSGetExecutablePath(exe_path, &exe_path_size) < 0)
+ {
+ exe_path = (char*)malloc(exe_path_size);
+ _NSGetExecutablePath(exe_path, &exe_path_size);
+ }
+ exe_dir =
+ cmSystemTools::GetFilenamePath(
+ cmSystemTools::GetRealPath(exe_path));
+ if(exe_path != exe_path_local)
+ {
+ free(exe_path);
+ }
+ if(cmSystemTools::GetFilenameName(exe_dir) == "MacOS")
+ {
+ // The executable is inside an application bundle.
+ // Look for ../bin (install tree) and then fall back to
+ // ../../../bin (build tree).
+ exe_dir = cmSystemTools::GetFilenamePath(exe_dir);
+ if(cmSystemTools::FileExists((exe_dir+"/bin/cmake").c_str()))
+ {
+ exe_dir += "/bin";
+ }
+ else
+ {
+ exe_dir = cmSystemTools::GetFilenamePath(exe_dir);
+ exe_dir = cmSystemTools::GetFilenamePath(exe_dir);
+ }
+ }
#else
std::string errorMsg;
std::string exe;
@@ -2028,7 +2075,7 @@ void cmSystemTools::FindExecutableDirectory(const char* argv0)
{
// remove symlinks
exe = cmSystemTools::GetRealPath(exe.c_str());
- cmSystemToolsExecutableDirectory =
+ exe_dir =
cmSystemTools::GetFilenamePath(exe.c_str());
}
else
@@ -2036,12 +2083,99 @@ void cmSystemTools::FindExecutableDirectory(const char* argv0)
// ???
}
#endif
+ cmSystemToolsCMakeCommand = exe_dir;
+ cmSystemToolsCMakeCommand += "/cmake";
+ cmSystemToolsCMakeCommand += cmSystemTools::GetExecutableExtension();
+ cmSystemToolsCTestCommand = exe_dir;
+ cmSystemToolsCTestCommand += "/ctest";
+ cmSystemToolsCTestCommand += cmSystemTools::GetExecutableExtension();
+ cmSystemToolsCPackCommand = exe_dir;
+ cmSystemToolsCPackCommand += "/cpack";
+ cmSystemToolsCPackCommand += cmSystemTools::GetExecutableExtension();
+ cmSystemToolsCMakeGUICommand = exe_dir;
+ cmSystemToolsCMakeGUICommand += "/cmake-gui";
+ cmSystemToolsCMakeGUICommand += cmSystemTools::GetExecutableExtension();
+ if(!cmSystemTools::FileExists(cmSystemToolsCMakeGUICommand.c_str()))
+ {
+ cmSystemToolsCMakeGUICommand = "";
+ }
+ cmSystemToolsCMakeCursesCommand = exe_dir;
+ cmSystemToolsCMakeCursesCommand += "/ccmake";
+ cmSystemToolsCMakeCursesCommand += cmSystemTools::GetExecutableExtension();
+ if(!cmSystemTools::FileExists(cmSystemToolsCMakeCursesCommand.c_str()))
+ {
+ cmSystemToolsCMakeCursesCommand = "";
+ }
+
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ // Install tree has "<prefix>/bin/cmake" and "<prefix><CMAKE_DATA_DIR>".
+ std::string dir = cmSystemTools::GetFilenamePath(exe_dir);
+ cmSystemToolsCMakeRoot = dir + CMAKE_DATA_DIR;
+ if(!cmSystemTools::FileExists(
+ (cmSystemToolsCMakeRoot+"/Modules/CMake.cmake").c_str()))
+ {
+ // Build tree has "<build>/bin[/<config>]/cmake" and
+ // "<build>/CMakeFiles/CMakeSourceDir.txt".
+ std::string src_dir_txt = dir + "/CMakeFiles/CMakeSourceDir.txt";
+ std::ifstream fin(src_dir_txt.c_str());
+ std::string src_dir;
+ if(fin && cmSystemTools::GetLineFromStream(fin, src_dir) &&
+ cmSystemTools::FileIsDirectory(src_dir.c_str()))
+ {
+ cmSystemToolsCMakeRoot = src_dir;
+ }
+ else
+ {
+ dir = cmSystemTools::GetFilenamePath(dir);
+ src_dir_txt = dir + "/CMakeFiles/CMakeSourceDir.txt";
+ std::ifstream fin2(src_dir_txt.c_str());
+ if(fin2 && cmSystemTools::GetLineFromStream(fin2, src_dir) &&
+ cmSystemTools::FileIsDirectory(src_dir.c_str()))
+ {
+ cmSystemToolsCMakeRoot = src_dir;
+ }
+ }
+ }
+#else
+ // Bootstrap build knows its source.
+ cmSystemToolsCMakeRoot = CMAKE_ROOT_DIR;
+#endif
+}
+
+//----------------------------------------------------------------------------
+std::string const& cmSystemTools::GetCMakeCommand()
+{
+ return cmSystemToolsCMakeCommand;
+}
+
+//----------------------------------------------------------------------------
+std::string const& cmSystemTools::GetCTestCommand()
+{
+ return cmSystemToolsCTestCommand;
+}
+
+//----------------------------------------------------------------------------
+std::string const& cmSystemTools::GetCPackCommand()
+{
+ return cmSystemToolsCPackCommand;
+}
+
+//----------------------------------------------------------------------------
+std::string const& cmSystemTools::GetCMakeCursesCommand()
+{
+ return cmSystemToolsCMakeCursesCommand;
+}
+
+//----------------------------------------------------------------------------
+std::string const& cmSystemTools::GetCMakeGUICommand()
+{
+ return cmSystemToolsCMakeGUICommand;
}
//----------------------------------------------------------------------------
-const char* cmSystemTools::GetExecutableDirectory()
+std::string const& cmSystemTools::GetCMakeRoot()
{
- return cmSystemToolsExecutableDirectory.c_str();
+ return cmSystemToolsCMakeRoot;
}
//----------------------------------------------------------------------------
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 07235da..69f6381 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -406,13 +406,16 @@ public:
/** Random seed generation. */
static unsigned int RandomSeed();
- /** Find the directory containing the running executable. Save it
- in a global location to be queried by GetExecutableDirectory
- later. */
- static void FindExecutableDirectory(const char* argv0);
-
- /** Get the directory containing the currently running executable. */
- static const char* GetExecutableDirectory();
+ /** Find the directory containing CMake executables. */
+ static void FindCMakeResources(const char* argv0);
+
+ /** Get the CMake resource paths, after FindCMakeResources. */
+ static std::string const& GetCTestCommand();
+ static std::string const& GetCPackCommand();
+ static std::string const& GetCMakeCommand();
+ static std::string const& GetCMakeGUICommand();
+ static std::string const& GetCMakeCursesCommand();
+ static std::string const& GetCMakeRoot();
#if defined(CMAKE_BUILD_WITH_CMAKE)
/** Echo a message in color using KWSys's Terminal cprintf. */
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index d5e8420..c9905b6 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -138,16 +138,16 @@ public:
std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
std::vector<cmValueWithOrigin> LinkInterfacePropertyEntries;
- std::map<std::string, std::vector<TargetPropertyEntry*> >
+ mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
CachedLinkInterfaceIncludeDirectoriesEntries;
- std::map<std::string, std::vector<TargetPropertyEntry*> >
+ mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
CachedLinkInterfaceCompileOptionsEntries;
- std::map<std::string, std::vector<TargetPropertyEntry*> >
+ mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
CachedLinkInterfaceCompileDefinitionsEntries;
- std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
- std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
- std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
+ mutable std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
+ mutable std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
+ mutable std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
};
//----------------------------------------------------------------------------
@@ -1593,7 +1593,7 @@ void cmTarget::InsertCompileDefinition(const cmValueWithOrigin &entry,
}
//----------------------------------------------------------------------------
-static void processIncludeDirectories(cmTarget *tgt,
+static void processIncludeDirectories(cmTarget const* tgt,
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
std::vector<std::string> &includes,
std::set<std::string> &uniqueIncludes,
@@ -1762,7 +1762,8 @@ static void processIncludeDirectories(cmTarget *tgt,
}
//----------------------------------------------------------------------------
-std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
+std::vector<std::string>
+cmTarget::GetIncludeDirectories(const char *config) const
{
std::vector<std::string> includes;
std::set<std::string> uniqueIncludes;
@@ -1772,8 +1773,6 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
this->GetName(),
"INCLUDE_DIRECTORIES", 0, 0);
- this->AppendBuildInterfaceIncludes();
-
std::vector<std::string> debugProperties;
const char *debugProp =
this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
@@ -1896,7 +1895,7 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
}
//----------------------------------------------------------------------------
-static void processCompileOptionsInternal(cmTarget *tgt,
+static void processCompileOptionsInternal(cmTarget const* tgt,
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
std::vector<std::string> &options,
std::set<std::string> &uniqueOptions,
@@ -1955,7 +1954,7 @@ static void processCompileOptionsInternal(cmTarget *tgt,
}
//----------------------------------------------------------------------------
-static void processCompileOptions(cmTarget *tgt,
+static void processCompileOptions(cmTarget const* tgt,
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
std::vector<std::string> &options,
std::set<std::string> &uniqueOptions,
@@ -1968,7 +1967,7 @@ static void processCompileOptions(cmTarget *tgt,
//----------------------------------------------------------------------------
void cmTarget::GetCompileOptions(std::vector<std::string> &result,
- const char *config)
+ const char *config) const
{
std::set<std::string> uniqueOptions;
cmListFileBacktrace lfbt;
@@ -2067,7 +2066,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
}
//----------------------------------------------------------------------------
-static void processCompileDefinitions(cmTarget *tgt,
+static void processCompileDefinitions(cmTarget const* tgt,
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
std::vector<std::string> &options,
std::set<std::string> &uniqueOptions,
@@ -2081,7 +2080,7 @@ static void processCompileDefinitions(cmTarget *tgt,
//----------------------------------------------------------------------------
void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
- const char *config)
+ const char *config) const
{
std::set<std::string> uniqueOptions;
cmListFileBacktrace lfbt;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index fbb4914..b516a0a 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -445,7 +445,7 @@ public:
const char* GetExportMacro();
void GetCompileDefinitions(std::vector<std::string> &result,
- const char *config);
+ const char *config) const;
// Compute the set of languages compiled by the target. This is
// computed every time it is called because the languages can change
@@ -512,7 +512,7 @@ public:
std::string GetAppBundleDirectory(const char* config,
bool contentOnly) const;
- std::vector<std::string> GetIncludeDirectories(const char *config);
+ std::vector<std::string> GetIncludeDirectories(const char *config) const;
void InsertInclude(const cmValueWithOrigin &entry,
bool before = false);
void InsertCompileOption(const cmValueWithOrigin &entry,
@@ -523,7 +523,7 @@ public:
void AppendBuildInterfaceIncludes();
void GetCompileOptions(std::vector<std::string> &result,
- const char *config);
+ const char *config) const;
bool IsNullImpliedByLinkLibraries(const std::string &p) const;
bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
@@ -679,9 +679,9 @@ private:
bool DLLPlatform;
bool IsApple;
bool IsImportedTarget;
- bool DebugIncludesDone;
- bool DebugCompileOptionsDone;
- bool DebugCompileDefinitionsDone;
+ mutable bool DebugIncludesDone;
+ mutable bool DebugCompileOptionsDone;
+ mutable bool DebugCompileDefinitionsDone;
mutable std::set<std::string> LinkImplicitNullProperties;
bool BuildInterfaceIncludesAppended;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index f786691..f0f9ef7 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -932,146 +932,30 @@ void cmake::SetDirectoriesFromFile(const char* arg)
// cache
int cmake::AddCMakePaths()
{
- // Find the cmake executable
- std::string cMakeSelf = cmSystemTools::GetExecutableDirectory();
- cMakeSelf = cmSystemTools::GetRealPath(cMakeSelf.c_str());
- cMakeSelf += "/cmake";
- cMakeSelf += cmSystemTools::GetExecutableExtension();
-#ifdef __APPLE__
- // on the apple this might be the gui bundle
- if(!cmSystemTools::FileExists(cMakeSelf.c_str()))
- {
- cMakeSelf = cmSystemTools::GetExecutableDirectory();
- cMakeSelf = cmSystemTools::GetRealPath(cMakeSelf.c_str());
- cMakeSelf += "../../../..";
- cMakeSelf = cmSystemTools::GetRealPath(cMakeSelf.c_str());
- cMakeSelf = cmSystemTools::CollapseFullPath(cMakeSelf.c_str());
- cMakeSelf += "/cmake";
- std::cerr << cMakeSelf.c_str() << "\n";
- }
-#endif
- if(!cmSystemTools::FileExists(cMakeSelf.c_str()))
- {
- cmSystemTools::Error("CMake executable cannot be found at ",
- cMakeSelf.c_str());
- return 0;
- }
// Save the value in the cache
this->CacheManager->AddCacheEntry
- ("CMAKE_COMMAND",cMakeSelf.c_str(), "Path to CMake executable.",
- cmCacheManager::INTERNAL);
- // 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 = cmSystemTools::GetFilenamePath(cMakeSelf)
- + std::string("/")
- + this->CMakeEditCommand
- + cmSystemTools::GetFilenameExtension(cMakeSelf);
- }
- if( !cmSystemTools::FileExists(editCacheCommand.c_str()))
- {
- editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
- "/ccmake" + cmSystemTools::GetFilenameExtension(cMakeSelf);
- }
- if( !cmSystemTools::FileExists(editCacheCommand.c_str()))
- {
- editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
- "/cmake-gui" + cmSystemTools::GetFilenameExtension(cMakeSelf);
- }
- if(cmSystemTools::FileExists(editCacheCommand.c_str()))
- {
- this->CacheManager->AddCacheEntry
- ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(),
- "Path to cache edit program executable.", cmCacheManager::INTERNAL);
- }
- }
- std::string ctestCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
- "/ctest" + cmSystemTools::GetFilenameExtension(cMakeSelf);
- if(cmSystemTools::FileExists(ctestCommand.c_str()))
- {
- this->CacheManager->AddCacheEntry
- ("CMAKE_CTEST_COMMAND", ctestCommand.c_str(),
- "Path to ctest program executable.", cmCacheManager::INTERNAL);
- }
- std::string cpackCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
- "/cpack" + cmSystemTools::GetFilenameExtension(cMakeSelf);
- if(cmSystemTools::FileExists(cpackCommand.c_str()))
- {
- this->CacheManager->AddCacheEntry
- ("CMAKE_CPACK_COMMAND", cpackCommand.c_str(),
- "Path to cpack program executable.", cmCacheManager::INTERNAL);
- }
-
- // do CMAKE_ROOT, look for the environment variable first
- std::string cMakeRoot;
- std::string modules;
- if (getenv("CMAKE_ROOT"))
- {
- cMakeRoot = getenv("CMAKE_ROOT");
- modules = cMakeRoot + "/Modules/CMake.cmake";
- }
- if(!cmSystemTools::FileExists(modules.c_str()))
- {
- // next try exe/..
- cMakeRoot = cmSystemTools::GetRealPath(cMakeSelf.c_str());
- cMakeRoot = cmSystemTools::GetProgramPath(cMakeRoot.c_str());
- std::string::size_type slashPos = cMakeRoot.rfind("/");
- if(slashPos != std::string::npos)
- {
- cMakeRoot = cMakeRoot.substr(0, slashPos);
- }
- // is there no Modules directory there?
- modules = cMakeRoot + "/Modules/CMake.cmake";
- }
-
- if (!cmSystemTools::FileExists(modules.c_str()))
- {
- // try exe/../share/cmake
- cMakeRoot += CMAKE_DATA_DIR;
- modules = cMakeRoot + "/Modules/CMake.cmake";
- }
-#ifdef CMAKE_ROOT_DIR
- if (!cmSystemTools::FileExists(modules.c_str()))
- {
- // try compiled in root directory
- cMakeRoot = CMAKE_ROOT_DIR;
- modules = cMakeRoot + "/Modules/CMake.cmake";
- }
+ ("CMAKE_COMMAND", cmSystemTools::GetCMakeCommand().c_str(),
+ "Path to CMake executable.", cmCacheManager::INTERNAL);
+#ifdef CMAKE_BUILD_WITH_CMAKE
+ this->CacheManager->AddCacheEntry
+ ("CMAKE_CTEST_COMMAND", cmSystemTools::GetCTestCommand().c_str(),
+ "Path to ctest program executable.", cmCacheManager::INTERNAL);
+ this->CacheManager->AddCacheEntry
+ ("CMAKE_CPACK_COMMAND", cmSystemTools::GetCPackCommand().c_str(),
+ "Path to cpack program executable.", cmCacheManager::INTERNAL);
#endif
- if (!cmSystemTools::FileExists(modules.c_str()))
- {
- // try
- cMakeRoot = cmSystemTools::GetProgramPath(cMakeSelf.c_str());
- cMakeRoot += CMAKE_DATA_DIR;
- modules = cMakeRoot + "/Modules/CMake.cmake";
- }
- if(!cmSystemTools::FileExists(modules.c_str()))
- {
- // next try exe
- cMakeRoot = cmSystemTools::GetProgramPath(cMakeSelf.c_str());
- // is there no Modules directory there?
- modules = cMakeRoot + "/Modules/CMake.cmake";
- }
- if (!cmSystemTools::FileExists(modules.c_str()))
+ if(!cmSystemTools::FileExists(
+ (cmSystemTools::GetCMakeRoot()+"/Modules/CMake.cmake").c_str()))
{
// couldn't find modules
cmSystemTools::Error("Could not find CMAKE_ROOT !!!\n"
"CMake has most likely not been installed correctly.\n"
"Modules directory not found in\n",
- cMakeRoot.c_str());
+ cmSystemTools::GetCMakeRoot().c_str());
return 0;
}
this->CacheManager->AddCacheEntry
- ("CMAKE_ROOT", cMakeRoot.c_str(),
+ ("CMAKE_ROOT", cmSystemTools::GetCMakeRoot().c_str(),
"Path to CMake installation.", cmCacheManager::INTERNAL);
return 1;
@@ -1705,9 +1589,6 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
return 0;
}
- // set the cmake command
- this->CMakeCommand = args[0];
-
if ( this->GetWorkingMode() == NORMAL_MODE )
{
// load the cache
@@ -1925,14 +1806,6 @@ int cmake::LoadCache()
}
}
- if (this->CMakeCommand.size() < 2)
- {
- cmSystemTools::Error(
- "cmake command was not specified prior to loading the cache in "
- "cmake.cxx");
- return -1;
- }
-
// setup CMAKE_ROOT and CMAKE_COMMAND
if(!this->AddCMakePaths())
{
@@ -2238,82 +2111,6 @@ inline std::string removeQuotes(const std::string& s)
return s;
}
-std::string cmake::FindCMakeProgram(const char* name) const
-{
- std::string path;
- if ((name) && (*name))
- {
- const cmMakefile* mf
- = this->GetGlobalGenerator()->GetLocalGenerators()[0]->GetMakefile();
-#ifdef CMAKE_BUILD_WITH_CMAKE
- path = mf->GetRequiredDefinition("CMAKE_COMMAND");
- path = removeQuotes(path);
- path = cmSystemTools::GetFilenamePath(path.c_str());
- path += "/";
- path += name;
- path += cmSystemTools::GetExecutableExtension();
- if(!cmSystemTools::FileExists(path.c_str()))
- {
- path = mf->GetRequiredDefinition("CMAKE_COMMAND");
- path = cmSystemTools::GetFilenamePath(path.c_str());
- path += "/Debug/";
- path += name;
- path += cmSystemTools::GetExecutableExtension();
- }
- if(!cmSystemTools::FileExists(path.c_str()))
- {
- path = mf->GetRequiredDefinition("CMAKE_COMMAND");
- path = cmSystemTools::GetFilenamePath(path.c_str());
- path += "/Release/";
- path += name;
- path += cmSystemTools::GetExecutableExtension();
- }
-#else
- // Only for bootstrap
- path += mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH");
- path += "/";
- path += name;
- path += cmSystemTools::GetExecutableExtension();
-#endif
- }
- return path;
-}
-
-const char* cmake::GetCTestCommand()
-{
- if ( this->CTestCommand.empty() )
- {
- this->CTestCommand = this->FindCMakeProgram("ctest");
- }
- if ( this->CTestCommand.empty() )
- {
- cmSystemTools::Error("Cannot find the CTest executable");
- this->CTestCommand = "CTEST-COMMAND-NOT-FOUND";
- }
- return this->CTestCommand.c_str();
-}
-
-const char* cmake::GetCPackCommand()
-{
- if ( this->CPackCommand.empty() )
- {
- this->CPackCommand = this->FindCMakeProgram("cpack");
- }
- if ( this->CPackCommand.empty() )
- {
- cmSystemTools::Error("Cannot find the CPack executable");
- this->CPackCommand = "CPACK-COMMAND-NOT-FOUND";
- }
- return this->CPackCommand.c_str();
-}
-
-
-const char* cmake::GetCMakeCommand()
-{
- return this->CMakeCommand.c_str();
-}
-
-
void cmake::MarkCliAsUsed(const std::string& variable)
{
this->UsedCliVariables[variable] = true;
diff --git a/Source/cmake.h b/Source/cmake.h
index 7fe130b..dfec55c 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -200,9 +200,6 @@ class cmake
///! get the cmCachemManager used by this invocation of cmake
cmCacheManager *GetCacheManager() { return this->CacheManager; }
- ///! set the cmake command this instance of cmake should use
- void SetCMakeCommand(const char* cmd) { this->CMakeCommand = cmd; }
-
/**
* Given a variable name, return its value (as a string).
*/
@@ -301,13 +298,6 @@ class cmake
*/
cmFileTimeComparison* GetFileComparison() { return this->FileComparison; }
- /**
- * Get the path to ctest
- */
- const char* GetCTestCommand();
- const char* GetCPackCommand();
- const char* GetCMakeCommand();
-
// Do we want debug output during the cmake run.
bool GetDebugOutput() { return this->DebugOutput; }
void SetDebugOutputOn(bool b) { this->DebugOutput = b;}
@@ -344,10 +334,11 @@ class cmake
debugging configurations.*/
std::vector<std::string> const& GetDebugConfigs();
- void SetCMakeEditCommand(const char* s)
- {
- this->CMakeEditCommand = s;
- }
+ void SetCMakeEditCommand(std::string const& s)
+ { this->CMakeEditCommand = s; }
+ std::string const& GetCMakeEditCommand() const
+ { return this->CMakeEditCommand; }
+
void SetSuppressDevWarnings(bool v)
{
this->SuppressDevWarnings = v;
@@ -425,8 +416,6 @@ protected:
cmVariableWatch* VariableWatch;
- ///! Find the full path to one of the cmake programs like ctest, cpack, etc.
- std::string FindCMakeProgram(const char* name) const;
private:
cmake(const cmake&); // Not implemented.
void operator=(const cmake&); // Not implemented.
@@ -443,15 +432,12 @@ private:
bool CheckSystemVars;
std::map<cmStdString, bool> UsedCliVariables;
std::string CMakeEditCommand;
- std::string CMakeCommand;
std::string CXXEnvironment;
std::string CCEnvironment;
std::string CheckBuildSystemArgument;
std::string CheckStampFile;
std::string CheckStampList;
std::string VSSolutionFile;
- std::string CTestCommand;
- std::string CPackCommand;
bool ClearBuildSystem;
bool DebugTryCompile;
cmFileTimeComparison* FileComparison;
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index ff5c8ae..6ef0579 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -162,7 +162,7 @@ static void cmakemainProgressCallback(const char *m, float prog,
int main(int ac, char** av)
{
cmSystemTools::EnableMSVCDebugHook();
- cmSystemTools::FindExecutableDirectory(av[0]);
+ cmSystemTools::FindCMakeResources(av[0]);
if(ac > 1)
{
if(strcmp(av[1], "--build") == 0)
@@ -198,7 +198,6 @@ int do_cmake(int ac, char** av)
// Construct and print requested documentation.
cmake hcm;
hcm.AddCMakePaths();
- doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
// the command line args are processed here so that you can do
// -DCMAKE_MODULE_PATH=/some/path and have this value accessible here
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 12e71b6..de07458 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -115,7 +115,7 @@ int main (int argc, char *argv[])
{
cmSystemTools::DoNotInheritStdPipes();
cmSystemTools::EnableMSVCDebugHook();
- cmSystemTools::FindExecutableDirectory(argv[0]);
+ cmSystemTools::FindCMakeResources(argv[0]);
// Dispatch 'ctest --launch' mode directly.
if(argc >= 2 && strcmp(argv[1], "--launch") == 0)
@@ -151,7 +151,6 @@ int main (int argc, char *argv[])
{
cmake hcm;
hcm.AddCMakePaths();
- doc.SetCMakeRoot(hcm.GetCacheDefinition("CMAKE_ROOT"));
// Construct and print requested documentation.
cmCTestScriptHandler* ch =
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/RunCMake/CMP0037/CMP0037-NEW-result.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-NEW-result.txt
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-result.txt
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt
new file mode 100644
index 0000000..aadc7d7
--- /dev/null
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt
@@ -0,0 +1,19 @@
+CMake Error at CMP0037-NEW-colon.cmake:4 \(add_library\):
+ Policy CMP0037 is not set: Target names should match a validity pattern.
+ Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
+ command to set the policy and suppress this warning.
+
+ The target name "lib:colon" is not valid for certain CMake features, such
+ as generator expressions, and may result in undefined behavior.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at CMP0037-NEW-colon.cmake:5 \(add_executable\):
+ Policy CMP0037 is not set: Target names should match a validity pattern.
+ Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
+ command to set the policy and suppress this warning.
+
+ The target name "exe:colon" is not valid for certain CMake features, such
+ as generator expressions, and may result in undefined behavior.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake
new file mode 100644
index 0000000..5c564f3
--- /dev/null
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake
@@ -0,0 +1,5 @@
+
+cmake_policy(SET CMP0037 NEW)
+
+add_library("lib:colon" empty.cpp)
+add_executable("exe:colon" empty.cpp)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-space-result.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt
new file mode 100644
index 0000000..169db86
--- /dev/null
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt
@@ -0,0 +1,19 @@
+CMake Error at CMP0037-NEW-space.cmake:4 \(add_library\):
+ Policy CMP0037 is not set: Target names should match a validity pattern.
+ Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
+ command to set the policy and suppress this warning.
+
+ The target name "lib with spaces" is not valid for certain CMake features,
+ such as generator expressions, and may result in undefined behavior.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at CMP0037-NEW-space.cmake:5 \(add_executable\):
+ Policy CMP0037 is not set: Target names should match a validity pattern.
+ Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
+ command to set the policy and suppress this warning.
+
+ The target name "exe with spaces" is not valid for certain CMake features,
+ such as generator expressions, and may result in undefined behavior.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW.cmake b/Tests/RunCMake/CMP0037/CMP0037-NEW-space.cmake
index a6ffc59..9e2faaa 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-NEW.cmake
+++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-space.cmake
@@ -3,5 +3,3 @@ cmake_policy(SET CMP0037 NEW)
add_library("lib with spaces" empty.cpp)
add_executable("exe with spaces" empty.cpp)
-add_library("lib:colon" empty.cpp)
-add_executable("exe:colon" empty.cpp)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-stderr.txt
deleted file mode 100644
index 6de96b1..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-NEW-stderr.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-CMake Error at CMP0037-NEW.cmake:4 \(add_library\):
- Policy CMP0037 is not set: Target names should match a validity pattern.
- Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The target name "lib with spaces" is not valid for certain CMake features,
- such as generator expressions, and may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at CMP0037-NEW.cmake:5 \(add_executable\):
- Policy CMP0037 is not set: Target names should match a validity pattern.
- Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The target name "exe with spaces" is not valid for certain CMake features,
- such as generator expressions, and may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at CMP0037-NEW.cmake:6 \(add_library\):
- Policy CMP0037 is not set: Target names should match a validity pattern.
- Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The target name "lib:colon" is not valid for certain CMake features, such
- as generator expressions, and may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-+
-CMake Error at CMP0037-NEW.cmake:7 \(add_executable\):
- Policy CMP0037 is not set: Target names should match a validity pattern.
- Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The target name "exe:colon" is not valid for certain CMake features, such
- as generator expressions, and may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-result.txt b/Tests/RunCMake/CMP0037/CMP0037-OLD-space-result.txt
index 573541a..573541a 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-WARN-result.txt
+++ b/Tests/RunCMake/CMP0037/CMP0037-OLD-space-result.txt
diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-OLD-space-stderr.txt
index 10f3293..10f3293 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-OLD-stderr.txt
+++ b/Tests/RunCMake/CMP0037/CMP0037-OLD-space-stderr.txt
diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD.cmake b/Tests/RunCMake/CMP0037/CMP0037-OLD-space.cmake
index af98f12..af98f12 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-OLD.cmake
+++ b/Tests/RunCMake/CMP0037/CMP0037-OLD-space.cmake
diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-result.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-result.txt
index 573541a..573541a 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-OLD-result.txt
+++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-result.txt
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-stderr.txt
new file mode 100644
index 0000000..c9366fa
--- /dev/null
+++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-stderr.txt
@@ -0,0 +1,21 @@
+CMake Warning \(dev\) at CMP0037-WARN-colon.cmake:2 \(add_library\):
+ Policy CMP0037 is not set: Target names should match a validity pattern.
+ Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
+ command to set the policy and suppress this warning.
+
+ The target name "lib:colon" is not valid for certain CMake features, such
+ as generator expressions, and may result in undefined behavior.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
++
+CMake Warning \(dev\) at CMP0037-WARN-colon.cmake:3 \(add_executable\):
+ Policy CMP0037 is not set: Target names should match a validity pattern.
+ Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
+ command to set the policy and suppress this warning.
+
+ The target name "exe:colon" is not valid for certain CMake features, such
+ as generator expressions, and may result in undefined behavior.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon.cmake b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon.cmake
new file mode 100644
index 0000000..17c815e
--- /dev/null
+++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon.cmake
@@ -0,0 +1,3 @@
+
+add_library("lib:colon" empty.cpp)
+add_executable("exe:colon" empty.cpp)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-space-result.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-space-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-space-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-space-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-space-stderr.txt
new file mode 100644
index 0000000..b29aad5
--- /dev/null
+++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-space-stderr.txt
@@ -0,0 +1,21 @@
+CMake Warning \(dev\) at CMP0037-WARN-space.cmake:2 \(add_library\):
+ Policy CMP0037 is not set: Target names should match a validity pattern.
+ Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
+ command to set the policy and suppress this warning.
+
+ The target name "lib with spaces" is not valid for certain CMake features,
+ such as generator expressions, and may result in undefined behavior.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
++
+CMake Warning \(dev\) at CMP0037-WARN-space.cmake:3 \(add_executable\):
+ Policy CMP0037 is not set: Target names should match a validity pattern.
+ Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
+ command to set the policy and suppress this warning.
+
+ The target name "exe with spaces" is not valid for certain CMake features,
+ such as generator expressions, and may result in undefined behavior.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN.cmake b/Tests/RunCMake/CMP0037/CMP0037-WARN-space.cmake
index 2beaad0..4a10828 100644
--- a/Tests/RunCMake/CMP0037/CMP0037-WARN.cmake
+++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-space.cmake
@@ -1,5 +1,3 @@
add_library("lib with spaces" empty.cpp)
add_executable("exe with spaces" empty.cpp)
-add_library("lib:colon" empty.cpp)
-add_executable("exe:colon" empty.cpp)
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-stderr.txt
deleted file mode 100644
index e7a9e1d..0000000
--- a/Tests/RunCMake/CMP0037/CMP0037-WARN-stderr.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-CMake Warning \(dev\) at CMP0037-WARN.cmake:2 \(add_library\):
- Policy CMP0037 is not set: Target names should match a validity pattern.
- Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The target name "lib with spaces" is not valid for certain CMake features,
- such as generator expressions, and may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) at CMP0037-WARN.cmake:3 \(add_executable\):
- Policy CMP0037 is not set: Target names should match a validity pattern.
- Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The target name "exe with spaces" is not valid for certain CMake features,
- such as generator expressions, and may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) at CMP0037-WARN.cmake:4 \(add_library\):
- Policy CMP0037 is not set: Target names should match a validity pattern.
- Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The target name "lib:colon" is not valid for certain CMake features, such
- as generator expressions, and may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) at CMP0037-WARN.cmake:5 \(add_executable\):
- Policy CMP0037 is not set: Target names should match a validity pattern.
- Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy
- command to set the policy and suppress this warning.
-
- The target name "exe:colon" is not valid for certain CMake features, such
- as generator expressions, and may result in undefined behavior.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0037/RunCMakeTest.cmake b/Tests/RunCMake/CMP0037/RunCMakeTest.cmake
index e983526..fbb1788 100644
--- a/Tests/RunCMake/CMP0037/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0037/RunCMakeTest.cmake
@@ -1,5 +1,10 @@
include(RunCMake)
-run_cmake(CMP0037-NEW)
-run_cmake(CMP0037-OLD)
-run_cmake(CMP0037-WARN)
+run_cmake(CMP0037-OLD-space)
+run_cmake(CMP0037-NEW-space)
+run_cmake(CMP0037-WARN-space)
+run_cmake(CMP0037-NEW-colon)
+
+if(NOT (WIN32 AND "${RunCMake_GENERATOR}" MATCHES "Make"))
+ run_cmake(CMP0037-WARN-colon)
+endif()
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 6e72e70..bf3dcc1 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -56,9 +56,7 @@ add_RunCMake_test(CMP0022)
add_RunCMake_test(CMP0026)
add_RunCMake_test(CMP0027)
add_RunCMake_test(CMP0028)
-if (NOT "${CMAKE_TEST_GENERATOR}" MATCHES "(MSYS|MinGW|NMake|Borland) Makefiles")
- add_RunCMake_test(CMP0037)
-endif()
+add_RunCMake_test(CMP0037)
add_RunCMake_test(CMP0038)
add_RunCMake_test(CMP0039)
add_RunCMake_test(CTest)
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)