summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CTestCustom.cmake.in1
-rw-r--r--Help/command/set.rst163
-rw-r--r--Help/manual/OPTIONS_BUILD.txt10
-rw-r--r--Help/manual/cmake-language.7.rst2
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/policy/CMP0059.rst17
-rw-r--r--Help/prop_dir/DEFINITIONS.rst11
-rw-r--r--Help/release/dev/makefile-DELETE_ON_ERROR.rst7
-rw-r--r--Help/release/dev/remove-DEFINITIONS-directory-property.rst6
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackGenerator.cxx23
-rw-r--r--Source/cmAddSubDirectoryCommand.cxx2
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx1
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.h1
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h3
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.h1
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx4
-rw-r--r--Source/cmMakefile.cxx32
-rw-r--r--Source/cmMakefile.h32
-rw-r--r--Source/cmMakefileTargetGenerator.cxx8
-rw-r--r--Source/cmPolicies.cxx5
-rw-r--r--Source/cmPolicies.h2
-rw-r--r--Source/cmSubdirCommand.cxx7
-rw-r--r--Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt12
-rw-r--r--Tests/CMakeTests/ELFTest.cmake.in2
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-NEW.cmake17
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt1
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-OLD.cmake17
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt1
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt18
-rw-r--r--Tests/RunCMake/CMP0059/CMP0059-WARN.cmake17
-rw-r--r--Tests/RunCMake/CMP0059/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0059/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stdout.txt22
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_writer.cpp14
-rw-r--r--Utilities/cmliblzma/config.h.in8
-rw-r--r--Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c3
42 files changed, 310 insertions, 183 deletions
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index 8c4d400..d716498 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -53,6 +53,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
"CMakeSetupManifest.xml.*manifest authoring warning.*Unrecognized Element"
"cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast
"ld: warning: directory not found for option .-(F|L)"
+ "ld: warning: in .*/libgcc.a, file is not of required architecture"
"warning.*This version of Mac OS X is unsupported"
"clang.*: warning: argument unused during compilation: .-g"
"note: in expansion of macro" # diagnostic context note
diff --git a/Help/command/set.rst b/Help/command/set.rst
index 7a59550..d04b880 100644
--- a/Help/command/set.rst
+++ b/Help/command/set.rst
@@ -1,116 +1,89 @@
set
---
-Set a CMake, cache or environment variable to a given value.
+Set a normal, cache, or environment variable to a given value.
+See the :ref:`cmake-language(7) variables <CMake Language Variables>`
+documentation for the scopes and interaction of normal variables
+and cache entries.
+
+Signatures of this command that specify a ``<value>...`` placeholder
+expect zero or more arguments. Multiple arguments will be joined as
+a :ref:`;-list <CMake Language Lists>` to form the actual variable
+value to be set. Zero arguments will cause normal variables to be
+unset. See the :command:`unset` command to unset variables explicitly.
+
+Set Normal Variable
+^^^^^^^^^^^^^^^^^^^
::
- set(<variable> <value>
- [[CACHE <type> <docstring> [FORCE]] | PARENT_SCOPE])
+ set(<variable> <value>... [PARENT_SCOPE])
+
+Set the given ``<variable>`` in the current function or directory scope.
-Within CMake sets <variable> to the value <value>. <value> is
-expanded before <variable> is set to it. Normally, set will set a
-regular CMake variable. If CACHE is present, then the <variable> is
-put in the cache instead, unless it is already in the cache. See
-section 'Variable types in CMake' below for details of regular and
-cache variables and their interactions. If CACHE is used, <type> and
-<docstring> are required. <type> is used by the CMake GUI to choose a
-widget with which the user sets a value. The value for <type> may be
-one of
+If the ``PARENT_SCOPE`` option is given the variable will be set in
+the scope above the current scope. Each new directory or function
+creates a new scope. This command will set the value of a variable
+into the parent directory or calling function (whichever is applicable
+to the case at hand).
+
+Set Cache Entry
+^^^^^^^^^^^^^^^
::
- FILEPATH = File chooser dialog.
- PATH = Directory chooser dialog.
- STRING = Arbitrary string.
- BOOL = Boolean ON/OFF checkbox.
- INTERNAL = No GUI entry (used for persistent variables).
+ set(<variable> <value>... CACHE <type> <docstring> [FORCE])
-If <type> is INTERNAL, the cache variable is marked as internal, and
-will not be shown to the user in tools like cmake-gui. This is
-intended for values that should be persisted in the cache, but which
-users should not normally change. INTERNAL implies FORCE.
+Set the given cache ``<variable>`` (cache entry). Since cache entries
+are meant to provide user-settable values this does not overwrite
+existing cache entries by default. Use the ``FORCE`` option to
+overwrite existing entries.
-Normally, set(...CACHE...) creates cache variables, but does not
-modify them. If FORCE is specified, the value of the cache variable
-is set, even if the variable is already in the cache. This should
-normally be avoided, as it will remove any changes to the cache
-variable's value by the user.
+The ``<type>`` must be specified as one of:
-If PARENT_SCOPE is present, the variable will be set in the scope
-above the current scope. Each new directory or function creates a new
-scope. This command will set the value of a variable into the parent
-directory or calling function (whichever is applicable to the case at
-hand). PARENT_SCOPE cannot be combined with CACHE.
+``BOOL``
+ Boolean ``ON/OFF`` value. :manual:`cmake-gui(1)` offers a checkbox.
-If <value> is not specified then the variable is removed instead of
-set. See also: the unset() command.
+``FILEPATH``
+ Path to a file on disk. :manual:`cmake-gui(1)` offers a file dialog.
-::
+``PATH``
+ Path to a directory on disk. :manual:`cmake-gui(1)` offers a file dialog.
- set(<variable> <value1> ... <valueN>)
+``STRING``
+ A line of text. :manual:`cmake-gui(1)` offers a text field or a
+ drop-down selection if the :prop_cache:`STRINGS` cache entry
+ property is set.
-In this case <variable> is set to a semicolon separated list of
-values.
+``INTERNAL``
+ A line of text. :manual:`cmake-gui(1)` does not show internal entries.
+ They may be used to store variables persistently across runs.
+ Use of this type implies ``FORCE``.
-<variable> can be an environment variable such as:
+The ``<docstring>`` must be specified as a line of text providing
+a quick summary of the option for presentation to :manual:`cmake-gui(1)`
+users.
+
+If the cache entry does not exist prior to the call or the ``FORCE``
+option is given then the cache entry will be set to the given value.
+Furthermore, any normal variable binding in the current scope will
+be removed to expose the newly cached value to any immediately
+following evaluation.
+
+It is possible for the cache entry to exist prior to the call but
+have no type set if it was created on the :manual:`cmake(1)` command
+line by a user through the ``-D<var>=<value>`` option without
+specifying a type. In this case the ``set`` command will add the
+type. Furthermore, if the ``<type>`` is ``PATH`` or ``FILEPATH``
+and the ``<value>`` provided on the command line is a relative path,
+then the ``set`` command will treat the path as relative to the
+current working directory and convert it to an absolute path.
+
+Set Environment Variable
+^^^^^^^^^^^^^^^^^^^^^^^^
::
- set( ENV{PATH} /home/martink )
-
-in which case the environment variable will be set.
-
-*** Variable types in CMake ***
-
-In CMake there are two types of variables: normal variables and cache
-variables. Normal variables are meant for the internal use of the
-script (just like variables in most programming languages); they are
-not persisted across CMake runs. Cache variables (unless set with
-INTERNAL) are mostly intended for configuration settings where the
-first CMake run determines a suitable default value, which the user
-can then override, by editing the cache with tools such as ccmake or
-cmake-gui. Cache variables are stored in the CMake cache file, and
-are persisted across CMake runs.
-
-Both types can exist at the same time with the same name but different
-values. When ${FOO} is evaluated, CMake first looks for a normal
-variable 'FOO' in scope and uses it if set. If and only if no normal
-variable exists then it falls back to the cache variable 'FOO'.
-
-Some examples:
-
-The code 'set(FOO "x")' sets the normal variable 'FOO'. It does not
-touch the cache, but it will hide any existing cache value 'FOO'.
-
-The code 'set(FOO "x" CACHE ...)' checks for 'FOO' in the cache,
-ignoring any normal variable of the same name. If 'FOO' is in the
-cache then nothing happens to either the normal variable or the cache
-variable. If 'FOO' is not in the cache, then it is added to the
-cache.
-
-Finally, whenever a cache variable is added or modified by a command,
-CMake also *removes* the normal variable of the same name from the
-current scope so that an immediately following evaluation of it will
-expose the newly cached value.
-
-Normally projects should avoid using normal and cache variables of the
-same name, as this interaction can be hard to follow. However, in
-some situations it can be useful. One example (used by some
-projects):
-
-A project has a subproject in its source tree. The child project has
-its own CMakeLists.txt, which is included from the parent
-CMakeLists.txt using add_subdirectory(). Now, if the parent and the
-child project provide the same option (for example a compiler option),
-the parent gets the first chance to add a user-editable option to the
-cache. Normally, the child would then use the same value that the
-parent uses. However, it may be necessary to hard-code the value for
-the child project's option while still allowing the user to edit the
-value used by the parent project. The parent project can achieve this
-simply by setting a normal variable with the same name as the option
-in a scope sufficient to hide the option's cache variable from the
-child completely. The parent has already set the cache variable, so
-the child's set(...CACHE...) will do nothing, and evaluating the
-option variable will use the value from the normal variable, which
-hides the cache variable.
+ set(ENV{<variable>} <value>...)
+
+Set the current process environment ``<variable>`` to the given value.
diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/OPTIONS_BUILD.txt
index 363d0aa..986b541 100644
--- a/Help/manual/OPTIONS_BUILD.txt
+++ b/Help/manual/OPTIONS_BUILD.txt
@@ -10,7 +10,7 @@
containing SET commands that use the CACHE option, not a
cache-format file.
-``-D <var>:<type>=<value>``
+``-D <var>:<type>=<value>, -D <var>=<value>``
Create a cmake cache entry.
When cmake is first run in an empty build tree, it creates a
@@ -19,6 +19,14 @@
takes priority over the project's default value. The option may be
repeated for as many cache entries as desired.
+ If the ``:<type>`` portion is given it must be one of the types
+ specified by the :command:`set` command documentation for its
+ ``CACHE`` signature.
+ If the ``:<type>`` portion is omitted the entry will be created
+ with no type if it does not exist with a type already. If a
+ command in the project sets the type to ``PATH`` or ``FILEPATH``
+ then the ``<value>`` will be converted to an absolute path.
+
``-U <globbing_expr>``
Remove matching entries from CMake cache.
diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst
index 4a9f0b5..41542c9 100644
--- a/Help/manual/cmake-language.7.rst
+++ b/Help/manual/cmake-language.7.rst
@@ -485,6 +485,8 @@ The :command:`macro`/:command:`endmacro`, and
:command:`function`/:command:`endfunction` commands delimit
code blocks to be recorded for later invocation as commands.
+.. _`CMake Language Variables`:
+
Variables
=========
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 228df14..d2960de 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -116,3 +116,4 @@ All Policies
/policy/CMP0056
/policy/CMP0057
/policy/CMP0058
+ /policy/CMP0059
diff --git a/Help/policy/CMP0059.rst b/Help/policy/CMP0059.rst
new file mode 100644
index 0000000..e40f450
--- /dev/null
+++ b/Help/policy/CMP0059.rst
@@ -0,0 +1,17 @@
+CMP0059
+-------
+
+Don't treat ``DEFINITIONS`` as a built-in directory property.
+
+CMake 3.3 and above no longer make a list of definitions available through
+the :prop_dir:`DEFINITIONS` directory property. The
+:prop_dir:`COMPILE_DEFINITIONS` directory property may be used instead.
+
+The ``OLD`` behavior for this policy is to provide the list of flags given
+so far to the :command:`add_definitions` command. The ``NEW`` behavior is
+to behave as a normal user-defined directory property.
+
+This policy was introduced in CMake version 3.3.
+CMake version |release| warns when the policy is not set and uses
+``OLD`` behavior. Use the :command:`cmake_policy` command to set
+it to ``OLD`` or ``NEW`` explicitly.
diff --git a/Help/prop_dir/DEFINITIONS.rst b/Help/prop_dir/DEFINITIONS.rst
index 22f7c15..79ac3f3 100644
--- a/Help/prop_dir/DEFINITIONS.rst
+++ b/Help/prop_dir/DEFINITIONS.rst
@@ -1,8 +1,13 @@
DEFINITIONS
-----------
-For CMake 2.4 compatibility only. Use COMPILE_DEFINITIONS instead.
+For CMake 2.4 compatibility only. Use :prop_dir:`COMPILE_DEFINITIONS`
+instead.
This read-only property specifies the list of flags given so far to
-the add_definitions command. It is intended for debugging purposes.
-Use the COMPILE_DEFINITIONS instead.
+the :command:`add_definitions` command. It is intended for debugging
+purposes. Use the :prop_dir:`COMPILE_DEFINITIONS` directory property
+instead.
+
+This built-in read-only property does not exist if policy
+:policy:`CMP0059` is set to ``NEW``.
diff --git a/Help/release/dev/makefile-DELETE_ON_ERROR.rst b/Help/release/dev/makefile-DELETE_ON_ERROR.rst
new file mode 100644
index 0000000..c7c45fd
--- /dev/null
+++ b/Help/release/dev/makefile-DELETE_ON_ERROR.rst
@@ -0,0 +1,7 @@
+makefile-DELETE_ON_ERROR
+------------------------
+
+* The Makefile generators now add ``.DELETE_ON_ERROR`` to the
+ makefiles that contain the actual build rules for files on disk.
+ This tells GNU make to remove rule outputs when their recipe
+ modifies an output but fails.
diff --git a/Help/release/dev/remove-DEFINITIONS-directory-property.rst b/Help/release/dev/remove-DEFINITIONS-directory-property.rst
new file mode 100644
index 0000000..d8e50f0
--- /dev/null
+++ b/Help/release/dev/remove-DEFINITIONS-directory-property.rst
@@ -0,0 +1,6 @@
+remove-DEFINITIONS-property
+---------------------------
+
+* The :command:`add_definitions()` command no longer causes a
+ :prop_dir:`DEFINITIONS` directory property to be populated. See policy
+ :policy:`CMP0059`.
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index f4f3aa6..8a93101 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 2)
-set(CMake_VERSION_PATCH 20150331)
+set(CMake_VERSION_PATCH 20150403)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 87764e1..fcf4122 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -805,12 +805,14 @@ static int put_arobj(CF *cfp, struct stat *sb)
if (lname > sizeof(hdr->ar_name) || strchr(name, ' '))
(void)sprintf(ar_hb, HDR1, AR_EFMT1, (int)lname,
(long int)sb->st_mtime, (unsigned)uid, (unsigned)gid,
- sb->st_mode, (long long)sb->st_size + lname, ARFMAG);
+ (unsigned)sb->st_mode, (long long)sb->st_size + lname,
+ ARFMAG);
else {
lname = 0;
(void)sprintf(ar_hb, HDR2, name,
(long int)sb->st_mtime, (unsigned)uid, (unsigned)gid,
- sb->st_mode, (long long)sb->st_size, ARFMAG);
+ (unsigned)sb->st_mode, (long long)sb->st_size,
+ ARFMAG);
}
off_t size = sb->st_size;
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index ee255af..67005ef 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -655,26 +655,19 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cmSystemTools::SetForceUnixPaths(globalGenerator->GetForceUnixPaths());
// Does this generator require pre-install?
- if ( globalGenerator->GetPreinstallTargetName() )
+ if (const char* preinstall = globalGenerator->GetPreinstallTargetName())
{
- globalGenerator->FindMakeProgram(this->MakefileMap);
- std::string cmakeMakeProgram
- = this->MakefileMap->GetSafeDefinition("CMAKE_MAKE_PROGRAM");
- std::vector<std::string> buildCommand;
- globalGenerator->GenerateBuildCommand(buildCommand, cmakeMakeProgram,
- installProjectName, installDirectory,
- globalGenerator->GetPreinstallTargetName(),
- buildConfig, false, false);
- std::string buildCommandStr =
- cmSystemTools::PrintSingleCommand(buildCommand);
+ std::string buildCommand =
+ globalGenerator->GenerateCMakeBuildCommand(
+ preinstall, buildConfig, "", false);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
- "- Install command: " << buildCommandStr << std::endl);
+ "- Install command: " << buildCommand << std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Run preinstall target for: " << installProjectName << std::endl);
std::string output;
int retVal = 1;
bool resB =
- cmSystemTools::RunSingleCommand(buildCommand,
+ cmSystemTools::RunSingleCommand(buildCommand.c_str(),
&output,
&retVal,
installDirectory.c_str(),
@@ -684,12 +677,12 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/PreinstallOutput.log";
cmGeneratedFileStream ofs(tmpFile.c_str());
- ofs << "# Run command: " << buildCommandStr << std::endl
+ ofs << "# Run command: " << buildCommand << std::endl
<< "# Directory: " << installDirectory << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem running install command: " << buildCommandStr
+ "Problem running install command: " << buildCommand
<< std::endl
<< "Please check " << tmpFile << " for errors"
<< std::endl);
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx
index 01598bc..9d55c1a 100644
--- a/Source/cmAddSubDirectoryCommand.cxx
+++ b/Source/cmAddSubDirectoryCommand.cxx
@@ -122,7 +122,7 @@ bool cmAddSubDirectoryCommand::InitialPass
// Add the subdirectory using the computed full paths.
this->Makefile->AddSubDirectory(srcPath, binPath,
- excludeFromAll, false, true);
+ excludeFromAll, true);
return true;
}
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index a30d992..b8238f8 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -26,7 +26,6 @@ bool cmAuxSourceDirectoryCommand::InitialPass
std::string sourceListValue;
std::string templateDirectory = args[0];
- this->Makefile->AddExtraDirectory(templateDirectory.c_str());
std::string tdir;
if(!cmSystemTools::FileIsFullPath(templateDirectory.c_str()))
{
diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h
index 120d2f8..005f0d6 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.h
+++ b/Source/cmGlobalBorlandMakefileGenerator.h
@@ -46,6 +46,7 @@ public:
cmMakefile *, bool optional);
virtual bool AllowNotParallel() const { return false; }
+ virtual bool AllowDeleteOnError() const { return false; }
};
#endif
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 50a901e..a76a835 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -128,6 +128,9 @@ public:
/** Does the make tool tolerate .NOTPARALLEL? */
virtual bool AllowNotParallel() const { return true; }
+ /** Does the make tool tolerate .DELETE_ON_ERROR? */
+ virtual bool AllowDeleteOnError() const { return true; }
+
virtual void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const;
protected:
void WriteMainMakefile2();
diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h
index 0e577b5..7bc209b 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.h
+++ b/Source/cmGlobalWatcomWMakeGenerator.h
@@ -45,6 +45,7 @@ public:
cmMakefile *, bool optional);
virtual bool AllowNotParallel() const { return false; }
+ virtual bool AllowDeleteOnError() const { return false; }
};
#endif
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f139ad1..5e584a4 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -865,6 +865,10 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext,
{
sourcecode += ".asm";
}
+ else if (ext == "metal")
+ {
+ sourcecode += ".metal";
+ }
//else
// {
// // Already specialized above or we leave sourcecode == "sourcecode"
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 7f355a6..ec1d814 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -101,7 +101,6 @@ cmMakefile::cmMakefile(): Internal(new Internals)
this->AddDefaultDefinitions();
this->Initialize();
- this->PreOrder = false;
this->GeneratingBuildSystem = false;
this->SuppressWatches = false;
@@ -113,8 +112,6 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
this->Internal->VarInitStack.push(mf.Internal->VarInitStack.top());
this->Internal->VarUsageStack.push(mf.Internal->VarUsageStack.top());
- this->Prefix = mf.Prefix;
- this->AuxSourceDirectories = mf.AuxSourceDirectories;
this->cmStartDirectory = mf.cmStartDirectory;
this->StartOutputDirectory = mf.StartOutputDirectory;
this->cmHomeDirectory = mf.cmHomeDirectory;
@@ -145,9 +142,7 @@ cmMakefile::cmMakefile(const cmMakefile& mf): Internal(new Internals)
this->LocalGenerator = mf.LocalGenerator;
this->FunctionBlockers = mf.FunctionBlockers;
this->MacrosList = mf.MacrosList;
- this->SubDirectoryOrder = mf.SubDirectoryOrder;
this->Properties = mf.Properties;
- this->PreOrder = mf.PreOrder;
this->WarnUnused = mf.WarnUnused;
this->Initialize();
this->CheckSystemVars = mf.CheckSystemVars;
@@ -1697,7 +1692,7 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2)
}
void cmMakefile::AddSubDirectory(const std::string& sub,
- bool excludeFromAll, bool preorder)
+ bool excludeFromAll)
{
// the source path must be made full if it isn't already
std::string srcPath = sub;
@@ -1719,13 +1714,13 @@ void cmMakefile::AddSubDirectory(const std::string& sub,
this->AddSubDirectory(srcPath, binPath,
- excludeFromAll, preorder, false);
+ excludeFromAll, false);
}
void cmMakefile::AddSubDirectory(const std::string& srcPath,
const std::string& binPath,
- bool excludeFromAll, bool preorder,
+ bool excludeFromAll,
bool immediate)
{
// Make sure the binary directory is unique.
@@ -1747,7 +1742,6 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
{
lg2->GetMakefile()->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
}
- lg2->GetMakefile()->SetPreOrder(preorder);
if (immediate)
{
@@ -2256,11 +2250,6 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
#endif
-void cmMakefile::AddExtraDirectory(const char* dir)
-{
- this->AuxSourceDirectories.push_back(dir);
-}
-
static bool mightExpandVariablesCMP0019(const char* s)
{
return s && *s && strstr(s,"${") && strchr(s,'}');
@@ -4220,8 +4209,19 @@ const char *cmMakefile::GetProperty(const std::string& prop,
}
else if (prop == "DEFINITIONS")
{
- output += this->DefineFlagsOrig;
- return output.c_str();
+ switch(this->GetPolicyStatus(cmPolicies::CMP0059))
+ {
+ case cmPolicies::WARN:
+ this->IssueMessage(cmake::AUTHOR_WARNING, this->GetPolicies()->
+ GetPolicyWarning(cmPolicies::CMP0059));
+ case cmPolicies::OLD:
+ output += this->DefineFlagsOrig;
+ return output.c_str();
+ case cmPolicies::NEW:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::REQUIRED_IF_USED:
+ break;
+ }
}
else if (prop == "LINK_DIRECTORIES")
{
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index e98f1d9..ebfe508 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -292,11 +292,10 @@ public:
/**
* Add a subdirectory to the build.
*/
- void AddSubDirectory(const std::string&, bool excludeFromAll=false,
- bool preorder = false);
+ void AddSubDirectory(const std::string&, bool excludeFromAll=false);
void AddSubDirectory(const std::string& fullSrcDir,
const std::string& fullBinDir,
- bool excludeFromAll, bool preorder,
+ bool excludeFromAll,
bool immediate);
/**
@@ -433,15 +432,6 @@ public:
bool HasCMP0054AlreadyBeenReported(
cmListFileContext context) const;
- /**
- * Add an auxiliary directory to the build.
- */
- void AddExtraDirectory(const char* dir);
-
-
- /**
- * Add an auxiliary directory to the build.
- */
void MakeStartDirectoriesCurrent()
{
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
@@ -620,12 +610,6 @@ public:
cmSourceFile* GetOrCreateSource(const std::string& sourceName,
bool generated = false);
- /**
- * Obtain a list of auxiliary source directories.
- */
- const std::vector<std::string>& GetAuxSourceDirectories() const
- {return this->AuxSourceDirectories;}
-
//@{
/**
* Return a list of extensions associated with source and header
@@ -879,10 +863,6 @@ public:
///! Initialize a makefile from its parent
void InitializeFromParent();
- ///! Set/Get the preorder flag
- void SetPreOrder(bool p) { this->PreOrder = p; }
- bool GetPreOrder() const { return this->PreOrder; }
-
void AddInstallGenerator(cmInstallGenerator* g)
{ if(g) this->InstallGenerators.push_back(g); }
std::vector<cmInstallGenerator*>& GetInstallGenerators()
@@ -976,9 +956,6 @@ protected:
// Check for a an unused variable
void CheckForUnused(const char* reason, const std::string& name) const;
- std::string Prefix;
- std::vector<std::string> AuxSourceDirectories; //
-
std::string cmStartDirectory;
std::string StartOutputDirectory;
std::string cmHomeDirectory;
@@ -1067,8 +1044,6 @@ private:
std::vector<std::string> MacrosList;
- std::map<std::string, bool> SubDirectoryOrder;
-
mutable cmsys::RegularExpression cmDefineRegex;
mutable cmsys::RegularExpression cmDefine01Regex;
mutable cmsys::RegularExpression cmAtVarRegex;
@@ -1076,9 +1051,6 @@ private:
cmPropertyMap Properties;
- // should this makefile be processed before or after processing the parent
- bool PreOrder;
-
// Unused variable flags
bool WarnUnused;
bool CheckSystemVars;
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 641cd23..2cd2d3e 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -122,6 +122,14 @@ void cmMakefileTargetGenerator::CreateRuleFile()
return;
}
this->LocalGenerator->WriteDisclaimer(*this->BuildFileStream);
+ if (this->GlobalGenerator->AllowDeleteOnError())
+ {
+ std::vector<std::string> no_depends;
+ std::vector<std::string> no_commands;
+ this->LocalGenerator->WriteMakeRule(
+ *this->BuildFileStream, "Delete rule output on recipe failure.",
+ ".DELETE_ON_ERROR", no_depends, no_commands, false);
+ }
this->LocalGenerator->WriteSpecialTargetsTop(*this->BuildFileStream);
}
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 592df8f..0a61bca 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -385,6 +385,11 @@ cmPolicies::cmPolicies()
CMP0058, "CMP0058",
"Ninja requires custom command byproducts to be explicit.",
3,3,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0059, "CMP0059",
+ "Do no treat DEFINITIONS as a built-in directory property.",
+ 3,3,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index b18b337..ced9d8c 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -116,6 +116,8 @@ public:
CMP0057, ///< Disallow multiple MAIN_DEPENDENCY specifications
/// for the same file.
CMP0058, ///< Ninja requires custom command byproducts to be explicit
+ CMP0059, ///< Do not treat ``DEFINITIONS`` as a built-in directory
+ /// property.
/** \brief Always the last entry.
*
diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx
index 93ad4f3..7cb2edc 100644
--- a/Source/cmSubdirCommand.cxx
+++ b/Source/cmSubdirCommand.cxx
@@ -22,7 +22,6 @@ bool cmSubdirCommand
}
bool res = true;
bool excludeFromAll = false;
- bool preorder = false;
for(std::vector<std::string>::const_iterator i = args.begin();
i != args.end(); ++i)
@@ -34,7 +33,7 @@ bool cmSubdirCommand
}
if(*i == "PREORDER")
{
- preorder = true;
+ // Ignored
continue;
}
@@ -48,7 +47,7 @@ bool cmSubdirCommand
std::string(this->Makefile->GetCurrentOutputDirectory()) +
"/" + i->c_str();
this->Makefile->AddSubDirectory(srcPath, binPath,
- excludeFromAll, preorder, false);
+ excludeFromAll, false);
}
// otherwise it is a full path
else if ( cmSystemTools::FileIsDirectory(*i) )
@@ -59,7 +58,7 @@ bool cmSubdirCommand
std::string(this->Makefile->GetCurrentOutputDirectory()) +
"/" + cmSystemTools::GetFilenameName(*i);
this->Makefile->AddSubDirectory(*i, binPath,
- excludeFromAll, preorder, false);
+ excludeFromAll, false);
}
else
{
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
index 818b8c9..741c73e 100644
--- a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
@@ -22,8 +22,18 @@ generate_export_header(staticlib1)
add_library(staticlib2 STATIC staticlib2.cpp)
generate_export_header(staticlib2)
target_link_libraries(staticlib1 LINK_PUBLIC staticlib2)
+
+# Try adding a private link item to be propagated out of a static lib.
+set(private_link "")
if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
- target_link_libraries(staticlib1 LINK_PRIVATE "-Wl,-v")
+ if (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
+ set(private_link "-Wl,-V")
+ else()
+ set(private_link "-Wl,-v")
+ endif()
+endif()
+if(private_link)
+ target_link_libraries(staticlib1 LINK_PRIVATE "${private_link}")
endif()
add_executable(staticlib_exe staticlib_exe.cpp)
diff --git a/Tests/CMakeTests/ELFTest.cmake.in b/Tests/CMakeTests/ELFTest.cmake.in
index 0271abb..4635778 100644
--- a/Tests/CMakeTests/ELFTest.cmake.in
+++ b/Tests/CMakeTests/ELFTest.cmake.in
@@ -11,7 +11,7 @@ set(out "@CMAKE_CURRENT_BINARY_DIR@/ELF-Out")
file(REMOVE_RECURSE "${out}")
file(MAKE_DIRECTORY "${out}")
foreach(f ${names})
- file(COPY ${in}/${f} DESTINATION ${out})
+ file(COPY ${in}/${f} DESTINATION ${out} NO_SOURCE_PERMISSIONS)
list(APPEND files "${out}/${f}")
endforeach()
diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt b/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-NEW-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt
new file mode 100644
index 0000000..76992d8
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-NEW-stderr.txt
@@ -0,0 +1,2 @@
+DEFS:
+CUSTOM CONTENT:CUSTOM_CONTENT
diff --git a/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake b/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake
new file mode 100644
index 0000000..f7b9303
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-NEW.cmake
@@ -0,0 +1,17 @@
+
+cmake_policy(SET CMP0059 NEW)
+
+add_definitions(-DSOME_DEF)
+
+get_property(defs DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("DEFS:${defs}")
+
+set_property(DIRECTORY .
+ PROPERTY DEFINITIONS CUSTOM_CONTENT
+)
+get_property(content DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("CUSTOM CONTENT:${content}")
diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt b/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-OLD-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt
new file mode 100644
index 0000000..e35e8c5
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-OLD-stderr.txt
@@ -0,0 +1,2 @@
+DEFS: -DSOME_DEF
+CUSTOM CONTENT: -DSOME_DEF
diff --git a/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake b/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake
new file mode 100644
index 0000000..2555774
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-OLD.cmake
@@ -0,0 +1,17 @@
+
+cmake_policy(SET CMP0059 OLD)
+
+add_definitions(-DSOME_DEF)
+
+get_property(defs DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("DEFS:${defs}")
+
+set_property(DIRECTORY .
+ PROPERTY DEFINITIONS CUSTOM_CONTENT
+)
+get_property(content DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("CUSTOM CONTENT:${content}")
diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt b/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt
new file mode 100644
index 0000000..4e04d15
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt
@@ -0,0 +1,18 @@
+CMake Warning \(dev\) at CMP0059-WARN.cmake:6 \(get_property\):
+ Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
+ property. Run "cmake --help-policy CMP0059" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+DEFS: -DSOME_DEF
+CMake Warning \(dev\) at CMP0059-WARN.cmake:14 \(get_property\):
+ Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
+ property. Run "cmake --help-policy CMP0059" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CUSTOM CONTENT: -DSOME_DEF
diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake b/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake
new file mode 100644
index 0000000..9d0b49c
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMP0059-WARN.cmake
@@ -0,0 +1,17 @@
+
+
+
+add_definitions(-DSOME_DEF)
+
+get_property(defs DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("DEFS:${defs}")
+
+set_property(DIRECTORY .
+ PROPERTY DEFINITIONS CUSTOM_CONTENT
+)
+get_property(content DIRECTORY .
+ PROPERTY DEFINITIONS
+)
+message("CUSTOM CONTENT:${content}")
diff --git a/Tests/RunCMake/CMP0059/CMakeLists.txt b/Tests/RunCMake/CMP0059/CMakeLists.txt
new file mode 100644
index 0000000..ef2163c
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.1)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0059/RunCMakeTest.cmake b/Tests/RunCMake/CMP0059/RunCMakeTest.cmake
new file mode 100644
index 0000000..9b57579
--- /dev/null
+++ b/Tests/RunCMake/CMP0059/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0059-OLD)
+run_cmake(CMP0059-NEW)
+run_cmake(CMP0059-WARN)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 7b9c810..6daf27a 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -64,6 +64,7 @@ add_RunCMake_test(CMP0053)
add_RunCMake_test(CMP0054)
add_RunCMake_test(CMP0055)
add_RunCMake_test(CMP0057)
+add_RunCMake_test(CMP0059)
if(CMAKE_GENERATOR STREQUAL "Ninja")
add_RunCMake_test(Ninja)
endif()
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stdout.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stdout.txt
index 0bc4f70..6e133cd 100644
--- a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stdout.txt
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stdout.txt
@@ -1,26 +1,26 @@
^Test project .*/Tests/RunCMake/CTestCommandLine/repeat-until-fail-build
Start 1: initialization
- Test #1: initialization ................... Passed [0-9.]+ sec
+ Test #1: initialization ................... Passed +[0-9.]+ sec
Start 1: initialization
- Test #1: initialization ................... Passed [0-9.]+ sec
+ Test #1: initialization ................... Passed +[0-9.]+ sec
Start 1: initialization
-1/4 Test #1: initialization ................... Passed [0-9.]+ sec
+1/4 Test #1: initialization ................... Passed +[0-9.]+ sec
Start 2: test1
- Test #2: test1 ............................ Passed [0-9.]+ sec
+ Test #2: test1 ............................ Passed +[0-9.]+ sec
Start 2: test1
- Test #2: test1 ............................\*\*\*Failed [0-9.]+ sec
+ Test #2: test1 ............................\*\*\*Failed +[0-9.]+ sec
Start 3: hello
- Test #3: hello ............................ Passed [0-9.]+ sec
+ Test #3: hello ............................ Passed +[0-9.]+ sec
Start 3: hello
- Test #3: hello ............................ Passed [0-9.]+ sec
+ Test #3: hello ............................ Passed +[0-9.]+ sec
Start 3: hello
-3/4 Test #3: hello ............................ Passed [0-9.]+ sec
+3/4 Test #3: hello ............................ Passed +[0-9.]+ sec
Start 4: goodbye
- Test #4: goodbye .......................... Passed [0-9.]+ sec
+ Test #4: goodbye .......................... Passed +[0-9.]+ sec
Start 4: goodbye
- Test #4: goodbye .......................... Passed [0-9.]+ sec
+ Test #4: goodbye .......................... Passed +[0-9.]+ sec
Start 4: goodbye
-4/4 Test #4: goodbye .......................... Passed [0-9.]+ sec
+4/4 Test #4: goodbye .......................... Passed +[0-9.]+ sec
+
75% tests passed, 1 tests failed out of 4
+
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
index 7f8e6f1..15222d6 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
@@ -27,6 +27,20 @@
# define isfinite finite
#endif
+// AIX
+#if defined(_AIX)
+# if !defined(isfinite)
+# define isfinite finite
+# endif
+#endif
+
+// HP-UX
+#if defined(__hpux)
+# if !defined(isfinite)
+# define isfinite finite
+# endif
+#endif
+
// Ancient glibc
#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 2
# if !defined(isfinite)
diff --git a/Utilities/cmliblzma/config.h.in b/Utilities/cmliblzma/config.h.in
index 017c435..9c53150 100644
--- a/Utilities/cmliblzma/config.h.in
+++ b/Utilities/cmliblzma/config.h.in
@@ -280,4 +280,10 @@ typedef uint64_t uintmax_t;
/* Define to 1 if the system supports fast unaligned access to 16-bit and
32-bit integers. */
-#define TUKLIB_FAST_UNALIGNED_ACCESS 1
+#if defined(__i386) || defined(__i386__) || defined(_M_IX86) \
+ || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) \
+ || defined(__amd64) || defined(__amd64__) \
+ || defined(__powerpc) || defined(__powerpc__) \
+ || defined(__ppc) || defined(__ppc__) || defined(__POWERPC__)
+# define TUKLIB_FAST_UNALIGNED_ACCESS 1
+#endif
diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
index d3a6348..fc54d8d 100644
--- a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
+++ b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
@@ -8,6 +8,9 @@
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
+#if defined(__IBMC__)
+# pragma options optimize=0
+#endif
#include "lzma_encoder_private.h"
#include "fastpos.h"