summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Auxiliary/cmake-indent.vim2
-rw-r--r--Auxiliary/cmake-mode.el9
-rw-r--r--Auxiliary/cmake-syntax.vim2
-rw-r--r--CMakeLists.txt23
-rw-r--r--Help/manual/LINKS.txt4
-rw-r--r--Help/manual/cmake-modules.7.rst1
-rw-r--r--Help/module/FindJsonCpp.rst1
-rw-r--r--Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst9
-rw-r--r--Help/release/dev/AppleClang-5.1-features.rst5
-rw-r--r--Help/release/dev/SolarisStudio-compile-features.rst5
-rw-r--r--Help/release/dev/WriteCompilerDetectionHeader-multi-file-lang.rst6
-rw-r--r--Help/release/dev/add-FindJsonCpp.rst5
-rw-r--r--Help/release/dev/cmake-E-tar-mtime.rst6
-rw-r--r--Help/release/dev/unsupported-compilers.rst22
-rw-r--r--Modules/CMakeFindPackageMode.cmake7
-rw-r--r--Modules/Compiler/SunPro-CXX-FeatureTests.cmake52
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake21
-rw-r--r--Modules/FindJsonCpp.cmake117
-rw-r--r--Modules/FindQt.cmake13
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake45
-rw-r--r--Source/CMakeLists.txt6
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackLog.cxx10
-rw-r--r--Source/CPack/cpack.cxx2
-rw-r--r--Source/CTest/cmCTestBatchTestHandler.cxx2
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx24
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx10
-rw-r--r--Source/CTest/cmCTestConfigureHandler.cxx4
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx38
-rw-r--r--Source/CTest/cmCTestLaunch.cxx2
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx14
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx10
-rw-r--r--Source/CTest/cmCTestP4.cxx4
-rw-r--r--Source/CTest/cmCTestRunTest.cxx8
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx2
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx52
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx42
-rw-r--r--Source/CTest/cmCTestUpdateHandler.cxx2
-rw-r--r--Source/CTest/cmParseCacheCoverage.cxx4
-rw-r--r--Source/CTest/cmParseDelphiCoverage.cxx6
-rw-r--r--Source/CTest/cmParseGTMCoverage.cxx2
-rw-r--r--Source/CTest/cmParseJacocoCoverage.cxx2
-rw-r--r--Source/CTest/cmProcess.cxx4
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx8
-rw-r--r--Source/cmAddSubDirectoryCommand.cxx2
-rw-r--r--Source/cmArchiveWrite.cxx19
-rw-r--r--Source/cmArchiveWrite.h2
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx2
-rw-r--r--Source/cmBuildNameCommand.cxx2
-rw-r--r--Source/cmCTest.cxx24
-rw-r--r--Source/cmCacheManager.cxx2
-rw-r--r--Source/cmCommand.h2
-rw-r--r--Source/cmComputeLinkDepends.cxx7
-rw-r--r--Source/cmCoreTryCompile.cxx10
-rw-r--r--Source/cmCreateTestSourceList.cxx8
-rw-r--r--Source/cmDependsC.cxx4
-rw-r--r--Source/cmDependsJavaParserHelper.cxx10
-rw-r--r--Source/cmDocumentation.cxx4
-rw-r--r--Source/cmDocumentationFormatter.cxx6
-rw-r--r--Source/cmExecProgramCommand.cxx12
-rw-r--r--Source/cmExecuteProcessCommand.cxx4
-rw-r--r--Source/cmExportSetMap.cxx7
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx3
-rw-r--r--Source/cmExtraKateGenerator.cxx2
-rw-r--r--Source/cmFileCommand.cxx30
-rw-r--r--Source/cmFindBase.cxx4
-rw-r--r--Source/cmFindPackageCommand.cxx4
-rw-r--r--Source/cmFindPathCommand.cxx6
-rw-r--r--Source/cmFunctionCommand.cxx4
-rw-r--r--Source/cmGeneratorExpression.cxx8
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx6
-rw-r--r--Source/cmGeneratorExpressionParser.cxx6
-rw-r--r--Source/cmGetCMakePropertyCommand.cxx2
-rw-r--r--Source/cmGetFilenameComponentCommand.cxx4
-rw-r--r--Source/cmGlobalGenerator.cxx52
-rw-r--r--Source/cmGlobalKdevelopGenerator.cxx2
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx4
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx62
-rw-r--r--Source/cmGlobalXCodeGenerator.h6
-rw-r--r--Source/cmGraphVizWriter.cxx2
-rw-r--r--Source/cmIfCommand.cxx6
-rw-r--r--Source/cmIncludeCommand.cxx6
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx2
-rw-r--r--Source/cmInstallFilesCommand.cxx2
-rw-r--r--Source/cmInstallTargetGenerator.cxx2
-rw-r--r--Source/cmListCommand.cxx20
-rw-r--r--Source/cmLoadCacheCommand.cxx9
-rw-r--r--Source/cmLocalGenerator.cxx18
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx13
-rw-r--r--Source/cmMacroCommand.cxx6
-rw-r--r--Source/cmMakeDepend.cxx6
-rw-r--r--Source/cmMakefile.cxx12
-rw-r--r--Source/cmRemoveCommand.cxx2
-rw-r--r--Source/cmSetCommand.cxx2
-rw-r--r--Source/cmSetTargetPropertiesCommand.cxx2
-rw-r--r--Source/cmSetTestsPropertiesCommand.cxx2
-rw-r--r--Source/cmSiteNameCommand.cxx4
-rw-r--r--Source/cmStandardIncludes.h21
-rw-r--r--Source/cmStringCommand.cxx4
-rw-r--r--Source/cmSystemTools.cxx5
-rw-r--r--Source/cmSystemTools.h6
-rw-r--r--Source/cmTarget.cxx16
-rw-r--r--Source/cmTryRunCommand.cxx18
-rw-r--r--Source/cmUseMangledMesaCommand.cxx2
-rw-r--r--Source/cmUtilitySourceCommand.cxx2
-rw-r--r--Source/cmUuid.cxx2
-rw-r--r--Source/cmWhileCommand.cxx4
-rw-r--r--Source/cm_get_date.c16
-rw-r--r--Source/cm_get_date.h28
-rw-r--r--Source/cmake.cxx36
-rw-r--r--Source/cmakemain.cxx14
-rw-r--r--Source/cmcmd.cxx28
-rw-r--r--Source/ctest.cxx2
-rw-r--r--Tests/CMakeLists.txt3
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt18
-rw-r--r--Tests/CompileFeatures/cxx_auto_type.cpp9
-rw-r--r--Tests/CompileFeatures/cxx_inheriting_constructors.cpp2
-rw-r--r--Tests/CompileFeatures/cxx_variadic_templates.cpp21
-rw-r--r--Tests/FindJsonCpp/CMakeLists.txt10
-rw-r--r--Tests/FindJsonCpp/Test/CMakeLists.txt14
-rw-r--r--Tests/FindJsonCpp/Test/main.cxx8
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/BadArg-result.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/BadArg-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestSubmit/BadFILES-result.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/BadFILES-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestSubmit/BadPARTS-result.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/BadPARTS-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestSubmit/CMakeLists.txt.in4
-rw-r--r--Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in6
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt3
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt3
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-http-result.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt3
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt3
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-https-result.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt3
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt3
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-scp-result.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-result.txt1
-rw-r--r--Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake49
-rw-r--r--Tests/RunCMake/CTestSubmit/test.cmake.in16
-rw-r--r--Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake6
-rw-r--r--Utilities/cmThirdParty.h.in1
-rw-r--r--Utilities/cm_jsoncpp_reader.h7
-rw-r--r--Utilities/cm_jsoncpp_value.h23
-rw-r--r--Utilities/cm_jsoncpp_writer.h23
-rw-r--r--Utilities/cmjsoncpp/include/json/reader.h2
-rw-r--r--Utilities/cmjsoncpp/include/json/writer.h1
167 files changed, 1113 insertions, 446 deletions
diff --git a/Auxiliary/cmake-indent.vim b/Auxiliary/cmake-indent.vim
index a26dd06..6cee9c8 100644
--- a/Auxiliary/cmake-indent.vim
+++ b/Auxiliary/cmake-indent.vim
@@ -16,7 +16,7 @@
" Version: $Revision$
"
" Licence: The CMake license applies to this file. See
-" http://www.cmake.org/HTML/Copyright.html
+" http://www.cmake.org/licensing
" This implies that distribution with Vim is allowed
if exists("b:did_indent")
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index f1470f3..7458a66 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -321,8 +321,13 @@ and store the result as a list in LISTVAR."
)
(require 'thingatpt)
+(defun cmake-symbol-at-point ()
+ (let ((symbol (symbol-at-point)))
+ (and (not (null symbol))
+ (symbol-name symbol))))
+
(defun cmake-help-type (type)
- (let* ((default-entry (word-at-point))
+ (let* ((default-entry (cmake-symbol-at-point))
(history (car (cdr (cdr (assoc type cmake-string-to-list-symbol)))))
(input (completing-read
(format "CMake %s: " type) ; prompt
@@ -365,7 +370,7 @@ and store the result as a list in LISTVAR."
(defun cmake-help ()
"Queries for any of the four available help topics and prints out the approriate page."
(interactive)
- (let* ((default-entry (word-at-point))
+ (let* ((default-entry (cmake-symbol-at-point))
(command-list (cmake-get-list "command"))
(variable-list (cmake-get-list "variable"))
(module-list (cmake-get-list "module"))
diff --git a/Auxiliary/cmake-syntax.vim b/Auxiliary/cmake-syntax.vim
index 782130d..3e4a122 100644
--- a/Auxiliary/cmake-syntax.vim
+++ b/Auxiliary/cmake-syntax.vim
@@ -16,7 +16,7 @@
" Version: $Revision$
"
" Licence: The CMake license applies to this file. See
-" http://www.cmake.org/HTML/Copyright.html
+" http://www.cmake.org/licensing
" This implies that distribution with Vim is allowed
" For version 5.x: Clear all syntax items
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3c424b..bdc160d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
# Allow the user to enable/disable all system utility library options by
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
- set(UTILITIES BZIP2 CURL EXPAT FORM LIBARCHIVE LIBLZMA ZLIB)
+ set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA ZLIB)
foreach(util ${UTILITIES})
if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
@@ -104,6 +104,7 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_LIBLZMA "Use system-installed liblzma"
"${CMAKE_USE_SYSTEM_LIBRARY_LIBLZMA}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
option(CMAKE_USE_SYSTEM_FORM "Use system-installed libform" "${CMAKE_USE_SYSTEM_LIBRARY_FORM}")
+ option(CMAKE_USE_SYSTEM_JSONCPP "Use system-installed jsoncpp" "${CMAKE_USE_SYSTEM_LIBRARY_JSONCPP}")
# Mention to the user what system libraries are being used.
foreach(util ${UTILITIES})
@@ -373,8 +374,24 @@ macro (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Build jsoncpp library.
- add_subdirectory(Utilities/cmjsoncpp)
- CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty")
+ if(CMAKE_USE_SYSTEM_JSONCPP)
+ if(EXISTS ${CMAKE_ROOT}/Modules/FindJsonCpp.cmake)
+ find_package(JsonCpp)
+ elseif(NOT CMAKE_VERSION VERSION_LESS 3.0)
+ include(${CMake_SOURCE_DIR}/Modules/FindJsonCpp.cmake)
+ else()
+ message(FATAL_ERROR "CMAKE_USE_SYSTEM_JSONCPP requires CMake >= 3.0")
+ endif()
+ if(NOT JsonCpp_FOUND)
+ message(FATAL_ERROR
+ "CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found!")
+ endif()
+ set(CMAKE_JSONCPP_LIBRARIES JsonCpp::JsonCpp)
+ else()
+ set(CMAKE_JSONCPP_LIBRARIES cmjsoncpp)
+ add_subdirectory(Utilities/cmjsoncpp)
+ CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty")
+ endif()
#---------------------------------------------------------------------
# Build XMLRPC library for CMake and CTest.
diff --git a/Help/manual/LINKS.txt b/Help/manual/LINKS.txt
index f6f707d..38fd151 100644
--- a/Help/manual/LINKS.txt
+++ b/Help/manual/LINKS.txt
@@ -11,12 +11,12 @@ Frequently Asked Questions
A Wiki is provided containing answers to frequently asked questions.
Online Documentation
- http://www.cmake.org/HTML/Documentation.html
+ http://www.cmake.org/documentation
Links to available documentation may be found on this web page.
Mailing List
- http://www.cmake.org/HTML/MailingLists.html
+ http://www.cmake.org/mailing-lists
For help and discussion about using cmake, a mailing list is
provided at cmake@cmake.org. The list is member-post-only but one
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index 5196485..0a0ca23 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -125,6 +125,7 @@ All Modules
/module/FindJava
/module/FindJNI
/module/FindJPEG
+ /module/FindJsonCpp
/module/FindKDE3
/module/FindKDE4
/module/FindLAPACK
diff --git a/Help/module/FindJsonCpp.rst b/Help/module/FindJsonCpp.rst
new file mode 100644
index 0000000..ba87ece
--- /dev/null
+++ b/Help/module/FindJsonCpp.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindJsonCpp.cmake
diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
index e24822c..163ae34 100644
--- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -130,9 +130,11 @@ The features known to this version of CMake are:
.. _N1987: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
``cxx_final``
- Override control ``final`` keyword, as defined in N2928_.
+ Override control ``final`` keyword, as defined in N2928_, N3206_ and N3272_.
.. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
+ .. _N3206: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
+ .. _N3272: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
``cxx_func_identifier``
Predefined ``__func__`` identifier, as defined in N2340_.
@@ -195,9 +197,12 @@ The features known to this version of CMake are:
.. _N2431: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf
``cxx_override``
- Override control ``override`` keyword, as defined in N2928_.
+ Override control ``override`` keyword, as defined in N2928_, N3206_
+ and N3272_.
.. _N2928: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm
+ .. _N3206: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm
+ .. _N3272: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm
``cxx_range_for``
Range-based for, as defined in N2930_.
diff --git a/Help/release/dev/AppleClang-5.1-features.rst b/Help/release/dev/AppleClang-5.1-features.rst
deleted file mode 100644
index 2b92d10..0000000
--- a/Help/release/dev/AppleClang-5.1-features.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-AppleClang-5.1-features
------------------------
-
-* The :manual:`Compile Features <cmake-compile-features(7)>` functionality
- is now aware of features supported by Apple Clang 5.1 (``AppleClang``).
diff --git a/Help/release/dev/SolarisStudio-compile-features.rst b/Help/release/dev/SolarisStudio-compile-features.rst
new file mode 100644
index 0000000..83110cd
--- /dev/null
+++ b/Help/release/dev/SolarisStudio-compile-features.rst
@@ -0,0 +1,5 @@
+SolarisStudio-compile-features
+------------------------------
+
+* The :manual:`Compile Features <cmake-compile-features(7)>` functionality
+ is now aware of features supported by Oracle SolarisStudio (``SunPro``).
diff --git a/Help/release/dev/WriteCompilerDetectionHeader-multi-file-lang.rst b/Help/release/dev/WriteCompilerDetectionHeader-multi-file-lang.rst
new file mode 100644
index 0000000..a8665da
--- /dev/null
+++ b/Help/release/dev/WriteCompilerDetectionHeader-multi-file-lang.rst
@@ -0,0 +1,6 @@
+WriteCompilerDetectionHeader-multi-file
+---------------------------------------
+
+* The :module:`WriteCompilerDetectionHeader` module learned to create
+ multiple output files per compiler and per language, instead of creating
+ one large file.
diff --git a/Help/release/dev/add-FindJsonCpp.rst b/Help/release/dev/add-FindJsonCpp.rst
new file mode 100644
index 0000000..5d1cb18
--- /dev/null
+++ b/Help/release/dev/add-FindJsonCpp.rst
@@ -0,0 +1,5 @@
+add-FindJsonCpp
+---------------
+
+* A :module:`FindJsonCpp` module was introduced to find the
+ JsonCpp package.
diff --git a/Help/release/dev/cmake-E-tar-mtime.rst b/Help/release/dev/cmake-E-tar-mtime.rst
new file mode 100644
index 0000000..6496577
--- /dev/null
+++ b/Help/release/dev/cmake-E-tar-mtime.rst
@@ -0,0 +1,6 @@
+cmake-E-tar-mtime
+-----------------
+
+* The :manual:`cmake(1)` ``-E tar`` command learned a new
+ ``--mtime=<date>`` option to specify the modification time
+ recorded in tarball entries.
diff --git a/Help/release/dev/unsupported-compilers.rst b/Help/release/dev/unsupported-compilers.rst
new file mode 100644
index 0000000..1f3e8c1
--- /dev/null
+++ b/Help/release/dev/unsupported-compilers.rst
@@ -0,0 +1,22 @@
+unsupported-compilers
+---------------------
+
+* The implementation of CMake relies on some C++ compiler features which are
+ not supported by some older compilers. As a result, those old compilers
+ can no longer be used to build CMake itself. CMake continues to be able to
+ generate Makefiles and project files for users of those old compilers
+ however. The compilers known to no longer be capable of building CMake
+ are:
+
+ * MSVC 6 and 7.0 - superceded by VisualStudio 7.1 and newer compilers.
+ * GCC 2.95 - superceded by GCC 3 and newer compilers.
+ * Borland compilers - superceded by other Windows compilers.
+ * Compaq compilers - superceded by other compilers.
+ * Comeau compilers - superceded by other compilers.
+ * SGI compilers - IRIX was dropped as a host platform.
+
+ When building using SolarisStudio 12, the default ``libCStd`` standard
+ library is not sufficient to build CMake. The SolarisStudio distribution
+ supports compiler options to use ``STLPort4`` or ``libstdc++``. An
+ appropriate option to select the standard library is now added
+ automatically when building CMake with SolarisStudio compilers.
diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake
index fc3058d..26731dc 100644
--- a/Modules/CMakeFindPackageMode.cmake
+++ b/Modules/CMakeFindPackageMode.cmake
@@ -102,15 +102,18 @@ if(UNIX)
# guess Debian multiarch if it has not been set:
if(EXISTS /etc/debian_version)
- if(NOT CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE )
+ if(NOT CMAKE_${LANGUAGE}_LIBRARY_ARCHITECTURE )
file(GLOB filesInLib RELATIVE /lib /lib/*-linux-gnu* )
foreach(file ${filesInLib})
if("${file}" MATCHES "${CMAKE_LIBRARY_ARCHITECTURE_REGEX}")
- set(CMAKE_${LANGUAGE}_LANGUAGE_ARCHITECTURE ${file})
+ set(CMAKE_${LANGUAGE}_LIBRARY_ARCHITECTURE ${file})
break()
endif()
endforeach()
endif()
+ if(NOT CMAKE_LIBRARY_ARCHITECTURE)
+ set(CMAKE_LIBRARY_ARCHITECTURE ${CMAKE_${LANGUAGE}_LIBRARY_ARCHITECTURE})
+ endif()
endif()
endif()
diff --git a/Modules/Compiler/SunPro-CXX-FeatureTests.cmake b/Modules/Compiler/SunPro-CXX-FeatureTests.cmake
new file mode 100644
index 0000000..8e97e1d
--- /dev/null
+++ b/Modules/Compiler/SunPro-CXX-FeatureTests.cmake
@@ -0,0 +1,52 @@
+
+# Based on GNU 4.8.2
+# http://docs.oracle.com/cd/E37069_01/html/E37071/gncix.html
+# Reference: http://gcc.gnu.org/projects/cxx0x.html
+
+set(_cmake_oldestSupported "__SUNPRO_CC >= 0x5130")
+
+set(SolarisStudio124_CXX11 "(__SUNPRO_CC >= 0x5130) && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_alignas "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_alignof "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_attributes "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_inheriting_constructors "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_thread_local "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_alias_templates "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_delegating_constructors "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_extended_friend_declarations "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_final "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_noexcept "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_nonstatic_member_init "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_override "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_constexpr "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_defaulted_move_initializers "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_enum_forward_declarations "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_nullptr "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_range_for "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_unrestricted_unions "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_explicit_conversions "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_lambdas "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_local_type_template_args "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_raw_string_literals "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_auto_type "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_defaulted_functions "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_deleted_functions "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_generalized_initializers "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_inline_namespaces "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_sizeof_member "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_strong_enums "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_trailing_return_types "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_unicode_literals "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_uniform_initialization "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_variadic_templates "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_decltype "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_default_function_template_args "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_long_long_type "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_right_angle_brackets "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_rvalue_references "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_static_assert "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_extern_templates "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_func_identifier "${SolarisStudio124_CXX11}")
+set(_cmake_feature_test_cxx_variadic_macros "${SolarisStudio124_CXX11}")
+
+set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported} && __cplusplus")
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index 5968712..cb37713 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -31,3 +31,24 @@ set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -
set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> "
"<CMAKE_RANLIB> <TARGET> ")
+
+if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11")
+endif()
+
+set(CMAKE_CXX_STANDARD_DEFAULT 98)
+
+macro(cmake_record_cxx_compile_features)
+ macro(_get_solaris_studio_features std_version list)
+ record_compiler_features(CXX "${std_version}" ${list})
+ endmacro()
+
+ set(_result 0)
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
+ _get_solaris_studio_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES)
+ if (_result EQUAL 0)
+ _get_solaris_studio_features("" CMAKE_CXX98_COMPILE_FEATURES)
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/FindJsonCpp.cmake b/Modules/FindJsonCpp.cmake
new file mode 100644
index 0000000..cbb4fb3
--- /dev/null
+++ b/Modules/FindJsonCpp.cmake
@@ -0,0 +1,117 @@
+#[=======================================================================[.rst:
+FindJsonCpp
+-----------
+
+Find JsonCpp includes and library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+An :ref:`imported target <Imported targets>` named
+``JsonCpp::JsonCpp`` is provided if JsonCpp has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``JsonCpp_FOUND``
+ True if JsonCpp was found, false otherwise.
+``JsonCpp_INCLUDE_DIRS``
+ Include directories needed to include JsonCpp headers.
+``JsonCpp_LIBRARIES``
+ Libraries needed to link to JsonCpp.
+``JsonCpp_VERSION_STRING``
+ The version of JsonCpp found.
+ May not be set for JsonCpp versions prior to 1.0.
+``JsonCpp_VERSION_MAJOR``
+ The major version of JsonCpp.
+``JsonCpp_VERSION_MINOR``
+ The minor version of JsonCpp.
+``JsonCpp_VERSION_PATCH``
+ The patch version of JsonCpp.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+This module uses the following cache variables:
+
+``JsonCpp_LIBRARY``
+ The location of the JsonCpp library file.
+``JsonCpp_INCLUDE_DIR``
+ The location of the JsonCpp include directory containing ``json/json.h``.
+
+The cache variables should not be used by project code.
+They may be set by end users to point at JsonCpp components.
+#]=======================================================================]
+
+#=============================================================================
+# Copyright 2014-2015 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+#-----------------------------------------------------------------------------
+find_library(JsonCpp_LIBRARY
+ NAMES jsoncpp
+ )
+mark_as_advanced(JsonCpp_LIBRARY)
+
+find_path(JsonCpp_INCLUDE_DIR
+ NAMES json/json.h
+ PATH_SUFFIXES jsoncpp
+ )
+mark_as_advanced(JsonCpp_INCLUDE_DIR)
+
+#-----------------------------------------------------------------------------
+# Extract version number if possible.
+set(_JsonCpp_H_REGEX "^#[ \t]*define[ \t]+JSONCPP_VERSION_STRING[ \t]+\"(([0-9]+)\\.([0-9]+)\\.([0-9]+)[^\"]*)\".*$")
+if(JsonCpp_INCLUDE_DIR AND EXISTS "${JsonCpp_INCLUDE_DIR}/json/version.h")
+ file(STRINGS "${JsonCpp_INCLUDE_DIR}/json/version.h" _JsonCpp_H REGEX "${_JsonCpp_H_REGEX}")
+else()
+ set(_JsonCpp_H "")
+endif()
+if(_JsonCpp_H MATCHES "${_JsonCpp_H_REGEX}")
+ set(JsonCpp_VERSION_STRING "${CMAKE_MATCH_1}")
+ set(JsonCpp_VERSION_MAJOR "${CMAKE_MATCH_2}")
+ set(JsonCpp_VERSION_MINOR "${CMAKE_MATCH_3}")
+ set(JsonCpp_VERSION_PATCH "${CMAKE_MATCH_4}")
+else()
+ set(JsonCpp_VERSION_STRING "")
+ set(JsonCpp_VERSION_MAJOR "")
+ set(JsonCpp_VERSION_MINOR "")
+ set(JsonCpp_VERSION_PATCH "")
+endif()
+unset(_JsonCpp_H_REGEX)
+unset(_JsonCpp_H)
+
+#-----------------------------------------------------------------------------
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(JsonCpp
+ FOUND_VAR JsonCpp_FOUND
+ REQUIRED_VARS JsonCpp_LIBRARY JsonCpp_INCLUDE_DIR
+ VERSION_VAR JsonCpp_VERSION_STRING
+ )
+set(JSONCPP_FOUND ${JsonCpp_FOUND})
+
+#-----------------------------------------------------------------------------
+# Provide documented result variables and targets.
+if(JsonCpp_FOUND)
+ set(JsonCpp_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR})
+ set(JsonCpp_LIBRARIES ${JsonCpp_LIBRARY})
+ if(NOT TARGET JsonCpp::JsonCpp)
+ add_library(JsonCpp::JsonCpp UNKNOWN IMPORTED)
+ set_target_properties(JsonCpp::JsonCpp PROPERTIES
+ IMPORTED_LOCATION "${JsonCpp_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${JsonCpp_INCLUDE_DIRS}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ )
+ endif()
+endif()
diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake
index 1bc0940..41b7271 100644
--- a/Modules/FindQt.cmake
+++ b/Modules/FindQt.cmake
@@ -13,6 +13,9 @@
# or FindQt4 module is included. Once the user sets DESIRED_QT_VERSION,
# then the FindQt3 or FindQt4 module is included.
#
+# This module can only detect and switch between Qt versions 3 and 4. It
+# cannot handle Qt5 or any later versions.
+#
# ::
#
# QT_REQUIRED if this is set to TRUE then if CMake can
@@ -79,7 +82,11 @@ endif()
set(GLOB_TEMP_VAR)
if (Qt_FIND_VERSION)
- set(DESIRED_QT_VERSION "${Qt_FIND_VERSION}")
+ if (Qt_FIND_VERSION MATCHES "^([34])(\\.[0-9]+.*)?$")
+ set(DESIRED_QT_VERSION ${CMAKE_MATCH_1})
+ else ()
+ message(FATAL_ERROR "FindQt was called with invalid version '${Qt_FIND_VERSION}'. Only Qt major versions 3 or 4 are supported. If you do not need to support both Qt3 and Qt4 in your source consider calling find_package(Qt3) or find_package(Qt4) instead of find_package(Qt) instead.")
+ endif ()
endif ()
# now find qmake
@@ -179,9 +186,9 @@ else()
endif()
if(NOT QT_FOUND AND DESIRED_QT_VERSION)
if(QT_REQUIRED)
- message(FATAL_ERROR "CMake was unable to find Qt version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE, if those are set then QT_QT_LIBRARY or QT_LIBRARY_DIR.")
+ message(FATAL_ERROR "CMake was unable to find Qt version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_H_FILE, if those are set then QT_QT_LIBRARY or QT_LIBRARY_DIR.")
else()
- message( "CMake was unable to find desired Qt version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_FILE.")
+ message( "CMake was unable to find desired Qt version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_H_FILE.")
endif()
endif()
endif()
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index d61358f..e81bc08 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -234,7 +234,11 @@ function(_load_compiler_variables CompilerId lang)
foreach(feature ${ARGN})
set(_cmake_feature_test_${CompilerId}_${feature} ${_cmake_feature_test_${feature}} PARENT_SCOPE)
endforeach()
- include("${CMAKE_ROOT}/Modules/Compiler/${CompilerId}-DetermineCompiler.cmake" OPTIONAL)
+ include("${CMAKE_ROOT}/Modules/Compiler/${CompilerId}-${lang}-DetermineCompiler.cmake" OPTIONAL
+ RESULT_VARIABLE determinedCompiler)
+ if (NOT determinedCompiler)
+ include("${CMAKE_ROOT}/Modules/Compiler/${CompilerId}-DetermineCompiler.cmake" OPTIONAL)
+ endif()
set(_compiler_id_version_compute_${CompilerId} ${_compiler_id_version_compute} PARENT_SCOPE)
endfunction()
@@ -317,6 +321,7 @@ function(write_compiler_detection_header
GNU
Clang
AppleClang
+ SunPro
)
set(_hex_compilers ADSP Borland Embarcadero SunPro)
@@ -382,6 +387,13 @@ function(write_compiler_detection_header
endif()
foreach(_lang ${_langs})
+ set(target_compilers)
+ foreach(compiler ${_WCD_COMPILERS})
+ _load_compiler_variables(${compiler} ${_lang} ${${_lang}_features})
+ if(_cmake_oldestSupported_${compiler})
+ list(APPEND target_compilers ${compiler})
+ endif()
+ endforeach()
get_property(known_features GLOBAL PROPERTY CMAKE_${_lang}_KNOWN_FEATURES)
foreach(feature ${${_lang}_features})
@@ -404,17 +416,16 @@ function(write_compiler_detection_header
set(file_content "${file_content}${ID_CONTENT}\n")
set(pp_if "if")
- foreach(compiler ${_WCD_COMPILERS})
- _load_compiler_variables(${compiler} ${_lang} ${${_lang}_features})
+ foreach(compiler ${target_compilers})
set(file_content "${file_content}\n# ${pp_if} ${prefix_arg}_COMPILER_IS_${compiler}\n")
if(_WCD_OUTPUT_FILES_VAR)
- set(compile_file_name "${_WCD_OUTPUT_DIR}${prefix_arg}_COMPILER_INFO_${compiler}.h")
+ set(compile_file_name "${_WCD_OUTPUT_DIR}${prefix_arg}_COMPILER_INFO_${compiler}_${_lang}.h")
set(file_content "${file_content}\n# include \"${compile_file_name}\"\n")
endif()
if(_WCD_OUTPUT_FILES_VAR)
- set(compiler_file_content compiler_file_content_${compiler})
+ set(compiler_file_content compiler_file_content_${compiler}_${_lang})
else()
set(compiler_file_content file_content)
endif()
@@ -617,16 +628,20 @@ function(write_compiler_detection_header
if(_WCD_OUTPUT_FILES_VAR)
foreach(compiler ${_WCD_COMPILERS})
- set(CMAKE_CONFIGURABLE_FILE_CONTENT "${compiler_file_content_}")
- set(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}${compiler_file_content_${compiler}}")
-
- set(compile_file_name "${_WCD_OUTPUT_DIR}${prefix_arg}_COMPILER_INFO_${compiler}.h")
- set(full_path "${main_file_dir}/${compile_file_name}")
- list(APPEND ${_WCD_OUTPUT_FILES_VAR} ${full_path})
- configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
- "${full_path}"
- @ONLY
- )
+ foreach(_lang ${_langs})
+ if(compiler_file_content_${compiler}_${_lang})
+ set(CMAKE_CONFIGURABLE_FILE_CONTENT "${compiler_file_content_}")
+ set(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}${compiler_file_content_${compiler}_${_lang}}")
+
+ set(compile_file_name "${_WCD_OUTPUT_DIR}${prefix_arg}_COMPILER_INFO_${compiler}_${_lang}.h")
+ set(full_path "${main_file_dir}/${compile_file_name}")
+ list(APPEND ${_WCD_OUTPUT_FILES_VAR} ${full_path})
+ configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
+ "${full_path}"
+ @ONLY
+ )
+ endif()
+ endforeach()
endforeach()
set(${_WCD_OUTPUT_FILES_VAR} ${${_WCD_OUTPUT_FILES_VAR}} PARENT_SCOPE)
endif()
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 96f4709..af4c7cf 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -335,6 +335,8 @@ set(SRCS
cmake.cxx
cmake.h
+ cm_get_date.h
+ cm_get_date.c
cm_sha2.h
cm_sha2.c
cm_utf8.h
@@ -500,7 +502,9 @@ add_library(CMakeLib ${SRCS})
target_link_libraries(CMakeLib cmsys
${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES}
${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES}
- ${CMAKE_CURL_LIBRARIES} )
+ ${CMAKE_CURL_LIBRARIES}
+ ${CMAKE_JSONCPP_LIBRARIES}
+ )
# On Apple we need CoreFoundation
if(APPLE)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 2821174..2f4cb8a 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 1)
-set(CMake_VERSION_PATCH 20150117)
+set(CMake_VERSION_PATCH 20150122)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 9cd53ea..f21fcf6 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -421,7 +421,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
}
}
/* rebuild symlinks in the installed tree */
- if (symlinkedFiles.size()>0)
+ if (!symlinkedFiles.empty())
{
std::list< std::pair<std::string,std::string> >::iterator symlinkedIt;
std::string curDir = cmSystemTools::GetCurrentWorkingDirectory();
@@ -926,7 +926,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
}
if (NULL !=mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) {
- if (absoluteDestFiles.length()>0) {
+ if (!absoluteDestFiles.empty()) {
absoluteDestFiles +=";";
}
absoluteDestFiles +=
@@ -1356,7 +1356,7 @@ int cmCPackGenerator::PrepareGroupingKind()
groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING");
}
- if (groupingType.length()>0)
+ if (!groupingType.empty())
{
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "["
<< this->Name << "]"
diff --git a/Source/CPack/cmCPackLog.cxx b/Source/CPack/cmCPackLog.cxx
index 7befca0..7633ac2 100644
--- a/Source/CPack/cmCPackLog.cxx
+++ b/Source/CPack/cmCPackLog.cxx
@@ -102,7 +102,7 @@ void cmCPackLog::Log(int tag, const char* file, int line,
display = true;
if ( needTagString )
{
- if ( tagString.size() > 0 ) { tagString += ","; }
+ if (!tagString.empty()) { tagString += ","; }
tagString = "VERBOSE";
}
}
@@ -112,7 +112,7 @@ void cmCPackLog::Log(int tag, const char* file, int line,
display = true;
if ( needTagString )
{
- if ( tagString.size() > 0 ) { tagString += ","; }
+ if (!tagString.empty()) { tagString += ","; }
tagString = "WARNING";
}
}
@@ -122,7 +122,7 @@ void cmCPackLog::Log(int tag, const char* file, int line,
display = true;
if ( needTagString )
{
- if ( tagString.size() > 0 ) { tagString += ","; }
+ if (!tagString.empty()) { tagString += ","; }
tagString = "ERROR";
}
}
@@ -132,7 +132,7 @@ void cmCPackLog::Log(int tag, const char* file, int line,
display = true;
if ( needTagString )
{
- if ( tagString.size() > 0 ) { tagString += ","; }
+ if (!tagString.empty()) { tagString += ","; }
tagString = "DEBUG";
}
useFileAndLine = true;
@@ -143,7 +143,7 @@ void cmCPackLog::Log(int tag, const char* file, int line,
display = true;
if ( needTagString )
{
- if ( tagString.size() > 0 ) { tagString += ","; }
+ if (!tagString.empty()) { tagString += ","; }
tagString = "VERBOSE";
}
}
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index b1b122d..00bfe5b 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -117,7 +117,7 @@ int main (int argc, char const* const* argv)
cmSystemTools::EnableMSVCDebugHook();
- if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 )
+ if (cmSystemTools::GetCurrentWorkingDirectory().empty())
{
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Current working directory cannot be established." << std::endl);
diff --git a/Source/CTest/cmCTestBatchTestHandler.cxx b/Source/CTest/cmCTestBatchTestHandler.cxx
index 7f966aa..d62c260 100644
--- a/Source/CTest/cmCTestBatchTestHandler.cxx
+++ b/Source/CTest/cmCTestBatchTestHandler.cxx
@@ -58,7 +58,7 @@ void cmCTestBatchTestHandler::WriteSrunArgs(int test, cmsys::ofstream& fout)
fout << "-J=" << properties->Name << " ";
//Write dependency information
- /*if(this->Tests[test].size() > 0)
+ /*if(!this->Tests[test].empty())
{
fout << "-P=afterany";
for(TestSet::iterator i = this->Tests[test].begin();
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index b1fb02d..d90aeb7 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -62,7 +62,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
std::vector<std::string> args;
args.push_back(cmSystemTools::GetCMakeCommand());
args.push_back(this->SourceDir);
- if(this->BuildGenerator.size())
+ if(!this->BuildGenerator.empty())
{
std::string generator = "-G";
generator += this->BuildGenerator;
@@ -74,7 +74,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
platform += this->BuildGeneratorPlatform;
args.push_back(platform);
}
- if(this->BuildGeneratorToolset.size())
+ if(!this->BuildGeneratorToolset.empty())
{
std::string toolset = "-T";
toolset += this->BuildGeneratorToolset;
@@ -82,7 +82,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
}
const char* config = 0;
- if ( this->CTest->GetConfigType().size() > 0 )
+ if (!this->CTest->GetConfigType().empty())
{
config = this->CTest->GetConfigType().c_str();
}
@@ -193,7 +193,7 @@ public:
int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
{
// if the generator and make program are not specified then it is an error
- if (!this->BuildGenerator.size())
+ if (this->BuildGenerator.empty())
{
if(outstring)
{
@@ -211,8 +211,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
static_cast<void>(captureRAII);
std::ostringstream out;
- if ( this->CTest->GetConfigType().size() == 0 &&
- this->ConfigSample.size())
+ if ( this->CTest->GetConfigType().empty() &&
+ !this->ConfigSample.empty())
{
// use the config sample to set the ConfigType
std::string fullPath;
@@ -225,7 +225,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
resultingConfig,
extraPaths,
failed);
- if (fullPath.size() && resultingConfig.size())
+ if (!fullPath.empty() && !resultingConfig.empty())
{
this->CTest->SetConfigType(resultingConfig.c_str());
}
@@ -269,7 +269,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
// do the build
std::vector<std::string>::iterator tarIt;
- if ( this->BuildTargets.size() == 0 )
+ if (this->BuildTargets.empty())
{
this->BuildTargets.push_back("");
}
@@ -291,7 +291,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
}
std::string output;
const char* config = 0;
- if ( this->CTest->GetConfigType().size() > 0 )
+ if (!this->CTest->GetConfigType().empty())
{
config = this->CTest->GetConfigType().c_str();
}
@@ -329,7 +329,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
}
// if no test was specified then we are done
- if (!this->TestCommand.size())
+ if (this->TestCommand.empty())
{
return 0;
}
@@ -340,7 +340,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
std::string resultingConfig;
std::vector<std::string> extraPaths;
// if this->ExecutableDirectory is set try that as well
- if (this->ExecutableDirectory.size())
+ if (!this->ExecutableDirectory.empty())
{
std::string tempPath = this->ExecutableDirectory;
tempPath += "/";
@@ -388,7 +388,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
std::string outs;
int retval = 0;
// run the test from the this->BuildRunDir if set
- if(this->BuildRunDir.size())
+ if(!this->BuildRunDir.empty())
{
out << "Run test in directory: " << this->BuildRunDir << "\n";
cmSystemTools::ChangeDirectory(this->BuildRunDir);
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 0c3f206..8f087ab 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -344,7 +344,7 @@ int cmCTestBuildHandler::ProcessHandler()
// Determine build command and build directory
std::string makeCommand = this->GetMakeCommand();
- if ( makeCommand.size() == 0 )
+ if (makeCommand.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find MakeCommand key in the DartConfiguration.tcl"
@@ -354,7 +354,7 @@ int cmCTestBuildHandler::ProcessHandler()
const std::string &buildDirectory
= this->CTest->GetCTestConfiguration("BuildDirectory");
- if ( buildDirectory.size() == 0 )
+ if (buildDirectory.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find BuildDirectory key in the DartConfiguration.tcl"
@@ -702,12 +702,12 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(std::ostream& os)
}
if ( !cm->SourceFile.empty() && cm->LineNumber >= 0 )
{
- if ( cm->SourceFile.size() > 0 )
+ if (!cm->SourceFile.empty())
{
os << "\t\t<SourceFile>" << cm->SourceFile << "</SourceFile>"
<< std::endl;
}
- if ( cm->SourceFileTail.size() > 0 )
+ if (!cm->SourceFileTail.empty())
{
os << "\t\t<SourceFileTail>" << cm->SourceFileTail
<< "</SourceFileTail>" << std::endl;
@@ -1150,7 +1150,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
{
// This is not an error or warning.
// So, figure out if this is a post-context line
- if ( this->ErrorsAndWarnings.size() &&
+ if ( !this->ErrorsAndWarnings.empty() &&
this->LastErrorOrWarning != this->ErrorsAndWarnings.end() &&
this->PostContextCount < this->MaxPostContext )
{
diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx
index c492bf0..506433f 100644
--- a/Source/CTest/cmCTestConfigureHandler.cxx
+++ b/Source/CTest/cmCTestConfigureHandler.cxx
@@ -38,7 +38,7 @@ int cmCTestConfigureHandler::ProcessHandler()
cmCTestLog(this->CTest, HANDLER_OUTPUT, "Configure project" << std::endl);
std::string cCommand
= this->CTest->GetCTestConfiguration("ConfigureCommand");
- if ( cCommand.size() == 0 )
+ if (cCommand.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find ConfigureCommand key in the DartConfiguration.tcl"
@@ -48,7 +48,7 @@ int cmCTestConfigureHandler::ProcessHandler()
std::string buildDirectory
= this->CTest->GetCTestConfiguration("BuildDirectory");
- if ( buildDirectory.size() == 0 )
+ if (buildDirectory.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find BuildDirectory key in the DartConfiguration.tcl"
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 6598111..08b7c66 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -87,7 +87,7 @@ public:
}
args.push_back(0); // null terminate
cmsysProcess_SetCommand(this->Process, &*args.begin());
- if(this->WorkingDirectory.size())
+ if(!this->WorkingDirectory.empty())
{
cmsysProcess_SetWorkingDirectory(this->Process,
this->WorkingDirectory.c_str());
@@ -270,7 +270,7 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
std::string ndc
= cmSystemTools::FileExistsInParentDirectories(".NoDartCoverage",
fFile.c_str(), checkDir.c_str());
- if ( ndc.size() )
+ if (!ndc.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found: " << ndc
<< " so skip coverage of " << file << std::endl);
@@ -281,7 +281,7 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
// Get the relative path to the file an apply it to the opposite directory.
// If it is the same as fileDir, then ignore, otherwise check.
std::string relPath;
- if(checkDir.size() )
+ if(!checkDir.empty())
{
relPath = cmSystemTools::RelativePath(checkDir.c_str(),
fFile.c_str());
@@ -309,7 +309,7 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
ndc = cmSystemTools::FileExistsInParentDirectories(".NoDartCoverage",
fFile.c_str(), checkDir.c_str());
- if ( ndc.size() )
+ if (!ndc.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found: " << ndc
<< " so skip coverage of: " << file << std::endl);
@@ -665,7 +665,7 @@ int cmCTestCoverageHandler::ProcessHandler()
this->EndCoverageLogFile(covLogFile, logFileCount);
- if ( errorsWhileAccumulating.size() > 0 )
+ if (!errorsWhileAccumulating.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE, std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE,
@@ -910,7 +910,7 @@ int cmCTestCoverageHandler::HandleJacocoCoverage(
g.FindFiles(coverageFile);
files=g.GetFiles();
- if (files.size() > 0)
+ if (!files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Found Jacoco Files, Performing Coverage" << std::endl);
@@ -943,7 +943,7 @@ int cmCTestCoverageHandler::HandleDelphiCoverage(
g.FindFiles(coverageFile);
files=g.GetFiles();
- if (files.size() > 0)
+ if (!files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Found Delphi HTML Files, Performing Coverage" << std::endl);
@@ -973,7 +973,7 @@ int cmCTestCoverageHandler::HandleBlanketJSCoverage(
std::vector<std::string> files;
g.FindFiles(coverageFile);
files=g.GetFiles();
- if (files.size() > 0)
+ if (!files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Found BlanketJS output JSON, Performing Coverage" << std::endl);
@@ -1037,7 +1037,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
this->FindGCovFiles(files);
std::vector<std::string>::iterator it;
- if ( files.size() == 0 )
+ if (files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Cannot find any GCov coverage files."
@@ -1131,7 +1131,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
cmCTestLog(this->CTest, DEBUG, "Line: [" << *line << "]"
<< std::endl);
- if ( line->size() == 0 )
+ if (line->empty())
{
// Ignore empty line; probably style 2
}
@@ -1311,7 +1311,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
//TODO: Handle gcov 3.0 non-coverage lines
// Skip empty lines
- if ( !nl.size() )
+ if (nl.empty())
{
continue;
}
@@ -1456,7 +1456,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
this->FindLCovFiles(files);
std::vector<std::string>::iterator it;
- if ( files.size() == 0 )
+ if (files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Cannot find any LCov coverage files."
@@ -1538,7 +1538,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
std::string sourceFile;
std::string lcovFile;
- if ( line->size() == 0 )
+ if (line->empty())
{
// Ignore empty line
}
@@ -1627,7 +1627,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
cnt ++;
// Skip empty lines
- if ( !nl.size() )
+ if (nl.empty())
{
continue;
}
@@ -1759,7 +1759,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
gl.FindFiles(daGlob);
std::vector<std::string> files = gl.GetFiles();
- if ( files.size() == 0 )
+ if (files.empty())
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Cannot find any Python Trace.py coverage files."
@@ -1813,7 +1813,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
cnt ++;
// Skip empty lines
- if ( !nl.size() )
+ if (nl.empty())
{
continue;
}
@@ -2076,7 +2076,7 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
std::string& outputFile)
{
std::string program = cmSystemTools::FindProgram(cmd);
- if(program.size() == 0)
+ if(program.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find :" << cmd << "\n");
return 0;
@@ -2183,7 +2183,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
while(cmSystemTools::GetLineFromStream(fin, stdline))
{
// if we have a line of output from stdout
- if(stdline.size())
+ if(!stdline.empty())
{
// parse the comma separated output
this->ParseBullsEyeCovsrcLine(stdline,
@@ -2596,7 +2596,7 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
}
}
- if(extraMatches.size())
+ if(!extraMatches.empty())
{
for(cmCTestCoverageHandlerContainer::TotalCoverageMap::iterator i =
cont->TotalCoverage.begin(); i != cont->TotalCoverage.end(); ++i)
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 77c5d57..62fa2be 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -720,7 +720,7 @@ bool cmCTestLaunch::Match(std::string const& line,
//----------------------------------------------------------------------------
bool cmCTestLaunch::MatchesFilterPrefix(std::string const& line) const
{
- if(this->OptionFilterPrefix.size() && cmSystemTools::StringStartsWith(
+ if(!this->OptionFilterPrefix.empty() && cmSystemTools::StringStartsWith(
line.c_str(), this->OptionFilterPrefix.c_str()))
{
return true;
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index fd0388a..d4ff24f 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -223,7 +223,7 @@ void cmCTestMemCheckHandler::GenerateTestCommand(
this->MemoryTesterEnvironmentVariable;
for ( pp = 0; pp < this->MemoryTesterOptions.size(); pp ++ )
{
- if(memTesterEnvironmentVariable.size())
+ if(!memTesterEnvironmentVariable.empty())
{
// If we are using env to pass options, append all the options to
// this string with space separation.
@@ -241,7 +241,7 @@ void cmCTestMemCheckHandler::GenerateTestCommand(
}
// if this is an env option type, then add the env string as a single
// argument.
- if(memTesterEnvironmentVariable.size())
+ if(!memTesterEnvironmentVariable.empty())
{
std::string::size_type pos = memTesterEnvironmentVariable.find("??");
if (pos != std::string::npos)
@@ -592,7 +592,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
}
}
- if(this->MemoryTester.size() == 0 )
+ if(this->MemoryTester.empty())
{
cmCTestLog(this->CTest, WARNING,
"Memory checker (MemoryCheckCommand) "
@@ -848,10 +848,10 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput(
{
resultFound = sanitizerWarning.match(1);
}
- if(resultFound.size())
+ if(!resultFound.empty())
{
std::vector<int>::size_type idx = this->FindOrAddWarning(resultFound);
- if(result.size() == 0 || idx > result.size()-1)
+ if(result.empty() || idx > result.size()-1)
{
result.push_back(1);
}
@@ -1197,7 +1197,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
<< res.Name << std::endl);
std::vector<std::string> files;
this->TestOutputFileNames(test, files);
- if ( files.size() == 0 )
+ if (files.empty())
{
return;
}
@@ -1280,7 +1280,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(int test,
ofile += ".*";
cmsys::Glob g;
g.FindFiles(ofile);
- if(g.GetFiles().size() == 0)
+ if(g.GetFiles().empty())
{
std::string log = "Cannot find memory tester output file: "
+ ofile;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index b32d47b..f9e8a3c 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -92,7 +92,7 @@ void cmCTestMultiProcessHandler::RunTests()
}
this->TestHandler->SetMaxIndex(this->FindMaxIndex());
this->StartNextTests();
- while(this->Tests.size() != 0)
+ while(!this->Tests.empty())
{
if(this->StopTimePassed)
{
@@ -265,7 +265,7 @@ void cmCTestMultiProcessHandler::StartNextTests()
bool cmCTestMultiProcessHandler::CheckOutput()
{
// no more output we are done
- if(this->RunningTests.size() == 0)
+ if(this->RunningTests.empty())
{
return false;
}
@@ -636,7 +636,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
testRun.SetTestProperties(&p);
testRun.ComputeArguments(); //logs the command in verbose mode
- if(p.Labels.size()) //print the labels
+ if(!p.Labels.empty()) //print the labels
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Labels:");
}
@@ -645,7 +645,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " " << *label);
}
- if(p.Labels.size()) //print the labels
+ if(!p.Labels.empty()) //print the labels
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl);
}
@@ -683,7 +683,7 @@ void cmCTestMultiProcessHandler::PrintLabels()
allLabels.insert(p.Labels.begin(), p.Labels.end());
}
- if(allLabels.size())
+ if(!allLabels.empty())
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, "All Labels:" << std::endl);
}
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 52b98d7..31002a6 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -324,7 +324,7 @@ private:
//----------------------------------------------------------------------------
void cmCTestP4::SetP4Options(std::vector<char const*> &CommandOptions)
{
- if(P4Options.size() == 0)
+ if(P4Options.empty())
{
const char* p4 = this->CommandLineTool.c_str();
P4Options.push_back(p4);
@@ -447,7 +447,7 @@ void cmCTestP4::LoadRevisions()
ChangeLists.clear();
this->RunChild(&p4_changes[0], &out, &err);
- if(ChangeLists.size() == 0)
+ if(ChangeLists.empty())
return;
//p4 describe -s ...@1111111,2222222
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 2a39051..314c8ad 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -155,7 +155,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
std::string> >::iterator passIt;
bool forceFail = false;
bool outputTestErrorsToConsole = false;
- if ( this->TestProperties->RequiredRegularExpressions.size() > 0 )
+ if (!this->TestProperties->RequiredRegularExpressions.empty())
{
bool found = false;
for ( passIt = this->TestProperties->RequiredRegularExpressions.begin();
@@ -184,7 +184,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
}
reason += "]";
}
- if ( this->TestProperties->ErrorRegularExpressions.size() > 0 )
+ if (!this->TestProperties->ErrorRegularExpressions.empty())
{
for ( passIt = this->TestProperties->ErrorRegularExpressions.begin();
passIt != this->TestProperties->ErrorRegularExpressions.end();
@@ -318,7 +318,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
*this->TestHandler->LogFile
<< "----------------------------------------------------------"
<< std::endl;
- if(this->TestResult.Reason.size())
+ if(!this->TestResult.Reason.empty())
{
*this->TestHandler->LogFile << reasonType << ":\n"
<< this->TestResult.Reason << "\n";
@@ -670,7 +670,7 @@ bool cmCTestRunTest::ForkProcess(double testTimeOut, bool explicitTimeout,
cmSystemTools::SaveRestoreEnvironment sre;
#endif
- if (environment && environment->size()>0)
+ if (environment && !environment->empty())
{
cmSystemTools::AppendEnv(*environment);
}
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 71edd5b..8184bb4 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -415,7 +415,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
this->UpdateElapsedTime();
// add the script arg if defined
- if (script_arg.size())
+ if (!script_arg.empty())
{
this->Makefile->AddDefinition("CTEST_SCRIPT_ARG", script_arg.c_str());
}
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index fea94ba..bc6fb31 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -61,7 +61,7 @@ private:
std::string GetCurrentValue()
{
std::string val;
- if(this->CurrentValue.size())
+ if(!this->CurrentValue.empty())
{
val.assign(&this->CurrentValue[0], this->CurrentValue.size());
}
@@ -273,13 +273,13 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
// Now run off and do what you've been told!
res = ::curl_easy_perform(curl);
- if ( chunk.size() > 0 )
+ if (!chunk.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
<< std::endl);
}
- if ( chunkDebug.size() > 0 )
+ if (!chunkDebug.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL debug output: ["
<< cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]"
@@ -301,7 +301,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
<< error_buffer << std::endl
<< " Curl output was: ";
// avoid dereference of empty vector
- if(chunk.size())
+ if(!chunk.empty())
{
*this->LogFile << cmCTestLogWrite(&*chunk.begin(), chunk.size());
cmCTestLog(this->CTest, ERROR_MESSAGE, "CURL output: ["
@@ -390,7 +390,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
break;
default:
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
- if (this->HTTPProxyAuth.size() > 0)
+ if (!this->HTTPProxyAuth.empty())
{
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD,
this->HTTPProxyAuth.c_str());
@@ -523,14 +523,14 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
chunk.assign(mock_output.begin(), mock_output.end());
}
- if ( chunk.size() > 0 )
+ if (!chunk.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
<< std::endl);
this->ParseResponse(chunk);
}
- if ( chunkDebug.size() > 0 )
+ if (!chunkDebug.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL debug output: ["
<< cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]"
@@ -576,7 +576,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
res = ::curl_easy_perform(curl);
- if ( chunk.size() > 0 )
+ if (!chunk.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
@@ -605,7 +605,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
<< " Error message was: " << error_buffer
<< std::endl;
// avoid deref of begin for zero size array
- if(chunk.size())
+ if(!chunk.empty())
{
*this->LogFile << " Curl output was: "
<< cmCTestLogWrite(&*chunk.begin(), chunk.size())
@@ -697,7 +697,7 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
break;
default:
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
- if (this->HTTPProxyAuth.size() > 0)
+ if (!this->HTTPProxyAuth.empty())
{
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD,
this->HTTPProxyAuth.c_str());
@@ -766,7 +766,7 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
<< std::endl
<< " Error message was: " << error_buffer
<< std::endl;
- if(chunk.size())
+ if(!chunk.empty())
{
*this->LogFile
<< " Curl output was: "
@@ -780,13 +780,13 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
return false;
}
- if ( chunk.size() > 0 )
+ if (!chunk.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL output: ["
<< cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
<< std::endl);
}
- if ( chunkDebug.size() > 0 )
+ if (!chunkDebug.empty())
{
cmCTestLog(this->CTest, DEBUG, "CURL debug output: ["
<< cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size())
@@ -812,8 +812,8 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
const std::string& remoteprefix,
const std::string& url)
{
- if ( !scp_command.size() || !localprefix.size() ||
- !files.size() || !remoteprefix.size() || !url.size() )
+ if ( scp_command.empty() || localprefix.empty() ||
+ files.empty() || remoteprefix.empty() || url.empty() )
{
return 0;
}
@@ -912,8 +912,8 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
const std::string& remoteprefix,
const std::string& destination)
{
- if ( !localprefix.size() ||
- !files.size() || !remoteprefix.size() || !destination.size() )
+ if ( localprefix.empty() ||
+ files.empty() || remoteprefix.empty() || destination.empty() )
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Missing arguments for submit via cp:\n"
@@ -1060,14 +1060,14 @@ int cmCTestSubmitHandler::ProcessHandler()
{
std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash");
// cdash does not need to trigger so just return true
- if(iscdash.size())
+ if(!iscdash.empty())
{
this->CDash = true;
}
const std::string &buildDirectory
= this->CTest->GetCTestConfiguration("BuildDirectory");
- if ( buildDirectory.size() == 0 )
+ if (buildDirectory.empty())
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find BuildDirectory key in the DartConfiguration.tcl"
@@ -1140,12 +1140,12 @@ int cmCTestSubmitHandler::ProcessHandler()
}
}
- if ( this->HTTPProxy.size() > 0 )
+ if (!this->HTTPProxy.empty())
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Use HTTP Proxy: "
<< this->HTTPProxy << std::endl);
}
- if ( this->FTPProxy.size() > 0 )
+ if (!this->FTPProxy.empty())
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Use FTP Proxy: "
<< this->FTPProxy << std::endl);
@@ -1256,12 +1256,12 @@ int cmCTestSubmitHandler::ProcessHandler()
this->CTest->GetCTestConfiguration("DropSite") +
cmCTest::MakeURLSafe(
this->CTest->GetCTestConfiguration("DropLocation"));
- if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 )
+ if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty())
{
cmCTestLog(this->CTest, HANDLER_OUTPUT,
this->CTest->GetCTestConfiguration(
"DropSiteUser").c_str());
- if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 )
+ if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty())
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******");
}
@@ -1310,12 +1310,12 @@ int cmCTestSubmitHandler::ProcessHandler()
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Using HTTP submit method"
<< std::endl
<< " Drop site:" << url);
- if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 )
+ if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty())
{
url += this->CTest->GetCTestConfiguration("DropSiteUser");
cmCTestLog(this->CTest, HANDLER_OUTPUT,
this->CTest->GetCTestConfiguration("DropSiteUser").c_str());
- if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 )
+ if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty())
{
url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword");
cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******");
@@ -1400,7 +1400,7 @@ int cmCTestSubmitHandler::ProcessHandler()
{
std::string url;
std::string oldWorkingDirectory;
- if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 )
+ if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty())
{
url += this->CTest->GetCTestConfiguration("DropSiteUser") + "@";
}
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index cfb0274..925e3c9 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -564,7 +564,7 @@ int cmCTestTestHandler::ProcessHandler()
}
else
{
- if (this->HandlerVerbose && passed.size() &&
+ if (this->HandlerVerbose && !passed.empty() &&
(this->UseIncludeRegExpFlag || this->UseExcludeRegExpFlag))
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
@@ -578,7 +578,7 @@ int cmCTestTestHandler::ProcessHandler()
}
float percent = float(passed.size()) * 100.0f / float(total);
- if ( failed.size() > 0 && percent > 99)
+ if (!failed.empty() && percent > 99)
{
percent = 99;
}
@@ -596,7 +596,7 @@ int cmCTestTestHandler::ProcessHandler()
cmCTestLog(this->CTest, HANDLER_OUTPUT, "\nTotal Test time (real) = "
<< realBuf << "\n" );
- if (failed.size())
+ if (!failed.empty())
{
cmGeneratedFileStream ofs;
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl
@@ -668,7 +668,7 @@ void cmCTestTestHandler::PrintLabelSummary()
for(; it != this->TestList.end(); ++it)
{
cmCTestTestProperties& p = *it;
- if(p.Labels.size() != 0)
+ if(!p.Labels.empty())
{
for(std::vector<std::string>::iterator l = p.Labels.begin();
l != p.Labels.end(); ++l)
@@ -688,7 +688,7 @@ void cmCTestTestHandler::PrintLabelSummary()
{
cmCTestTestResult &result = *ri;
cmCTestTestProperties& p = *result.Properties;
- if(p.Labels.size() != 0)
+ if(!p.Labels.empty())
{
for(std::vector<std::string>::iterator l = p.Labels.begin();
l != p.Labels.end(); ++l)
@@ -698,7 +698,7 @@ void cmCTestTestHandler::PrintLabelSummary()
}
}
// now print times
- if(labels.size())
+ if(!labels.empty())
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, "\nLabel Time Summary:");
}
@@ -717,7 +717,7 @@ void cmCTestTestHandler::PrintLabelSummary()
<< buf << "\n";
}
}
- if(labels.size())
+ if(!labels.empty())
{
if(this->LogFile)
{
@@ -738,7 +738,7 @@ void cmCTestTestHandler::CheckLabelFilterInclude(cmCTestTestProperties& it)
}
// if there are no labels and we are filtering by labels
// then exclude the test as it does not have the label
- if(it.Labels.size() == 0 )
+ if(it.Labels.empty())
{
it.IsInBasedOnREOptions = false;
return;
@@ -772,7 +772,7 @@ void cmCTestTestHandler::CheckLabelFilterExclude(cmCTestTestProperties& it)
}
// if there are no labels and we are excluding by labels
// then do nothing as a no label can not be a match
- if(it.Labels.size() == 0 )
+ if(it.Labels.empty())
{
return;
}
@@ -850,7 +850,7 @@ void cmCTestTestHandler::ComputeTestList()
if (this->UseUnion)
{
// if it is not in the list and not in the regexp then skip
- if ((this->TestsToRun.size() &&
+ if ((!this->TestsToRun.empty() &&
std::find(this->TestsToRun.begin(), this->TestsToRun.end(), cnt)
== this->TestsToRun.end()) && !it->IsInBasedOnREOptions)
{
@@ -860,7 +860,7 @@ void cmCTestTestHandler::ComputeTestList()
else
{
// is this test in the list of tests to run? If not then skip it
- if ((this->TestsToRun.size() &&
+ if ((!this->TestsToRun.empty() &&
std::find(this->TestsToRun.begin(),
this->TestsToRun.end(), inREcnt)
== this->TestsToRun.end()) || !it->IsInBasedOnREOptions)
@@ -891,7 +891,7 @@ void cmCTestTestHandler::ComputeTestListForRerunFailed()
cnt ++;
// if this test is not in our list of tests to run, then skip it.
- if ((this->TestsToRun.size() &&
+ if ((!this->TestsToRun.empty() &&
std::find(this->TestsToRun.begin(), this->TestsToRun.end(), cnt)
== this->TestsToRun.end()))
{
@@ -1094,7 +1094,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<std::string> &passed,
p.Timeout = this->CTest->GetGlobalTimeout();
}
- if(p.Depends.size())
+ if(!p.Depends.empty())
{
for(std::vector<std::string>::iterator i = p.Depends.begin();
i != p.Depends.end(); ++i)
@@ -1192,7 +1192,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os)
<< "name=\"Execution Time\"><Value>"
<< result->ExecutionTime
<< "</Value></NamedMeasurement>\n";
- if(result->Reason.size())
+ if(!result->Reason.empty())
{
const char* reasonType = "Pass Reason";
if(result->Status != cmCTestTestHandler::COMPLETED &&
@@ -1376,7 +1376,7 @@ void cmCTestTestHandler
{
std::string tempPath;
- if (filepath.size() &&
+ if (!filepath.empty() &&
filepath[filepath.size()-1] != '/')
{
filepath += "/";
@@ -1385,7 +1385,7 @@ void cmCTestTestHandler
attempted.push_back(tempPath);
attemptedConfigs.push_back("");
- if(ctest->GetConfigType().size())
+ if(!ctest->GetConfigType().empty())
{
tempPath = filepath;
tempPath += ctest->GetConfigType();
@@ -1463,7 +1463,7 @@ std::string cmCTestTestHandler
// even if a fullpath was specified also try it relative to the current
// directory
- if (filepath.size() && filepath[0] == '/')
+ if (!filepath.empty() && filepath[0] == '/')
{
std::string localfilepath = filepath.substr(1,filepath.size()-1);
cmCTestTestHandler::AddConfigurations(ctest, attempted,
@@ -1474,7 +1474,7 @@ std::string cmCTestTestHandler
// if extraPaths are provided and we were not passed a full path, try them,
// try any extra paths
- if (filepath.size() == 0)
+ if (filepath.empty())
{
for (unsigned int i = 0; i < extraPaths.size(); ++i)
{
@@ -1494,7 +1494,7 @@ std::string cmCTestTestHandler
// now look in the paths we specified above
for(unsigned int ai=0;
- ai < attempted.size() && fullPath.size() == 0; ++ai)
+ ai < attempted.size() && fullPath.empty(); ++ai)
{
// first check without exe extension
if(cmSystemTools::FileExists(attempted[ai].c_str())
@@ -1524,7 +1524,7 @@ std::string cmCTestTestHandler
// if everything else failed, check the users path, but only if a full path
// wasn't specified
- if (fullPath.size() == 0 && filepath.size() == 0)
+ if (fullPath.empty() && filepath.empty())
{
std::string path = cmSystemTools::FindProgram(filename.c_str());
if (path != "")
@@ -1533,7 +1533,7 @@ std::string cmCTestTestHandler
return path;
}
}
- if(fullPath.size() == 0)
+ if(fullPath.empty())
{
cmCTestLog(ctest, HANDLER_OUTPUT,
"Could not find executable " << testCommand << "\n"
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index 772c9aa..4c37c8b 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -94,7 +94,7 @@ cmCTestUpdateHandlerLocale::~cmCTestUpdateHandlerLocale()
{
// restore the value of LC_MESSAGES after running the version control
// commands
- if(saveLCMessages.size())
+ if(!saveLCMessages.empty())
{
std::string put = "LC_MESSAGES=";
put += saveLCMessages;
diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx
index 97454a8..3642308 100644
--- a/Source/CTest/cmParseCacheCoverage.cxx
+++ b/Source/CTest/cmParseCacheCoverage.cxx
@@ -163,7 +163,7 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file)
}
// if we do not have a routine yet, then it should be
// the first argument in the vector
- if(routine.size() == 0)
+ if(routine.empty())
{
routine = separateLine[0];
// Find the full path to the file
@@ -191,7 +191,7 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file)
// move to next line. We should have already warned
// after the call to FindMumpsFile that we did not find
// it, so don't report again to cut down on output
- if(filepath.size() == 0)
+ if(filepath.empty())
{
continue;
}
diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx
index 3afbfac..4dfdfac 100644
--- a/Source/CTest/cmParseDelphiCoverage.cxx
+++ b/Source/CTest/cmParseDelphiCoverage.cxx
@@ -61,7 +61,7 @@ public:
continue;
}
else if((line.find("end;") != line.npos)
- && (beginSet.size() > 0))
+ && !beginSet.empty())
{
beginSet.pop_back();
coverageVector.push_back(-1);
@@ -80,7 +80,7 @@ public:
}
}
//Based up what was found, add a line to the coverageVector
- if((beginSet.size() > 0) && line != "" && !blockComFlag
+ if(!beginSet.empty() && line != "" && !blockComFlag
&& !lineComFlag)
{
coverageVector.push_back(0);
@@ -147,7 +147,7 @@ public:
std::string glob = Coverage.SourceDir + "*/" + filename;
gl.FindFiles(glob);
std::vector<std::string> const& files = gl.GetFiles();
- if(files.size() == 0)
+ if(files.empty())
{
/*
* If that doesn't find any matching files
diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx
index d77244a..f3f8008 100644
--- a/Source/CTest/cmParseGTMCoverage.cxx
+++ b/Source/CTest/cmParseGTMCoverage.cxx
@@ -80,7 +80,7 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file)
// no need to search the file if we just did it
if(function == lastfunction && lastroutine == routine)
{
- if(lastpath.size())
+ if(!lastpath.empty())
{
this->Coverage.TotalCoverage[lastpath][lastoffset + linenumber]
+= count;
diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx
index f270adb..780debc 100644
--- a/Source/CTest/cmParseJacocoCoverage.cxx
+++ b/Source/CTest/cmParseJacocoCoverage.cxx
@@ -106,7 +106,7 @@ class cmParseJacocoCoverage::XMLParser: public cmXMLParser
{
FileLinesType& curFileLines=
this->Coverage.TotalCoverage[this->CurFileName];
- if(curFileLines.size() > 0)
+ if(!curFileLines.empty())
{
curFileLines[nr-1] = ci;
}
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 167b992..e1bd02b 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -39,7 +39,7 @@ void cmProcess::SetCommandArguments(std::vector<std::string> const& args)
bool cmProcess::StartProcess()
{
- if(this->Command.size() == 0)
+ if(this->Command.empty())
{
return false;
}
@@ -56,7 +56,7 @@ bool cmProcess::StartProcess()
this->ProcessArgs.push_back(0); // null terminate the list
this->Process = cmsysProcess_New();
cmsysProcess_SetCommand(this->Process, &*this->ProcessArgs.begin());
- if(this->WorkingDirectory.size())
+ if(!this->WorkingDirectory.empty())
{
cmsysProcess_SetWorkingDirectory(this->Process,
this->WorkingDirectory.c_str());
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 248efaf..dcd0b6c 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -893,7 +893,7 @@ void cmCursesMainForm::HandleInput()
if ( key == 10 || key == KEY_ENTER )
{
this->SearchMode = false;
- if ( this->SearchString.size() > 0 )
+ if (!this->SearchString.empty())
{
this->JumpToCacheEntry(this->SearchString.c_str());
this->OldSearchString = this->SearchString;
@@ -918,7 +918,7 @@ void cmCursesMainForm::HandleInput()
}
else if ( key == ctrl('h') || key == KEY_BACKSPACE || key == KEY_DC )
{
- if ( this->SearchString.size() > 0 )
+ if (!this->SearchString.empty())
{
this->SearchString.resize(this->SearchString.size()-1);
}
@@ -1067,7 +1067,7 @@ void cmCursesMainForm::HandleInput()
}
else if ( key == 'n' )
{
- if ( this->OldSearchString.size() > 0 )
+ if (!this->OldSearchString.empty())
{
this->JumpToCacheEntry(this->OldSearchString.c_str());
}
@@ -1201,7 +1201,7 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr)
int findex = start_index;
for(;;)
{
- if ( str.size() > 0 )
+ if (!str.empty())
{
cmCursesWidget* lbl = 0;
if ( findex >= 0 )
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx
index 8db5078..01598bc 100644
--- a/Source/cmAddSubDirectoryCommand.cxx
+++ b/Source/cmAddSubDirectoryCommand.cxx
@@ -37,7 +37,7 @@ bool cmAddSubDirectoryCommand::InitialPass
excludeFromAll = true;
continue;
}
- else if (!binArg.size())
+ else if (binArg.empty())
{
binArg = *i;
}
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index a2aecac..c24c68e 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -16,6 +16,7 @@
#include <cmsys/Directory.hxx>
#include <cmsys/FStream.hxx>
#include <cm_libarchive.h>
+#include "cm_get_date.h"
//----------------------------------------------------------------------------
static std::string cm_archive_error_string(struct archive* a)
@@ -271,10 +272,26 @@ bool cmArchiveWrite::AddFile(const char* file,
cm_archive_entry_copy_pathname(e, dest);
if(archive_read_disk_entry_from_file(this->Disk, e, -1, 0) != ARCHIVE_OK)
{
- this->Error = "archive_read_disk_entry_from_file: ";
+ this->Error = "archive_read_disk_entry_from_file '";
+ this->Error += file;
+ this->Error += "': ";
this->Error += cm_archive_error_string(this->Disk);
return false;
}
+ if (!this->MTime.empty())
+ {
+ time_t now;
+ time(&now);
+ time_t t = cm_get_date(now, this->MTime.c_str());
+ if (t == -1)
+ {
+ this->Error = "unable to parse mtime '";
+ this->Error += this->MTime;
+ this->Error += "'";
+ return false;
+ }
+ archive_entry_set_mtime(e, t, 0);
+ }
// Clear acl and xattr fields not useful for distribution.
archive_entry_acl_clear(e);
archive_entry_xattr_clear(e);
diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h
index a6dcc0e..17357b4 100644
--- a/Source/cmArchiveWrite.h
+++ b/Source/cmArchiveWrite.h
@@ -74,6 +74,7 @@ public:
// std::cout.
void SetVerbose(bool v) { this->Verbose = v; }
+ void SetMTime(std::string const& t) { this->MTime = t; }
private:
bool Okay() const { return this->Error.empty(); }
bool AddPath(const char* path, size_t skip, const char* prefix);
@@ -90,6 +91,7 @@ private:
struct archive* Disk;
bool Verbose;
std::string Error;
+ std::string MTime;
};
#endif
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index d8c3c43..a30d992 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -61,7 +61,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass
std::string ext = file.substr(dotpos+1);
std::string base = file.substr(0, dotpos);
// Process only source files
- if( base.size() != 0
+ if(!base.empty()
&& std::find( this->Makefile->GetSourceExtensions().begin(),
this->Makefile->GetSourceExtensions().end(), ext )
!= this->Makefile->GetSourceExtensions().end() )
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
index c64209f..171ed0f 100644
--- a/Source/cmBuildNameCommand.cxx
+++ b/Source/cmBuildNameCommand.cxx
@@ -50,7 +50,7 @@ bool cmBuildNameCommand
{
buildname = "";
cmSystemTools::RunSingleCommand("uname -a", &buildname);
- if(buildname.length())
+ if(!buildname.empty())
{
std::string RegExp = "([^ ]*) [^ ]* ([^ ]*) ";
cmsys::RegularExpression reg( RegExp.c_str() );
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 76873ad..1ef4c92 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -212,7 +212,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method,
::curl_easy_setopt(curl, CURLOPT_INFILE, file);
//fall through to append GET fields
case cmCTest::HTTP_GET:
- if(fields.size())
+ if(!fields.empty())
{
url += "?" + fields;
}
@@ -580,7 +580,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
}
tfin.close();
}
- if (tag.size() == 0 || (0 != command) || this->Parts[PartStart])
+ if (tag.empty() || (0 != command) || this->Parts[PartStart])
{
cmCTestLog(this, DEBUG, "TestModel: " << this->GetTestModelString()
<< std::endl);
@@ -772,7 +772,7 @@ bool cmCTest::UpdateCTestConfiguration()
fin.getline(buffer, 1023);
buffer[1023] = 0;
std::string line = cmCTest::CleanString(buffer);
- if(line.size() == 0)
+ if(line.empty())
{
continue;
}
@@ -872,7 +872,7 @@ bool cmCTest::OpenOutputFile(const std::string& path,
bool compress)
{
std::string testingDir = this->BinaryDir + "/Testing";
- if ( path.size() > 0 )
+ if (!path.empty())
{
testingDir += "/" + path;
}
@@ -1067,7 +1067,7 @@ int cmCTest::ProcessTests()
if ( cmSystemTools::FileExists(fullname.c_str()) &&
!cmSystemTools::FileIsDirectory(fullname) )
{
- if ( this->NotesFiles.size() > 0 )
+ if (!this->NotesFiles.empty())
{
this->NotesFiles += ";";
}
@@ -1080,7 +1080,7 @@ int cmCTest::ProcessTests()
if (this->Parts[PartNotes])
{
this->UpdateCTestConfiguration();
- if ( this->NotesFiles.size() )
+ if (!this->NotesFiles.empty())
{
this->GenerateNotesFile(this->NotesFiles.c_str());
}
@@ -1266,7 +1266,7 @@ int cmCTest::RunTest(std::vector<const char*> argv,
std::ostream* log, double testTimeOut,
std::vector<std::string>* environment)
{
- bool modifyEnv = (environment && environment->size()>0);
+ bool modifyEnv = (environment && !environment->empty());
// determine how much time we have
double timeout = this->GetRemainingTimeAllowed() - 120;
@@ -1653,7 +1653,7 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
cmCTestLog(this, OUTPUT, "Create notes file" << std::endl);
files = cmSystemTools::SplitString(cfiles, ';');
- if ( files.size() == 0 )
+ if (files.empty())
{
return 1;
}
@@ -1744,7 +1744,7 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles)
cmCTestLog(this, OUTPUT, "Submit extra files" << std::endl);
files = cmSystemTools::SplitString(cfiles, ';');
- if ( files.size() == 0 )
+ if (files.empty())
{
return 1;
}
@@ -2936,11 +2936,11 @@ bool cmCTest::RunCommand(
}
cmsysProcess_WaitForExit(cp, 0);
- if ( tempOutput.size() > 0 )
+ if (!tempOutput.empty())
{
stdOut->append(&*tempOutput.begin(), tempOutput.size());
}
- if ( tempError.size() > 0 )
+ if (!tempError.empty())
{
stdErr->append(&*tempError.begin(), tempError.size());
}
@@ -3136,7 +3136,7 @@ double cmCTest::GetRemainingTimeAllowed()
void cmCTest::OutputTestErrors(std::vector<char> const &process_output)
{
std::string test_outputs("\n*** Test Failed:\n");
- if(process_output.size())
+ if(!process_output.empty())
{
test_outputs.append(&*process_output.begin(), process_output.size());
}
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 6a47ea7..45e92ce 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -609,7 +609,7 @@ void cmCacheManager::OutputKey(std::ostream& fout, std::string const& key)
void cmCacheManager::OutputValue(std::ostream& fout, std::string const& value)
{
// if value has trailing space or tab, enclose it in single quotes
- if (value.size() &&
+ if (!value.empty() &&
(value[value.size() - 1] == ' ' ||
value[value.size() - 1] == '\t'))
{
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index a34ea71..6689243 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -155,7 +155,7 @@ public:
*/
const char* GetError()
{
- if(this->Error.length() == 0)
+ if(this->Error.empty())
{
this->Error = this->GetName();
this->Error += " unknown error.";
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index f0bae28..32d5cd3 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -676,11 +676,8 @@ void cmComputeLinkDepends::InferDependencies()
}
// Add the inferred dependencies to the graph.
- for(DependSet::const_iterator j = common.begin(); j != common.end(); ++j)
- {
- int dependee_index = *j;
- this->EntryConstraintGraph[depender_index].push_back(dependee_index);
- }
+ cmGraphEdgeList& edges = this->EntryConstraintGraph[depender_index];
+ edges.insert(edges.end(), common.begin(), common.end());
}
}
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 002e75a..60d8dd9 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -201,13 +201,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
else
{
// only valid for srcfile signatures
- if (compileDefs.size())
+ if (!compileDefs.empty())
{
this->Makefile->IssueMessage(cmake::FATAL_ERROR,
"COMPILE_DEFINITIONS specified on a srcdir type TRY_COMPILE");
return -1;
}
- if (copyFile.size())
+ if (!copyFile.empty())
{
this->Makefile->IssueMessage(cmake::FATAL_ERROR,
"COPY_FILE specified on a srcdir type TRY_COMPILE");
@@ -371,7 +371,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
fprintf(fout, "set(CMAKE_SUPPRESS_REGENERATION 1)\n");
fprintf(fout, "link_directories(${LINK_DIRECTORIES})\n");
// handle any compile flags we need to pass on
- if (compileDefs.size())
+ if (!compileDefs.empty())
{
fprintf(fout, "add_definitions( ");
for (size_t i = 0; i < compileDefs.size(); ++i)
@@ -537,7 +537,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
"Result of TRY_COMPILE",
cmCacheManager::INTERNAL);
- if ( outputVariable.size() > 0 )
+ if (!outputVariable.empty())
{
this->Makefile->AddDefinition(outputVariable, output.c_str());
}
@@ -547,7 +547,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
std::string copyFileErrorMessage;
this->FindOutputFile(targetName);
- if ((res==0) && (copyFile.size()))
+ if ((res==0) && !copyFile.empty())
{
if(this->OutputFile.empty() ||
!cmSystemTools::CopyFileAlways(this->OutputFile,
diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx
index 02fb8cb..f93d3df 100644
--- a/Source/cmCreateTestSourceList.cxx
+++ b/Source/cmCreateTestSourceList.cxx
@@ -101,7 +101,7 @@ bool cmCreateTestSourceList
break;
}
std::string func_name;
- if (cmSystemTools::GetFilenamePath(*i).size() > 0)
+ if (!cmSystemTools::GetFilenamePath(*i).empty())
{
func_name = cmSystemTools::GetFilenamePath(*i) + "/" +
cmSystemTools::GetFilenameWithoutLastExtension(*i);
@@ -126,7 +126,7 @@ bool cmCreateTestSourceList
for(i = testsBegin, j = tests_func_name.begin(); i != tests.end(); ++i, ++j)
{
std::string func_name;
- if (cmSystemTools::GetFilenamePath(*i).size() > 0)
+ if (!cmSystemTools::GetFilenamePath(*i).empty())
{
func_name = cmSystemTools::GetFilenamePath(*i) + "/" +
cmSystemTools::GetFilenameWithoutLastExtension(*i);
@@ -145,12 +145,12 @@ bool cmCreateTestSourceList
" },\n";
numTests++;
}
- if(extraInclude.size())
+ if(!extraInclude.empty())
{
this->Makefile->AddDefinition("CMAKE_TESTDRIVER_EXTRA_INCLUDES",
extraInclude.c_str());
}
- if(function.size())
+ if(!function.empty())
{
this->Makefile->AddDefinition("CMAKE_TESTDRIVER_ARGVC_FUNCTION",
function.c_str());
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 5ae065e..6dde349 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -285,7 +285,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
//----------------------------------------------------------------------------
void cmDependsC::ReadCacheFile()
{
- if(this->CacheFileName.size() == 0)
+ if(this->CacheFileName.empty())
{
return;
}
@@ -374,7 +374,7 @@ void cmDependsC::ReadCacheFile()
//----------------------------------------------------------------------------
void cmDependsC::WriteCacheFile() const
{
- if(this->CacheFileName.size() == 0)
+ if(this->CacheFileName.empty())
{
return;
}
diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx
index 02f2d21..3c02325 100644
--- a/Source/cmDependsJavaParserHelper.cxx
+++ b/Source/cmDependsJavaParserHelper.cxx
@@ -226,7 +226,7 @@ void cmDependsJavaParserHelper::EndClass()
{
CurrentClass* parent = 0;
CurrentClass* current = 0;
- if ( this->ClassStack.size() > 0 )
+ if (!this->ClassStack.empty())
{
current = &(*(this->ClassStack.end() - 1));
if ( this->ClassStack.size() > 1 )
@@ -251,7 +251,7 @@ void cmDependsJavaParserHelper::EndClass()
void cmDependsJavaParserHelper::PrintClasses()
{
- if ( this->ClassStack.size() == 0 )
+ if (this->ClassStack.empty())
{
std::cerr << "Error when parsing. No classes on class stack" << std::endl;
abort();
@@ -305,13 +305,13 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
if ( verb )
{
- if ( this->CurrentPackage.size() > 0 )
+ if (!this->CurrentPackage.empty())
{
std::cout << "Current package is: " <<
this->CurrentPackage << std::endl;
}
std::cout << "Imports packages:";
- if ( this->PackagesImport.size() > 0 )
+ if (!this->PackagesImport.empty())
{
std::vector<std::string>::iterator it;
for ( it = this->PackagesImport.begin();
@@ -323,7 +323,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
}
std::cout << std::endl;
std::cout << "Depends on:";
- if ( this->ClassesFound.size() > 0 )
+ if (!this->ClassesFound.empty())
{
std::vector<std::string>::iterator it;
for ( it = this->ClassesFound.begin();
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index a268d12..f4e3a75 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -162,7 +162,7 @@ bool cmDocumentation::PrintRequestedDocumentation(std::ostream& os)
// given stream.
cmsys::ofstream* fout = 0;
std::ostream* s = &os;
- if(i->Filename.length() > 0)
+ if(!i->Filename.empty())
{
fout = new cmsys::ofstream(i->Filename.c_str(), std::ios::out);
if(fout)
@@ -877,7 +877,7 @@ bool cmDocumentation::PrintHelp(std::ostream& os)
//----------------------------------------------------------------------------
const char* cmDocumentation::GetNameString() const
{
- if(this->NameString.length() > 0)
+ if(!this->NameString.empty())
{
return this->NameString.c_str();
}
diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx
index 29c806d..4de59c0 100644
--- a/Source/cmDocumentationFormatter.cxx
+++ b/Source/cmDocumentationFormatter.cxx
@@ -46,7 +46,7 @@ void cmDocumentationFormatter::PrintFormatted(std::ostream& os,
preformatted.append(1, '\n');
}
}
- if(preformatted.length())
+ if(!preformatted.empty())
{
this->PrintPreformatted(os, preformatted.c_str());
}
@@ -62,7 +62,7 @@ void cmDocumentationFormatter::PrintFormatted(std::ostream& os,
++ptr;
paragraph.append(1, '\n');
}
- if(paragraph.length())
+ if(!paragraph.empty())
{
this->PrintParagraph(os, paragraph.c_str());
}
@@ -201,7 +201,7 @@ void cmDocumentationFormatter
for(std::vector<cmDocumentationEntry>::const_iterator op = entries.begin();
op != entries.end(); ++op)
{
- if(op->Name.size())
+ if(!op->Name.empty())
{
os << " " << op->Name;
this->TextIndent = " ";
diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx
index 9b59088..e021d0b 100644
--- a/Source/cmExecProgramCommand.cxx
+++ b/Source/cmExecProgramCommand.cxx
@@ -41,7 +41,7 @@ bool cmExecProgramCommand
}
else if ( haveoutput_variable )
{
- if ( output_variable.size() > 0 )
+ if (!output_variable.empty())
{
this->SetError("called with incorrect number of arguments");
return false;
@@ -59,7 +59,7 @@ bool cmExecProgramCommand
}
else if ( havereturn_variable )
{
- if ( return_variable.size() > 0 )
+ if (!return_variable.empty())
{
this->SetError("called with incorrect number of arguments");
return false;
@@ -84,7 +84,7 @@ bool cmExecProgramCommand
}
std::string command;
- if(arguments.size())
+ if(!arguments.empty())
{
command = cmSystemTools::ConvertToRunCommandPath(args[0].c_str());
command += " ";
@@ -95,7 +95,7 @@ bool cmExecProgramCommand
command = args[0];
}
bool verbose = true;
- if(output_variable.size() > 0)
+ if(!output_variable.empty())
{
verbose = false;
}
@@ -118,7 +118,7 @@ bool cmExecProgramCommand
retVal = -1;
}
- if ( output_variable.size() > 0 )
+ if (!output_variable.empty())
{
std::string::size_type first = output.find_first_not_of(" \n\t\r");
std::string::size_type last = output.find_last_not_of(" \n\t\r");
@@ -135,7 +135,7 @@ bool cmExecProgramCommand
this->Makefile->AddDefinition(output_variable, coutput.c_str());
}
- if ( return_variable.size() > 0 )
+ if (!return_variable.empty())
{
char buffer[100];
sprintf(buffer, "%d", retVal);
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index 0707906..1225992 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -324,12 +324,12 @@ bool cmExecuteProcessCommand
error_strip_trailing_whitespace);
// Store the output obtained.
- if(!output_variable.empty() && tempOutput.size())
+ if(!output_variable.empty() && !tempOutput.empty())
{
this->Makefile->AddDefinition(output_variable,
&*tempOutput.begin());
}
- if(!merge_output && !error_variable.empty() && tempError.size())
+ if(!merge_output && !error_variable.empty() && !tempError.empty())
{
this->Makefile->AddDefinition(error_variable,
&*tempError.begin());
diff --git a/Source/cmExportSetMap.cxx b/Source/cmExportSetMap.cxx
index 5174118..14c4458 100644
--- a/Source/cmExportSetMap.cxx
+++ b/Source/cmExportSetMap.cxx
@@ -25,12 +25,7 @@ cmExportSet* cmExportSetMap::operator[](const std::string &name)
void cmExportSetMap::clear()
{
- for(std::map<std::string, cmExportSet*>::iterator it = this->begin();
- it != this->end();
- ++ it)
- {
- delete it->second;
- }
+ cmDeleteAll(*this);
this->derived::clear();
}
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 2f69882..d64b0d7 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -62,6 +62,7 @@ void cmExtraEclipseCDT4Generator
if (*lit == "CXX")
{
this->Natures.insert("org.eclipse.cdt.core.ccnature");
+ this->Natures.insert("org.eclipse.cdt.core.cnature");
}
else if (*lit == "C")
{
@@ -1179,7 +1180,7 @@ std::string
cmExtraEclipseCDT4Generator::GetPathBasename(const std::string& path)
{
std::string outputBasename = path;
- while (outputBasename.size() > 0 &&
+ while (!outputBasename.empty() &&
(outputBasename[outputBasename.size() - 1] == '/' ||
outputBasename[outputBasename.size() - 1] == '\\'))
{
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index 567542e..9645d0e 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -334,7 +334,7 @@ std::string cmExtraKateGenerator::GenerateProjectName(const std::string& name,
std::string cmExtraKateGenerator::GetPathBasename(const std::string& path)const
{
std::string outputBasename = path;
- while (outputBasename.size() > 0 &&
+ while (!outputBasename.empty() &&
(outputBasename[outputBasename.size() - 1] == '/' ||
outputBasename[outputBasename.size() - 1] == '\\'))
{
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 0306f18..2c92db2 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -336,14 +336,14 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args)
// is there a limit?
long sizeLimit = -1;
- if (limitArg.GetString().size() > 0)
+ if (!limitArg.GetString().empty())
{
sizeLimit = atoi(limitArg.GetCString());
}
// is there an offset?
long offset = 0;
- if (offsetArg.GetString().size() > 0)
+ if (!offsetArg.GetString().empty())
{
offset = atoi(offsetArg.GetCString());
}
@@ -745,7 +745,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
// A non-string character has been found. Check if the current
// string matches the requirements. We require that the length
// be at least one no matter what the user specified.
- if(s.length() >= minlen && s.length() >= 1 &&
+ if(s.length() >= minlen && !s.empty() &&
(!have_regex || regex.find(s.c_str())))
{
output_size += static_cast<int>(s.size()) + 1;
@@ -899,7 +899,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
{
std::string expr = this->Makefile->GetCurrentDirectory();
// Handle script mode
- if ( expr.size() > 0 )
+ if (!expr.empty())
{
expr += "/" + *i;
g.FindFiles(expr);
@@ -2992,7 +2992,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
msg = "returning early; file already exists with expected ";
msg += hashMatchMSG;
msg += "\"";
- if(statusVar.size())
+ if(!statusVar.empty())
{
std::ostringstream result;
result << (int)0 << ";\"" << msg;
@@ -3085,7 +3085,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
check_curl_result(res, "DOWNLOAD cannot set follow-redirect option: ");
- if(verboseLog.size())
+ if(!verboseLog.empty())
{
res = ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
check_curl_result(res, "DOWNLOAD cannot set verbose: ");
@@ -3131,7 +3131,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
g_curl.release();
::curl_easy_cleanup(curl);
- if(statusVar.size())
+ if(!statusVar.empty())
{
std::ostringstream result;
result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\"";
@@ -3151,7 +3151,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
if (hash.get())
{
std::string actualHash = hash->HashFile(file);
- if (actualHash.size() == 0)
+ if (actualHash.empty())
{
this->SetError("DOWNLOAD cannot compute hash on downloaded file");
return false;
@@ -3172,14 +3172,14 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
}
}
- if(chunkDebug.size())
+ if(!chunkDebug.empty())
{
chunkDebug.push_back(0);
if(CURLE_OPERATION_TIMEOUTED == res)
{
std::string output = &*chunkDebug.begin();
- if(verboseLog.size())
+ if(!verboseLog.empty())
{
this->Makefile->AddDefinition(verboseLog,
&*chunkDebug.begin());
@@ -3335,7 +3335,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
check_curl_result(res, "UPLOAD cannot set follow-redirect option: ");
- if(logVar.size())
+ if(!logVar.empty())
{
res = ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
check_curl_result(res, "UPLOAD cannot set verbose: ");
@@ -3390,7 +3390,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
g_curl.release();
::curl_easy_cleanup(curl);
- if(statusVar.size())
+ if(!statusVar.empty())
{
std::ostringstream result;
result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\"";
@@ -3403,11 +3403,11 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
fclose(fin);
fin = NULL;
- if(logVar.size())
+ if(!logVar.empty())
{
std::string log;
- if(chunkResponse.size())
+ if(!chunkResponse.empty())
{
chunkResponse.push_back(0);
log += "Response:\n";
@@ -3415,7 +3415,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
log += "\n";
}
- if(chunkDebug.size())
+ if(!chunkDebug.empty())
{
chunkDebug.push_back(0);
log += "Debug:\n";
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index 013724e..69991d5 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -152,10 +152,10 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
}
}
- if(this->VariableDocumentation.size() == 0)
+ if(this->VariableDocumentation.empty())
{
this->VariableDocumentation = "Where can ";
- if(this->Names.size() == 0)
+ if(this->Names.empty())
{
this->VariableDocumentation += "the (unknown) library be found";
}
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 72737b7..7746980 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -622,7 +622,7 @@ bool cmFindPackageCommand::FindModule(bool& found)
module += this->Name;
module += ".cmake";
std::string mfile = this->Makefile->GetModulesFile(module.c_str());
- if ( mfile.size() )
+ if (!mfile.empty())
{
// Load the module we found, and set "<name>_FIND_MODULE" to true
// while inside it.
@@ -763,7 +763,7 @@ bool cmFindPackageCommand::HandlePackageMode()
}
// If there are files in ConsideredConfigs, it means that FooConfig.cmake
// have been found, but they didn't have appropriate versions.
- else if (this->ConsideredConfigs.size() > 0)
+ else if (!this->ConsideredConfigs.empty())
{
e << "Could not find a configuration file for package \""
<< this->Name << "\" that "
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx
index f4cc4c2..49fbf45 100644
--- a/Source/cmFindPathCommand.cxx
+++ b/Source/cmFindPathCommand.cxx
@@ -48,7 +48,7 @@ bool cmFindPathCommand
}
std::string result = this->FindHeader();
- if(result.size() != 0)
+ if(!result.empty())
{
this->Makefile->AddCacheDefinition
(this->VariableName, result.c_str(),
@@ -108,7 +108,7 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file,
fileName = file;
frameWorkName = "";
}
- if(frameWorkName.size())
+ if(!frameWorkName.empty())
{
std::string fpath = dir;
fpath += frameWorkName;
@@ -134,7 +134,7 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file,
cmsys::Glob globIt;
globIt.FindFiles(glob);
std::vector<std::string> files = globIt.GetFiles();
- if(files.size())
+ if(!files.empty())
{
std::string fheader = cmSystemTools::CollapseFullPath(files[0]);
if(this->IncludeFileInPath)
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index b213e80..c33048c 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -132,14 +132,14 @@ bool cmFunctionHelperCommand::InvokeInitialPass
unsigned int cnt = 0;
for ( eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit )
{
- if ( argvDef.size() > 0 )
+ if (!argvDef.empty())
{
argvDef += ";";
}
argvDef += *eit;
if ( cnt >= this->Args.size()-1 )
{
- if ( argnDef.size() > 0 )
+ if (!argnDef.empty())
{
argnDef += ";";
}
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index b2a2386..bf96951 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -98,12 +98,8 @@ const char *cmCompiledGeneratorExpression::Evaluate(
{
this->Output += (*it)->Evaluate(&context, dagChecker);
- for(std::set<std::string>::const_iterator
- p = context.SeenTargetProperties.begin();
- p != context.SeenTargetProperties.end(); ++p)
- {
- this->SeenTargetProperties.insert(*p);
- }
+ this->SeenTargetProperties.insert(context.SeenTargetProperties.begin(),
+ context.SeenTargetProperties.end());
if (context.HadError)
{
this->Output = "";
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 3b1e9c2..5f246f9 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -429,7 +429,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
{
const char *compilerId =
context->Makefile->GetSafeDefinition("CMAKE_" + lang + "_COMPILER_ID");
- if (parameters.size() == 0)
+ if (parameters.empty())
{
return compilerId ? compilerId : "";
}
@@ -534,7 +534,7 @@ struct CompilerVersionNode : public cmGeneratorExpressionNode
{
const char *compilerVersion = context->Makefile->GetSafeDefinition(
"CMAKE_" + lang + "_COMPILER_VERSION");
- if (parameters.size() == 0)
+ if (parameters.empty())
{
return compilerVersion ? compilerVersion : "";
}
@@ -616,7 +616,7 @@ struct PlatformIdNode : public cmGeneratorExpressionNode
{
const char *platformId =
context->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME");
- if (parameters.size() == 0)
+ if (parameters.empty())
{
return platformId ? platformId : "";
}
diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx
index ec15daf..a17da8c 100644
--- a/Source/cmGeneratorExpressionParser.cxx
+++ b/Source/cmGeneratorExpressionParser.cxx
@@ -39,7 +39,7 @@ void cmGeneratorExpressionParser::Parse(
static void extendText(std::vector<cmGeneratorExpressionEvaluator*> &result,
std::vector<cmGeneratorExpressionToken>::const_iterator it)
{
- if (result.size() > 0
+ if (!result.empty()
&& (*(result.end() - 1))->GetType()
== cmGeneratorExpressionEvaluator::Text)
{
@@ -57,7 +57,7 @@ static void extendText(std::vector<cmGeneratorExpressionEvaluator*> &result,
static void extendResult(std::vector<cmGeneratorExpressionEvaluator*> &result,
const std::vector<cmGeneratorExpressionEvaluator*> &contents)
{
- if (result.size() > 0
+ if (!result.empty()
&& (*(result.end() - 1))->GetType()
== cmGeneratorExpressionEvaluator::Text
&& (*contents.begin())->GetType()
@@ -256,7 +256,7 @@ void cmGeneratorExpressionParser::ParseContent(
{
if (this->NestingLevel == 0)
{
- if (result.size() > 0
+ if (!result.empty()
&& (*(result.end() - 1))->GetType()
== cmGeneratorExpressionEvaluator::Text)
{
diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx
index e88f498..e193cf5 100644
--- a/Source/cmGetCMakePropertyCommand.cxx
+++ b/Source/cmGetCMakePropertyCommand.cxx
@@ -33,7 +33,7 @@ bool cmGetCMakePropertyCommand
{
int cacheonly = 0;
std::vector<std::string> vars = this->Makefile->GetDefinitions(cacheonly);
- if (vars.size()>0)
+ if (!vars.empty())
{
output = vars[0];
}
diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx
index e7d2857..9aceb39 100644
--- a/Source/cmGetFilenameComponentCommand.cxx
+++ b/Source/cmGetFilenameComponentCommand.cxx
@@ -113,7 +113,7 @@ bool cmGetFilenameComponentCommand
if(args.size() == 4 && args[3] == "CACHE")
{
- if(programArgs.size() && storeArgs.size())
+ if(!programArgs.empty() && !storeArgs.empty())
{
this->Makefile->AddCacheDefinition
(storeArgs, programArgs.c_str(),
@@ -127,7 +127,7 @@ bool cmGetFilenameComponentCommand
}
else
{
- if(programArgs.size() && storeArgs.size())
+ if(!programArgs.empty() && !storeArgs.empty())
{
this->Makefile->AddDefinition(storeArgs, programArgs.c_str());
}
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index d17710e..dd3b1ec 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -38,6 +38,8 @@
#if defined(CMAKE_BUILD_WITH_CMAKE)
# include <cmsys/MD5.h>
+# include "cm_jsoncpp_value.h"
+# include "cm_jsoncpp_writer.h"
#endif
#include <stdlib.h> // required for atof
@@ -174,7 +176,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang,
{
path = name;
}
- if((path.size() == 0 || !cmSystemTools::FileExists(path.c_str()))
+ if((path.empty() || !cmSystemTools::FileExists(path.c_str()))
&& (optional==false))
{
return;
@@ -265,7 +267,7 @@ cmGlobalGenerator::IsExportedTargetsFile(const std::string &filename) const
// Find the make program for the generator, required for try compiles
void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
{
- if(this->FindMakeProgramFile.size() == 0)
+ if(this->FindMakeProgramFile.empty())
{
cmSystemTools::Error(
"Generator implementation error, "
@@ -276,7 +278,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
{
std::string setMakeProgram =
mf->GetModulesFile(this->FindMakeProgramFile.c_str());
- if(setMakeProgram.size())
+ if(!setMakeProgram.empty())
{
mf->ReadListFile(0, setMakeProgram.c_str());
}
@@ -383,7 +385,7 @@ void
cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *mf, bool optional)
{
- if(languages.size() == 0)
+ if(languages.empty())
{
cmSystemTools::Error("EnableLanguage must have a lang specified!");
cmSystemTools::SetFatalErrorOccured();
@@ -426,7 +428,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
// If the configuration files path has been set,
// then we are in a try compile and need to copy the enable language
// files from the parent cmake bin dir, into the try compile bin dir
- if(this->ConfiguredFilesPath.size())
+ if(!this->ConfiguredFilesPath.empty())
{
rootBin = this->ConfiguredFilesPath;
}
@@ -1510,11 +1512,7 @@ void cmGlobalGenerator::CreateGeneratorTargets()
//----------------------------------------------------------------------------
void cmGlobalGenerator::ClearGeneratorMembers()
{
- for(cmGeneratorTargetsType::iterator i = this->GeneratorTargets.begin();
- i != this->GeneratorTargets.end(); ++i)
- {
- delete i->second;
- }
+ cmDeleteAll(this->GeneratorTargets);
this->GeneratorTargets.clear();
cmDeleteAll(this->EvaluationFiles);
@@ -1636,7 +1634,7 @@ void cmGlobalGenerator::CheckLocalGenerators()
static_cast<float>(this->LocalGenerators.size()));
}
- if(notFoundMap.size())
+ if(!notFoundMap.empty())
{
std::string notFoundVars;
for(std::map<std::string, std::string>::const_iterator
@@ -2318,7 +2316,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
cpackCommandLines.end());
depends.erase(depends.begin(), depends.end());
std::ostringstream ostr;
- if ( componentsSet->size() > 0 )
+ if (!componentsSet->empty())
{
ostr << "Available install components are:";
std::set<std::string>::iterator it;
@@ -2460,19 +2458,19 @@ void cmGlobalGenerator::EnableMinGWLanguage(cmMakefile *mf)
locations.push_back("c:/mingw/bin");
std::string tgcc = cmSystemTools::FindProgram("gcc", locations);
std::string gcc = "gcc.exe";
- if(tgcc.size())
+ if(!tgcc.empty())
{
gcc = tgcc;
}
std::string tgxx = cmSystemTools::FindProgram("g++", locations);
std::string gxx = "g++.exe";
- if(tgxx.size())
+ if(!tgxx.empty())
{
gxx = tgxx;
}
std::string trc = cmSystemTools::FindProgram("windres", locations);
std::string rc = "windres.exe";
- if(trc.size())
+ if(!trc.empty())
{
rc = trc;
}
@@ -2915,10 +2913,21 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
std::string dir = target->GetSupportDirectory();
std::string file = dir;
file += "/Labels.txt";
+ std::string json_file = dir + "/Labels.json";
+#ifdef CMAKE_BUILD_WITH_CMAKE
// Check whether labels are enabled for this target.
if(const char* value = target->GetProperty("LABELS"))
{
+ Json::Value lj_root(Json::objectValue);
+ Json::Value& lj_target =
+ lj_root["target"] = Json::objectValue;
+ lj_target["name"] = target->GetName();
+ Json::Value& lj_target_labels =
+ lj_target["labels"] = Json::arrayValue;
+ Json::Value& lj_sources =
+ lj_root["sources"] = Json::arrayValue;
+
cmSystemTools::MakeDirectory(dir.c_str());
cmGeneratedFileStream fout(file.c_str());
@@ -2933,6 +2942,7 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
li != labels.end(); ++li)
{
fout << " " << *li << "\n";
+ lj_target_labels.append(*li);
}
}
@@ -2958,23 +2968,33 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target)
{
continue;
}
+ Json::Value& lj_source = lj_sources.append(Json::objectValue);
cmSourceFile* sf = *si;
- fout << sf->GetFullPath() << "\n";
+ std::string const& sfp = sf->GetFullPath();
+ fout << sfp << "\n";
+ lj_source["file"] = sfp;
if(const char* svalue = sf->GetProperty("LABELS"))
{
labels.clear();
+ Json::Value& lj_source_labels =
+ lj_source["labels"] = Json::arrayValue;
cmSystemTools::ExpandListArgument(svalue, labels);
for(std::vector<std::string>::const_iterator li = labels.begin();
li != labels.end(); ++li)
{
fout << " " << *li << "\n";
+ lj_source_labels.append(*li);
}
}
}
+ cmGeneratedFileStream json_fout(json_file.c_str());
+ json_fout << lj_root;
}
else
+#endif
{
cmSystemTools::RemoveFile(file);
+ cmSystemTools::RemoveFile(json_file);
}
}
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index ee0c583..b9c01fa 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -236,7 +236,7 @@ bool cmGlobalKdevelopGenerator
// make it relative to the project dir
cmSystemTools::ReplaceString(tmp, projectDir.c_str(), "");
// only put relative paths
- if (tmp.size() && tmp[0] != '/')
+ if (!tmp.empty() && tmp[0] != '/')
{
fout << tmp.c_str() <<"\n";
}
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 1f08629..5f1bb83 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -572,7 +572,7 @@ void cmGlobalUnixMakefileGenerator3
if (!targetName.empty())
{
cmLocalUnixMakefileGenerator3 *lg;
- if (this->LocalGenerators.size())
+ if (!this->LocalGenerators.empty())
{
lg = static_cast<cmLocalUnixMakefileGenerator3 *>
(this->LocalGenerators[0]);
@@ -597,7 +597,7 @@ void cmGlobalUnixMakefileGenerator3
tname = lg->Convert(tname,cmLocalGenerator::HOME_OUTPUT);
cmSystemTools::ConvertToOutputSlashes(tname);
makeCommand.push_back(tname);
- if (!this->LocalGenerators.size())
+ if (this->LocalGenerators.empty())
{
delete lg;
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 8831a8b..b6c428b 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -969,16 +969,40 @@ struct cmSourceFilePathCompare
};
//----------------------------------------------------------------------------
-void
+struct cmCompareTargets
+{
+ bool operator () (std::string const& a, std::string const& b) const
+ {
+ if (a == "ALL_BUILD")
+ {
+ return true;
+ }
+ if (b == "ALL_BUILD")
+ {
+ return false;
+ }
+ return strcmp(a.c_str(), b.c_str()) < 0;
+ }
+};
+
+//----------------------------------------------------------------------------
+bool
cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
std::vector<cmXCodeObject*>&
targets)
{
this->SetCurrentLocalGenerator(gen);
cmTargets &tgts = this->CurrentMakefile->GetTargets();
+ typedef std::map<std::string, cmTarget*, cmCompareTargets> cmSortedTargets;
+ cmSortedTargets sortedTargets;
for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++)
{
- cmTarget& cmtarget = l->second;
+ sortedTargets[l->first] = &l->second;
+ }
+ for(cmSortedTargets::iterator l = sortedTargets.begin();
+ l != sortedTargets.end(); l++)
+ {
+ cmTarget& cmtarget = *l->second;
cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget);
// make sure ALL_BUILD, INSTALL, etc are only done once
@@ -995,7 +1019,12 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
if(cmtarget.GetType() == cmTarget::UTILITY ||
cmtarget.GetType() == cmTarget::GLOBAL_TARGET)
{
- targets.push_back(this->CreateUtilityTarget(cmtarget));
+ cmXCodeObject* t = this->CreateUtilityTarget(cmtarget);
+ if (!t)
+ {
+ return false;
+ }
+ targets.push_back(t);
continue;
}
@@ -1003,7 +1032,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
std::vector<cmSourceFile*> classes;
if (!cmtarget.GetConfigCommonSourceFiles(classes))
{
- return;
+ return false;
}
std::sort(classes.begin(), classes.end(), cmSourceFilePathCompare());
@@ -1230,6 +1259,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
targets.push_back(this->CreateXCodeTarget(cmtarget, buildPhases));
}
+ return true;
}
//----------------------------------------------------------------------------
@@ -2906,7 +2936,7 @@ void cmGlobalXCodeGenerator
}
//----------------------------------------------------------------------------
-void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
+bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>&
generators)
{
@@ -2949,7 +2979,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
std::vector<cmSourceFile*> classes;
if (!cmtarget.GetConfigCommonSourceFiles(classes))
{
- return;
+ return false;
}
// Put cmSourceFile instances in proper groups:
for(std::vector<cmSourceFile*>::const_iterator s = classes.begin();
@@ -2982,6 +3012,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
}
}
}
+ return true;
}
cmXCodeObject *cmGlobalXCodeGenerator
@@ -3102,7 +3133,7 @@ cmXCodeObject* cmGlobalXCodeGenerator
}
//----------------------------------------------------------------------------
-void cmGlobalXCodeGenerator
+bool cmGlobalXCodeGenerator
::CreateXCodeObjects(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>&
generators)
@@ -3183,7 +3214,10 @@ void cmGlobalXCodeGenerator
this->MainGroupChildren->AddObject(resourcesGroup);
// now create the cmake groups
- this->CreateGroups(root, generators);
+ if (!this->CreateGroups(root, generators))
+ {
+ return false;
+ }
cmXCodeObject* productGroup = this->CreateObject(cmXCodeObject::PBXGroup);
productGroup->AddAttribute("name", this->CreateString("Products"));
@@ -3383,7 +3417,10 @@ void cmGlobalXCodeGenerator
{
if(!this->IsExcluded(root, *i))
{
- this->CreateXCodeTargets(*i, targets);
+ if (!this->CreateXCodeTargets(*i, targets))
+ {
+ return false;
+ }
}
}
// loop over all targets and add link and depend info
@@ -3412,6 +3449,7 @@ void cmGlobalXCodeGenerator
}
}
this->RootObject->AddAttribute("targets", allTargets);
+ return true;
}
//----------------------------------------------------------------------------
@@ -3598,8 +3636,10 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
}
}
- this->CreateXCodeObjects(root,
- generators);
+ if (!this->CreateXCodeObjects(root, generators))
+ {
+ return;
+ }
std::string xcodeDir = root->GetMakefile()->GetStartOutputDirectory();
xcodeDir += "/";
xcodeDir += root->GetMakefile()->GetProjectName();
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index f38435e..a39c8c7 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -91,7 +91,7 @@ private:
cmSourceGroup* sg);
cmXCodeObject* CreatePBXGroup(cmXCodeObject *parent,
std::string name);
- void CreateGroups(cmLocalGenerator* root,
+ bool CreateGroups(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>&
generators);
std::string XCodeEscapePath(const char* p);
@@ -150,7 +150,7 @@ private:
std::string ExtractFlag(const char* flag, std::string& flags);
// delete all objects in the this->XCodeObjects vector.
void ClearXCodeObjects();
- void CreateXCodeObjects(cmLocalGenerator* root,
+ bool CreateXCodeObjects(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
void OutputXCodeProject(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
@@ -169,7 +169,7 @@ private:
cmXCodeObject* CreateXCodeSourceFile(cmLocalGenerator* gen,
cmSourceFile* sf,
cmTarget& cmtarget);
- void CreateXCodeTargets(cmLocalGenerator* gen,
+ bool CreateXCodeTargets(cmLocalGenerator* gen,
std::vector<cmXCodeObject*>&);
bool IsHeaderFile(cmSourceFile*);
void AddDependTarget(cmXCodeObject* target,
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index 11a5466..af88d1c 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -125,7 +125,7 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
__set_if_set(ignoreTargetsRegexes, "GRAPHVIZ_IGNORE_TARGETS");
this->TargetsToIgnoreRegex.clear();
- if (ignoreTargetsRegexes.size() > 0)
+ if (!ignoreTargetsRegexes.empty())
{
std::vector<std::string> ignoreTargetsRegExVector;
cmSystemTools::ExpandListArgument(ignoreTargetsRegexes,
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index b8e30b7..3362abb 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -116,7 +116,7 @@ IsFunctionBlocked(const cmListFileFunction& lff,
bool isTrue = conditionEvaluator.IsTrue(
expandedArguments, errorString, messType);
- if (errorString.size())
+ if (!errorString.empty())
{
std::string err = cmIfCommandError(&mf, expandedArguments);
err += errorString;
@@ -177,7 +177,7 @@ bool cmIfFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
{
// if the endif has arguments, then make sure
// they match the arguments of the matching if
- if (lff.Arguments.size() == 0 ||
+ if (lff.Arguments.empty() ||
lff.Arguments == this->Args)
{
return true;
@@ -204,7 +204,7 @@ bool cmIfCommand
bool isTrue = conditionEvaluator.IsTrue(
expandedArguments, errorString, status);
- if (errorString.size())
+ if (!errorString.empty())
{
std::string err = cmIfCommandError(this->Makefile, expandedArguments);
err += errorString;
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index 9d44db1..c15d46e 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -40,7 +40,7 @@ bool cmIncludeCommand
}
else if(args[i] == "RESULT_VARIABLE")
{
- if (resultVarName.size() > 0)
+ if (!resultVarName.empty())
{
this->SetError("called with invalid arguments: "
"only one result variable allowed");
@@ -83,7 +83,7 @@ bool cmIncludeCommand
std::string module = fname;
module += ".cmake";
std::string mfile = this->Makefile->GetModulesFile(module.c_str());
- if ( mfile.size() )
+ if (!mfile.empty())
{
fname = mfile.c_str();
}
@@ -137,7 +137,7 @@ bool cmIncludeCommand
noPolicyScope);
// add the location of the included file if a result variable was given
- if (resultVarName.size())
+ if (!resultVarName.empty())
{
this->Makefile->AddDefinition(resultVarName,
readit?fullFilePath.c_str():"NOTFOUND");
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index f37d8bc..464b4c2 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -47,7 +47,7 @@ bool cmIncludeDirectoryCommand
system = true;
continue;
}
- if(i->size() == 0)
+ if(i->empty())
{
this->SetError("given empty-string as include directory.");
return false;
diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx
index a007693..06a78e5 100644
--- a/Source/cmInstallFilesCommand.cxx
+++ b/Source/cmInstallFilesCommand.cxx
@@ -80,7 +80,7 @@ void cmInstallFilesCommand::FinalPass()
{
// replace any variables
std::string temps = *s;
- if (cmSystemTools::GetFilenamePath(temps).size() > 0)
+ if (!cmSystemTools::GetFilenamePath(temps).empty())
{
testf = cmSystemTools::GetFilenamePath(temps) + "/" +
cmSystemTools::GetFilenameWithoutLastExtension(temps) + ext;
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 8701b73..6d69f54 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -523,7 +523,7 @@ cmInstallTargetGenerator
std::string installNameTool =
this->Target->GetMakefile()->GetSafeDefinition("CMAKE_INSTALL_NAME_TOOL");
- if(!installNameTool.size())
+ if(installNameTool.empty())
{
return;
}
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index c3f0f57..107dca9 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -98,7 +98,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list,
return false;
}
// if the size of the list
- if(listString.size() == 0)
+ if(listString.empty())
{
return true;
}
@@ -109,7 +109,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list,
for(std::vector<std::string>::iterator i = list.begin();
i != list.end(); ++i)
{
- if(i->size() == 0)
+ if(i->empty())
{
hasEmpty = true;
break;
@@ -257,7 +257,7 @@ bool cmListCommand::HandleAppendCommand(std::vector<std::string> const& args)
size_t cc;
for ( cc = 2; cc < args.size(); ++ cc )
{
- if(listString.size())
+ if(!listString.empty())
{
listString += ";";
}
@@ -328,7 +328,7 @@ bool cmListCommand::HandleInsertCommand(std::vector<std::string> const& args)
return false;
}
- if ( varArgsExpanded.size() != 0 )
+ if (!varArgsExpanded.empty())
{
size_t nitem = varArgsExpanded.size();
if ( item < 0 )
@@ -340,18 +340,14 @@ bool cmListCommand::HandleInsertCommand(std::vector<std::string> const& args)
std::ostringstream str;
str << "index: " << item << " out of range (-"
<< varArgsExpanded.size() << ", "
- << (varArgsExpanded.size() == 0?0:(varArgsExpanded.size()-1)) << ")";
+ << (varArgsExpanded.empty() ? 0 : (varArgsExpanded.size() - 1)) << ")";
this->SetError(str.str());
return false;
}
}
- size_t cc;
- size_t cnt = 0;
- for ( cc = 3; cc < args.size(); ++ cc )
- {
- varArgsExpanded.insert(varArgsExpanded.begin()+item+cnt, args[cc]);
- cnt ++;
- }
+
+ varArgsExpanded.insert(varArgsExpanded.begin()+item,
+ args.begin() + 3, args.end());
std::string value = cmJoin(varArgsExpanded, ";");
this->Makefile->AddDefinition(listName, value.c_str());
diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx
index 427e29d..93aec32 100644
--- a/Source/cmLoadCacheCommand.cxx
+++ b/Source/cmLoadCacheCommand.cxx
@@ -110,10 +110,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args)
// Prepare the table of variables to read.
this->Prefix = args[2];
- for(unsigned int i=3; i < args.size(); ++i)
- {
- this->VariablesToRead.insert(args[i]);
- }
+ this->VariablesToRead.insert(args.begin() + 3, args.end());
// Read the cache file.
cmsys::ifstream fin(cacheFile.c_str());
@@ -160,7 +157,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector<std::string> const& args)
}
}
}
- if(line.length())
+ if(!line.empty())
{
// Partial last line.
this->CheckLine(line.c_str());
@@ -184,7 +181,7 @@ void cmLoadCacheCommand::CheckLine(const char* line)
// This was requested. Set this variable locally with the given
// prefix.
var = this->Prefix + var;
- if(value.length())
+ if(!value.empty())
{
this->Makefile->AddDefinition(var, value.c_str());
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 7b54b88..834f705 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -335,7 +335,7 @@ void cmLocalGenerator::GenerateTestFiles()
{
(*gi)->Generate(fout, config, configurationTypes);
}
- if ( this->Children.size())
+ if (!this->Children.empty())
{
size_t i;
for(i = 0; i < this->Children.size(); ++i)
@@ -936,7 +936,7 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
if(variable == "TARGET_QUOTED")
{
std::string targetQuoted = replaceValues.Target;
- if(targetQuoted.size() && targetQuoted[0] != '\"')
+ if(!targetQuoted.empty() && targetQuoted[0] != '\"')
{
targetQuoted = '\"';
targetQuoted += replaceValues.Target;
@@ -1414,12 +1414,12 @@ std::string cmLocalGenerator::GetIncludeFlags(
}
std::string includePath =
this->ConvertToIncludeReference(*i, shellFormat, forceFullPaths);
- if(quotePaths && includePath.size() && includePath[0] != '\"')
+ if(quotePaths && !includePath.empty() && includePath[0] != '\"')
{
includeFlags << "\"";
}
includeFlags << includePath;
- if(quotePaths && includePath.size() && includePath[0] != '\"')
+ if(quotePaths && !includePath.empty() && includePath[0] != '\"')
{
includeFlags << "\"";
}
@@ -1427,7 +1427,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
}
std::string flags = includeFlags.str();
// remove trailing separators
- if((sep[0] != ' ') && flags.size()>0 && flags[flags.size()-1] == sep[0])
+ if((sep[0] != ' ') && !flags.empty() && flags[flags.size()-1] == sep[0])
{
flags[flags.size()-1] = ' ';
}
@@ -2514,7 +2514,7 @@ void cmLocalGenerator::AppendFlags(std::string& flags,
{
if(!newFlags.empty())
{
- if(flags.size())
+ if(!flags.empty())
{
flags += " ";
}
@@ -2906,7 +2906,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
assert(in_remote[0] != '\"');
// The local path should never have a trailing slash.
- assert(local.size() > 0 && !(local[local.size()-1] == ""));
+ assert(!local.empty() && !(local[local.size()-1] == ""));
// If the path is already relative then just return the path.
if(!cmSystemTools::FileIsFullPath(in_remote.c_str()))
@@ -2968,7 +2968,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
// If the entire path is in common except for a trailing slash then
// just return a "./".
if(common+1 == remote.size() &&
- remote[common].size() == 0 &&
+ remote[common].empty() &&
common == local.size())
{
return "./";
@@ -2998,7 +2998,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
// the trailing slash in the output.
for(unsigned int i=common; i < remote.size(); ++i)
{
- if(relative.size() > 0)
+ if(!relative.empty())
{
relative += "/";
}
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index ebaee37..f825f5f 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -738,11 +738,8 @@ cmLocalUnixMakefileGenerator3
// Add the output to the local help if requested.
if(in_help)
{
- for (std::vector<std::string>::const_iterator i = outputs.begin();
- i != outputs.end(); ++i)
- {
- this->LocalHelp.push_back(*i);
- }
+ this->LocalHelp.insert(this->LocalHelp.end(),
+ outputs.begin(), outputs.end());
}
}
@@ -1160,7 +1157,7 @@ cmLocalUnixMakefileGenerator3
{
// Build the command line in a single string.
std::string cmd = ccg.GetCommand(c);
- if (cmd.size())
+ if (!cmd.empty())
{
// Use "call " before any invocations of .bat or .cmd files
// invoked as custom commands in the WindowsShell.
@@ -2173,7 +2170,7 @@ cmLocalUnixMakefileGenerator3
cmd += " ";
// Pass down verbosity level.
- if(this->GetMakeSilentFlag().size())
+ if(!this->GetMakeSilentFlag().empty())
{
cmd += this->GetMakeSilentFlag();
cmd += " ";
@@ -2297,7 +2294,7 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p,
for(unsigned int i=1; i < components.size(); ++i)
{
// Only the last component can be empty to avoid double slashes.
- if(components[i].length() > 0 || (i == (components.size()-1)))
+ if(!components[i].empty() || (i == (components.size()-1)))
{
if(!first)
{
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 567403f..69fcca7 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -116,7 +116,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
std::string argnDef;
bool argnDefInitialized = false;
bool argvDefInitialized = false;
- if( this->Functions.size())
+ if(!this->Functions.empty())
{
this->FilePath = this->Functions[0].FilePath;
}
@@ -170,7 +170,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
{
if ( cnt >= this->Args.size()-1 )
{
- if ( argnDef.size() > 0 )
+ if (!argnDef.empty())
{
argnDef += ";";
}
@@ -195,7 +195,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
std::vector<std::string>::const_iterator eit;
for(eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit)
{
- if ( argvDef.size() > 0 )
+ if (!argvDef.empty())
{
argvDef += ";";
}
diff --git a/Source/cmMakeDepend.cxx b/Source/cmMakeDepend.cxx
index 54b8535..31bbb73 100644
--- a/Source/cmMakeDepend.cxx
+++ b/Source/cmMakeDepend.cxx
@@ -175,7 +175,7 @@ void cmMakeDepend::GenerateDependInformation(cmDependInformation* info)
t != this->IncludeDirectories.end(); ++t)
{
std::string incpath = *t;
- if (incpath.size() && incpath[incpath.size() - 1] != '/')
+ if (!incpath.empty() && incpath[incpath.size() - 1] != '/')
{
incpath = incpath + "/";
}
@@ -318,7 +318,7 @@ std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath)
i != this->IncludeDirectories.end(); ++i)
{
std::string path = *i;
- if (path.size() && path[path.size() - 1] != '/')
+ if (!path.empty() && path[path.size() - 1] != '/')
{
path = path + "/";
}
@@ -335,7 +335,7 @@ std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath)
if (extraPath)
{
std::string path = extraPath;
- if (path.size() && path[path.size() - 1] != '/')
+ if (!path.empty() && path[path.size() - 1] != '/')
{
path = path + "/";
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index c96c6da..87e62d7 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1798,7 +1798,7 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value)
}
this->Internal->VarStack.top().Set(name, value);
- if (this->Internal->VarUsageStack.size() &&
+ if (!this->Internal->VarUsageStack.empty() &&
this->VariableInitialized(name))
{
this->CheckForUnused("changing definition", name);
@@ -1873,7 +1873,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
void cmMakefile::AddDefinition(const std::string& name, bool value)
{
this->Internal->VarStack.top().Set(name, value? "ON" : "OFF");
- if (this->Internal->VarUsageStack.size() &&
+ if (!this->Internal->VarUsageStack.empty() &&
this->VariableInitialized(name))
{
this->CheckForUnused("changing definition", name);
@@ -1937,7 +1937,7 @@ void cmMakefile::CheckForUnused(const char* reason,
{
std::string path;
cmListFileBacktrace bt(this->GetLocalGenerator());
- if (this->CallStack.size())
+ if (!this->CallStack.empty())
{
const cmListFileContext* file = this->CallStack.back().Context;
bt.push_back(*file);
@@ -1972,7 +1972,7 @@ void cmMakefile::CheckForUnused(const char* reason,
void cmMakefile::RemoveDefinition(const std::string& name)
{
this->Internal->VarStack.top().Set(name, 0);
- if (this->Internal->VarUsageStack.size() &&
+ if (!this->Internal->VarUsageStack.empty() &&
this->VariableInitialized(name))
{
this->CheckForUnused("unsetting", name);
@@ -3852,12 +3852,12 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
// from which we are being called is located itself in CMAKE_ROOT, then
// prefer results from CMAKE_ROOT depending on the policy setting.
result = moduleInCMakeModulePath;
- if (result.size() == 0)
+ if (result.empty())
{
result = moduleInCMakeRoot;
}
- if ((moduleInCMakeModulePath.size()>0) && (moduleInCMakeRoot.size()>0))
+ if (!moduleInCMakeModulePath.empty() && !moduleInCMakeRoot.empty())
{
const char* currentFile = this->GetDefinition("CMAKE_CURRENT_LIST_FILE");
std::string mods = cmakeRoot + std::string("/Modules/");
diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx
index d8aa1cb..bad38be 100644
--- a/Source/cmRemoveCommand.cxx
+++ b/Source/cmRemoveCommand.cxx
@@ -57,7 +57,7 @@ bool cmRemoveCommand
}
if (!found)
{
- if (value.size())
+ if (!value.empty())
{
value += ";";
}
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 176a08d..90d7b03 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -37,7 +37,7 @@ bool cmSetCommand
delete [] varName;
// will it be set to something, then set it
- if (args.size() > 1 && args[1].size())
+ if (args.size() > 1 && !args[1].empty())
{
// but only if it is different from current value
if (!currValue || strcmp(currValue,args[1].c_str()))
diff --git a/Source/cmSetTargetPropertiesCommand.cxx b/Source/cmSetTargetPropertiesCommand.cxx
index bf3519c..aeb8077 100644
--- a/Source/cmSetTargetPropertiesCommand.cxx
+++ b/Source/cmSetTargetPropertiesCommand.cxx
@@ -61,7 +61,7 @@ bool cmSetTargetPropertiesCommand
return false;
}
}
- if(propertyPairs.size() == 0)
+ if(propertyPairs.empty())
{
this->SetError("called with illegal arguments, maybe missing "
"a PROPERTIES specifier?");
diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx
index b026ff3..e66d13d 100644
--- a/Source/cmSetTestsPropertiesCommand.cxx
+++ b/Source/cmSetTestsPropertiesCommand.cxx
@@ -62,7 +62,7 @@ bool cmSetTestsPropertiesCommand
return false;
}
}
- if(propertyPairs.size() == 0)
+ if(propertyPairs.empty())
{
this->SetError("called with illegal arguments, maybe "
"missing a PROPERTIES specifier?");
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index e61caab..927888b 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -66,7 +66,7 @@ bool cmSiteNameCommand
&host, 0, 0, cmSystemTools::OUTPUT_NONE);
// got the hostname
- if (host.length())
+ if (!host.empty())
{
// remove any white space from the host name
std::string hostRegExp = "[ \t\n\r]*([^\t\n\r ]*)[ \t\n\r]*";
@@ -77,7 +77,7 @@ bool cmSiteNameCommand
host = hostReg.match(1);
}
- if(host.length())
+ if(!host.empty())
{
siteName = host;
}
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index 251a043..646300d 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -239,7 +239,20 @@ private:
namespace ContainerAlgorithms {
-template<typename Container>
+template<typename T>
+struct cmIsPair
+{
+ enum { value = false };
+};
+
+template<typename K, typename V>
+struct cmIsPair<std::pair<K, V> >
+{
+ enum { value = true };
+};
+
+template<typename Container,
+ bool valueTypeIsPair = cmIsPair<typename Container::value_type>::value>
struct DefaultDeleter
{
void operator()(typename Container::value_type value) {
@@ -247,10 +260,10 @@ struct DefaultDeleter
}
};
-template<typename K, typename V>
-struct DefaultDeleter<std::map<K, V> >
+template<typename Container>
+struct DefaultDeleter<Container, /* valueTypeIsPair = */ true>
{
- void operator()(typename std::map<K, V>::value_type value) {
+ void operator()(typename Container::value_type value) {
delete value.second;
}
};
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index fe962ba..3e606d7 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -386,7 +386,7 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args)
this->SetError(e);
return false;
}
- if(output.length() > 0)
+ if(!output.empty())
{
output += ";";
}
@@ -898,7 +898,7 @@ bool cmStringCommand
}
}
}
- if ( !alphabet.size() )
+ if (alphabet.empty())
{
alphabet = cmStringCommandDefaultAlphabet;
}
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index c769154..e9735ed 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1152,7 +1152,7 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
std::string path = cmSystemTools::GetFilenamePath(glob);
std::string ppath = cmSystemTools::GetFilenameName(glob);
ppath = ppath.substr(0, ppath.size()-1);
- if ( path.size() == 0 )
+ if (path.empty())
{
path = "/";
}
@@ -1469,7 +1469,7 @@ bool cmSystemTools::IsPathToFramework(const char* path)
bool cmSystemTools::CreateTar(const char* outFileName,
const std::vector<std::string>& files,
cmTarCompression compressType,
- bool verbose)
+ bool verbose, std::string const& mtime)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
@@ -1501,6 +1501,7 @@ bool cmSystemTools::CreateTar(const char* outFileName,
}
cmArchiveWrite a(fout, compress,
cmArchiveWrite::TypeTAR);
+ a.SetMTime(mtime);
a.SetVerbose(verbose);
for(std::vector<std::string>::const_iterator i = files.begin();
i != files.end(); ++i)
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 09ceea6..361f42e 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -394,9 +394,9 @@ public:
bool verbose);
static bool CreateTar(const char* outFileName,
const std::vector<std::string>& files,
- cmTarCompression compressType, bool verbose);
- static bool ExtractTar(const char* inFileName,
- bool verbose);
+ cmTarCompression compressType, bool verbose,
+ std::string const& mtime = std::string());
+ static bool ExtractTar(const char* inFileName, bool verbose);
// This should be called first thing in main
// it will keep child processes from inheriting the
// stdin and stdout of this process. This is important
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 8e060c4..98cb75c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -539,12 +539,7 @@ void cmTarget::ClearLinkMaps()
this->Internal->LinkInterfaceUsageRequirementsOnlyMap.clear();
this->Internal->LinkClosureMap.clear();
this->Internal->SourceFilesMap.clear();
- for (cmTargetLinkInformationMap::const_iterator it
- = this->LinkInformation.begin();
- it != this->LinkInformation.end(); ++it)
- {
- delete it->second;
- }
+ cmDeleteAll(this->LinkInformation);
this->LinkInformation.clear();
}
@@ -1513,7 +1508,7 @@ cmTarget::AnalyzeLibDependenciesForVS6( const cmMakefile& mf )
{
// skip zero size library entries, this may happen
// if a variable expands to nothing.
- if (lib->first.size() != 0)
+ if (!lib->first.empty())
{
this->EmitForVS6( *lib, dep_map, done, visited, newLinkLibrariesForVS6 );
}
@@ -1653,7 +1648,7 @@ void cmTarget::GatherDependenciesForVS6( const cmMakefile& mf,
while( end != std::string::npos )
{
std::string l = depline.substr( start, end-start );
- if( l.size() != 0 )
+ if(!l.empty())
{
if (l == "debug")
{
@@ -6874,10 +6869,7 @@ cmTargetLinkInformationMap
//----------------------------------------------------------------------------
cmTargetLinkInformationMap::~cmTargetLinkInformationMap()
{
- for(derived::iterator i = this->begin(); i != this->end(); ++i)
- {
- delete i->second;
- }
+ cmDeleteAll(*this);
}
//----------------------------------------------------------------------------
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 8f2deeb..3daf61e 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -104,8 +104,8 @@ bool cmTryRunCommand
// although they could be used together, don't allow it, because
// using OUTPUT_VARIABLE makes crosscompiling harder
if (this->OutputVariable.size()
- && ((this->RunOutputVariable.size())
- || (this->CompileOutputVariable.size())))
+ && (!this->RunOutputVariable.empty()
+ || !this->CompileOutputVariable.empty()))
{
cmSystemTools::Error(
"You cannot use OUTPUT_VARIABLE together with COMPILE_OUTPUT_VARIABLE "
@@ -115,18 +115,18 @@ bool cmTryRunCommand
}
bool captureRunOutput = false;
- if (this->OutputVariable.size())
+ if (!this->OutputVariable.empty())
{
captureRunOutput = true;
tryCompile.push_back("OUTPUT_VARIABLE");
tryCompile.push_back(this->OutputVariable);
}
- if (this->CompileOutputVariable.size())
+ if (!this->CompileOutputVariable.empty())
{
tryCompile.push_back("OUTPUT_VARIABLE");
tryCompile.push_back(this->CompileOutputVariable);
}
- if (this->RunOutputVariable.size())
+ if (!this->RunOutputVariable.empty())
{
captureRunOutput = true;
}
@@ -140,7 +140,7 @@ bool cmTryRunCommand
// now try running the command if it compiled
if (!res)
{
- if (this->OutputFile.size() == 0)
+ if (this->OutputFile.empty())
{
cmSystemTools::Error(this->FindErrorMessage.c_str());
}
@@ -160,13 +160,13 @@ bool cmTryRunCommand
}
// now put the output into the variables
- if(this->RunOutputVariable.size())
+ if(!this->RunOutputVariable.empty())
{
this->Makefile->AddDefinition(this->RunOutputVariable,
runOutputContents.c_str());
}
- if(this->OutputVariable.size())
+ if(!this->OutputVariable.empty())
{
// if the TryCompileCore saved output in this outputVariable then
// prepend that output to this output
@@ -196,7 +196,7 @@ void cmTryRunCommand::RunExecutable(const std::string& runArgs,
int retVal = -1;
std::string finalCommand = cmSystemTools::ConvertToRunCommandPath(
this->OutputFile.c_str());
- if (runArgs.size())
+ if (!runArgs.empty())
{
finalCommand += runArgs;
}
diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx
index 8d26f86..2ee664f 100644
--- a/Source/cmUseMangledMesaCommand.cxx
+++ b/Source/cmUseMangledMesaCommand.cxx
@@ -44,7 +44,7 @@ bool cmUseMangledMesaCommand
const char* destDir = args[1].c_str();
std::vector<std::string> files;
cmSystemTools::Glob(inputDir, "\\.h$", files);
- if(files.size() == 0)
+ if(files.empty())
{
cmSystemTools::Error("Could not open Mesa Directory ", inputDir);
return false;
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index ba6b4ac..ee1ff29 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -95,7 +95,7 @@ bool cmUtilitySourceCommand
{
exePath = this->Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH");
}
- if(exePath.size())
+ if(!exePath.empty())
{
utilityDirectory = exePath;
}
diff --git a/Source/cmUuid.cxx b/Source/cmUuid.cxx
index 8b5b7ae..e2d0049 100644
--- a/Source/cmUuid.cxx
+++ b/Source/cmUuid.cxx
@@ -66,7 +66,7 @@ void cmUuid::CreateHashInput(std::vector<unsigned char> const& uuidNamespace,
{
output = uuidNamespace;
- if(name.size())
+ if(!name.empty())
{
output.resize(output.size() + name.size());
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index 47edb03..5170ead 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -47,7 +47,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
while (isTrue)
{
- if (errorString.size())
+ if (!errorString.empty())
{
std::string err = "had incorrect arguments: ";
unsigned int i;
@@ -120,7 +120,7 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile& )
{
// if the endwhile has arguments, then make sure
// they match the arguments of the matching while
- if (lff.Arguments.size() == 0 ||
+ if (lff.Arguments.empty() ||
lff.Arguments == this->Args)
{
return true;
diff --git a/Source/cm_get_date.c b/Source/cm_get_date.c
new file mode 100644
index 0000000..2e0d4bd
--- /dev/null
+++ b/Source/cm_get_date.c
@@ -0,0 +1,16 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2015 Kitware, Inc.
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#include "cm_get_date.h"
+
+#define __archive_get_date cm_get_date
+
+#include "../Utilities/cmlibarchive/libarchive/archive_getdate.c"
diff --git a/Source/cm_get_date.h b/Source/cm_get_date.h
new file mode 100644
index 0000000..d5f6d3e
--- /dev/null
+++ b/Source/cm_get_date.h
@@ -0,0 +1,28 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2015 Kitware, Inc.
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cm_get_date_h
+#define cm_get_date_h
+
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Parse a date/time string. Treat relative times with respect to 'now'. */
+time_t cm_get_date(time_t now, const char *str);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 4244b25..29d8206 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -316,7 +316,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
if(arg.find("-D",0) == 0)
{
std::string entry = arg.substr(2);
- if(entry.size() == 0)
+ if(entry.empty())
{
++i;
if(i < args.size())
@@ -380,7 +380,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
else if(arg.find("-U",0) == 0)
{
std::string entryPattern = arg.substr(2);
- if(entryPattern.size() == 0)
+ if(entryPattern.empty())
{
++i;
if(i < args.size())
@@ -424,7 +424,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
else if(arg.find("-C",0) == 0)
{
std::string path = arg.substr(2);
- if ( path.size() == 0 )
+ if (path.empty())
{
++i;
if(i < args.size())
@@ -449,7 +449,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
return false;
}
std::string path = args[i];
- if ( path.size() == 0 )
+ if (path.empty())
{
cmSystemTools::Error("No cmake script provided.");
return false;
@@ -763,7 +763,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
else if(arg.find("-A",0) == 0)
{
std::string value = arg.substr(2);
- if(value.size() == 0)
+ if(value.empty())
{
++i;
if(i >= args.size())
@@ -784,7 +784,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
else if(arg.find("-T",0) == 0)
{
std::string value = arg.substr(2);
- if(value.size() == 0)
+ if(value.empty())
{
++i;
if(i >= args.size())
@@ -805,7 +805,7 @@ void cmake::SetArgs(const std::vector<std::string>& args,
else if(arg.find("-G",0) == 0)
{
std::string value = arg.substr(2);
- if(value.size() == 0)
+ if(value.empty())
{
++i;
if(i >= args.size())
@@ -909,7 +909,7 @@ void cmake::SetDirectoriesFromFile(const char* arg)
}
// If there is a CMakeCache.txt file, use its settings.
- if(cachePath.length() > 0)
+ if(!cachePath.empty())
{
cmCacheManager* cachem = this->GetCacheManager();
cmCacheManager::CacheIterator it = cachem->NewIterator();
@@ -925,7 +925,7 @@ void cmake::SetDirectoriesFromFile(const char* arg)
}
// If there is a CMakeLists.txt file, use it as the source tree.
- if(listPath.length() > 0)
+ if(!listPath.empty())
{
this->SetHomeDirectory(listPath);
this->SetStartDirectory(listPath);
@@ -1123,13 +1123,13 @@ void cmake::SetGlobalGenerator(cmGlobalGenerator *gg)
// restore the original environment variables CXX and CC
// Restore CC
std::string env = "CC=";
- if(this->CCEnvironment.size())
+ if(!this->CCEnvironment.empty())
{
env += this->CCEnvironment;
}
cmSystemTools::PutEnv(env);
env = "CXX=";
- if(this->CXXEnvironment.size())
+ if(!this->CXXEnvironment.empty())
{
env += this->CXXEnvironment;
}
@@ -1608,7 +1608,7 @@ void cmake::PreLoadCMakeFiles()
{
std::vector<std::string> args;
std::string pre_load = this->GetHomeDirectory();
- if ( pre_load.size() > 0 )
+ if (!pre_load.empty())
{
pre_load += "/PreLoad.cmake";
if ( cmSystemTools::FileExists(pre_load.c_str()) )
@@ -1617,7 +1617,7 @@ void cmake::PreLoadCMakeFiles()
}
}
pre_load = this->GetHomeOutputDirectory();
- if ( pre_load.size() > 0 )
+ if (!pre_load.empty())
{
pre_load += "/PreLoad.cmake";
if ( cmSystemTools::FileExists(pre_load.c_str()) )
@@ -1959,7 +1959,7 @@ int cmake::CheckBuildSystem()
// determine whether CMake should rerun.
// If no file is provided for the check, we have to rerun.
- if(this->CheckBuildSystemArgument.size() == 0)
+ if(this->CheckBuildSystemArgument.empty())
{
if(verbose)
{
@@ -2277,7 +2277,7 @@ const char *cmake::GetProperty(const std::string& prop,
this->GetCacheManager()->GetCacheIterator();
for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() )
{
- if ( output.size() )
+ if (!output.empty())
{
output += ";";
}
@@ -2395,7 +2395,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
else if(arg.find("-G",0) == 0)
{
std::string value = arg.substr(2);
- if(value.size() == 0)
+ if(value.empty())
{
++i;
if(i >= args.size())
@@ -2450,7 +2450,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
}
// do we write to a file or to stdout?
- if (resultFile.size() == 0)
+ if (resultFile.empty())
{
resultFile = cwd;
resultFile += "/__cmake_systeminformation/results.txt";
@@ -2531,7 +2531,7 @@ static bool cmakeCheckStampFile(const char* stampName)
while(cmSystemTools::GetLineFromStream(fin, dep))
{
int result;
- if(dep.length() >= 1 && dep[0] != '#' &&
+ if(!dep.empty() && dep[0] != '#' &&
(!ftc.FileTimeCompare(stampDepends.c_str(), dep.c_str(), &result)
|| result < 0))
{
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 61b175e..6d25b70 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -96,11 +96,9 @@ static const char * cmDocumentationOptions[][2] =
static int do_command(int ac, char const* const* av)
{
std::vector<std::string> args;
+ args.reserve(ac - 1);
args.push_back(av[0]);
- for(int i = 2; i < ac; ++i)
- {
- args.push_back(av[i]);
- }
+ args.insert(args.end(), av + 2, av + ac);
return cmcmd::ExecuteCMakeCommand(args);
}
@@ -203,7 +201,7 @@ int main(int ac, char const* const* av)
int do_cmake(int ac, char const* const* av)
{
- if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 )
+ if (cmSystemTools::GetCurrentWorkingDirectory().empty())
{
std::cerr << "Current working directory cannot be established."
<< std::endl;
@@ -221,11 +219,7 @@ int do_cmake(int ac, char const* const* av)
// the command line args are processed here so that you can do
// -DCMAKE_MODULE_PATH=/some/path and have this value accessible here
- std::vector<std::string> args;
- for(int i =0; i < ac; ++i)
- {
- args.push_back(av[i]);
- }
+ std::vector<std::string> args(av, av + ac);
hcm.SetCacheArgs(args);
std::vector<cmDocumentationEntry> generators;
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 70d98d2..7ca3eb3 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -729,9 +729,31 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
std::string flags = args[2];
std::string outFile = args[3];
std::vector<std::string> files;
+ std::string mtime;
+ bool doing_options = true;
for (std::string::size_type cc = 4; cc < args.size(); cc ++)
{
- files.push_back(args[cc]);
+ std::string const& arg = args[cc];
+ if (doing_options && cmHasLiteralPrefix(arg, "--"))
+ {
+ if (arg == "--")
+ {
+ doing_options = false;
+ }
+ else if (cmHasLiteralPrefix(arg, "--mtime="))
+ {
+ mtime = arg.substr(8);
+ }
+ else
+ {
+ cmSystemTools::Error("Unknown option to -E tar: ", arg.c_str());
+ return 1;
+ }
+ }
+ else
+ {
+ files.push_back(arg);
+ }
}
cmSystemTools::cmTarCompression compress =
cmSystemTools::TarCompressNone;
@@ -774,7 +796,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
else if ( flags.find_first_of('c') != flags.npos )
{
if ( !cmSystemTools::CreateTar(
- outFile.c_str(), files, compress, verbose) )
+ outFile.c_str(), files, compress, verbose, mtime) )
{
cmSystemTools::Error("Problem creating tar: ", outFile.c_str());
return 1;
@@ -1228,7 +1250,7 @@ int cmcmd::ParseVisualStudioLinkCommand(std::vector<std::string>& args,
targetName = i->substr(5);
}
}
- if(targetName.size() == 0 || command.size() == 0)
+ if(targetName.empty() || command.empty())
{
return -1;
}
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index fb97af6..b77c231 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -136,7 +136,7 @@ int main (int argc, char const* const* argv)
cmCTest inst;
- if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 )
+ if (cmSystemTools::GetCurrentWorkingDirectory().empty())
{
cmCTestLog(&inst, ERROR_MESSAGE,
"Current working directory cannot be established." << std::endl);
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index dea30e4..3aecd9b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1247,6 +1247,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
if(CMake_TEST_FindGSL)
add_subdirectory(FindGSL)
endif()
+ if(CMake_TEST_FindJsonCpp)
+ add_subdirectory(FindJsonCpp)
+ endif()
find_package(GTK2 QUIET)
if(GTK2_FOUND)
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index a276f36..ef37dcb 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -51,6 +51,17 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"
)
endif()
+if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
+ list(REMOVE_ITEM CXX_non_features
+ cxx_attribute_deprecated
+ cxx_contextual_conversions
+ cxx_extended_friend_declarations
+ cxx_long_long_type
+ cxx_sizeof_member
+ cxx_variadic_macros
+ )
+endif()
+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
# The cxx_constexpr feature happens to work (for *this* testcase) with
@@ -197,6 +208,13 @@ if (CMAKE_CXX_COMPILE_FEATURES)
-DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0
)
endif()
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
+ add_definitions(
+ -DEXPECT_OVERRIDE_CONTROL=1
+ -DEXPECT_INHERITING_CONSTRUCTORS=1
+ -DEXPECT_FINAL=1
+ -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1
+ )
endif()
add_executable(CompileFeaturesGenex genex_test.cpp)
diff --git a/Tests/CompileFeatures/cxx_auto_type.cpp b/Tests/CompileFeatures/cxx_auto_type.cpp
index 7dbf04f..1f36a79 100644
--- a/Tests/CompileFeatures/cxx_auto_type.cpp
+++ b/Tests/CompileFeatures/cxx_auto_type.cpp
@@ -1,5 +1,12 @@
+double foo_ = 3.14;
+
+double& foo()
+{
+ return foo_;
+}
+
void someFunc()
{
- auto x = 3.14;
+ auto& x = foo();
}
diff --git a/Tests/CompileFeatures/cxx_inheriting_constructors.cpp b/Tests/CompileFeatures/cxx_inheriting_constructors.cpp
index a83b624..cfce880 100644
--- a/Tests/CompileFeatures/cxx_inheriting_constructors.cpp
+++ b/Tests/CompileFeatures/cxx_inheriting_constructors.cpp
@@ -13,6 +13,6 @@ struct B : public A
void someFunc()
{
- int i;
+ int i = 0;
B b(i);
}
diff --git a/Tests/CompileFeatures/cxx_variadic_templates.cpp b/Tests/CompileFeatures/cxx_variadic_templates.cpp
index a80e157..e1f641b 100644
--- a/Tests/CompileFeatures/cxx_variadic_templates.cpp
+++ b/Tests/CompileFeatures/cxx_variadic_templates.cpp
@@ -1,21 +1,30 @@
+#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) < 407)
+#define OLD_GNU
+#endif
+
+#ifdef OLD_GNU
template<int... Is>
struct Interface;
+#endif
-template<int I>
-struct Interface<I>
+template<int I, int... Is>
+struct Interface
+#ifdef OLD_GNU
+ <I, Is...>
+#endif
{
static int accumulate()
{
- return I;
+ return I + Interface<Is...>::accumulate();
}
};
-template<int I, int... Is>
-struct Interface<I, Is...>
+template<int I>
+struct Interface<I>
{
static int accumulate()
{
- return I + Interface<Is...>::accumulate();
+ return I;
}
};
diff --git a/Tests/FindJsonCpp/CMakeLists.txt b/Tests/FindJsonCpp/CMakeLists.txt
new file mode 100644
index 0000000..9a1fa38
--- /dev/null
+++ b/Tests/FindJsonCpp/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindJsonCpp.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindJsonCpp/Test"
+ "${CMake_BINARY_DIR}/Tests/FindJsonCpp/Test"
+ ${build_generator_args}
+ --build-project TestFindJsonCpp
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindJsonCpp/Test/CMakeLists.txt b/Tests/FindJsonCpp/Test/CMakeLists.txt
new file mode 100644
index 0000000..4e1e271
--- /dev/null
+++ b/Tests/FindJsonCpp/Test/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.1)
+project(TestFindJsonCpp CXX)
+include(CTest)
+
+find_package(JsonCpp REQUIRED)
+
+add_executable(test_jsoncpp_tgt main.cxx)
+target_link_libraries(test_jsoncpp_tgt JsonCpp::JsonCpp)
+add_test(NAME test_jsoncpp_tgt COMMAND test_jsoncpp_tgt)
+
+add_executable(test_jsoncpp_var main.cxx)
+target_include_directories(test_jsoncpp_var PRIVATE ${JsonCpp_INCLUDE_DIRS})
+target_link_libraries(test_jsoncpp_var PRIVATE ${JsonCpp_LIBRARIES})
+add_test(NAME test_jsoncpp_var COMMAND test_jsoncpp_var)
diff --git a/Tests/FindJsonCpp/Test/main.cxx b/Tests/FindJsonCpp/Test/main.cxx
new file mode 100644
index 0000000..0fefe32
--- /dev/null
+++ b/Tests/FindJsonCpp/Test/main.cxx
@@ -0,0 +1,8 @@
+#include <json/json.h>
+
+int main()
+{
+ int zero = 0;
+ Json::Value value(zero);
+ return value.asInt();
+}
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index 5849417..b5e46c0 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -11,7 +11,7 @@ get_property(c_known_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES)
write_compiler_detection_header(
FILE "${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h"
PREFIX TEST
- COMPILERS GNU Clang AppleClang
+ COMPILERS GNU Clang AppleClang SunPro
VERSION 3.1
PROLOG "// something"
EPILOG "// more"
@@ -60,7 +60,8 @@ endmacro()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
- OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
+ OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"
+ OR CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
# False for C++98 mode.
list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS)
list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES)
@@ -83,7 +84,7 @@ write_compiler_detection_header(
PREFIX MULTI
OUTPUT_FILES_VAR multi_files
OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/compiler_support"
- COMPILERS GNU Clang AppleClang
+ COMPILERS GNU Clang AppleClang SunPro
VERSION 3.1
FEATURES
${cxx_known_features} ${c_known_features}
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 1697025..3a61751 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -52,6 +52,7 @@ add_RunCMake_test(CMP0053)
add_RunCMake_test(CMP0054)
add_RunCMake_test(CMP0055)
add_RunCMake_test(CTest)
+add_RunCMake_test(CTestSubmit)
if(NOT CMake_TEST_EXTERNAL_CMAKE)
add_RunCMake_test(CTestMemcheck
diff --git a/Tests/RunCMake/CTestSubmit/BadArg-result.txt b/Tests/RunCMake/CTestSubmit/BadArg-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/BadArg-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestSubmit/BadArg-stderr.txt b/Tests/RunCMake/CTestSubmit/BadArg-stderr.txt
new file mode 100644
index 0000000..68812ab
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/BadArg-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at .*/Tests/RunCMake/CTestSubmit/BadArg/test.cmake:[0-9]+ \(ctest_submit\):
+ ctest_submit called with unknown argument "bad-arg".
diff --git a/Tests/RunCMake/CTestSubmit/BadFILES-result.txt b/Tests/RunCMake/CTestSubmit/BadFILES-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/BadFILES-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestSubmit/BadFILES-stderr.txt b/Tests/RunCMake/CTestSubmit/BadFILES-stderr.txt
new file mode 100644
index 0000000..703224b
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/BadFILES-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at .*/Tests/RunCMake/CTestSubmit/BadFILES/test.cmake:[0-9]+ \(ctest_submit\):
+ File "bad-file" does not exist. Cannot submit a non-existent file.
diff --git a/Tests/RunCMake/CTestSubmit/BadPARTS-result.txt b/Tests/RunCMake/CTestSubmit/BadPARTS-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/BadPARTS-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestSubmit/BadPARTS-stderr.txt b/Tests/RunCMake/CTestSubmit/BadPARTS-stderr.txt
new file mode 100644
index 0000000..4e491a9
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/BadPARTS-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at .*/Tests/RunCMake/CTestSubmit/BadPARTS/test.cmake:[0-9]+ \(ctest_submit\):
+ Part name "bad-part" is invalid.
diff --git a/Tests/RunCMake/CTestSubmit/CMakeLists.txt.in b/Tests/RunCMake/CTestSubmit/CMakeLists.txt.in
new file mode 100644
index 0000000..96e6c13
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/CMakeLists.txt.in
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.1)
+project(CTestSubmit@CASE_NAME@ NONE)
+include(CTest)
+add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
diff --git a/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in b/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in
new file mode 100644
index 0000000..378a85a
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in
@@ -0,0 +1,6 @@
+set(CTEST_PROJECT_NAME "CTestSubmit@CASE_NAME@")
+
+# Intentionally leave out other upload-related CTestConfig.cmake settings
+# so that any ctest_submit calls fail with an error message.
+set(CTEST_DROP_METHOD "@CASE_DROP_METHOD@")
+set(CTEST_DROP_SITE "@CASE_DROP_SITE@")
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt
new file mode 100644
index 0000000..b451315
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt
@@ -0,0 +1,4 @@
+Missing arguments for submit via cp:
+.*
+ Problems when submitting via CP
+Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-cp/test.cmake
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt
new file mode 100644
index 0000000..fa6e004
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt
@@ -0,0 +1 @@
+Submit files \(using cp\)
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt
new file mode 100644
index 0000000..a622fac
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt
@@ -0,0 +1,3 @@
+Error message was: .*
+ Problems when submitting via FTP
+Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-ftp/test.cmake
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt
new file mode 100644
index 0000000..345bb62
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt
@@ -0,0 +1,3 @@
+Submit files \(using ftp\)
+ Using FTP submit method
+ Drop site: ftp://
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-http-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-http-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-http-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt
new file mode 100644
index 0000000..6870d2e
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt
@@ -0,0 +1,3 @@
+Error message was: .*
+ Problems when submitting via HTTP
+Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-http/test.cmake
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt
new file mode 100644
index 0000000..c7f35c5
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt
@@ -0,0 +1,3 @@
+Submit files \(using http\)
+ Using HTTP submit method
+ Drop site:http://
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-https-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-https-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-https-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt
new file mode 100644
index 0000000..a3c0cd5
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt
@@ -0,0 +1,3 @@
+Error message was: .*
+ Problems when submitting via HTTP
+Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-https/test.cmake
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt
new file mode 100644
index 0000000..19f8234
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt
@@ -0,0 +1,3 @@
+Submit files \(using https\)
+ Using HTTP submit method
+ Drop site:https://
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-scp-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-scp-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-scp-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt
new file mode 100644
index 0000000..42b8f50
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt
@@ -0,0 +1,2 @@
+ Problems when submitting via SCP
+Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-scp/test.cmake
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt
new file mode 100644
index 0000000..ec2ce92
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt
@@ -0,0 +1 @@
+Submit files \(using scp\)
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt
new file mode 100644
index 0000000..020b615
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt
@@ -0,0 +1,2 @@
+ (Problems when submitting via XML-RPC|Submission method "xmlrpc" not compiled into CTest!)
+Error in read script: .*/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc/test.cmake
diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt
new file mode 100644
index 0000000..ed2acb5
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt
@@ -0,0 +1 @@
+Submit files \(using xmlrpc\)
diff --git a/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-result.txt b/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-stderr.txt b/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-stderr.txt
new file mode 100644
index 0000000..d56793e
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at .*/Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE/test.cmake:[0-9]+ \(ctest_submit\):
+ Called with more than one value for RETURN_VALUE
diff --git a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake
new file mode 100644
index 0000000..3638007
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake
@@ -0,0 +1,49 @@
+include(RunCMake)
+
+# Default case parameters.
+set(CASE_DROP_METHOD "http")
+set(CASE_DROP_SITE "-no-site-")
+set(CASE_CTEST_SUBMIT_ARGS "")
+
+function(run_ctest CASE_NAME)
+ configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in
+ ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake @ONLY)
+ configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in
+ ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY)
+ configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in
+ ${RunCMake_BINARY_DIR}/${CASE_NAME}/CMakeLists.txt @ONLY)
+ run_cmake_command(${CASE_NAME} ${CMAKE_CTEST_COMMAND}
+ -C Debug
+ -S ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake
+ -V
+ --output-log ${RunCMake_BINARY_DIR}/${CASE_NAME}-build/testOutput.log
+ ${ARGN}
+ )
+endfunction()
+
+#-----------------------------------------------------------------------------
+# Test bad argument combinations.
+
+function(run_ctest_submit CASE_NAME)
+ set(CASE_CTEST_SUBMIT_ARGS "${ARGN}")
+ run_ctest(${CASE_NAME})
+endfunction()
+
+run_ctest_submit(BadArg bad-arg)
+run_ctest_submit(BadPARTS PARTS bad-part)
+run_ctest_submit(BadFILES FILES bad-file)
+run_ctest_submit(RepeatRETURN_VALUE RETURN_VALUE res RETURN_VALUE res)
+
+#-----------------------------------------------------------------------------
+# Test failed drops by various protocols
+
+function(run_ctest_submit_FailDrop CASE_DROP_METHOD)
+ run_ctest(FailDrop-${CASE_DROP_METHOD})
+endfunction()
+
+run_ctest_submit_FailDrop(cp)
+run_ctest_submit_FailDrop(ftp)
+run_ctest_submit_FailDrop(http)
+run_ctest_submit_FailDrop(https)
+run_ctest_submit_FailDrop(scp)
+run_ctest_submit_FailDrop(xmlrpc)
diff --git a/Tests/RunCMake/CTestSubmit/test.cmake.in b/Tests/RunCMake/CTestSubmit/test.cmake.in
new file mode 100644
index 0000000..ba826f1
--- /dev/null
+++ b/Tests/RunCMake/CTestSubmit/test.cmake.in
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.1)
+
+set(CTEST_SITE "test-site")
+set(CTEST_BUILD_NAME "test-build-name")
+set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
+set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
+set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
+set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+
+ctest_start(Experimental)
+ctest_configure()
+
+set(ctest_submit_args "@CASE_CTEST_SUBMIT_ARGS@")
+ctest_submit(${ctest_submit_args})
diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt
new file mode 100644
index 0000000..ca925f1
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: unable to parse mtime 'bad'
+CMake Error: Problem creating tar: bad.tar$
diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt
new file mode 100644
index 0000000..35133c8
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: Unknown option to -E tar: --bad$
diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt b/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_tar-end-opt1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt
new file mode 100644
index 0000000..1fddf6d
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: archive_read_disk_entry_from_file '--bad':.*
+CMake Error: Problem creating tar: bad.tar$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 0c43c20..2994f16 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -1,5 +1,11 @@
include(RunCMake)
+run_cmake_command(E_tar-bad-opt1 ${CMAKE_COMMAND} -E tar cvf bad.tar --bad)
+run_cmake_command(E_tar-bad-mtime1 ${CMAKE_COMMAND} -E tar cvf bad.tar --mtime=bad .)
+run_cmake_command(E_tar-end-opt1 ${CMAKE_COMMAND} -E tar cvf bad.tar -- --bad)
+run_cmake_command(E_tar-end-opt2 ${CMAKE_COMMAND} -E tar cvf bad.tar --)
+run_cmake_command(E_tar-mtime ${CMAKE_COMMAND} -E tar cvf bad.tar "--mtime=1970-01-01 00:00:00 UTC")
+
run_cmake_command(build-no-cache
${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR})
run_cmake_command(build-no-generator
diff --git a/Utilities/cmThirdParty.h.in b/Utilities/cmThirdParty.h.in
index b883284..0cb6809 100644
--- a/Utilities/cmThirdParty.h.in
+++ b/Utilities/cmThirdParty.h.in
@@ -20,6 +20,7 @@
#cmakedefine CMAKE_USE_SYSTEM_LIBARCHIVE
#cmakedefine CMAKE_USE_SYSTEM_LIBLZMA
#cmakedefine CMAKE_USE_SYSTEM_FORM
+#cmakedefine CMAKE_USE_SYSTEM_JSONCPP
#cmakedefine CTEST_USE_XMLRPC
#endif
diff --git a/Utilities/cm_jsoncpp_reader.h b/Utilities/cm_jsoncpp_reader.h
index d7cb50e..22f2d81 100644
--- a/Utilities/cm_jsoncpp_reader.h
+++ b/Utilities/cm_jsoncpp_reader.h
@@ -13,6 +13,11 @@
#define cm_jsoncpp_reader_h
/* Use the jsoncpp library configured for CMake. */
-#include <cmjsoncpp/include/json/reader.h>
+#include "cmThirdParty.h"
+#ifdef CMAKE_USE_SYSTEM_JSONCPP
+# include <json/reader.h>
+#else
+# include <cmjsoncpp/include/json/reader.h>
+#endif
#endif
diff --git a/Utilities/cm_jsoncpp_value.h b/Utilities/cm_jsoncpp_value.h
new file mode 100644
index 0000000..b4cf620
--- /dev/null
+++ b/Utilities/cm_jsoncpp_value.h
@@ -0,0 +1,23 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cm_jsoncpp_value_h
+#define cm_jsoncpp_value_h
+
+/* Use the jsoncpp library configured for CMake. */
+#include "cmThirdParty.h"
+#ifdef CMAKE_USE_SYSTEM_JSONCPP
+# include <json/value.h>
+#else
+# include <cmjsoncpp/include/json/value.h>
+#endif
+
+#endif
diff --git a/Utilities/cm_jsoncpp_writer.h b/Utilities/cm_jsoncpp_writer.h
new file mode 100644
index 0000000..c99a0d0
--- /dev/null
+++ b/Utilities/cm_jsoncpp_writer.h
@@ -0,0 +1,23 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cm_jsoncpp_writer_h
+#define cm_jsoncpp_writer_h
+
+/* Use the jsoncpp library configured for CMake. */
+#include "cmThirdParty.h"
+#ifdef CMAKE_USE_SYSTEM_JSONCPP
+# include <json/writer.h>
+#else
+# include <cmjsoncpp/include/json/writer.h>
+#endif
+
+#endif
diff --git a/Utilities/cmjsoncpp/include/json/reader.h b/Utilities/cmjsoncpp/include/json/reader.h
index 98814d5..95237d1 100644
--- a/Utilities/cmjsoncpp/include/json/reader.h
+++ b/Utilities/cmjsoncpp/include/json/reader.h
@@ -106,9 +106,7 @@ public:
* the parsed document. An empty string is returned if no error
* occurred
* during parsing.
- * \deprecated Use getFormattedErrorMessages() instead (typo fix).
*/
- JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead")
std::string getFormatedErrorMessages() const;
/** \brief Returns a user friendly string that list errors in the parsed
diff --git a/Utilities/cmjsoncpp/include/json/writer.h b/Utilities/cmjsoncpp/include/json/writer.h
index 397bf6a..10863b0 100644
--- a/Utilities/cmjsoncpp/include/json/writer.h
+++ b/Utilities/cmjsoncpp/include/json/writer.h
@@ -150,7 +150,6 @@ private:
* If the Value have comments then they are outputed according to their
#CommentPlacement.
*
- * \param indentation Each level will be indented by this amount extra.
* \sa Reader, Value, Value::setComment()
*/
class JSON_API StyledStreamWriter {