From kwrobot at kitware.com Thu Jan 1 00:01:11 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 1 Jan 2015 00:01:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-593-gec31926 Message-ID: <20150101050111.3F15CA81EC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via ec31926d24ac2cf9a8aef4cfbcbeaaca0c99b717 (commit) from c2445d3dfd837cd2e372061f5545054317be110a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ec31926d24ac2cf9a8aef4cfbcbeaaca0c99b717 commit ec31926d24ac2cf9a8aef4cfbcbeaaca0c99b717 Author: Kitware Robot AuthorDate: Thu Jan 1 00:01:09 2015 -0500 Commit: Kitware Robot CommitDate: Thu Jan 1 00:01:09 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ffad404..e2e79ed 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 20141231) +set(CMake_VERSION_PATCH 20150101) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 1 06:46:50 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 1 Jan 2015 06:46:50 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1452-gc583500 Message-ID: <20150101114657.D509BA7BA9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c58350078e22ec7706a0eae99ae2b57950f12328 (commit) via f07d96ccf4c0b09b544efadaac47cd79f9298b89 (commit) via 5a8b9437c24e1548ad15ed816e0f252e912812e1 (commit) from a1839ec4124605ff90885bdcae3e06de946747cc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c58350078e22ec7706a0eae99ae2b57950f12328 commit c58350078e22ec7706a0eae99ae2b57950f12328 Merge: a1839ec f07d96c Author: Stephen Kelly AuthorDate: Thu Jan 1 06:46:46 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 1 06:46:46 2015 -0500 Merge topic 'drop-GNU-2.95' into next f07d96cc Remove workaround for GCC < 3 ios_base absence. 5a8b9437 Remove GCC 2.95 support macros in favor of template versions. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f07d96ccf4c0b09b544efadaac47cd79f9298b89 commit f07d96ccf4c0b09b544efadaac47cd79f9298b89 Author: Stephen Kelly AuthorDate: Wed Dec 31 18:48:34 2014 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 1 12:45:54 2015 +0100 Remove workaround for GCC < 3 ios_base absence. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index c6788d3..e4f5760 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -146,11 +146,6 @@ extern int putenv (char *__string) __THROW; #define for if(false) {} else for #endif -// Provide std::ios_base on ancient GCC 2.9x -#if defined(__GNUC__) && __GNUC__ < 3 -namespace std { typedef ios ios_base; } -#endif - // check for the 720 compiler on the SGI // which has some strange properties that I don't think are worth // checking for in a general way in configure http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5a8b9437c24e1548ad15ed816e0f252e912812e1 commit 5a8b9437c24e1548ad15ed816e0f252e912812e1 Author: Stephen Kelly AuthorDate: Wed Dec 31 18:47:37 2014 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 1 12:44:11 2015 +0100 Remove GCC 2.95 support macros in favor of template versions. GCC < 3 is no longer supported as a host compiler. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 6b85634..c6788d3 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -393,20 +393,6 @@ inline bool cmHasLiteralSuffixImpl(const char* str1, return len >= N && strcmp(str1 + len - N, str2) == 0; } -#if defined(__GNUC__) && __GNUC__ < 3 - -#define cmArrayBegin(a) a -#define cmArraySize(a) (sizeof(a)/sizeof(*a)) -#define cmArrayEnd(a) a + cmArraySize(a) - -#define cmHasLiteralPrefix(STR1, STR2) \ - cmHasLiteralPrefixImpl(STR1, "" STR2 "", sizeof(STR2) - 1) - -#define cmHasLiteralSuffix(STR1, STR2) \ - cmHasLiteralSuffixImpl(STR1, "" STR2 "", sizeof(STR2) - 1) - -#else - template const T* cmArrayBegin(const T (&a)[N]) { return a; } template @@ -426,8 +412,6 @@ bool cmHasLiteralSuffix(T str1, const char (&str2)[N]) return cmHasLiteralSuffixImpl(str1, str2, N - 1); } -#endif - struct cmStrCmp { cmStrCmp(const char *test) : m_test(test) {} cmStrCmp(const std::string &test) : m_test(test) {} ----------------------------------------------------------------------- Summary of changes: Source/cmStandardIncludes.h | 21 --------------------- 1 file changed, 21 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 1 07:44:26 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 1 Jan 2015 07:44:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1455-gf26306d Message-ID: <20150101124449.9FA911473F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f26306d36f7fefcbb041587a6e432ceb4eeb6926 (commit) via 11508b1a5d8fe5b7d136d0d75591a1e846cc2ca8 (commit) via bb00d7cbca6e7a9f75a6c5094487b9c6468213f4 (commit) from c58350078e22ec7706a0eae99ae2b57950f12328 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f26306d36f7fefcbb041587a6e432ceb4eeb6926 commit f26306d36f7fefcbb041587a6e432ceb4eeb6926 Merge: c583500 11508b1 Author: Stephen Kelly AuthorDate: Thu Jan 1 07:44:22 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 1 07:44:22 2015 -0500 Merge topic 'sun-better-stdlib' into next 11508b1a cmTarget: Use insert instead of std::copy. bb00d7cb Workaround SolarisStudio bug with libstdc++. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=11508b1a5d8fe5b7d136d0d75591a1e846cc2ca8 commit 11508b1a5d8fe5b7d136d0d75591a1e846cc2ca8 Author: Stephen Kelly AuthorDate: Thu Jan 1 13:35:18 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 1 13:43:40 2015 +0100 cmTarget: Use insert instead of std::copy. insert can reserve() memory in the container, and this is more-consistent with the rest of CMake now. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index c8fbf61..d454e89 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -6058,8 +6058,8 @@ cmTargetInternals::ComputeLinkInterfaceLibraries( // The link implementation is the default link interface. cmTarget::LinkImplementationLibraries const* impl = thisTarget->GetLinkImplementationLibrariesInternal(config, headTarget); - std::copy(impl->Libraries.begin(), impl->Libraries.end(), - std::back_inserter(iface.Libraries)); + iface.Libraries.insert(iface.Libraries.end(), + impl->Libraries.begin(), impl->Libraries.end()); if(thisTarget->PolicyStatusCMP0022 == cmPolicies::WARN && !this->PolicyWarnedCMP0022 && !usage_requirements_only) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb00d7cbca6e7a9f75a6c5094487b9c6468213f4 commit bb00d7cbca6e7a9f75a6c5094487b9c6468213f4 Author: Stephen Kelly AuthorDate: Thu Jan 1 12:54:50 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 1 13:43:40 2015 +0100 Workaround SolarisStudio bug with libstdc++. Using iostream and cxxabi.h together causes a compile failure .../CC-gcc/include/c++/4.8.2/cxxabi.h", line 131: Error: Only one of a set of overloaded functions can be extern "C". https://community.oracle.com/thread/3644901 This only happens if the iostream include is before the cxxabi include. The available solutions are: re-order the includes in kwsys/SystemInformation.cxx, skip the test for KWSYS_CXX_HAS_CXXABI, or cause it to fail by adding the include. Do the latter for now. diff --git a/Source/kwsys/kwsysPlatformTestsCXX.cxx b/Source/kwsys/kwsysPlatformTestsCXX.cxx index 3f947f3..82620da 100644 --- a/Source/kwsys/kwsysPlatformTestsCXX.cxx +++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx @@ -548,6 +548,10 @@ int main() #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif +#if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 \ + && __linux && __SUNPRO_CC_COMPAT == 'G' +# include +#endif #include int main() { ----------------------------------------------------------------------- Summary of changes: Source/cmTarget.cxx | 4 ++-- Source/kwsys/kwsysPlatformTestsCXX.cxx | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 1 11:41:59 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 1 Jan 2015 11:41:59 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1458-g03a66cf Message-ID: <20150101164159.DF84E149D6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 03a66cff114687d0d9e71a289b05a66259853d47 (commit) via c7d7eef21b678a0949a26fb7b12be8f032a51ffd (commit) via a240682cb7c71fe241945c6fb67c8e55ee032eb7 (commit) from f26306d36f7fefcbb041587a6e432ceb4eeb6926 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=03a66cff114687d0d9e71a289b05a66259853d47 commit 03a66cff114687d0d9e71a289b05a66259853d47 Merge: f26306d c7d7eef Author: Stephen Kelly AuthorDate: Thu Jan 1 11:41:58 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 1 11:41:58 2015 -0500 Merge topic 'sun-better-stdlib' into next c7d7eef2 Bootstrap: Use -library=stlport4 with SolarisStudio. a240682c Fix build with SunCC/stlport. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c7d7eef21b678a0949a26fb7b12be8f032a51ffd commit c7d7eef21b678a0949a26fb7b12be8f032a51ffd Author: Stephen Kelly AuthorDate: Thu Jan 1 17:31:54 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 1 17:31:54 2015 +0100 Bootstrap: Use -library=stlport4 with SolarisStudio. diff --git a/bootstrap b/bootstrap index fe051e1..3574973 100755 --- a/bootstrap +++ b/bootstrap @@ -1154,6 +1154,35 @@ if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then cmake_test_flags= fi + +if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then + # Are we SolarisStudio? + + TMPFILE=`cmake_tmp_file` + echo ' + #if defined(__SUNPRO_CC) + #include + int main() { std::cout << "This is SolarisStudio" << std::endl; return 0;} + #endif + ' > ${TMPFILE}.cxx + cmake_cxx_compiler_is_solarisstudio=0 + if cmake_try_run "${cmake_cxx_compiler}" \ + "${cmake_cxx_flags} " "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then + cmake_cxx_compiler_is_solarisstudio=1 + fi + if [ "x${cmake_cxx_compiler_is_solarisstudio}" = "x1" ]; then + echo "${cmake_cxx_compiler} is SolarisStudio compiler" + else + echo "${cmake_cxx_compiler} is not SolarisStudio compiler" + fi + rm -f "${TMPFILE}.cxx" + + if [ "x${cmake_cxx_compiler_is_solarisstudio}" = "x1" ]; then + cmake_cxx_flags="${cmake_cxx_flags} -library=stlport4" + fi +fi + + # Test for kwsys features KWSYS_NAME_IS_KWSYS=0 KWSYS_BUILD_SHARED=0 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a240682cb7c71fe241945c6fb67c8e55ee032eb7 commit a240682cb7c71fe241945c6fb67c8e55ee032eb7 Author: Stephen Kelly AuthorDate: Thu Jan 1 16:04:39 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 1 16:36:12 2015 +0100 Fix build with SunCC/stlport. fcntl.h needs to be included before is included when using stlport. Otherwise: "Source/kwsys/SystemTools.cxx", line 1240: Error: UTIME_OMIT is not defined. "Source/kwsys/SystemTools.cxx", line 1240: Error: UTIME_NOW is not defined. "Source/kwsys/SystemTools.cxx", line 1241: Error: AT_FDCWD is not defined. diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index e4c82d8..c2b6097 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -16,6 +16,14 @@ # define _XOPEN_SOURCE_EXTENDED #endif +#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__)) +# define KWSYS_WINDOWS_DIRS +#else +# if defined(__SUNPRO_CC) +# include +# endif +#endif + #include "kwsysPrivate.h" #include KWSYS_HEADER(RegularExpression.hxx) #include KWSYS_HEADER(SystemTools.hxx) @@ -205,8 +213,7 @@ static time_t windows_filetime_to_posix_time(const FILETIME& ft) } #endif -#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__)) - +#ifdef KWSYS_WINDOWS_DIRS #include inline int Mkdir(const kwsys_stl::string& dir) ----------------------------------------------------------------------- Summary of changes: Source/kwsys/SystemTools.cxx | 11 +++++++++-- bootstrap | 29 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 1 12:48:40 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 1 Jan 2015 12:48:40 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1461-g1fac291 Message-ID: <20150101174840.6562F9A902@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1fac2911e1008224c9c0f0676e0e2b90d0cc25d4 (commit) via 998e9c10943ef361785e6f15cab1fa61172b1c24 (commit) via ec31926d24ac2cf9a8aef4cfbcbeaaca0c99b717 (commit) from 03a66cff114687d0d9e71a289b05a66259853d47 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1fac2911e1008224c9c0f0676e0e2b90d0cc25d4 commit 1fac2911e1008224c9c0f0676e0e2b90d0cc25d4 Merge: 03a66cf 998e9c1 Author: Stephen Kelly AuthorDate: Thu Jan 1 12:48:39 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 1 12:48:39 2015 -0500 Merge topic 'WCDH-thread_local-portability' into next 998e9c10 WCDH: Add feature portability for thread_local. ec31926d CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=998e9c10943ef361785e6f15cab1fa61172b1c24 commit 998e9c10943ef361785e6f15cab1fa61172b1c24 Author: Stephen Kelly AuthorDate: Thu Jan 1 17:56:01 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 1 18:20:10 2015 +0100 WCDH: Add feature portability for thread_local. AppleClang does not support the cxx_thread_local feature, even though it is based on a Clang version which does support the feature. http://stackoverflow.com/a/23850891/2428389 A possible reason for that is that thread_local might be used as a variable in existing Apple SDK headers. Extend the WriteCompilerDetectionHeader module to generate a define for that feature with portability fallbacks. For the avoidance of making it easy to write code which looks correct but which has odd runtime behavior, don't set the define symbol at all if no equivalent keyword is known. diff --git a/Help/release/dev/WCDH-thread_local.rst b/Help/release/dev/WCDH-thread_local.rst new file mode 100644 index 0000000..44516a7 --- /dev/null +++ b/Help/release/dev/WCDH-thread_local.rst @@ -0,0 +1,7 @@ +WriteCompilerDetectionHeader thread_local portability +----------------------------------------------------- + +* The :module:`WriteCompilerDetectionHeader` module learned to + create a define for portability of the cxx_thread_local feature. The define + expands to either the C++11 ``thread_local`` keyword, or a + pre-standardization compiler-specific equivalent, as appropriate. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 36b9706..d61358f 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -194,6 +194,7 @@ # ``cxx_static_assert`` ``_STATIC_ASSERT_MSG`` ``static_assert`` # ``cxx_attribute_deprecated`` ``_DEPRECATED`` ``[[deprecated]]`` # ``cxx_attribute_deprecated`` ``_DEPRECATED_MSG`` ``[[deprecated]]`` +# ``cxx_thread_local`` ``_THREAD_LOCAL`` ``thread_local`` # ============================= ================================ ===================== # # A use-case which arises with such deprecation macros is the deprecation @@ -573,6 +574,20 @@ function(write_compiler_detection_header # endif \n") endif() + if (feature STREQUAL cxx_thread_local) + set(def_value "${prefix_arg}_THREAD_LOCAL") + set(file_content "${file_content} +# if ${def_name} +# define ${def_value} thread_local +# elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang +# define ${def_value} __thread +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __declspec(thread) +# else +// ${def_value} not defined for this configuration. +# endif +\n") + endif() if (feature STREQUAL cxx_attribute_deprecated) set(def_name ${prefix_arg}_${feature_PP}) set(def_value "${prefix_arg}_DEPRECATED") ----------------------------------------------------------------------- Summary of changes: Help/release/dev/WCDH-thread_local.rst | 7 +++++++ Modules/WriteCompilerDetectionHeader.cmake | 15 +++++++++++++++ Source/CMakeVersion.cmake | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 Help/release/dev/WCDH-thread_local.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 1 13:00:20 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 1 Jan 2015 13:00:20 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-595-g07cbe36 Message-ID: <20150101180020.34C12A7779@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 07cbe3640e3afc879a07b6510de4c6e437f43f3e (commit) via f881c6bafaab2c62617259c86f044b05cefe21c2 (commit) from ec31926d24ac2cf9a8aef4cfbcbeaaca0c99b717 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=07cbe3640e3afc879a07b6510de4c6e437f43f3e commit 07cbe3640e3afc879a07b6510de4c6e437f43f3e Merge: ec31926 f881c6b Author: Brad King AuthorDate: Thu Jan 1 13:00:19 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 1 13:00:19 2015 -0500 Merge topic 'copyright-year' f881c6ba Copyright.txt: Update year range to end in 2015 ----------------------------------------------------------------------- Summary of changes: Copyright.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 1 13:00:45 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 1 Jan 2015 13:00:45 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1463-g1b96758 Message-ID: <20150101180045.D3FA3A77B6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1b9675850c4df397a517b7c72448f51c9ef717eb (commit) via 07cbe3640e3afc879a07b6510de4c6e437f43f3e (commit) from 1fac2911e1008224c9c0f0676e0e2b90d0cc25d4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b9675850c4df397a517b7c72448f51c9ef717eb commit 1b9675850c4df397a517b7c72448f51c9ef717eb Merge: 1fac291 07cbe36 Author: Brad King AuthorDate: Thu Jan 1 13:00:36 2015 -0500 Commit: Brad King CommitDate: Thu Jan 1 13:00:36 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 1 16:08:49 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 1 Jan 2015 16:08:49 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1465-gaf5d9cd Message-ID: <20150101210850.AFFE1A842E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via af5d9cd265bea1b7fedffdcd38f94bd9e92687ed (commit) via 998ed4ca0a922faf08c7ee3e95f337ff9e8f02c1 (commit) from 1b9675850c4df397a517b7c72448f51c9ef717eb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af5d9cd265bea1b7fedffdcd38f94bd9e92687ed commit af5d9cd265bea1b7fedffdcd38f94bd9e92687ed Merge: 1b96758 998ed4c Author: Stephen Kelly AuthorDate: Thu Jan 1 16:08:47 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 1 16:08:47 2015 -0500 Merge topic 'record-GNU-5-features' into next 998ed4ca Features: Record cxx_variable_templates for GNU 5.0. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=998ed4ca0a922faf08c7ee3e95f337ff9e8f02c1 commit 998ed4ca0a922faf08c7ee3e95f337ff9e8f02c1 Author: Stephen Kelly AuthorDate: Thu Jan 1 22:00:49 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 1 22:00:49 2015 +0100 Features: Record cxx_variable_templates for GNU 5.0. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 9c98e44..6de06dd 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -1,8 +1,15 @@ # Reference: http://gcc.gnu.org/projects/cxx0x.html +# http://gcc.gnu.org/projects/cxx1y.html set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") +set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L") +set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}") + +# GNU 4.9 in c++14 mode sets __cplusplus to 201300L, so don't test for the +# correct value of it below. +# https://patchwork.ozlabs.org/patch/382470/ set(GNU49_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L") set(_cmake_feature_test_cxx_contextual_conversions "${GNU49_CXX14}") set(_cmake_feature_test_cxx_attribute_deprecated "${GNU49_CXX14}") ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/GNU-CXX-FeatureTests.cmake | 7 +++++++ 1 file changed, 7 insertions(+) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jan 2 00:01:13 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 2 Jan 2015 00:01:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-596-g24dfa74 Message-ID: <20150102050113.41250A8495@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 24dfa74214bba9ac80e675e0cf7d13d72474f652 (commit) from 07cbe3640e3afc879a07b6510de4c6e437f43f3e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=24dfa74214bba9ac80e675e0cf7d13d72474f652 commit 24dfa74214bba9ac80e675e0cf7d13d72474f652 Author: Kitware Robot AuthorDate: Fri Jan 2 00:01:08 2015 -0500 Commit: Kitware Robot CommitDate: Fri Jan 2 00:01:08 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e2e79ed..2b99f8a 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 20150101) +set(CMake_VERSION_PATCH 20150102) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From robert.maynard at kitware.com Fri Jan 2 09:12:41 2015 From: robert.maynard at kitware.com (Robert Maynard) Date: Fri, 2 Jan 2015 09:12:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1470-g383c5f1 Message-ID: <20150102141241.12F8A145C5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 383c5f1b1956818c4c2f5d4fd19c1a7283a8f7f3 (commit) via 51b7afe48fe8b6256a850620764b3ab090af08a5 (commit) via e77371108755670a8f49fac8059796bb61c5abad (commit) via ef26ddcdf1de2da802a07b483fe36dc840e8e4ff (commit) via 0a8ad952382a3ee036173480bd0dd946b15a3eb7 (commit) from af5d9cd265bea1b7fedffdcd38f94bd9e92687ed (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=383c5f1b1956818c4c2f5d4fd19c1a7283a8f7f3 commit 383c5f1b1956818c4c2f5d4fd19c1a7283a8f7f3 Merge: af5d9cd 51b7afe Author: Robert Maynard AuthorDate: Fri Jan 2 09:12:39 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 2 09:12:39 2015 -0500 Merge topic 'feature_record_msvc' into next 51b7afe4 Features: Enable writing of MSVC compiler feature header. e7737110 Features: Record for MSVC 2015. ef26ddcd Features: Record for MSVC 2010-2013. 0a8ad952 CompileFeatures: Handle compilers that don't support cxx_final. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51b7afe48fe8b6256a850620764b3ab090af08a5 commit 51b7afe48fe8b6256a850620764b3ab090af08a5 Author: Robert Maynard AuthorDate: Mon Dec 22 13:45:18 2014 -0500 Commit: Robert Maynard CommitDate: Fri Jan 2 09:10:49 2015 -0500 Features: Enable writing of MSVC compiler feature header. Notes: VS2015 and above are the only MSVC versions to support cxx_final, so remove usages from the tests, and instead only test for cxx_override. VS2012 and above to conform to cxx_decltype_incomplete_return_types proposal, but without support for auto return types the dcl.type.simple example in the proposal doesn't compile. VS2013 and above to conform to the updated cxx_contextual_conversions proposal, but VS2010 and above pass the test. I am hesitant to say that VS2010 and above meet all the requirements of the proposal currently. Compilers such as MSVC have no explicit flags to enable C++11 mode, it just is always on. So only run the link tests with compilers that require a flag to specify the language version. diff --git a/Modules/Compiler/MSVC-C-FeatureTests.cmake b/Modules/Compiler/MSVC-C-FeatureTests.cmake new file mode 100644 index 0000000..64016bc --- /dev/null +++ b/Modules/Compiler/MSVC-C-FeatureTests.cmake @@ -0,0 +1,24 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + +set(_cmake_oldestSupported "_MSC_VER >= 1300") + +#currently disabling everything while we test +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_c_static_assert "${MSVC_2010}") +set(_cmake_feature_test_c_variadic_macros "${MSVC_2010}") + +set(MSVC_2003 "_MSC_VER >= 1300") +set(_cmake_feature_test_c_function_prototypes "${MSVC_2003}") + +# Currently unsupported: +#restrict requires the __restrict syntax in msvc +#set(_cmake_feature_test_c_restrict) + +#Unset all the variables that we don't need exposed. +#_cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2010) +set(MSVC_2003) \ No newline at end of file diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 36b9706..bcaaafa 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -316,6 +316,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC ) set(_hex_compilers ADSP Borland Embarcadero SunPro) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index ff5d745..d6f39bf 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.1) project(CompileFeatures) @@ -26,18 +26,30 @@ get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) foreach(feature ${c_features}) run_test(${feature} C) endforeach() + get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) + +#blacklist for msvc +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM cxx_features + #This test requires auto return type deduction to work properly, but + #that is not supported by all versions of MSVC that support decltype + #incomplete return types. + cxx_decltype_incomplete_return_types + ) +endif() + foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) list(REMOVE_ITEM CXX_non_features cxx_alignof ) endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) # GNU prior to 4.9 does not set any preprocessor define to distinguish # c++1y from c++11, so CMake does not support c++1y features before GNU 4.9. @@ -50,6 +62,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU cxx_return_type_deduction ) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM CXX_non_features + #Micrsoft only officially supports this feature in VS2013 and above, due + #to new wording of the proposal. We don't test for this with MSVC because + #older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() set(C_ext c) set(C_standard_flag 11) @@ -122,15 +142,15 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) - target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$) + target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$) add_executable(CompileFeaturesGenex2 genex_test.cpp) - target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_constexpr) - target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$) + target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert) + target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$) - add_library(noexcept_iface INTERFACE) - target_compile_features(noexcept_iface INTERFACE cxx_noexcept) + add_library(nullptr_iface INTERFACE) + target_compile_features(nullptr_iface INTERFACE cxx_nullptr) add_executable(CompileFeaturesGenex3 genex_test.cpp) - target_link_libraries(CompileFeaturesGenex3 PRIVATE noexcept_iface) - target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$) + target_link_libraries(CompileFeaturesGenex3 PRIVATE nullptr_iface) + target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$) endif() diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index ca38883..1d30884 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -8,7 +8,7 @@ struct A virtual int getA() { return 7; } }; -struct B final : A +struct B : A { int getA() override { return 42; } }; diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 5b2f1de..cbfe3f3 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0.0) +cmake_minimum_required(VERSION 3.1.0) project(WriteCompilerDetectionHeader) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -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 MSVC VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -56,17 +56,29 @@ macro(set_defines target true_defs false_defs) ) endmacro() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU - OR CMAKE_CXX_COMPILER_ID STREQUAL Clang - OR CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" + OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") # False for C++98 mode. list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() -if (CMAKE_C_COMPILER_ID STREQUAL GNU - OR CMAKE_C_COMPILER_ID STREQUAL Clang - OR CMAKE_C_COMPILER_ID STREQUAL AppleClang) +#for msvc the version determines if we support delegating constructors +#and variadic templates. Luckily support for both of these features was +#added in the same msvc version (1800) +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + +if (CMAKE_C_COMPILER_ID STREQUAL "GNU" + OR CMAKE_C_COMPILER_ID STREQUAL "Clang" + OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") add_executable(C_undefined c_undefined.c) set_property(TARGET C_undefined PROPERTY CXX_STANDARD 90) target_compile_options(C_undefined PRIVATE -Werror=undef) @@ -81,7 +93,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 MSVC VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..e4abed5 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,8 +27,13 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) - run_cmake(LinkImplementationFeatureCycleSolved) + #compilers such as MSVC have no explicit flags to enable C++11 mode, + #it just is always on. So only run the link tests with compilers that require + #a flag to specify the language version. + if(CMAKE_CXX11_STANDARD_COMPILE_OPTION) + run_cmake(LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycleSolved) + endif() if (";${CXX_FEATURES};" MATCHES ";cxx_final;") set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e77371108755670a8f49fac8059796bb61c5abad commit e77371108755670a8f49fac8059796bb61c5abad Author: Robert Maynard AuthorDate: Mon Dec 22 10:25:18 2014 -0500 Commit: Robert Maynard CommitDate: Fri Jan 2 09:10:48 2015 -0500 Features: Record for MSVC 2015. Initializer lists are only properly supported in 2015 and above.Previous Visual Studio releases said they supported initializer lists but silently produced bad code. diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake index 18dea24..2dba314 100644 --- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -1,8 +1,35 @@ # Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx # http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx -set(_oldestSupported "_MSC_VER >= 1600") + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") set(MSVC_2013 "_MSC_VER >= 1800") set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") @@ -11,14 +38,16 @@ set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") -# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221 -set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}") set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") # Possibly broken: # http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") +# Microsoft now states they support contextual conversions +# see footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}") set(MSVC_2012 "_MSC_VER >= 1700") set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") @@ -42,24 +71,27 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") # Currently unsupported: # http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ -# set(_cmake_feature_test_cxx_reference_qualified_functions ) -# set(_cmake_feature_test_cxx_inheriting_constructors ) -# set(_cmake_feature_test_cxx_alignas ) -# set(_cmake_feature_test_cxx_alignof ) -# set(_cmake_feature_test_cxx_thread_local ) -# set(_cmake_feature_test_cxx_func_identifier ) -# set(_cmake_feature_test_cxx_sizeof_member ) +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -# set(_cmake_feature_test_cxx_user_literals ) -# set(_cmake_feature_test_cxx_unrestricted_unions ) -# set(_cmake_feature_test_cxx_unicode_literals ) -# set(_cmake_feature_test_cxx_inline_namespaces ) +# set(_cmake_feature_test_cxx_reference_qualified_functions ) # set(_cmake_feature_test_cxx_constexpr ) -# set(_cmake_feature_test_cxx_noexcept ) # set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + -set(_oldestSupported) +#Unset all the variables that we don't need exposed. +#_cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Platform/Windows-MSVC-C.cmake b/Modules/Platform/Windows-MSVC-C.cmake index cbe1586..c7792eb 100644 --- a/Modules/Platform/Windows-MSVC-C.cmake +++ b/Modules/Platform/Windows-MSVC-C.cmake @@ -3,3 +3,5 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_C " /FS") endif() __windows_compiler_msvc(C) + +set(CMAKE_C_STANDARD_DEFAULT 90) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 89885b8..d0599f9 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -5,6 +5,11 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) endif() __windows_compiler_msvc(CXX) +#No version of MSVC has full conformance to C++11. Therefore the +#__cplusplus macro always evaluates to 98 even if the compilers come with +#C++11/14/+ features enabled. +set(CMAKE_CXX_STANDARD_DEFAULT 98) + macro(cmake_record_cxx_compile_features) record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ef26ddcdf1de2da802a07b483fe36dc840e8e4ff commit ef26ddcdf1de2da802a07b483fe36dc840e8e4ff Author: Stephen Kelly AuthorDate: Sun Apr 6 15:55:37 2014 +0200 Commit: Robert Maynard CommitDate: Fri Jan 2 09:10:48 2015 -0500 Features: Record for MSVC 2010-2013. diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..18dea24 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,65 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx + +set(_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221 +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Possibly broken: +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_inheriting_constructors ) +# set(_cmake_feature_test_cxx_alignas ) +# set(_cmake_feature_test_cxx_alignof ) +# set(_cmake_feature_test_cxx_thread_local ) +# set(_cmake_feature_test_cxx_func_identifier ) +# set(_cmake_feature_test_cxx_sizeof_member ) + +# set(_cmake_feature_test_cxx_user_literals ) +# set(_cmake_feature_test_cxx_unrestricted_unions ) +# set(_cmake_feature_test_cxx_unicode_literals ) +# set(_cmake_feature_test_cxx_inline_namespaces ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_noexcept ) +# set(_cmake_feature_test_cxx_attributes ) + +set(_oldestSupported) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 0e85005..89885b8 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -4,3 +4,7 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_CXX " /FS") endif() __windows_compiler_msvc(CXX) + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a8ad952382a3ee036173480bd0dd946b15a3eb7 commit 0a8ad952382a3ee036173480bd0dd946b15a3eb7 Author: Robert Maynard AuthorDate: Wed Dec 31 10:25:33 2014 -0500 Commit: Robert Maynard CommitDate: Fri Jan 2 09:10:08 2015 -0500 CompileFeatures: Handle compilers that don't support cxx_final. Previously we expanded HAVE_FINAL to determine what the copied_file number would be, but when we don't have cxx_final than HAVE_FINAL is not defined. What we really want is to use expected_result. diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake index c6707c1..b544b99 100644 --- a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake @@ -7,7 +7,7 @@ else() set(expected_result 0) endif() -add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${HAVE_FINAL}.cpp" +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_result}.cpp" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp" ) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From robert.maynard at kitware.com Fri Jan 2 09:26:25 2015 From: robert.maynard at kitware.com (Robert Maynard) Date: Fri, 2 Jan 2015 09:26:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1473-g35eaf58 Message-ID: <20150102142625.A32C2A833B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 35eaf58f91224691aa0f68bfb61d866f695db936 (commit) via 07fb7d435dd71aea389d9d89ffd4ef5aa14f1750 (commit) via dd36560b72a7f3bb0325f29d9c4c7df2c8ed3f46 (commit) from 383c5f1b1956818c4c2f5d4fd19c1a7283a8f7f3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=35eaf58f91224691aa0f68bfb61d866f695db936 commit 35eaf58f91224691aa0f68bfb61d866f695db936 Merge: 383c5f1 07fb7d4 Author: Robert Maynard AuthorDate: Fri Jan 2 09:26:24 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 2 09:26:24 2015 -0500 Merge topic 'feature_record_msvc' into next 07fb7d43 Fixup comments in commit: Enable writing of MSVC dd36560b Fixup comments in commit: Record for MSVC 2015. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=07fb7d435dd71aea389d9d89ffd4ef5aa14f1750 commit 07fb7d435dd71aea389d9d89ffd4ef5aa14f1750 Author: Robert Maynard AuthorDate: Fri Jan 2 09:23:57 2015 -0500 Commit: Robert Maynard CommitDate: Fri Jan 2 09:25:54 2015 -0500 Fixup comments in commit: Enable writing of MSVC diff --git a/Modules/Compiler/MSVC-C-FeatureTests.cmake b/Modules/Compiler/MSVC-C-FeatureTests.cmake index 64016bc..e449358 100644 --- a/Modules/Compiler/MSVC-C-FeatureTests.cmake +++ b/Modules/Compiler/MSVC-C-FeatureTests.cmake @@ -6,7 +6,6 @@ set(_cmake_oldestSupported "_MSC_VER >= 1300") -#currently disabling everything while we test set(MSVC_2010 "_MSC_VER >= 1600") set(_cmake_feature_test_c_static_assert "${MSVC_2010}") set(_cmake_feature_test_c_variadic_macros "${MSVC_2010}") @@ -15,10 +14,10 @@ set(MSVC_2003 "_MSC_VER >= 1300") set(_cmake_feature_test_c_function_prototypes "${MSVC_2003}") # Currently unsupported: -#restrict requires the __restrict syntax in msvc -#set(_cmake_feature_test_c_restrict) +# restrict requires the __restrict syntax in msvc +# set(_cmake_feature_test_c_restrict) -#Unset all the variables that we don't need exposed. -#_cmake_oldestSupported is required by WriteCompilerDetectionHeader +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader set(MSVC_2010) set(MSVC_2003) \ No newline at end of file diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index d6f39bf..48abb5c 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -29,12 +29,11 @@ endforeach() get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) -#blacklist for msvc if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") list(REMOVE_ITEM cxx_features - #This test requires auto return type deduction to work properly, but - #that is not supported by all versions of MSVC that support decltype - #incomplete return types. + # This test requires auto return type deduction to work properly, but + # that is not supported by all versions of MSVC that support decltype + # incomplete return types. cxx_decltype_incomplete_return_types ) endif() @@ -64,9 +63,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") list(REMOVE_ITEM CXX_non_features - #Micrsoft only officially supports this feature in VS2013 and above, due - #to new wording of the proposal. We don't test for this with MSVC because - #older compiler pass the test but might not actually conform + # Micrsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform cxx_contextual_conversions ) endif() diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index cbfe3f3..cfaa78c 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -64,9 +64,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() -#for msvc the version determines if we support delegating constructors -#and variadic templates. Luckily support for both of these features was -#added in the same msvc version (1800) +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index e4abed5..3b37091 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,9 +27,9 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - #compilers such as MSVC have no explicit flags to enable C++11 mode, - #it just is always on. So only run the link tests with compilers that require - #a flag to specify the language version. + # compilers such as MSVC have no explicit flags to enable c++11 mode. + # Instead they come with all c++11 features implicitly enabled. + # So for those types of compilers this tests is not applicable. if(CMAKE_CXX11_STANDARD_COMPILE_OPTION) run_cmake(LinkImplementationFeatureCycle) run_cmake(LinkImplementationFeatureCycleSolved) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd36560b72a7f3bb0325f29d9c4c7df2c8ed3f46 commit dd36560b72a7f3bb0325f29d9c4c7df2c8ed3f46 Author: Robert Maynard AuthorDate: Fri Jan 2 09:15:57 2015 -0500 Commit: Robert Maynard CommitDate: Fri Jan 2 09:25:38 2015 -0500 Fixup comments in commit: Record for MSVC 2015. diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake index 2dba314..b238fde 100644 --- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -46,7 +46,7 @@ set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") # Microsoft now states they support contextual conversions # see footnote 6 at: -# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}") set(MSVC_2012 "_MSC_VER >= 1700") @@ -89,8 +89,8 @@ set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") # set(_cmake_feature_test_cxx_variable_templates ) -#Unset all the variables that we don't need exposed. -#_cmake_oldestSupported is required by WriteCompilerDetectionHeader +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader set(MSVC_2015) set(MSVC_2013) set(MSVC_2012) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index d0599f9..ad56f68 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -5,9 +5,9 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) endif() __windows_compiler_msvc(CXX) -#No version of MSVC has full conformance to C++11. Therefore the -#__cplusplus macro always evaluates to 98 even if the compilers come with -#C++11/14/+ features enabled. +# No version of MSVC has full conformance to C++11. Therefore the +# __cplusplus macro always evaluates to 98 even if the compilers come with +# C++11/14/+ features enabled. set(CMAKE_CXX_STANDARD_DEFAULT 98) macro(cmake_record_cxx_compile_features) ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/MSVC-C-FeatureTests.cmake | 9 ++++----- Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 6 +++--- Modules/Platform/Windows-MSVC-CXX.cmake | 6 +++--- Tests/CompileFeatures/CMakeLists.txt | 13 ++++++------- Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt | 6 +++--- Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake | 6 +++--- 6 files changed, 22 insertions(+), 24 deletions(-) hooks/post-receive -- CMake From robert.maynard at kitware.com Fri Jan 2 09:32:59 2015 From: robert.maynard at kitware.com (Robert Maynard) Date: Fri, 2 Jan 2015 09:32:59 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1476-g625dde5 Message-ID: <20150102143259.A8B15A8566@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 625dde5e7f890a840160408c4b494a454e61fbae (commit) via 80b31347051db23291ff0d2ba0a4d5075a0f8c50 (commit) via 7272bd3e60e07879f526b3cd42ae965fe047c62f (commit) from 35eaf58f91224691aa0f68bfb61d866f695db936 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=625dde5e7f890a840160408c4b494a454e61fbae commit 625dde5e7f890a840160408c4b494a454e61fbae Merge: 35eaf58 80b3134 Author: Robert Maynard AuthorDate: Fri Jan 2 09:32:58 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 2 09:32:58 2015 -0500 Merge topic 'feature_record_msvc' into next 80b31347 Features: Enable writing of MSVC compiler feature header. 7272bd3e Features: Record for MSVC C++ 2015 and MSVC C 2010-2015. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80b31347051db23291ff0d2ba0a4d5075a0f8c50 commit 80b31347051db23291ff0d2ba0a4d5075a0f8c50 Author: Robert Maynard AuthorDate: Fri Jan 2 09:30:28 2015 -0500 Commit: Robert Maynard CommitDate: Fri Jan 2 09:32:13 2015 -0500 Features: Enable writing of MSVC compiler feature header. Notes: VS2015 and above are the only MSVC versions to support cxx_final, so remove usages from the tests, and instead only test for cxx_override. VS2012 and above to conform to cxx_decltype_incomplete_return_types proposal, but without support for auto return types the dcl.type.simple example in the proposal doesn't compile. VS2013 and above to conform to the updated cxx_contextual_conversions proposal, but VS2010 and above pass the test. Compilers such as MSVC have no explicit flags to enable C++11 mode, it just is always on. So only run the link tests with compilers that require a flag to specify the language version. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 36b9706..bcaaafa 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -316,6 +316,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC ) set(_hex_compilers ADSP Borland Embarcadero SunPro) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index ff5d745..48abb5c 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.1) project(CompileFeatures) @@ -26,18 +26,29 @@ get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) foreach(feature ${c_features}) run_test(${feature} C) endforeach() + get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) + +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM cxx_features + # This test requires auto return type deduction to work properly, but + # that is not supported by all versions of MSVC that support decltype + # incomplete return types. + cxx_decltype_incomplete_return_types + ) +endif() + foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) list(REMOVE_ITEM CXX_non_features cxx_alignof ) endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) # GNU prior to 4.9 does not set any preprocessor define to distinguish # c++1y from c++11, so CMake does not support c++1y features before GNU 4.9. @@ -50,6 +61,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU cxx_return_type_deduction ) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM CXX_non_features + # Micrsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() set(C_ext c) set(C_standard_flag 11) @@ -122,15 +141,15 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) - target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$) + target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$) add_executable(CompileFeaturesGenex2 genex_test.cpp) - target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_constexpr) - target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$) + target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert) + target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$) - add_library(noexcept_iface INTERFACE) - target_compile_features(noexcept_iface INTERFACE cxx_noexcept) + add_library(nullptr_iface INTERFACE) + target_compile_features(nullptr_iface INTERFACE cxx_nullptr) add_executable(CompileFeaturesGenex3 genex_test.cpp) - target_link_libraries(CompileFeaturesGenex3 PRIVATE noexcept_iface) - target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$) + target_link_libraries(CompileFeaturesGenex3 PRIVATE nullptr_iface) + target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$) endif() diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index ca38883..1d30884 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -8,7 +8,7 @@ struct A virtual int getA() { return 7; } }; -struct B final : A +struct B : A { int getA() override { return 42; } }; diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 5b2f1de..cfaa78c 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0.0) +cmake_minimum_required(VERSION 3.1.0) project(WriteCompilerDetectionHeader) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -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 MSVC VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -56,17 +56,29 @@ macro(set_defines target true_defs false_defs) ) endmacro() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU - OR CMAKE_CXX_COMPILER_ID STREQUAL Clang - OR CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" + OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") # False for C++98 mode. list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() -if (CMAKE_C_COMPILER_ID STREQUAL GNU - OR CMAKE_C_COMPILER_ID STREQUAL Clang - OR CMAKE_C_COMPILER_ID STREQUAL AppleClang) +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + +if (CMAKE_C_COMPILER_ID STREQUAL "GNU" + OR CMAKE_C_COMPILER_ID STREQUAL "Clang" + OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") add_executable(C_undefined c_undefined.c) set_property(TARGET C_undefined PROPERTY CXX_STANDARD 90) target_compile_options(C_undefined PRIVATE -Werror=undef) @@ -81,7 +93,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 MSVC VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..3b37091 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,8 +27,13 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) - run_cmake(LinkImplementationFeatureCycleSolved) + # compilers such as MSVC have no explicit flags to enable c++11 mode. + # Instead they come with all c++11 features implicitly enabled. + # So for those types of compilers this tests is not applicable. + if(CMAKE_CXX11_STANDARD_COMPILE_OPTION) + run_cmake(LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycleSolved) + endif() if (";${CXX_FEATURES};" MATCHES ";cxx_final;") set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7272bd3e60e07879f526b3cd42ae965fe047c62f commit 7272bd3e60e07879f526b3cd42ae965fe047c62f Author: Robert Maynard AuthorDate: Mon Dec 22 10:25:18 2014 -0500 Commit: Robert Maynard CommitDate: Fri Jan 2 09:31:03 2015 -0500 Features: Record for MSVC C++ 2015 and MSVC C 2010-2015. Initializer lists are only properly supported in 2015 and above. Previous Visual Studio releases said they supported initializer lists but silently produced bad code. diff --git a/Modules/Compiler/MSVC-C-FeatureTests.cmake b/Modules/Compiler/MSVC-C-FeatureTests.cmake new file mode 100644 index 0000000..e449358 --- /dev/null +++ b/Modules/Compiler/MSVC-C-FeatureTests.cmake @@ -0,0 +1,23 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + +set(_cmake_oldestSupported "_MSC_VER >= 1300") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_c_static_assert "${MSVC_2010}") +set(_cmake_feature_test_c_variadic_macros "${MSVC_2010}") + +set(MSVC_2003 "_MSC_VER >= 1300") +set(_cmake_feature_test_c_function_prototypes "${MSVC_2003}") + +# Currently unsupported: +# restrict requires the __restrict syntax in msvc +# set(_cmake_feature_test_c_restrict) + +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2010) +set(MSVC_2003) \ No newline at end of file diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake index 18dea24..b238fde 100644 --- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -1,8 +1,35 @@ # Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx # http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx -set(_oldestSupported "_MSC_VER >= 1600") + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") set(MSVC_2013 "_MSC_VER >= 1800") set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") @@ -11,14 +38,16 @@ set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") -# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221 -set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}") set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") # Possibly broken: # http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") +# Microsoft now states they support contextual conversions +# see footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}") set(MSVC_2012 "_MSC_VER >= 1700") set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") @@ -42,24 +71,27 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") # Currently unsupported: # http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ -# set(_cmake_feature_test_cxx_reference_qualified_functions ) -# set(_cmake_feature_test_cxx_inheriting_constructors ) -# set(_cmake_feature_test_cxx_alignas ) -# set(_cmake_feature_test_cxx_alignof ) -# set(_cmake_feature_test_cxx_thread_local ) -# set(_cmake_feature_test_cxx_func_identifier ) -# set(_cmake_feature_test_cxx_sizeof_member ) +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -# set(_cmake_feature_test_cxx_user_literals ) -# set(_cmake_feature_test_cxx_unrestricted_unions ) -# set(_cmake_feature_test_cxx_unicode_literals ) -# set(_cmake_feature_test_cxx_inline_namespaces ) +# set(_cmake_feature_test_cxx_reference_qualified_functions ) # set(_cmake_feature_test_cxx_constexpr ) -# set(_cmake_feature_test_cxx_noexcept ) # set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + -set(_oldestSupported) +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Platform/Windows-MSVC-C.cmake b/Modules/Platform/Windows-MSVC-C.cmake index cbe1586..c7792eb 100644 --- a/Modules/Platform/Windows-MSVC-C.cmake +++ b/Modules/Platform/Windows-MSVC-C.cmake @@ -3,3 +3,5 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_C " /FS") endif() __windows_compiler_msvc(C) + +set(CMAKE_C_STANDARD_DEFAULT 90) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 89885b8..ad56f68 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -5,6 +5,11 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) endif() __windows_compiler_msvc(CXX) +# No version of MSVC has full conformance to C++11. Therefore the +# __cplusplus macro always evaluates to 98 even if the compilers come with +# C++11/14/+ features enabled. +set(CMAKE_CXX_STANDARD_DEFAULT 98) + macro(cmake_record_cxx_compile_features) record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) endmacro() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jan 3 00:01:10 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 3 Jan 2015 00:01:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-597-g472553b Message-ID: <20150103050110.D0B90A802B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 472553b4c152e741cfafc11cdca48a5bfeae4206 (commit) from 24dfa74214bba9ac80e675e0cf7d13d72474f652 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=472553b4c152e741cfafc11cdca48a5bfeae4206 commit 472553b4c152e741cfafc11cdca48a5bfeae4206 Author: Kitware Robot AuthorDate: Sat Jan 3 00:01:08 2015 -0500 Commit: Kitware Robot CommitDate: Sat Jan 3 00:01:08 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2b99f8a..e6b405f 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 20150102) +set(CMake_VERSION_PATCH 20150103) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 3 11:44:23 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 3 Jan 2015 11:44:23 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1480-g2890d2c Message-ID: <20150103164423.0AAF6149D6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2890d2caa2a4c95518f72371bb57fb959e97419e (commit) via 76532b843f467e936466e30106acb04e5e7859db (commit) via 472553b4c152e741cfafc11cdca48a5bfeae4206 (commit) via 24dfa74214bba9ac80e675e0cf7d13d72474f652 (commit) from 625dde5e7f890a840160408c4b494a454e61fbae (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2890d2caa2a4c95518f72371bb57fb959e97419e commit 2890d2caa2a4c95518f72371bb57fb959e97419e Merge: 625dde5 76532b8 Author: Stephen Kelly AuthorDate: Sat Jan 3 11:44:22 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 3 11:44:22 2015 -0500 Merge topic 'Apple-compiler-selection' into next 76532b84 Apple: Prefer the compiler reported by Xcode to that in path. 472553b4 CMake Nightly Date Stamp 24dfa742 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76532b843f467e936466e30106acb04e5e7859db commit 76532b843f467e936466e30106acb04e5e7859db Author: Stephen Kelly AuthorDate: Sat Jan 3 17:36:34 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 3 17:36:34 2015 +0100 Apple: Prefer the compiler reported by Xcode to that in path. The compiler in the PATH on mac is a stub for a different delegate depending on the environment. Rather than requiring xcode-select to change the used Xcode globally, users should be able to choose the compiler per-session. That is possible with the DEVELOPER_DIR environment variable. However, the environment can change between running CMake and invoking the build. In such cases, CMake prefers to record the relevant paths from the environment and use them when invoking the build. That is not currently done for the compilers on APPLE, so the compiler used is not the one reported when running cmake: $ DEVELOPER_DIR=/Applications/Xcode2.app/Contents/Developer/ cc --version Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix $ DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ cc --version Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix Update that now by querying Xcode for the correct compiler path before falling back to whatever is delegated to by the compilers in /usr/bin. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 0ab3af6..f509ef3 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -41,47 +41,49 @@ macro(_cmake_find_compiler lang) endif() endif() - # Look for directories containing compilers of reference languages. - set(_${lang}_COMPILER_HINTS) - foreach(l ${_languages}) - if(CMAKE_${l}_COMPILER AND IS_ABSOLUTE "${CMAKE_${l}_COMPILER}") - get_filename_component(_hint "${CMAKE_${l}_COMPILER}" PATH) - if(IS_DIRECTORY "${_hint}") - list(APPEND _${lang}_COMPILER_HINTS "${_hint}") - endif() - unset(_hint) - endif() - endforeach() - - # Find the compiler. - if(_${lang}_COMPILER_HINTS) - # Prefer directories containing compilers of reference languages. - list(REMOVE_DUPLICATES _${lang}_COMPILER_HINTS) - find_program(CMAKE_${lang}_COMPILER - NAMES ${CMAKE_${lang}_COMPILER_LIST} - PATHS ${_${lang}_COMPILER_HINTS} - NO_DEFAULT_PATH - DOC "${lang} compiler") - endif() - find_program(CMAKE_${lang}_COMPILER NAMES ${CMAKE_${lang}_COMPILER_LIST} DOC "${lang} compiler") - if(CMAKE_${lang}_COMPILER_INIT AND NOT CMAKE_${lang}_COMPILER) - set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${CMAKE_${lang}_COMPILER_INIT}") - endif() - unset(_${lang}_COMPILER_HINTS) - unset(_languages) - # Look for a make tool provided by Xcode - if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE) + if(CMAKE_HOST_APPLE) foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) execute_process(COMMAND xcrun --find ${comp} OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE _xcrun_err) if(_xcrun_out) - set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_out}") + set(CMAKE_${lang}_COMPILER "${_xcrun_out}" CACHE PATH "${lang} compiler") break() endif() endforeach() endif() + + if(NOT CMAKE_${lang}_COMPILER) + # Look for directories containing compilers of reference languages. + set(_${lang}_COMPILER_HINTS) + foreach(l ${_languages}) + if(CMAKE_${l}_COMPILER AND IS_ABSOLUTE "${CMAKE_${l}_COMPILER}") + get_filename_component(_hint "${CMAKE_${l}_COMPILER}" PATH) + if(IS_DIRECTORY "${_hint}") + list(APPEND _${lang}_COMPILER_HINTS "${_hint}") + endif() + unset(_hint) + endif() + endforeach() + + # Find the compiler. + if(_${lang}_COMPILER_HINTS) + # Prefer directories containing compilers of reference languages. + list(REMOVE_DUPLICATES _${lang}_COMPILER_HINTS) + find_program(CMAKE_${lang}_COMPILER + NAMES ${CMAKE_${lang}_COMPILER_LIST} + PATHS ${_${lang}_COMPILER_HINTS} + NO_DEFAULT_PATH + DOC "${lang} compiler") + endif() + find_program(CMAKE_${lang}_COMPILER NAMES ${CMAKE_${lang}_COMPILER_LIST} DOC "${lang} compiler") + if(CMAKE_${lang}_COMPILER_INIT AND NOT CMAKE_${lang}_COMPILER) + set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${CMAKE_${lang}_COMPILER_INIT}") + endif() + unset(_${lang}_COMPILER_HINTS) + endif() + unset(_languages) endmacro() macro(_cmake_find_compiler_path lang) ----------------------------------------------------------------------- Summary of changes: Modules/CMakeDetermineCompiler.cmake | 64 ++++++++++++++++++---------------- Source/CMakeVersion.cmake | 2 +- 2 files changed, 34 insertions(+), 32 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jan 4 00:01:12 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 4 Jan 2015 00:01:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-598-g592dd35 Message-ID: <20150104050112.C6C1DAA571@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 592dd355705ba0b22f33d48c2e0b5ff0e2a471d8 (commit) from 472553b4c152e741cfafc11cdca48a5bfeae4206 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=592dd355705ba0b22f33d48c2e0b5ff0e2a471d8 commit 592dd355705ba0b22f33d48c2e0b5ff0e2a471d8 Author: Kitware Robot AuthorDate: Sun Jan 4 00:01:08 2015 -0500 Commit: Kitware Robot CommitDate: Sun Jan 4 00:01:08 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e6b405f..16c31e3 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 20150103) +set(CMake_VERSION_PATCH 20150104) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From eike at sf-mail.de Sun Jan 4 08:29:06 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Sun, 4 Jan 2015 08:29:06 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1482-gc0dec59 Message-ID: <20150104132906.603FFA915A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c0dec596d1fadce47a9188a2a7f1b53c62852b72 (commit) via 939198a53bb6ad9a2600b357fb69a47f8d344cfd (commit) from 2890d2caa2a4c95518f72371bb57fb959e97419e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c0dec596d1fadce47a9188a2a7f1b53c62852b72 commit c0dec596d1fadce47a9188a2a7f1b53c62852b72 Merge: 2890d2c 939198a Author: Rolf Eike Beer AuthorDate: Sun Jan 4 08:29:05 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 4 08:29:05 2015 -0500 Merge topic 'FindICE-no-quote' into next 939198a5 FindICE: remove quoting of variable names that must be dereferenced http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=939198a53bb6ad9a2600b357fb69a47f8d344cfd commit 939198a53bb6ad9a2600b357fb69a47f8d344cfd Author: Rolf Eike Beer AuthorDate: Sun Jan 4 14:06:14 2015 +0100 Commit: Rolf Eike Beer CommitDate: Sun Jan 4 14:28:32 2015 +0100 FindICE: remove quoting of variable names that must be dereferenced diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake index 76cecc1..8493d80 100644 --- a/Modules/FindIce.cmake +++ b/Modules/FindIce.cmake @@ -282,21 +282,21 @@ function(_Ice_FIND) PATH_SUFFIXES ${ice_library_suffixes} DOC "Ice ${component} library") mark_as_advanced("${component_cache}") - if("${component_cache}") + if(${component_cache}) set("${component_found}" ON) list(APPEND Ice_LIBRARY "${${component_cache}}") endif() mark_as_advanced("${component_found}") set("${component_cache}" "${${component_cache}}" PARENT_SCOPE) set("${component_found}" "${${component_found}}" PARENT_SCOPE) - if("${component_found}") - if ("Ice_FIND_REQUIRED_${component}") + if(${component_found}) + if (Ice_FIND_REQUIRED_${component}) list(APPEND Ice_LIBS_FOUND "${component} (required)") else() list(APPEND Ice_LIBS_FOUND "${component} (optional)") endif() else() - if ("Ice_FIND_REQUIRED_${component}") + if (Ice_FIND_REQUIRED_${component}) set(Ice_REQUIRED_LIBS_FOUND OFF) list(APPEND Ice_LIBS_NOTFOUND "${component} (required)") else() @@ -356,7 +356,7 @@ if(Ice_FOUND) set(_Ice_component_cache "Ice_${_Ice_component_upcase}_LIBRARY") set(_Ice_component_lib "Ice_${_Ice_component_upcase}_LIBRARIES") set(_Ice_component_found "${_Ice_component_upcase}_FOUND") - if("${_Ice_component_found}") + if(${_Ice_component_found}) set("${_Ice_component_lib}" "${${_Ice_component_cache}}") endif() unset(_Ice_component_upcase) ----------------------------------------------------------------------- Summary of changes: Modules/FindIce.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 4 10:55:33 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 4 Jan 2015 10:55:33 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1489-gdc834a6 Message-ID: <20150104155533.684F8A8D66@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via dc834a64ff36cf9f7d8863bcb26862ca00c602e0 (commit) via 2b14fd9b2f2d19fd5f44ce8c3047125233c01943 (commit) via 65a39f05ac1913daa08173429f76f6df60e07502 (commit) via eb754045d93a75e290905409071da88c8cdd49b4 (commit) via 727980e93918d8df3847a17c608abe49432254c7 (commit) via 5216c48224a24c1c3d59b3535ee9c851c6c19636 (commit) via 3fba119f099cc7d6a1597d5bdc112c8f79ee0bcd (commit) from c0dec596d1fadce47a9188a2a7f1b53c62852b72 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc834a64ff36cf9f7d8863bcb26862ca00c602e0 commit dc834a64ff36cf9f7d8863bcb26862ca00c602e0 Merge: c0dec59 2b14fd9 Author: Stephen Kelly AuthorDate: Sun Jan 4 10:55:30 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 4 10:55:30 2015 -0500 Merge topic 'delete-algorithm' into next 2b14fd9b Use the cmDeleteAll algorithm for types derived from std::map. 65a39f05 cmDeleteAll: Generalize deletion specialization for map types. eb754045 cmVariableWatch: Use the cmDeleteAll algorithm with for_each. 727980e9 cmGeneratorExpressionEvaluator: Replace own algorithm with cmDeleteAll. 5216c482 Use the cmDeleteAll algorithm instead of trivial raw loops. 3fba119f Add a generic algorithm for deleting items in a container. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2b14fd9b2f2d19fd5f44ce8c3047125233c01943 commit 2b14fd9b2f2d19fd5f44ce8c3047125233c01943 Author: Stephen Kelly AuthorDate: Sun Jan 4 15:06:37 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 4 16:36:48 2015 +0100 Use the cmDeleteAll algorithm for types derived from std::map. 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::iterator it = this->begin(); - it != this->end(); - ++ it) - { - delete it->second; - } + cmDeleteAll(*this); this->derived::clear(); } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 721c2ab..1549322 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1510,11 +1510,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); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 3f09b9e..0eb47a9 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -542,12 +542,7 @@ void cmTarget::ClearLinkMaps() this->Internal->LinkInterfaceMap.clear(); this->Internal->LinkInterfaceUsageRequirementsOnlyMap.clear(); this->Internal->LinkClosureMap.clear(); - for (cmTargetLinkInformationMap::const_iterator it - = this->LinkInformation.begin(); - it != this->LinkInformation.end(); ++it) - { - delete it->second; - } + cmDeleteAll(this->LinkInformation); this->LinkInformation.clear(); } @@ -6913,10 +6908,7 @@ cmTargetLinkInformationMap //---------------------------------------------------------------------------- cmTargetLinkInformationMap::~cmTargetLinkInformationMap() { - for(derived::iterator i = this->begin(); i != this->end(); ++i) - { - delete i->second; - } + cmDeleteAll(*this); } //---------------------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=65a39f05ac1913daa08173429f76f6df60e07502 commit 65a39f05ac1913daa08173429f76f6df60e07502 Author: Stephen Kelly AuthorDate: Sun Jan 4 15:16:56 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 4 16:36:48 2015 +0100 cmDeleteAll: Generalize deletion specialization for map types. Assume that a container whose const_iterator to a container which has a value_type which in turn has a second_type should have the second member deleted. Use a C++17-style voider to implement the type introspection. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 853413d..af060a3 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -448,7 +448,26 @@ private: namespace ContainerAlgorithms { -template +template struct voider { typedef void type; }; + +template +struct HasSecondType +{ + enum { value = false }; +}; + +template +struct HasSecondType::type> +{ + enum { value = true }; +}; + +template::value_type + >::value> struct DefaultDeleter { void operator()(typename Container::value_type value) { @@ -456,10 +475,10 @@ struct DefaultDeleter } }; -template -struct DefaultDeleter > +template +struct DefaultDeleter { - void operator()(typename std::map::value_type value) { + void operator()(typename Container::value_type value) { delete value.second; } }; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb754045d93a75e290905409071da88c8cdd49b4 commit eb754045d93a75e290905409071da88c8cdd49b4 Author: Stephen Kelly AuthorDate: Sun Jan 4 16:33:15 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 4 16:36:48 2015 +0100 cmVariableWatch: Use the cmDeleteAll algorithm with for_each. diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx index cb6cb12..b8a6df2 100644 --- a/Source/cmVariableWatch.cxx +++ b/Source/cmVariableWatch.cxx @@ -34,21 +34,16 @@ cmVariableWatch::cmVariableWatch() { } -cmVariableWatch::~cmVariableWatch() +template +void deleteAllSecond(typename C::value_type it) { - cmVariableWatch::StringToVectorOfPairs::iterator svp_it; - - for ( svp_it = this->WatchMap.begin(); - svp_it != this->WatchMap.end(); ++svp_it ) - { - cmVariableWatch::VectorOfPairs::iterator p_it; + cmDeleteAll(it.second); +} - for ( p_it = svp_it->second.begin(); - p_it != svp_it->second.end(); ++p_it ) - { - delete *p_it; - } - } +cmVariableWatch::~cmVariableWatch() +{ + std::for_each(this->WatchMap.begin(), this->WatchMap.end(), + deleteAllSecond); } bool cmVariableWatch::AddWatch(const std::string& variable, http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=727980e93918d8df3847a17c608abe49432254c7 commit 727980e93918d8df3847a17c608abe49432254c7 Author: Stephen Kelly AuthorDate: Sun Jan 4 16:35:26 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 4 16:36:48 2015 +0100 cmGeneratorExpressionEvaluator: Replace own algorithm with cmDeleteAll. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 7ddf4d0..8d4c0c5 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -2054,30 +2054,9 @@ std::string GeneratorExpressionContent::EvaluateParameters( } //---------------------------------------------------------------------------- -static void deleteAll(const std::vector &c) -{ - std::vector::const_iterator it - = c.begin(); - const std::vector::const_iterator end - = c.end(); - for ( ; it != end; ++it) - { - delete *it; - } -} - -//---------------------------------------------------------------------------- GeneratorExpressionContent::~GeneratorExpressionContent() { - deleteAll(this->IdentifierChildren); - - typedef std::vector EvaluatorVector; - std::vector::const_iterator pit = - this->ParamChildren.begin(); - const std::vector::const_iterator pend = - this->ParamChildren.end(); - for ( ; pit != pend; ++pit) - { - deleteAll(*pit); - } + cmDeleteAll(this->IdentifierChildren); + std::for_each(this->ParamChildren.begin(), this->ParamChildren.end(), + cmDeleteAll >); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5216c48224a24c1c3d59b3535ee9c851c6c19636 commit 5216c48224a24c1c3d59b3535ee9c851c6c19636 Author: Stephen Kelly AuthorDate: Sun Jan 4 13:33:16 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 4 16:36:40 2015 +0100 Use the cmDeleteAll algorithm instead of trivial raw loops. diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index 94ca536..a07c29a 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -158,11 +158,7 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory() //---------------------------------------------------------------------- cmCPackGeneratorFactory::~cmCPackGeneratorFactory() { - std::vector::iterator it; - for ( it = this->Generators.begin(); it != this->Generators.end(); ++ it ) - { - delete *it; - } + cmDeleteAll(this->Generators); } //---------------------------------------------------------------------- diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 4200e9e..248efaf 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -69,11 +69,7 @@ cmCursesMainForm::~cmCursesMainForm() // Clean-up composites if (this->Entries) { - std::vector::iterator it; - for (it = this->Entries->begin(); it != this->Entries->end(); ++it) - { - delete *it; - } + cmDeleteAll(*this->Entries); } delete this->Entries; if (this->CMakeInstance) @@ -188,12 +184,7 @@ void cmCursesMainForm::InitializeUI() // Clean old entries if (this->Entries) { - // Have to call delete on each pointer - std::vector::iterator it; - for (it = this->Entries->begin(); it != this->Entries->end(); ++it) - { - delete *it; - } + cmDeleteAll(*this->Entries); } delete this->Entries; this->Entries = newEntries; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 80dbaf3..1879bf7 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -378,13 +378,7 @@ cmCTest::cmCTest() //---------------------------------------------------------------------- cmCTest::~cmCTest() { - cmCTest::t_TestingHandlers::iterator it; - for ( it = this->TestingHandlers.begin(); - it != this->TestingHandlers.end(); ++ it ) - { - delete it->second; - it->second = 0; - } + cmDeleteAll(this->TestingHandlers); this->SetOutputLogFileName(0); } diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index a636d23..ed2026c 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -200,12 +200,7 @@ cmComputeLinkDepends //---------------------------------------------------------------------------- cmComputeLinkDepends::~cmComputeLinkDepends() { - for(std::vector::iterator - i = this->InferredDependSets.begin(); - i != this->InferredDependSets.end(); ++i) - { - delete *i; - } + cmDeleteAll(this->InferredDependSets); delete this->CCG; } diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index a1fc268..bedd0aa 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -90,12 +90,7 @@ cmDependsC::cmDependsC(cmLocalGenerator* lg, cmDependsC::~cmDependsC() { this->WriteCacheFile(); - - for (std::map::iterator it= - this->FileCache.begin(); it!=this->FileCache.end(); ++it) - { - delete it->second; - } + cmDeleteAll(this->FileCache); } //---------------------------------------------------------------------------- diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 3ff1017..a268d12 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -87,12 +87,7 @@ cmDocumentation::cmDocumentation() //---------------------------------------------------------------------------- cmDocumentation::~cmDocumentation() { - for(std::map::iterator i = - this->AllSections.begin(); - i != this->AllSections.end(); ++i) - { - delete i->second; - } + cmDeleteAll(this->AllSections); } //---------------------------------------------------------------------------- diff --git a/Source/cmExportSet.cxx b/Source/cmExportSet.cxx index 33b0630..14812e4 100644 --- a/Source/cmExportSet.cxx +++ b/Source/cmExportSet.cxx @@ -15,10 +15,7 @@ cmExportSet::~cmExportSet() { - for(unsigned int i = 0; i < this->TargetExports.size(); ++ i) - { - delete this->TargetExports[i]; - } + cmDeleteAll(this->TargetExports); } void cmExportSet::AddTargetExport(cmTargetExport* te) diff --git a/Source/cmFileLockPool.cxx b/Source/cmFileLockPool.cxx index 551a75a..cf8e9a9 100644 --- a/Source/cmFileLockPool.cxx +++ b/Source/cmFileLockPool.cxx @@ -23,16 +23,8 @@ cmFileLockPool::cmFileLockPool() cmFileLockPool::~cmFileLockPool() { - for (It i = this->FunctionScopes.begin(); - i != this->FunctionScopes.end(); ++i) - { - delete *i; - } - - for (It i = this->FileScopes.begin(); i != this->FileScopes.end(); ++i) - { - delete *i; - } + cmDeleteAll(this->FunctionScopes); + cmDeleteAll(this->FileScopes); } void cmFileLockPool::PushFunctionScope() @@ -148,10 +140,7 @@ cmFileLockPool::ScopePool::ScopePool() cmFileLockPool::ScopePool::~ScopePool() { - for (It i = this->Locks.begin(); i != this->Locks.end(); ++i) - { - delete *i; - } + cmDeleteAll(this->Locks); } cmFileLockResult cmFileLockPool::ScopePool::Lock( diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 861122c..b2a2386 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -150,15 +150,7 @@ cmCompiledGeneratorExpression::cmCompiledGeneratorExpression( //---------------------------------------------------------------------------- cmCompiledGeneratorExpression::~cmCompiledGeneratorExpression() { - std::vector::const_iterator it - = this->Evaluators.begin(); - const std::vector::const_iterator end - = this->Evaluators.end(); - - for ( ; it != end; ++it) - { - delete *it; - } + cmDeleteAll(this->Evaluators); } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index dd7fbc8..721c2ab 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1517,27 +1517,13 @@ void cmGlobalGenerator::ClearGeneratorMembers() } this->GeneratorTargets.clear(); - for(std::vector::const_iterator - li = this->EvaluationFiles.begin(); - li != this->EvaluationFiles.end(); - ++li) - { - delete *li; - } + cmDeleteAll(this->EvaluationFiles); this->EvaluationFiles.clear(); - for(std::map::iterator - i = this->BuildExportSets.begin(); - i != this->BuildExportSets.end(); ++i) - { - delete i->second; - } + cmDeleteAll(this->BuildExportSets); this->BuildExportSets.clear(); - for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) - { - delete this->LocalGenerators[i]; - } + cmDeleteAll(this->LocalGenerators); this->LocalGenerators.clear(); this->ExportSets.clear(); diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h index 7134a4e..503f92c 100644 --- a/Source/cmInstalledFile.h +++ b/Source/cmInstalledFile.h @@ -38,11 +38,7 @@ public: ~Property() { - for(ExpressionVectorType::iterator i = ValueExpressions.begin(); - i != ValueExpressions.end(); ++i) - { - delete *i; - } + cmDeleteAll(this->ValueExpressions); } ExpressionVectorType ValueExpressions; diff --git a/Source/cmMakeDepend.cxx b/Source/cmMakeDepend.cxx index 1499e57..54b8535 100644 --- a/Source/cmMakeDepend.cxx +++ b/Source/cmMakeDepend.cxx @@ -34,12 +34,7 @@ cmMakeDepend::cmMakeDepend() cmMakeDepend::~cmMakeDepend() { - for(DependInformationMapType::iterator i = - this->DependInformationMap.begin(); - i != this->DependInformationMap.end(); ++i) - { - delete i->second; - } + cmDeleteAll(this->DependInformationMap); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 20dae5a..d93a46f 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -194,45 +194,13 @@ bool cmMakefile::NeedCacheCompatibility(int major, int minor) const cmMakefile::~cmMakefile() { - for(std::vector::iterator - i = this->InstallGenerators.begin(); - i != this->InstallGenerators.end(); ++i) - { - delete *i; - } - for(std::vector::iterator - i = this->TestGenerators.begin(); - i != this->TestGenerators.end(); ++i) - { - delete *i; - } - for(std::vector::iterator i = this->SourceFiles.begin(); - i != this->SourceFiles.end(); ++i) - { - delete *i; - } - for(std::map::iterator i = this->Tests.begin(); - i != this->Tests.end(); ++i) - { - delete i->second; - } - for(std::vector::iterator - i = this->ImportedTargetsOwned.begin(); - i != this->ImportedTargetsOwned.end(); ++i) - { - delete *i; - } - for(unsigned int i=0; i < this->FinalPassCommands.size(); i++) - { - delete this->FinalPassCommands[i]; - } - std::vector::iterator pos; - for (pos = this->FunctionBlockers.begin(); - pos != this->FunctionBlockers.end(); ++pos) - { - cmFunctionBlocker* b = *pos; - delete b; - } + cmDeleteAll(this->InstallGenerators); + cmDeleteAll(this->TestGenerators); + cmDeleteAll(this->SourceFiles); + cmDeleteAll(this->Tests); + cmDeleteAll(this->ImportedTargetsOwned); + cmDeleteAll(this->FinalPassCommands); + cmDeleteAll(this->FunctionBlockers); this->FunctionBlockers.clear(); if (this->PolicyStack.size() != 1) { diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 3cdd2f6..6c4609a 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -291,18 +291,8 @@ cmOrderDirectories::cmOrderDirectories(cmGlobalGenerator* gg, //---------------------------------------------------------------------------- cmOrderDirectories::~cmOrderDirectories() { - for(std::vector::iterator - i = this->ConstraintEntries.begin(); - i != this->ConstraintEntries.end(); ++i) - { - delete *i; - } - for(std::vector::iterator - i = this->ImplicitDirEntries.begin(); - i != this->ImplicitDirEntries.end(); ++i) - { - delete *i; - } + cmDeleteAll(this->ConstraintEntries); + cmDeleteAll(this->ImplicitDirEntries); } //---------------------------------------------------------------------------- diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 1a27a25..ad40565 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -378,13 +378,7 @@ cmPolicies::cmPolicies() cmPolicies::~cmPolicies() { - // free the policies - std::map::iterator i - = this->Policies.begin(); - for (;i != this->Policies.end(); ++i) - { - delete i->second; - } + cmDeleteAll(this->Policies); } void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 94a6de3..3f09b9e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -226,13 +226,7 @@ cmLinkImplItem cmTargetInternals::TargetPropertyEntry::NoLinkImplItem; static void deleteAndClear( std::vector &entries) { - for (std::vector::const_iterator - it = entries.begin(), - end = entries.end(); - it != end; ++it) - { - delete *it; - } + cmDeleteAll(entries); entries.clear(); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bbd3fe4..da265e3 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -171,16 +171,8 @@ cmake::~cmake() delete this->GlobalGenerator; this->GlobalGenerator = 0; } - for(RegisteredCommandsMap::iterator j = this->Commands.begin(); - j != this->Commands.end(); ++j) - { - delete (*j).second; - } - for(RegisteredGeneratorsVector::iterator j = this->Generators.begin(); - j != this->Generators.end(); ++j) - { - delete *j; - } + cmDeleteAll(this->Commands); + cmDeleteAll(this->Generators); #ifdef CMAKE_BUILD_WITH_CMAKE delete this->VariableWatch; #endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3fba119f099cc7d6a1597d5bdc112c8f79ee0bcd commit 3fba119f099cc7d6a1597d5bdc112c8f79ee0bcd Author: Stephen Kelly AuthorDate: Sun Jan 4 14:53:24 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 4 15:57:10 2015 +0100 Add a generic algorithm for deleting items in a container. Specialize for std::map types to delete the second element from the iterator. This is not quite general enough that it can be used everywhere, because CMake inherits from std::map and creates typedefs with custom comparison functors etc, which can not use this algorithm. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 6b85634..853413d 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -446,4 +446,31 @@ private: const std::string m_test; }; +namespace ContainerAlgorithms { + +template +struct DefaultDeleter +{ + void operator()(typename Container::value_type value) { + delete value; + } +}; + +template +struct DefaultDeleter > +{ + void operator()(typename std::map::value_type value) { + delete value.second; + } +}; + +} + +template +void cmDeleteAll(Container const& c) +{ + std::for_each(c.begin(), c.end(), + ContainerAlgorithms::DefaultDeleter()); +} + #endif ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGeneratorFactory.cxx | 6 +--- Source/CursesDialog/cmCursesMainForm.cxx | 13 ++------ Source/cmCTest.cxx | 8 +---- Source/cmComputeLinkDepends.cxx | 7 +---- Source/cmDependsC.cxx | 7 +---- Source/cmDocumentation.cxx | 7 +---- Source/cmExportSet.cxx | 5 +--- Source/cmExportSetMap.cxx | 7 +---- Source/cmFileLockPool.cxx | 17 ++--------- Source/cmGeneratorExpression.cxx | 10 +------ Source/cmGeneratorExpressionEvaluator.cxx | 27 ++--------------- Source/cmGlobalGenerator.cxx | 26 +++------------- Source/cmInstalledFile.h | 6 +--- Source/cmMakeDepend.cxx | 7 +---- Source/cmMakefile.cxx | 46 +++++------------------------ Source/cmOrderDirectories.cxx | 14 ++------- Source/cmPolicies.cxx | 8 +---- Source/cmStandardIncludes.h | 46 +++++++++++++++++++++++++++++ Source/cmTarget.cxx | 20 ++----------- Source/cmVariableWatch.cxx | 21 +++++-------- Source/cmake.cxx | 12 ++------ 21 files changed, 91 insertions(+), 229 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 4 11:02:54 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 4 Jan 2015 11:02:54 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1491-g1ec61b9 Message-ID: <20150104160254.5ED22A8F25@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1ec61b9ae1e107567553ee4fd799a41fb266735a (commit) via 7aba88cc18f2d1b46a210e4132f04798feb5d93e (commit) from dc834a64ff36cf9f7d8863bcb26862ca00c602e0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ec61b9ae1e107567553ee4fd799a41fb266735a commit 1ec61b9ae1e107567553ee4fd799a41fb266735a Merge: dc834a6 7aba88c Author: Stephen Kelly AuthorDate: Sun Jan 4 11:02:53 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 4 11:02:53 2015 -0500 Merge topic 'delete-algorithm' into next 7aba88cc Simplify the template metaprogram. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7aba88cc18f2d1b46a210e4132f04798feb5d93e commit 7aba88cc18f2d1b46a210e4132f04798feb5d93e Author: Stephen Kelly AuthorDate: Sun Jan 4 17:01:05 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 4 17:01:39 2015 +0100 Simplify the template metaprogram. No need to go through iterator_traits really. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index af060a3..4e846e6 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -463,11 +463,7 @@ struct HasSecondType::type> }; template::value_type - >::value> + bool hasSecondType = HasSecondType::value> struct DefaultDeleter { void operator()(typename Container::value_type value) { ----------------------------------------------------------------------- Summary of changes: Source/cmStandardIncludes.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 4 11:03:24 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 4 Jan 2015 11:03:24 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1494-g4d0a5c0 Message-ID: <20150104160324.C7849A8F4E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4d0a5c05cec02e9b0ed8987621ae3a4f6a3b2428 (commit) via 66c9ae6c7ea88dc65c5923d124970bf8cd6c4f3b (commit) via abaffb10fb67e3e16937518b307215f44da01051 (commit) from 1ec61b9ae1e107567553ee4fd799a41fb266735a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4d0a5c05cec02e9b0ed8987621ae3a4f6a3b2428 commit 4d0a5c05cec02e9b0ed8987621ae3a4f6a3b2428 Merge: 1ec61b9 66c9ae6 Author: Stephen Kelly AuthorDate: Sun Jan 4 11:03:24 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 4 11:03:24 2015 -0500 Merge topic 'delete-algorithm' into next 66c9ae6c Use the cmDeleteAll algorithm for types derived from std::map. abaffb10 cmDeleteAll: Generalize deletion specialization for map types. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=66c9ae6c7ea88dc65c5923d124970bf8cd6c4f3b commit 66c9ae6c7ea88dc65c5923d124970bf8cd6c4f3b Author: Stephen Kelly AuthorDate: Sun Jan 4 15:06:37 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 4 17:03:06 2015 +0100 Use the cmDeleteAll algorithm for types derived from std::map. 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::iterator it = this->begin(); - it != this->end(); - ++ it) - { - delete it->second; - } + cmDeleteAll(*this); this->derived::clear(); } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 721c2ab..1549322 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1510,11 +1510,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); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 3f09b9e..0eb47a9 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -542,12 +542,7 @@ void cmTarget::ClearLinkMaps() this->Internal->LinkInterfaceMap.clear(); this->Internal->LinkInterfaceUsageRequirementsOnlyMap.clear(); this->Internal->LinkClosureMap.clear(); - for (cmTargetLinkInformationMap::const_iterator it - = this->LinkInformation.begin(); - it != this->LinkInformation.end(); ++it) - { - delete it->second; - } + cmDeleteAll(this->LinkInformation); this->LinkInformation.clear(); } @@ -6913,10 +6908,7 @@ cmTargetLinkInformationMap //---------------------------------------------------------------------------- cmTargetLinkInformationMap::~cmTargetLinkInformationMap() { - for(derived::iterator i = this->begin(); i != this->end(); ++i) - { - delete i->second; - } + cmDeleteAll(*this); } //---------------------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=abaffb10fb67e3e16937518b307215f44da01051 commit abaffb10fb67e3e16937518b307215f44da01051 Author: Stephen Kelly AuthorDate: Sun Jan 4 15:16:56 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 4 17:03:05 2015 +0100 cmDeleteAll: Generalize deletion specialization for map types. Assume that a container whose const_iterator to a container which has a value_type which in turn has a second_type should have the second member deleted. Use a C++17-style voider to implement the type introspection. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 853413d..4e846e6 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -448,7 +448,22 @@ private: namespace ContainerAlgorithms { -template +template struct voider { typedef void type; }; + +template +struct HasSecondType +{ + enum { value = false }; +}; + +template +struct HasSecondType::type> +{ + enum { value = true }; +}; + +template::value> struct DefaultDeleter { void operator()(typename Container::value_type value) { @@ -456,10 +471,10 @@ struct DefaultDeleter } }; -template -struct DefaultDeleter > +template +struct DefaultDeleter { - void operator()(typename std::map::value_type value) { + void operator()(typename Container::value_type value) { delete value.second; } }; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jan 5 00:01:11 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 5 Jan 2015 00:01:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-599-g4b70635 Message-ID: <20150105050111.7DA7EA8F96@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 4b70635c9fe9b4425db275c2ed3be1b5223ebe4b (commit) from 592dd355705ba0b22f33d48c2e0b5ff0e2a471d8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4b70635c9fe9b4425db275c2ed3be1b5223ebe4b commit 4b70635c9fe9b4425db275c2ed3be1b5223ebe4b Author: Kitware Robot AuthorDate: Mon Jan 5 00:01:09 2015 -0500 Commit: Kitware Robot CommitDate: Mon Jan 5 00:01:09 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 16c31e3..506f0da 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 20150104) +set(CMake_VERSION_PATCH 20150105) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Mon Jan 5 03:21:34 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 5 Jan 2015 03:21:34 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1496-g9b8ba31 Message-ID: <20150105082134.CF0EDA9068@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9b8ba31802a3e89b8aa1f34b3dfa7521d47c235a (commit) via 6e977a761af4f38ad27dbdbc2e3777c780fb494e (commit) from 4d0a5c05cec02e9b0ed8987621ae3a4f6a3b2428 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b8ba31802a3e89b8aa1f34b3dfa7521d47c235a commit 9b8ba31802a3e89b8aa1f34b3dfa7521d47c235a Merge: 4d0a5c0 6e977a7 Author: Stephen Kelly AuthorDate: Mon Jan 5 03:21:33 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 5 03:21:33 2015 -0500 Merge topic 'delete-algorithm' into next 6e977a76 Revert use of sfinae. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e977a761af4f38ad27dbdbc2e3777c780fb494e commit 6e977a761af4f38ad27dbdbc2e3777c780fb494e Author: Stephen Kelly AuthorDate: Mon Jan 5 09:19:59 2015 +0100 Commit: Stephen Kelly CommitDate: Mon Jan 5 09:20:11 2015 +0100 Revert use of sfinae. VS 7.1 doesn't support sfinae. diff --git a/Source/cmExportSetMap.cxx b/Source/cmExportSetMap.cxx index 14c4458..5174118 100644 --- a/Source/cmExportSetMap.cxx +++ b/Source/cmExportSetMap.cxx @@ -25,7 +25,12 @@ cmExportSet* cmExportSetMap::operator[](const std::string &name) void cmExportSetMap::clear() { - cmDeleteAll(*this); + for(std::map::iterator it = this->begin(); + it != this->end(); + ++ it) + { + delete it->second; + } this->derived::clear(); } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 1549322..721c2ab 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1510,7 +1510,11 @@ void cmGlobalGenerator::CreateGeneratorTargets() //---------------------------------------------------------------------------- void cmGlobalGenerator::ClearGeneratorMembers() { - cmDeleteAll(this->GeneratorTargets); + for(cmGeneratorTargetsType::iterator i = this->GeneratorTargets.begin(); + i != this->GeneratorTargets.end(); ++i) + { + delete i->second; + } this->GeneratorTargets.clear(); cmDeleteAll(this->EvaluationFiles); diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 4e846e6..853413d 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -448,22 +448,7 @@ private: namespace ContainerAlgorithms { -template struct voider { typedef void type; }; - -template -struct HasSecondType -{ - enum { value = false }; -}; - -template -struct HasSecondType::type> -{ - enum { value = true }; -}; - -template::value> +template struct DefaultDeleter { void operator()(typename Container::value_type value) { @@ -471,10 +456,10 @@ struct DefaultDeleter } }; -template -struct DefaultDeleter +template +struct DefaultDeleter > { - void operator()(typename Container::value_type value) { + void operator()(typename std::map::value_type value) { delete value.second; } }; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 0eb47a9..3f09b9e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -542,7 +542,12 @@ void cmTarget::ClearLinkMaps() this->Internal->LinkInterfaceMap.clear(); this->Internal->LinkInterfaceUsageRequirementsOnlyMap.clear(); this->Internal->LinkClosureMap.clear(); - cmDeleteAll(this->LinkInformation); + for (cmTargetLinkInformationMap::const_iterator it + = this->LinkInformation.begin(); + it != this->LinkInformation.end(); ++it) + { + delete it->second; + } this->LinkInformation.clear(); } @@ -6908,7 +6913,10 @@ cmTargetLinkInformationMap //---------------------------------------------------------------------------- cmTargetLinkInformationMap::~cmTargetLinkInformationMap() { - cmDeleteAll(*this); + for(derived::iterator i = this->begin(); i != this->end(); ++i) + { + delete i->second; + } } //---------------------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/cmExportSetMap.cxx | 7 ++++++- Source/cmGlobalGenerator.cxx | 6 +++++- Source/cmStandardIncludes.h | 23 ++++------------------- Source/cmTarget.cxx | 12 ++++++++++-- 4 files changed, 25 insertions(+), 23 deletions(-) hooks/post-receive -- CMake From eike at sf-mail.de Mon Jan 5 05:57:28 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Mon, 5 Jan 2015 05:57:28 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1498-g56054b1 Message-ID: <20150105105728.C15D6A91C7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 56054b1982748475a350239ae42d99af0554242a (commit) via 52d4ff49d973d77dba480e0b60b08c6c70e94538 (commit) from 9b8ba31802a3e89b8aa1f34b3dfa7521d47c235a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56054b1982748475a350239ae42d99af0554242a commit 56054b1982748475a350239ae42d99af0554242a Merge: 9b8ba31 52d4ff4 Author: Rolf Eike Beer AuthorDate: Mon Jan 5 05:57:28 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 5 05:57:28 2015 -0500 Merge topic 'FindCUDA-cross' into next 52d4ff49 Fix FindCUDA.cmake assumption about cross-compiling http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52d4ff49d973d77dba480e0b60b08c6c70e94538 commit 52d4ff49d973d77dba480e0b60b08c6c70e94538 Author: Mark Abraham AuthorDate: Sun Jan 4 14:37:51 2015 +0100 Commit: Rolf Eike Beer CommitDate: Mon Jan 5 11:56:50 2015 +0100 Fix FindCUDA.cmake assumption about cross-compiling CMAKE_SYSTEM_PROCESSOR is not guaranteed to be defined (per http://www.vtk.org/Wiki/CMake_Cross_Compiling), and when cross compiling where it happens to be undefined, this module was broken. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 29bb875..ecfc781 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -613,7 +613,7 @@ endif() set(CUDA_VERSION_STRING "${CUDA_VERSION}") # Support for arm cross compilation with CUDA 5.5 -if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf") +if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf") set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf" CACHE PATH "Toolkit target location.") else() set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}" CACHE PATH "Toolkit target location.") @@ -621,7 +621,7 @@ endif() mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) # Target CPU architecture -if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") +if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm") set(_cuda_target_cpu_arch_initial "ARM") else() set(_cuda_target_cpu_arch_initial "") ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From ben.boeckel at kitware.com Mon Jan 5 13:54:25 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Mon, 5 Jan 2015 13:54:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1502-gbe2007b Message-ID: <20150105185426.05C9DA8E17@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via be2007b08096c2ca1323141d07811f8018151e24 (commit) via c4e743674f3f7c576ff90cacae6465e7e171faed (commit) via 4b70635c9fe9b4425db275c2ed3be1b5223ebe4b (commit) via 592dd355705ba0b22f33d48c2e0b5ff0e2a471d8 (commit) from 56054b1982748475a350239ae42d99af0554242a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=be2007b08096c2ca1323141d07811f8018151e24 commit be2007b08096c2ca1323141d07811f8018151e24 Merge: 56054b1 c4e7436 Author: Ben Boeckel AuthorDate: Mon Jan 5 13:54:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 5 13:54:25 2015 -0500 Merge topic 'fix-error-message-typo-tar-cmd' into next c4e74367 cmcmd: fix copy/paste typo in '-E tar t' command 4b70635c CMake Nightly Date Stamp 592dd355 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4e743674f3f7c576ff90cacae6465e7e171faed commit c4e743674f3f7c576ff90cacae6465e7e171faed Author: Ben Boeckel AuthorDate: Mon Jan 5 13:53:53 2015 -0500 Commit: Ben Boeckel CommitDate: Mon Jan 5 13:53:53 2015 -0500 cmcmd: fix copy/paste typo in '-E tar t' command diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index a97444d..37d2916 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -753,7 +753,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) { if ( !cmSystemTools::ListTar(outFile.c_str(), gzip, verbose) ) { - cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); + cmSystemTools::Error("Problem listing tar: ", outFile.c_str()); return 1; } } ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- Source/cmcmd.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jan 6 00:01:14 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 6 Jan 2015 00:01:14 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-600-g73144c0 Message-ID: <20150106050114.D21B8A92B8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 73144c098d8b176bb99b762450b9b231687011b8 (commit) from 4b70635c9fe9b4425db275c2ed3be1b5223ebe4b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=73144c098d8b176bb99b762450b9b231687011b8 commit 73144c098d8b176bb99b762450b9b231687011b8 Author: Kitware Robot AuthorDate: Tue Jan 6 00:01:12 2015 -0500 Commit: Kitware Robot CommitDate: Tue Jan 6 00:01:12 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 506f0da..9515372 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 20150105) +set(CMake_VERSION_PATCH 20150106) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From ben.boeckel at kitware.com Tue Jan 6 12:59:41 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Tue, 6 Jan 2015 12:59:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1506-g007b045 Message-ID: <20150106175941.2A8B2A9EA0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 007b0452b5f7e536f1f88b30bcc5331227cbb098 (commit) via ab4d1d07e44b42d963aaec8b8b4cdd57c938ea9d (commit) via 827243942c3568bbb621c4009c8f03fdd0ba71f7 (commit) via 73144c098d8b176bb99b762450b9b231687011b8 (commit) from be2007b08096c2ca1323141d07811f8018151e24 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=007b0452b5f7e536f1f88b30bcc5331227cbb098 commit 007b0452b5f7e536f1f88b30bcc5331227cbb098 Merge: be2007b ab4d1d0 Author: Ben Boeckel AuthorDate: Tue Jan 6 12:59:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 6 12:59:40 2015 -0500 Merge topic 'find-msmpi' into next ab4d1d07 FindMPI: MSMPI changed the subdirectories it uses 82724394 FindMPI: add more search paths for MSMPI 73144c09 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab4d1d07e44b42d963aaec8b8b4cdd57c938ea9d commit ab4d1d07e44b42d963aaec8b8b4cdd57c938ea9d Author: Ben Boeckel AuthorDate: Tue Jan 6 12:58:31 2015 -0500 Commit: Ben Boeckel CommitDate: Tue Jan 6 12:59:07 2015 -0500 FindMPI: MSMPI changed the subdirectories it uses diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 672c65d..9192054 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -426,16 +426,18 @@ function (interrogate_mpi_compiler lang try_libs) # Decide between 32-bit and 64-bit libraries for Microsoft's MPI if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) - set(MS_MPI_ARCH_DIR amd64) + set(MS_MPI_ARCH_DIR x64) + set(MS_MPI_ARCH_DIR2 amd64) else() - set(MS_MPI_ARCH_DIR i386) + set(MS_MPI_ARCH_DIR x86) + set(MS_MPI_ARCH_DIR2 i386) endif() set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_library(MPI_LIB NAMES mpi mpich mpich2 msmpi HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}) + PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR} Lib/${MS_MPI_ARCH_DIR2}) set(MPI_LIBRARIES_WORK ${MPI_LIB}) # Right now, we only know about the extra libs for C++. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=827243942c3568bbb621c4009c8f03fdd0ba71f7 commit 827243942c3568bbb621c4009c8f03fdd0ba71f7 Author: Ben Boeckel AuthorDate: Tue Jan 6 12:58:07 2015 -0500 Commit: Ben Boeckel CommitDate: Tue Jan 6 12:58:07 2015 -0500 FindMPI: add more search paths for MSMPI Also comment what the various search paths are for. diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 8e39a7f..672c65d 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -174,7 +174,11 @@ set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun) # Grab the path to MPI from the registry if we're on windows. set(_MPI_PREFIX_PATH) if(WIN32) + # MSMPI + list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_BIN}") list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]/Bin") + list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_INC}/..") # The SDK is installed separately from the runtime + # MPICH list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..") list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]") list(APPEND _MPI_PREFIX_PATH "$ENV{ProgramW6432}/MPICH2/") ----------------------------------------------------------------------- Summary of changes: Modules/FindMPI.cmake | 12 +++++++++--- Source/CMakeVersion.cmake | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jan 7 00:01:10 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 7 Jan 2015 00:01:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-601-g8c4b7c5 Message-ID: <20150107050111.0622EA9A99@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 8c4b7c567bbb47ed9555da2bd50b672304ccb858 (commit) from 73144c098d8b176bb99b762450b9b231687011b8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c4b7c567bbb47ed9555da2bd50b672304ccb858 commit 8c4b7c567bbb47ed9555da2bd50b672304ccb858 Author: Kitware Robot AuthorDate: Wed Jan 7 00:01:08 2015 -0500 Commit: Kitware Robot CommitDate: Wed Jan 7 00:01:08 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 9515372..94fc7a4 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 20150106) +set(CMake_VERSION_PATCH 20150107) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From robert.maynard at kitware.com Wed Jan 7 11:26:50 2015 From: robert.maynard at kitware.com (Robert Maynard) Date: Wed, 7 Jan 2015 11:26:50 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1508-g7d6c29f Message-ID: <20150107162650.A70F6A913A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7d6c29fc162f8977700c590f868800779de2594f (commit) via b4e54f9b8c748f78d16e9da055a7e0436d7654ef (commit) from 007b0452b5f7e536f1f88b30bcc5331227cbb098 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7d6c29fc162f8977700c590f868800779de2594f commit 7d6c29fc162f8977700c590f868800779de2594f Merge: 007b045 b4e54f9 Author: Robert Maynard AuthorDate: Wed Jan 7 11:26:49 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 7 11:26:49 2015 -0500 Merge topic 'FindCUDA.cmake/UseCMAKE_CXX_FLAGS_separableCompilation' into next b4e54f9b FindCUDA: Add relevant CMAKE_{C,CXX}_FLAGS for separable compilation http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4e54f9b8c748f78d16e9da055a7e0436d7654ef commit b4e54f9b8c748f78d16e9da055a7e0436d7654ef Author: James Bigler AuthorDate: Tue Jan 6 16:28:05 2015 -0700 Commit: James Bigler CommitDate: Tue Jan 6 16:28:05 2015 -0700 FindCUDA: Add relevant CMAKE_{C,CXX}_FLAGS for separable compilation Previously only the CMAKE_{C,CXX}_FLAGS_ flags were inspected for relevant flags when compiling the intermediate link file. We need to also consider the configuration agnostic flags, CMAKE_{C,CXX}_FLAGS as well. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 29bb875..b420005 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1423,7 +1423,8 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") endif() - # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} + + # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* set(config_specific_flags) set(flags) foreach(config ${CUDA_configuration_types}) @@ -1438,6 +1439,13 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options list(APPEND flags $<$:-Xcompiler> $<$:${f}>) endforeach() endforeach() + # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS}) + foreach(f ${important_host_flags}) + list(APPEND flags -Xcompiler ${f}) + endforeach() + # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From domen.vrankar at gmail.com Wed Jan 7 14:34:43 2015 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Wed, 7 Jan 2015 14:34:43 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1511-gb5f5b58 Message-ID: <20150107193443.7CB6FA9F68@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b5f5b58d179e6ce8fcb783ab0d5bcbc2a7dc62ee (commit) via 5d0a04f09487dacac5520c6e963a64cce854d2bd (commit) via 8c4b7c567bbb47ed9555da2bd50b672304ccb858 (commit) from 7d6c29fc162f8977700c590f868800779de2594f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b5f5b58d179e6ce8fcb783ab0d5bcbc2a7dc62ee commit b5f5b58d179e6ce8fcb783ab0d5bcbc2a7dc62ee Merge: 7d6c29f 5d0a04f Author: Domen Vrankar AuthorDate: Wed Jan 7 14:34:42 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 7 14:34:42 2015 -0500 Merge topic 'rpm_at_in_path' into next 5d0a04f0 rpm revert at in path escaping patch 8c4b7c56 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d0a04f09487dacac5520c6e963a64cce854d2bd commit 5d0a04f09487dacac5520c6e963a64cce854d2bd Author: Domen Vrankar AuthorDate: Wed Jan 7 20:33:27 2015 +0100 Commit: Domen Vrankar CommitDate: Wed Jan 7 20:33:27 2015 +0100 rpm revert at in path escaping patch Patch for escaping at symbols in paths was added to RPM generator and was obsoleted in next cmake release. The change that obsoleted it also caused it to break paths with @ symbols for which it was written to solve. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index d2cb2ee..7de3aa3 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -1058,13 +1058,6 @@ if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}") endif() -# protect @ in pathname in order to avoid their -# interpretation during the configure_file step -set(CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES}") -set(PROTECTED_AT "@") -string(REPLACE "@" "\@PROTECTED_AT\@" CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES_LIST}") -set(CPACK_RPM_INSTALL_FILES_LIST "") - # # USER generated/provided spec file handling. # @@ -1175,9 +1168,6 @@ else() configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY) endif() -# remove AT protection -unset(PROTECTED_AT) - if(RPMBUILD_EXECUTABLE) # Now call rpmbuild using the SPECFILE execute_process( ----------------------------------------------------------------------- Summary of changes: Modules/CPackRPM.cmake | 10 ---------- Source/CMakeVersion.cmake | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) hooks/post-receive -- CMake From domen.vrankar at gmail.com Wed Jan 7 14:36:40 2015 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Wed, 7 Jan 2015 14:36:40 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1513-gb9196b9 Message-ID: <20150107193640.1C14DA9FB4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b9196b94711e082704fa775db5edc8688644e14a (commit) via f89e41c3e7c6d47dd26a47e3543ada2301db7521 (commit) from b5f5b58d179e6ce8fcb783ab0d5bcbc2a7dc62ee (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9196b94711e082704fa775db5edc8688644e14a commit b9196b94711e082704fa775db5edc8688644e14a Merge: b5f5b58 f89e41c Author: Domen Vrankar AuthorDate: Wed Jan 7 14:36:39 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 7 14:36:39 2015 -0500 Merge topic 'cpack_invalid_cmake_generator' into next f89e41c3 CPack invalid CMake generator http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f89e41c3e7c6d47dd26a47e3543ada2301db7521 commit f89e41c3e7c6d47dd26a47e3543ada2301db7521 Author: Domen Vrankar AuthorDate: Fri Jan 2 10:46:08 2015 +0100 Commit: Domen Vrankar CommitDate: Fri Jan 2 10:46:08 2015 +0100 CPack invalid CMake generator Case where CPACK_CMAKE_GENERATOR value is non existent or or contains multiple words that were not quoted was not handled and produced a segmentation fault. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index e78f161..2330278 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -628,6 +628,14 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( cmGlobalGenerator* globalGenerator = this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator( cmakeGenerator); + if ( !globalGenerator ) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Specified package generator not found. " + "CPACK_CMAKE_GENERATOR value is invalid." + << std::endl); + return 0; + } // set the global flag for unix style paths on cmSystemTools as // soon as the generator is set. This allows gmake to be used // on windows. ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From eike at sf-mail.de Wed Jan 7 17:45:50 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Wed, 7 Jan 2015 17:45:50 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1515-g7ece741 Message-ID: <20150107224550.CF32FA8CF5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7ece74108e1d0e5dd859943f831794a745a657c9 (commit) via 8de3f22e8fe9e798b63eb00e35eee6404748d3bd (commit) from b9196b94711e082704fa775db5edc8688644e14a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ece74108e1d0e5dd859943f831794a745a657c9 commit 7ece74108e1d0e5dd859943f831794a745a657c9 Merge: b9196b9 8de3f22 Author: Rolf Eike Beer AuthorDate: Wed Jan 7 17:45:49 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 7 17:45:49 2015 -0500 Merge topic 'FindQt4-versioned-qmake-first' into next 8de3f22e FindQt4: search for versioned qmake names first before general qmake http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8de3f22e8fe9e798b63eb00e35eee6404748d3bd commit 8de3f22e8fe9e798b63eb00e35eee6404748d3bd Author: Rolf Eike Beer AuthorDate: Wed Jan 7 23:42:35 2015 +0100 Commit: Rolf Eike Beer CommitDate: Wed Jan 7 23:42:35 2015 +0100 FindQt4: search for versioned qmake names first before general qmake Thanks to OpenBSD for not reporting this upstream. diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index a79246a..a424d63 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -522,7 +522,7 @@ endfunction() set(QT4_INSTALLED_VERSION_TOO_OLD FALSE) -set(_QT4_QMAKE_NAMES qmake qmake4 qmake-qt4 qmake-mac) +set(_QT4_QMAKE_NAMES qmake4 qmake-qt4 qmake qmake-mac) _qt4_find_qmake("${_QT4_QMAKE_NAMES}" QT_QMAKE_EXECUTABLE QTVERSION) if (QT_QMAKE_EXECUTABLE AND ----------------------------------------------------------------------- Summary of changes: Modules/FindQt4.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From eike at sf-mail.de Wed Jan 7 17:47:29 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Wed, 7 Jan 2015 17:47:29 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1517-gf2ff942 Message-ID: <20150107224729.3F072A8EFE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f2ff942e6346e0e689dec36f440de3beb512f799 (commit) via fd329307b2ee76abaa41e25a300902a2fb983895 (commit) from 7ece74108e1d0e5dd859943f831794a745a657c9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f2ff942e6346e0e689dec36f440de3beb512f799 commit f2ff942e6346e0e689dec36f440de3beb512f799 Merge: 7ece741 fd32930 Author: Rolf Eike Beer AuthorDate: Wed Jan 7 17:47:28 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 7 17:47:28 2015 -0500 Merge topic 'FindSDL-quoting' into next fd329307 FindSDL: fix bad variable expansion http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd329307b2ee76abaa41e25a300902a2fb983895 commit fd329307b2ee76abaa41e25a300902a2fb983895 Author: Rolf Eike Beer AuthorDate: Wed Jan 7 23:46:56 2015 +0100 Commit: Rolf Eike Beer CommitDate: Wed Jan 7 23:46:56 2015 +0100 FindSDL: fix bad variable expansion Thanks to OpenBSD for not reporting that upstream. diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 3905e54..45ca1d4 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -106,7 +106,7 @@ find_library(SDL_LIBRARY_TEMP ) if(NOT SDL_BUILDING_LIBRARY) - if(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") + if(NOT SDL_INCLUDE_DIR MATCHES ".framework") # Non-OS X framework versions expect you to also dynamically link to # SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms # seem to provide SDLmain for compatibility even though they don't ----------------------------------------------------------------------- Summary of changes: Modules/FindSDL.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jan 8 00:01:10 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 8 Jan 2015 00:01:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-602-g46f8765 Message-ID: <20150108050110.D1EF7A9FB8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 46f87655c973a7bed523fcff76b59a465b751df5 (commit) from 8c4b7c567bbb47ed9555da2bd50b672304ccb858 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=46f87655c973a7bed523fcff76b59a465b751df5 commit 46f87655c973a7bed523fcff76b59a465b751df5 Author: Kitware Robot AuthorDate: Thu Jan 8 00:01:08 2015 -0500 Commit: Kitware Robot CommitDate: Thu Jan 8 00:01:08 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 94fc7a4..05b46c5 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 20150107) +set(CMake_VERSION_PATCH 20150108) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 13:45:28 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 13:45:28 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1519-g1c85c60 Message-ID: <20150108184528.C55AEA8C75@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1c85c606fd9c5f39ce8ab254cbc7b631bd250271 (commit) via 7a2c3f0c0ec5b542c89456826adeb56c3cbd7df0 (commit) from f2ff942e6346e0e689dec36f440de3beb512f799 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c85c606fd9c5f39ce8ab254cbc7b631bd250271 commit 1c85c606fd9c5f39ce8ab254cbc7b631bd250271 Merge: f2ff942 7a2c3f0 Author: Brad King AuthorDate: Thu Jan 8 13:45:27 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 13:45:27 2015 -0500 Merge topic 'doc-if-variable-not-defined' into next 7a2c3f0c Help: Clarify if() documentation (#15335) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7a2c3f0c0ec5b542c89456826adeb56c3cbd7df0 commit 7a2c3f0c0ec5b542c89456826adeb56c3cbd7df0 Author: Brad King AuthorDate: Thu Jan 8 13:36:11 2015 -0500 Commit: Brad King CommitDate: Thu Jan 8 13:43:40 2015 -0500 Help: Clarify if() documentation (#15335) When the variable is not defined the signature is actually accepting a string. Also clarify fall-through from if() case. diff --git a/Help/command/if.rst b/Help/command/if.rst index 79e5d21..d50b14c 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -42,11 +42,12 @@ Possible expressions are: or a non-zero number. False if the constant is ``0``, ``OFF``, ``NO``, ``FALSE``, ``N``, ``IGNORE``, ``NOTFOUND``, the empty string, or ends in the suffix ``-NOTFOUND``. Named boolean constants are - case-insensitive. If the argument is not one of these constants, it - is treated as a variable. + case-insensitive. If the argument is not one of these specific + constants, it is treated as a variable or string and the following + signature is used. -``if()`` - True if the variable is defined to a value that is not a false +``if()`` + True if given a variable that is defined to a value that is not a false constant. False otherwise. (Note macro arguments are not variables.) ``if(NOT )`` ----------------------------------------------------------------------- Summary of changes: Help/command/if.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 8 13:56:38 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 8 Jan 2015 13:56:38 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1521-g4a844a8 Message-ID: <20150108185638.2143DA9DEA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4a844a8df23ed6798884a655942f9ca700800520 (commit) via 72a0d6df6dfa7c81a5a81c6f5b85b964815ffbc1 (commit) from 1c85c606fd9c5f39ce8ab254cbc7b631bd250271 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4a844a8df23ed6798884a655942f9ca700800520 commit 4a844a8df23ed6798884a655942f9ca700800520 Merge: 1c85c60 72a0d6d Author: Stephen Kelly AuthorDate: Thu Jan 8 13:56:37 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 13:56:37 2015 -0500 Merge topic 'doc-CXX_STANDARD-14' into next 72a0d6df Help: Document valid 14 value for CXX_STANDARD. (#15339) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=72a0d6df6dfa7c81a5a81c6f5b85b964815ffbc1 commit 72a0d6df6dfa7c81a5a81c6f5b85b964815ffbc1 Author: Stephen Kelly AuthorDate: Thu Jan 8 19:41:23 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 19:55:29 2015 +0100 Help: Document valid 14 value for CXX_STANDARD. (#15339) Support was added in commit v3.1.0-rc1~475^2 (Features: Add support for C++14 features., 2014-05-06), but the documentation for this property was not amended. diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst index b50cdf9..6329e34 100644 --- a/Help/prop_tgt/CXX_STANDARD.rst +++ b/Help/prop_tgt/CXX_STANDARD.rst @@ -7,7 +7,7 @@ This property specifies the C++ standard whose features are requested to build this target. For some compilers, this results in adding a flag such as ``-std=gnu++11`` to the compile line. -Supported values are ``98`` and ``11``. +Supported values are ``98``, ``11`` and ``14``. If the value requested does not result in a compile flag being added for the compiler in use, a previous standard flag will be added instead. This ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/CXX_STANDARD.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:14:39 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:14:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1523-g8b10da3 Message-ID: <20150108191439.319C4A895C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8b10da3c7437e7486b0a2661c9439e58c94b0bca (commit) via cbaf0802a5646dd1fdf9fabc0f0c274621349619 (commit) from 4a844a8df23ed6798884a655942f9ca700800520 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b10da3c7437e7486b0a2661c9439e58c94b0bca commit 8b10da3c7437e7486b0a2661c9439e58c94b0bca Merge: 4a844a8 cbaf080 Author: Brad King AuthorDate: Thu Jan 8 14:14:38 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:14:38 2015 -0500 Merge topic 'FindIce-CMP0054' into next cbaf0802 FindIce: Port to work with CMP0054 NEW behavior http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cbaf0802a5646dd1fdf9fabc0f0c274621349619 commit cbaf0802a5646dd1fdf9fabc0f0c274621349619 Author: Rolf Eike Beer AuthorDate: Sun Jan 4 14:06:14 2015 +0100 Commit: Brad King CommitDate: Thu Jan 8 14:13:48 2015 -0500 FindIce: Port to work with CMP0054 NEW behavior Do not quote if() arguments meant to test variable definitions. diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake index 76cecc1..8493d80 100644 --- a/Modules/FindIce.cmake +++ b/Modules/FindIce.cmake @@ -282,21 +282,21 @@ function(_Ice_FIND) PATH_SUFFIXES ${ice_library_suffixes} DOC "Ice ${component} library") mark_as_advanced("${component_cache}") - if("${component_cache}") + if(${component_cache}) set("${component_found}" ON) list(APPEND Ice_LIBRARY "${${component_cache}}") endif() mark_as_advanced("${component_found}") set("${component_cache}" "${${component_cache}}" PARENT_SCOPE) set("${component_found}" "${${component_found}}" PARENT_SCOPE) - if("${component_found}") - if ("Ice_FIND_REQUIRED_${component}") + if(${component_found}) + if (Ice_FIND_REQUIRED_${component}) list(APPEND Ice_LIBS_FOUND "${component} (required)") else() list(APPEND Ice_LIBS_FOUND "${component} (optional)") endif() else() - if ("Ice_FIND_REQUIRED_${component}") + if (Ice_FIND_REQUIRED_${component}) set(Ice_REQUIRED_LIBS_FOUND OFF) list(APPEND Ice_LIBS_NOTFOUND "${component} (required)") else() @@ -356,7 +356,7 @@ if(Ice_FOUND) set(_Ice_component_cache "Ice_${_Ice_component_upcase}_LIBRARY") set(_Ice_component_lib "Ice_${_Ice_component_upcase}_LIBRARIES") set(_Ice_component_found "${_Ice_component_upcase}_FOUND") - if("${_Ice_component_found}") + if(${_Ice_component_found}) set("${_Ice_component_lib}" "${${_Ice_component_cache}}") endif() unset(_Ice_component_upcase) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:41:34 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:41:34 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1525-g018444b Message-ID: <20150108194134.ABB01A5B99@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 018444bac72ac1672f9886449cd53745888e9d24 (commit) via d5846eb153e277980f59f70c92807851a429c3c1 (commit) from 8b10da3c7437e7486b0a2661c9439e58c94b0bca (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=018444bac72ac1672f9886449cd53745888e9d24 commit 018444bac72ac1672f9886449cd53745888e9d24 Merge: 8b10da3 d5846eb Author: Brad King AuthorDate: Thu Jan 8 14:41:34 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:41:34 2015 -0500 Merge topic 'FindCUDA-cross' into next d5846eb1 FindCUDA: Do not assume CMAKE_SYSTEM_PROCESSOR is set http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5846eb153e277980f59f70c92807851a429c3c1 commit d5846eb153e277980f59f70c92807851a429c3c1 Author: Mark Abraham AuthorDate: Sun Jan 4 14:37:51 2015 +0100 Commit: Brad King CommitDate: Thu Jan 8 14:39:16 2015 -0500 FindCUDA: Do not assume CMAKE_SYSTEM_PROCESSOR is set CMAKE_SYSTEM_PROCESSOR is not guaranteed to be defined (per http://www.cmake.org/Wiki/CMake_Cross_Compiling), and when cross compiling where it happens to be undefined, this module was broken. Reviewed-by: Rolf Eike Beer diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 29bb875..ecfc781 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -613,7 +613,7 @@ endif() set(CUDA_VERSION_STRING "${CUDA_VERSION}") # Support for arm cross compilation with CUDA 5.5 -if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf") +if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf") set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf" CACHE PATH "Toolkit target location.") else() set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}" CACHE PATH "Toolkit target location.") @@ -621,7 +621,7 @@ endif() mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) # Target CPU architecture -if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") +if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm") set(_cuda_target_cpu_arch_initial "ARM") else() set(_cuda_target_cpu_arch_initial "") ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:48:24 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:48:24 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1527-gd9747a8 Message-ID: <20150108194824.5BDCBA8C5C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d9747a8a692fd2129cc13a7ce320b5a61bc3d6e8 (commit) via 67516fb57e7f0781c79801efdcae8f76bb1adaae (commit) from 018444bac72ac1672f9886449cd53745888e9d24 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9747a8a692fd2129cc13a7ce320b5a61bc3d6e8 commit d9747a8a692fd2129cc13a7ce320b5a61bc3d6e8 Merge: 018444b 67516fb Author: Brad King AuthorDate: Thu Jan 8 14:48:23 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:48:23 2015 -0500 Merge topic 'FindSDL-quoting' into next 67516fb5 FindSDL: Allow if() to dereference SDL_INCLUDE_DIR for matching http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=67516fb57e7f0781c79801efdcae8f76bb1adaae commit 67516fb57e7f0781c79801efdcae8f76bb1adaae Author: Rolf Eike Beer AuthorDate: Wed Jan 7 23:46:56 2015 +0100 Commit: Brad King CommitDate: Thu Jan 8 14:47:39 2015 -0500 FindSDL: Allow if() to dereference SDL_INCLUDE_DIR for matching Otherwise the syntax is incorrect when the variable is empty. diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 3905e54..45ca1d4 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -106,7 +106,7 @@ find_library(SDL_LIBRARY_TEMP ) if(NOT SDL_BUILDING_LIBRARY) - if(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") + if(NOT SDL_INCLUDE_DIR MATCHES ".framework") # Non-OS X framework versions expect you to also dynamically link to # SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms # seem to provide SDLmain for compatibility even though they don't ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:57:39 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:57:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-605-g9bb7f8f Message-ID: <20150108195739.EC3D0A9403@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 9bb7f8f8982d1d73ca4d4ee108f3f2505e01ee7e (commit) via 1819d4ad1fb0016c20a46a0b66274b53d2b0f010 (commit) via 6ed23ff4e9bbf848a77865e6d08c1e8e6074de92 (commit) from 46f87655c973a7bed523fcff76b59a465b751df5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9bb7f8f8982d1d73ca4d4ee108f3f2505e01ee7e commit 9bb7f8f8982d1d73ca4d4ee108f3f2505e01ee7e Merge: 46f8765 1819d4a Author: Brad King AuthorDate: Thu Jan 8 14:57:38 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:57:38 2015 -0500 Merge topic 'update-kwsys' 1819d4ad Merge branch 'upstream-kwsys' into update-kwsys 6ed23ff4 KWSys 2014-12-23 (5a15cb3b) ----------------------------------------------------------------------- Summary of changes: Source/kwsys/Base64.c | 24 ++++++++++++------------ Source/kwsys/Base64.h.in | 18 ++++++++++-------- 2 files changed, 22 insertions(+), 20 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:57:42 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:57:42 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-608-gdc45157 Message-ID: <20150108195742.2CC19A9400@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via dc451574c67da688024d5f3686c7c2aa4c5040ba (commit) via 0bdd4ebfb8303cc46e4a8bbe16f6c7bcc7108e2a (commit) via a9fae8ac1d952ffd3b54de6082f9729466101bb0 (commit) from 9bb7f8f8982d1d73ca4d4ee108f3f2505e01ee7e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc451574c67da688024d5f3686c7c2aa4c5040ba commit dc451574c67da688024d5f3686c7c2aa4c5040ba Merge: 9bb7f8f 0bdd4eb Author: Brad King AuthorDate: Thu Jan 8 14:57:41 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:57:41 2015 -0500 Merge topic 'base64-casts' 0bdd4ebf cmCTest: Use size_t for cmsysBase64_Encode return value a9fae8ac CTest: Fix integer overflow when uploading huge files ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestRunTest.cxx | 4 ++-- Source/CTest/cmCTestTestHandler.cxx | 5 ++--- Source/cmCTest.cxx | 13 ++++++------- 3 files changed, 10 insertions(+), 12 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:57:44 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:57:44 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-610-gdcd2e38 Message-ID: <20150108195744.66820A9404@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via dcd2e38b992eb327f5387fa9a7a9195c70b24593 (commit) via 73ae888506c89b8c0619905f4c19b79116afb514 (commit) from dc451574c67da688024d5f3686c7c2aa4c5040ba (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dcd2e38b992eb327f5387fa9a7a9195c70b24593 commit dcd2e38b992eb327f5387fa9a7a9195c70b24593 Merge: dc45157 73ae888 Author: Brad King AuthorDate: Thu Jan 8 14:57:43 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:57:43 2015 -0500 Merge topic 'RunCMake-stderr-default' 73ae8885 RunCMake: Expect empty output by default. ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CMP0019/CMakeLists.txt | 2 +- Tests/RunCMake/CheckModules/CMakeLists.txt | 1 + Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 2 ++ Tests/RunCMake/FPHSA/RunCMakeTest.cmake | 2 ++ Tests/RunCMake/Languages/CMakeLists.txt | 1 + Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt | 2 +- .../Languages/link-libraries-TARGET_FILE-genex-stderr.txt | 2 +- Tests/RunCMake/README.rst | 2 +- Tests/RunCMake/RunCMake.cmake | 7 +++++++ 9 files changed, 17 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:57:46 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:57:46 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-613-g3fb174d Message-ID: <20150108195746.61191A9447@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 3fb174dd0b1e6bfb34c6ab82d9b22becd4181be4 (commit) via f07d96ccf4c0b09b544efadaac47cd79f9298b89 (commit) via 5a8b9437c24e1548ad15ed816e0f252e912812e1 (commit) from dcd2e38b992eb327f5387fa9a7a9195c70b24593 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3fb174dd0b1e6bfb34c6ab82d9b22becd4181be4 commit 3fb174dd0b1e6bfb34c6ab82d9b22becd4181be4 Merge: dcd2e38 f07d96c Author: Brad King AuthorDate: Thu Jan 8 14:57:45 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:57:45 2015 -0500 Merge topic 'drop-GNU-2.95' f07d96cc Remove workaround for GCC < 3 ios_base absence. 5a8b9437 Remove GCC 2.95 support macros in favor of template versions. ----------------------------------------------------------------------- Summary of changes: Source/cmStandardIncludes.h | 21 --------------------- 1 file changed, 21 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:57:48 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:57:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-615-g04e880f Message-ID: <20150108195752.34620A8DE9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 04e880fd33ca8a95ef15354f1791f151fe7a54e5 (commit) via d5846eb153e277980f59f70c92807851a429c3c1 (commit) from 3fb174dd0b1e6bfb34c6ab82d9b22becd4181be4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=04e880fd33ca8a95ef15354f1791f151fe7a54e5 commit 04e880fd33ca8a95ef15354f1791f151fe7a54e5 Merge: 3fb174d d5846eb Author: Brad King AuthorDate: Thu Jan 8 14:57:47 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:57:47 2015 -0500 Merge topic 'FindCUDA-cross' d5846eb1 FindCUDA: Do not assume CMAKE_SYSTEM_PROCESSOR is set ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:57:54 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:57:54 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-617-g35ea140 Message-ID: <20150108195754.801D6A9441@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 35ea14050ee41f9ea1c540ef2f582607b3d50925 (commit) via cbaf0802a5646dd1fdf9fabc0f0c274621349619 (commit) from 04e880fd33ca8a95ef15354f1791f151fe7a54e5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=35ea14050ee41f9ea1c540ef2f582607b3d50925 commit 35ea14050ee41f9ea1c540ef2f582607b3d50925 Merge: 04e880f cbaf080 Author: Brad King AuthorDate: Thu Jan 8 14:57:53 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:57:53 2015 -0500 Merge topic 'FindIce-CMP0054' cbaf0802 FindIce: Port to work with CMP0054 NEW behavior ----------------------------------------------------------------------- Summary of changes: Modules/FindIce.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:57:56 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:57:56 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-620-g038caf3 Message-ID: <20150108195756.B50A3A9450@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 038caf38b2c72577f2ad74b5a24c522e5537fb96 (commit) via ab4d1d07e44b42d963aaec8b8b4cdd57c938ea9d (commit) via 827243942c3568bbb621c4009c8f03fdd0ba71f7 (commit) from 35ea14050ee41f9ea1c540ef2f582607b3d50925 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=038caf38b2c72577f2ad74b5a24c522e5537fb96 commit 038caf38b2c72577f2ad74b5a24c522e5537fb96 Merge: 35ea140 ab4d1d0 Author: Brad King AuthorDate: Thu Jan 8 14:57:55 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:57:55 2015 -0500 Merge topic 'find-msmpi' ab4d1d07 FindMPI: MSMPI changed the subdirectories it uses 82724394 FindMPI: add more search paths for MSMPI ----------------------------------------------------------------------- Summary of changes: Modules/FindMPI.cmake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:57:58 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:57:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-622-gf1b0340 Message-ID: <20150108195758.C14D8A948E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f1b0340d6c57af3ca2799c344b866d9cc5c5cbbc (commit) via 67516fb57e7f0781c79801efdcae8f76bb1adaae (commit) from 038caf38b2c72577f2ad74b5a24c522e5537fb96 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f1b0340d6c57af3ca2799c344b866d9cc5c5cbbc commit f1b0340d6c57af3ca2799c344b866d9cc5c5cbbc Merge: 038caf3 67516fb Author: Brad King AuthorDate: Thu Jan 8 14:57:57 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:57:57 2015 -0500 Merge topic 'FindSDL-quoting' 67516fb5 FindSDL: Allow if() to dereference SDL_INCLUDE_DIR for matching ----------------------------------------------------------------------- Summary of changes: Modules/FindSDL.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:58:00 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:58:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-624-gc1c1fcb Message-ID: <20150108195801.03819A948E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via c1c1fcb17cb2a4dbd408ac7f1b9a962966eb3939 (commit) via c4e743674f3f7c576ff90cacae6465e7e171faed (commit) from f1b0340d6c57af3ca2799c344b866d9cc5c5cbbc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1c1fcb17cb2a4dbd408ac7f1b9a962966eb3939 commit c1c1fcb17cb2a4dbd408ac7f1b9a962966eb3939 Merge: f1b0340 c4e7436 Author: Brad King AuthorDate: Thu Jan 8 14:57:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:57:59 2015 -0500 Merge topic 'fix-error-message-typo-tar-cmd' c4e74367 cmcmd: fix copy/paste typo in '-E tar t' command ----------------------------------------------------------------------- Summary of changes: Source/cmcmd.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:58:02 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:58:02 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-626-g0042ad9 Message-ID: <20150108195802.B8FD7A941F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0042ad97480a236cd748f7d5aebc70ff21e75513 (commit) via f89e41c3e7c6d47dd26a47e3543ada2301db7521 (commit) from c1c1fcb17cb2a4dbd408ac7f1b9a962966eb3939 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0042ad97480a236cd748f7d5aebc70ff21e75513 commit 0042ad97480a236cd748f7d5aebc70ff21e75513 Merge: c1c1fcb f89e41c Author: Brad King AuthorDate: Thu Jan 8 14:58:01 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:58:01 2015 -0500 Merge topic 'cpack_invalid_cmake_generator' f89e41c3 CPack invalid CMake generator ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:58:04 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:58:04 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-628-g44b2dcb Message-ID: <20150108195804.85F2BA94B7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 44b2dcb2e0c945339947c2e71b32f6da2fc4f610 (commit) via 998ed4ca0a922faf08c7ee3e95f337ff9e8f02c1 (commit) from 0042ad97480a236cd748f7d5aebc70ff21e75513 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44b2dcb2e0c945339947c2e71b32f6da2fc4f610 commit 44b2dcb2e0c945339947c2e71b32f6da2fc4f610 Merge: 0042ad9 998ed4c Author: Brad King AuthorDate: Thu Jan 8 14:58:03 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 14:58:03 2015 -0500 Merge topic 'record-GNU-5-features' 998ed4ca Features: Record cxx_variable_templates for GNU 5.0. ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/GNU-CXX-FeatureTests.cmake | 7 +++++++ 1 file changed, 7 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 14:58:42 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 14:58:42 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1540-ge60d07d Message-ID: <20150108195842.F0D0FA9436@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e60d07d8987bcfd41aa58cd443ccc56a61543eeb (commit) via 44b2dcb2e0c945339947c2e71b32f6da2fc4f610 (commit) via 0042ad97480a236cd748f7d5aebc70ff21e75513 (commit) via c1c1fcb17cb2a4dbd408ac7f1b9a962966eb3939 (commit) via f1b0340d6c57af3ca2799c344b866d9cc5c5cbbc (commit) via 038caf38b2c72577f2ad74b5a24c522e5537fb96 (commit) via 35ea14050ee41f9ea1c540ef2f582607b3d50925 (commit) via 04e880fd33ca8a95ef15354f1791f151fe7a54e5 (commit) via 3fb174dd0b1e6bfb34c6ab82d9b22becd4181be4 (commit) via dcd2e38b992eb327f5387fa9a7a9195c70b24593 (commit) via dc451574c67da688024d5f3686c7c2aa4c5040ba (commit) via 9bb7f8f8982d1d73ca4d4ee108f3f2505e01ee7e (commit) via 46f87655c973a7bed523fcff76b59a465b751df5 (commit) from d9747a8a692fd2129cc13a7ce320b5a61bc3d6e8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e60d07d8987bcfd41aa58cd443ccc56a61543eeb commit e60d07d8987bcfd41aa58cd443ccc56a61543eeb Merge: d9747a8 44b2dcb Author: Brad King AuthorDate: Thu Jan 8 14:58:28 2015 -0500 Commit: Brad King CommitDate: Thu Jan 8 14:58:28 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 15:04:26 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 15:04:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-630-g7ecbade Message-ID: <20150108200426.7CDA2A9DA0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 7ecbade8877522d9d565bcb2216f71426873f564 (commit) via 998e9c10943ef361785e6f15cab1fa61172b1c24 (commit) from 44b2dcb2e0c945339947c2e71b32f6da2fc4f610 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7ecbade8877522d9d565bcb2216f71426873f564 commit 7ecbade8877522d9d565bcb2216f71426873f564 Merge: 44b2dcb 998e9c1 Author: Brad King AuthorDate: Thu Jan 8 15:04:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 15:04:25 2015 -0500 Merge topic 'WCDH-thread_local-portability' 998e9c10 WCDH: Add feature portability for thread_local. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/WCDH-thread_local.rst | 7 +++++++ Modules/WriteCompilerDetectionHeader.cmake | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Help/release/dev/WCDH-thread_local.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 15:04:37 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 15:04:37 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1542-g2f6a32d Message-ID: <20150108200437.55A5AA9D9F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2f6a32d4551894eb60107ac93da8db086355a410 (commit) via 7ecbade8877522d9d565bcb2216f71426873f564 (commit) from e60d07d8987bcfd41aa58cd443ccc56a61543eeb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2f6a32d4551894eb60107ac93da8db086355a410 commit 2f6a32d4551894eb60107ac93da8db086355a410 Merge: e60d07d 7ecbade Author: Brad King AuthorDate: Thu Jan 8 15:04:33 2015 -0500 Commit: Brad King CommitDate: Thu Jan 8 15:04:33 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 8 15:05:53 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 8 Jan 2015 15:05:53 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1544-gc669312 Message-ID: <20150108200553.24F64A9DF7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c669312b305c6a2cff7f914449513a88c0ad5d4f (commit) via 0246f32c2e9f89287b223becf86185ac1488595d (commit) from 2f6a32d4551894eb60107ac93da8db086355a410 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c669312b305c6a2cff7f914449513a88c0ad5d4f commit c669312b305c6a2cff7f914449513a88c0ad5d4f Merge: 2f6a32d 0246f32 Author: Brad King AuthorDate: Thu Jan 8 15:05:52 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 15:05:52 2015 -0500 Merge topic 'FindQt4-versioned-qmake-first' into next 0246f32c Revert "FindQt4: search for versioned qmake names first before general qmake" http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0246f32c2e9f89287b223becf86185ac1488595d commit 0246f32c2e9f89287b223becf86185ac1488595d Author: Brad King AuthorDate: Thu Jan 8 15:05:20 2015 -0500 Commit: Brad King CommitDate: Thu Jan 8 15:05:27 2015 -0500 Revert "FindQt4: search for versioned qmake names first before general qmake" This reverts commit 8de3f22e8fe9e798b63eb00e35eee6404748d3bd. This requires some research and discussion. diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index a424d63..a79246a 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -522,7 +522,7 @@ endfunction() set(QT4_INSTALLED_VERSION_TOO_OLD FALSE) -set(_QT4_QMAKE_NAMES qmake4 qmake-qt4 qmake qmake-mac) +set(_QT4_QMAKE_NAMES qmake qmake4 qmake-qt4 qmake-mac) _qt4_find_qmake("${_QT4_QMAKE_NAMES}" QT_QMAKE_EXECUTABLE QTVERSION) if (QT_QMAKE_EXECUTABLE AND ----------------------------------------------------------------------- Summary of changes: Modules/FindQt4.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From robert.maynard at kitware.com Thu Jan 8 15:48:44 2015 From: robert.maynard at kitware.com (Robert Maynard) Date: Thu, 8 Jan 2015 15:48:44 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1556-g5813172 Message-ID: <20150108204844.B7BA5A8D32@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5813172221d7e1c19f458dae00fdfa5b19a7df77 (commit) via 97b312626263f4d1af3769a5cdd93e7f8900668b (commit) via ff8642df721b583ce27fc20292b536f86844b785 (commit) via 0f76fd1f9d731735044ac68bee8dd8f0339dcf65 (commit) via 58c525941389eba1da655bd70889527ab204912b (commit) via 33afee0d69b63b69469c791c01f23512c0ffe38b (commit) via 5177decb4703b91546819455186f14c9d9e63855 (commit) via ddb8b42422de110b7124f44adc842d3268e4d1d3 (commit) via 6296192defaaaa4c18b1821614c20b95ad94f806 (commit) via c13656e7173a517961349a5fe20ce0f727d37568 (commit) via 3e34e8331a72f227248a235595e3cfeabf65312e (commit) via b3e86f4e976562913bbe322bd2856a75a1542b27 (commit) from c669312b305c6a2cff7f914449513a88c0ad5d4f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5813172221d7e1c19f458dae00fdfa5b19a7df77 commit 5813172221d7e1c19f458dae00fdfa5b19a7df77 Merge: c669312 97b3126 Author: Robert Maynard AuthorDate: Thu Jan 8 15:48:43 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 15:48:43 2015 -0500 Merge topic 'revert_old_feature_record_msvc' into next 97b31262 Merge topic 'old_feature_record_msvc' into feature_record_msvc ff8642df Only disable cxx_contextual_conversions on MSVC 2012 and older. 0f76fd1f Features: Enable writing of MSVC compiler feature header. 58c52594 Features: Record for MSVC C++ 2015 and MSVC C 2010-2015. 33afee0d Features: Record for MSVC 2010-2013. 5177decb Features: Quote all compiler names when comparing with COMPILER_ID ddb8b424 Features: Properly evaluate if the compiler supports cxx_final. 6296192d Features: Add a comment explaining part of test. c13656e7 Features: Test nullptr as a side-effect activation of static_assert. 3e34e833 Features: Test feature propagation with more-common features. b3e86f4e Features: Test an expectation of whether OVERRIDE_CONTROL is expected http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97b312626263f4d1af3769a5cdd93e7f8900668b commit 97b312626263f4d1af3769a5cdd93e7f8900668b Merge: ff8642d b97c86b Author: Robert Maynard AuthorDate: Thu Jan 8 15:46:14 2015 -0500 Commit: Robert Maynard CommitDate: Thu Jan 8 15:48:33 2015 -0500 Merge topic 'old_feature_record_msvc' into feature_record_msvc Conflicts: Modules/Compiler/MSVC-C-FeatureTests.cmake Modules/Compiler/MSVC-CXX-FeatureTests.cmake Modules/Platform/Windows-MSVC-CXX.cmake Tests/CompileFeatures/CMakeLists.txt Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake diff --cc Tests/CompileFeatures/CMakeLists.txt index 9fb8d1b,d6f39bf..b90dc32 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -63,18 -62,15 +63,26 @@@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU cxx_return_type_deduction ) endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM CXX_non_features + #Micrsoft only officially supports this feature in VS2013 and above, due + #to new wording of the proposal. We don't test for this with MSVC because + #older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) + endif() +set(MSVC_) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + MSVC_VERSION LESS 1800) + list(REMOVE_ITEM CXX_non_features + # Microsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() + set(C_ext c) set(C_standard_flag 11) set(CXX_ext cpp) @@@ -156,17 -146,11 +164,18 @@@ if (CMAKE_CXX_COMPILE_FEATURES add_executable(CompileFeaturesGenex2 genex_test.cpp) target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert) - target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$) + target_compile_definitions(CompileFeaturesGenex2 PRIVATE + HAVE_OVERRIDE_CONTROL=$ + HAVE_NULLPTR=$ + ) - add_library(nullptr_iface INTERFACE) - target_compile_features(nullptr_iface INTERFACE cxx_nullptr) + add_library(static_assert_iface INTERFACE) + target_compile_features(static_assert_iface INTERFACE cxx_static_assert) add_executable(CompileFeaturesGenex3 genex_test.cpp) - target_link_libraries(CompileFeaturesGenex3 PRIVATE nullptr_iface) - target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$) + target_link_libraries(CompileFeaturesGenex3 PRIVATE static_assert_iface) + target_compile_definitions(CompileFeaturesGenex3 PRIVATE + HAVE_OVERRIDE_CONTROL=$ + HAVE_NULLPTR=$ + ) ++ endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff8642df721b583ce27fc20292b536f86844b785 commit ff8642df721b583ce27fc20292b536f86844b785 Author: Robert Maynard AuthorDate: Mon Jan 5 14:55:42 2015 -0500 Commit: Robert Maynard CommitDate: Tue Jan 6 15:24:42 2015 -0500 Only disable cxx_contextual_conversions on MSVC 2012 and older. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 0bcae32..9fb8d1b 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -63,9 +63,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" cxx_return_type_deduction ) endif() -if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + +set(MSVC_) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + MSVC_VERSION LESS 1800) list(REMOVE_ITEM CXX_non_features - # Micrsoft only officially supports this feature in VS2013 and above, due + # Microsoft only officially supports this feature in VS2013 and above, due # to new wording of the proposal. We don't test for this with MSVC because # older compiler pass the test but might not actually conform cxx_contextual_conversions http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0f76fd1f9d731735044ac68bee8dd8f0339dcf65 commit 0f76fd1f9d731735044ac68bee8dd8f0339dcf65 Author: Robert Maynard AuthorDate: Tue Jan 6 13:19:44 2015 -0500 Commit: Robert Maynard CommitDate: Tue Jan 6 15:24:42 2015 -0500 Features: Enable writing of MSVC compiler feature header. Notes: VS2015 and above are the only MSVC versions to support cxx_final, so remove usages from the tests, and instead only test for cxx_override. VS2012 and above to conform to cxx_decltype_incomplete_return_types proposal, but without support for auto return types the dcl.type.simple example in the proposal doesn't compile. VS2013 and above to conform to the updated cxx_contextual_conversions proposal, but VS2010 and above pass the test. Compilers such as MSVC have no explicit flags to enable C++11 mode, it just is always on. So only run the link tests with compilers that require a flag to specify the language version. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 36b9706..bcaaafa 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -316,6 +316,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC ) set(_hex_compilers ADSP Borland Embarcadero SunPro) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index b164f06..0bcae32 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -26,7 +26,18 @@ get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) foreach(feature ${c_features}) run_test(${feature} C) endforeach() + get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) + +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM cxx_features + # This test requires auto return type deduction to work properly, but + # that is not supported by all versions of MSVC that support decltype + # incomplete return types. + cxx_decltype_incomplete_return_types + ) +endif() + foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() @@ -52,6 +63,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" cxx_return_type_deduction ) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM CXX_non_features + # Micrsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() set(C_ext c) set(C_standard_flag 11) @@ -126,6 +145,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) + target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index f667cc4..4412569 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -10,7 +10,7 @@ struct A virtual int getA() { return 7; } }; -struct B final : A +struct B : A { int getA() override { return 42; } }; diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 401de95..cfaa78c 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 MSVC VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -64,6 +64,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -81,7 +93,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 MSVC VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..3b37091 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,8 +27,13 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) - run_cmake(LinkImplementationFeatureCycleSolved) + # compilers such as MSVC have no explicit flags to enable c++11 mode. + # Instead they come with all c++11 features implicitly enabled. + # So for those types of compilers this tests is not applicable. + if(CMAKE_CXX11_STANDARD_COMPILE_OPTION) + run_cmake(LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycleSolved) + endif() if (";${CXX_FEATURES};" MATCHES ";cxx_final;") set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58c525941389eba1da655bd70889527ab204912b commit 58c525941389eba1da655bd70889527ab204912b Author: Robert Maynard AuthorDate: Mon Dec 22 10:25:18 2014 -0500 Commit: Robert Maynard CommitDate: Tue Jan 6 15:24:42 2015 -0500 Features: Record for MSVC C++ 2015 and MSVC C 2010-2015. Initializer lists are only properly supported in 2015 and above. Previous Visual Studio releases said they supported initializer lists but silently produced bad code. diff --git a/Modules/Compiler/MSVC-C-FeatureTests.cmake b/Modules/Compiler/MSVC-C-FeatureTests.cmake new file mode 100644 index 0000000..e449358 --- /dev/null +++ b/Modules/Compiler/MSVC-C-FeatureTests.cmake @@ -0,0 +1,23 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + +set(_cmake_oldestSupported "_MSC_VER >= 1300") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_c_static_assert "${MSVC_2010}") +set(_cmake_feature_test_c_variadic_macros "${MSVC_2010}") + +set(MSVC_2003 "_MSC_VER >= 1300") +set(_cmake_feature_test_c_function_prototypes "${MSVC_2003}") + +# Currently unsupported: +# restrict requires the __restrict syntax in msvc +# set(_cmake_feature_test_c_restrict) + +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2010) +set(MSVC_2003) \ No newline at end of file diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake index 18dea24..b238fde 100644 --- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -1,8 +1,35 @@ # Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx # http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx -set(_oldestSupported "_MSC_VER >= 1600") + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") set(MSVC_2013 "_MSC_VER >= 1800") set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") @@ -11,14 +38,16 @@ set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") -# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221 -set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}") set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") # Possibly broken: # http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") +# Microsoft now states they support contextual conversions +# see footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}") set(MSVC_2012 "_MSC_VER >= 1700") set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") @@ -42,24 +71,27 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") # Currently unsupported: # http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ -# set(_cmake_feature_test_cxx_reference_qualified_functions ) -# set(_cmake_feature_test_cxx_inheriting_constructors ) -# set(_cmake_feature_test_cxx_alignas ) -# set(_cmake_feature_test_cxx_alignof ) -# set(_cmake_feature_test_cxx_thread_local ) -# set(_cmake_feature_test_cxx_func_identifier ) -# set(_cmake_feature_test_cxx_sizeof_member ) +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -# set(_cmake_feature_test_cxx_user_literals ) -# set(_cmake_feature_test_cxx_unrestricted_unions ) -# set(_cmake_feature_test_cxx_unicode_literals ) -# set(_cmake_feature_test_cxx_inline_namespaces ) +# set(_cmake_feature_test_cxx_reference_qualified_functions ) # set(_cmake_feature_test_cxx_constexpr ) -# set(_cmake_feature_test_cxx_noexcept ) # set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + -set(_oldestSupported) +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Platform/Windows-MSVC-C.cmake b/Modules/Platform/Windows-MSVC-C.cmake index cbe1586..c7792eb 100644 --- a/Modules/Platform/Windows-MSVC-C.cmake +++ b/Modules/Platform/Windows-MSVC-C.cmake @@ -3,3 +3,5 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_C " /FS") endif() __windows_compiler_msvc(C) + +set(CMAKE_C_STANDARD_DEFAULT 90) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 89885b8..ad56f68 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -5,6 +5,11 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) endif() __windows_compiler_msvc(CXX) +# No version of MSVC has full conformance to C++11. Therefore the +# __cplusplus macro always evaluates to 98 even if the compilers come with +# C++11/14/+ features enabled. +set(CMAKE_CXX_STANDARD_DEFAULT 98) + macro(cmake_record_cxx_compile_features) record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=33afee0d69b63b69469c791c01f23512c0ffe38b commit 33afee0d69b63b69469c791c01f23512c0ffe38b Author: Stephen Kelly AuthorDate: Sun Apr 6 15:55:37 2014 +0200 Commit: Robert Maynard CommitDate: Tue Jan 6 15:24:42 2015 -0500 Features: Record for MSVC 2010-2013. diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..18dea24 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,65 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx + +set(_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221 +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Possibly broken: +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_inheriting_constructors ) +# set(_cmake_feature_test_cxx_alignas ) +# set(_cmake_feature_test_cxx_alignof ) +# set(_cmake_feature_test_cxx_thread_local ) +# set(_cmake_feature_test_cxx_func_identifier ) +# set(_cmake_feature_test_cxx_sizeof_member ) + +# set(_cmake_feature_test_cxx_user_literals ) +# set(_cmake_feature_test_cxx_unrestricted_unions ) +# set(_cmake_feature_test_cxx_unicode_literals ) +# set(_cmake_feature_test_cxx_inline_namespaces ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_noexcept ) +# set(_cmake_feature_test_cxx_attributes ) + +set(_oldestSupported) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 0e85005..89885b8 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -4,3 +4,7 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_CXX " /FS") endif() __windows_compiler_msvc(CXX) + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5177decb4703b91546819455186f14c9d9e63855 commit 5177decb4703b91546819455186f14c9d9e63855 Author: Robert Maynard AuthorDate: Tue Jan 6 13:31:30 2015 -0500 Commit: Robert Maynard CommitDate: Tue Jan 6 15:24:41 2015 -0500 Features: Quote all compiler names when comparing with COMPILER_ID In preparation of adding MSVC support we need to quote all compiler names, as MSVC is also a CMake variable. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 834ac7c..b164f06 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.1) project(CompileFeatures) @@ -31,7 +31,7 @@ foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) # The cxx_alignof feature happens to work (for *this* testcase) with # GNU 4.7, but it is first documented as available with GNU 4.8. @@ -39,7 +39,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU cxx_alignof ) endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) # GNU prior to 4.9 does not set any preprocessor define to distinguish # c++1y from c++11, so CMake does not support c++1y features before GNU 4.9. diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 5b2f1de..401de95 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0.0) +cmake_minimum_required(VERSION 3.1.0) project(WriteCompilerDetectionHeader) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -56,17 +56,17 @@ macro(set_defines target true_defs false_defs) ) endmacro() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU - OR CMAKE_CXX_COMPILER_ID STREQUAL Clang - OR CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" + OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") # False for C++98 mode. list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() -if (CMAKE_C_COMPILER_ID STREQUAL GNU - OR CMAKE_C_COMPILER_ID STREQUAL Clang - OR CMAKE_C_COMPILER_ID STREQUAL AppleClang) +if (CMAKE_C_COMPILER_ID STREQUAL "GNU" + OR CMAKE_C_COMPILER_ID STREQUAL "Clang" + OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") add_executable(C_undefined c_undefined.c) set_property(TARGET C_undefined PROPERTY CXX_STANDARD 90) target_compile_options(C_undefined PRIVATE -Werror=undef) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ddb8b42422de110b7124f44adc842d3268e4d1d3 commit ddb8b42422de110b7124f44adc842d3268e4d1d3 Author: Robert Maynard AuthorDate: Wed Dec 31 10:25:33 2014 -0500 Commit: Robert Maynard CommitDate: Mon Jan 5 14:57:27 2015 -0500 Features: Properly evaluate if the compiler supports cxx_final. Previously we expanded HAVE_FINAL to determine what the copied_file number would be, but when we don't have cxx_final than HAVE_FINAL is not defined. What we really want is to use expected_result. diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake index c6707c1..b544b99 100644 --- a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake @@ -7,7 +7,7 @@ else() set(expected_result 0) endif() -add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${HAVE_FINAL}.cpp" +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_result}.cpp" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp" ) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6296192defaaaa4c18b1821614c20b95ad94f806 commit 6296192defaaaa4c18b1821614c20b95ad94f806 Author: Stephen Kelly AuthorDate: Sat Jan 3 15:18:39 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 3 15:18:39 2015 +0100 Features: Add a comment explaining part of test. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 832f68b..834ac7c 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -33,6 +33,8 @@ endforeach() if (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + # The cxx_alignof feature happens to work (for *this* testcase) with + # GNU 4.7, but it is first documented as available with GNU 4.8. list(REMOVE_ITEM CXX_non_features cxx_alignof ) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c13656e7173a517961349a5fe20ce0f727d37568 commit c13656e7173a517961349a5fe20ce0f727d37568 Author: Stephen Kelly AuthorDate: Sat Jan 3 15:09:53 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 3 15:14:52 2015 +0100 Features: Test nullptr as a side-effect activation of static_assert. Because not all compilers under test support the existing 'activation features', add another test to ensure that compilers which support both static_assert and nullptr behave as expected in this test. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index aca1791..832f68b 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -124,15 +124,24 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) - target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$) + target_compile_definitions(CompileFeaturesGenex PRIVATE + HAVE_OVERRIDE_CONTROL=$ + HAVE_NULLPTR=$ + ) add_executable(CompileFeaturesGenex2 genex_test.cpp) target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert) - target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$) + target_compile_definitions(CompileFeaturesGenex2 PRIVATE + HAVE_OVERRIDE_CONTROL=$ + HAVE_NULLPTR=$ + ) add_library(static_assert_iface INTERFACE) target_compile_features(static_assert_iface INTERFACE cxx_static_assert) add_executable(CompileFeaturesGenex3 genex_test.cpp) target_link_libraries(CompileFeaturesGenex3 PRIVATE static_assert_iface) - target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$) + target_compile_definitions(CompileFeaturesGenex3 PRIVATE + HAVE_OVERRIDE_CONTROL=$ + HAVE_NULLPTR=$ + ) endif() diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index 46b1942..f667cc4 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -17,6 +17,17 @@ struct B final : A #endif +#if !HAVE_NULLPTR +#error "Expect nullptr feature" +#else + +const char* getString() +{ + return nullptr; +} + +#endif + int main() { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3e34e8331a72f227248a235595e3cfeabf65312e commit 3e34e8331a72f227248a235595e3cfeabf65312e Author: Stephen Kelly AuthorDate: Sat Jan 3 15:04:39 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 3 15:11:04 2015 +0100 Features: Test feature propagation with more-common features. The purpose of the feature listing in these tests is to make other features from the same feature set (eg "C++11 features") available. The compilers under test until now have supported these 'activation features', but MSVC does not. Use the cxx_static_assert feature instead to activate the feature set. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index ae666c8..aca1791 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -127,12 +127,12 @@ if (CMAKE_CXX_COMPILE_FEATURES) target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$) add_executable(CompileFeaturesGenex2 genex_test.cpp) - target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_constexpr) + target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert) target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$) - add_library(noexcept_iface INTERFACE) - target_compile_features(noexcept_iface INTERFACE cxx_noexcept) + add_library(static_assert_iface INTERFACE) + target_compile_features(static_assert_iface INTERFACE cxx_static_assert) add_executable(CompileFeaturesGenex3 genex_test.cpp) - target_link_libraries(CompileFeaturesGenex3 PRIVATE noexcept_iface) + target_link_libraries(CompileFeaturesGenex3 PRIVATE static_assert_iface) target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$) endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b3e86f4e976562913bbe322bd2856a75a1542b27 commit b3e86f4e976562913bbe322bd2856a75a1542b27 Author: Stephen Kelly AuthorDate: Sat Jan 3 14:57:31 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 3 15:09:58 2015 +0100 Features: Test an expectation of whether OVERRIDE_CONTROL is expected The tests below test the presence of both cxx_final and cxx_override, only one of which is supported by MSVC. The test is in part intended to verify that the COMPILE_FEATURES genex supports multiple arguments and allows users to define names for groups of features (Clang already calls cxx_final and cxx_override 'override control' as a group). Keep the test, and allow the expectation to be set as appropriate. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index ff5d745..ae666c8 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -120,6 +120,8 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(IfaceCompileFeatures main.cpp) target_link_libraries(IfaceCompileFeatures iface) + add_definitions(-DEXPECT_OVERRIDE_CONTROL=1) + add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$) diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index ca38883..46b1942 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -1,6 +1,8 @@ #if !HAVE_OVERRIDE_CONTROL +#if EXPECT_OVERRIDE_CONTROL #error "Expect override control feature" +#endif #else struct A ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 38 ++++++++++++++++++++++++++++------ Tests/CompileFeatures/genex_test.cpp | 13 ++++++++++++ 2 files changed, 45 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 8 15:53:20 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 8 Jan 2015 15:53:20 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1558-ge74ca40 Message-ID: <20150108205320.4B939A9174@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e74ca4050fc64514c0f3bf43027435692afcc9e7 (commit) via 70afd657ebb9c578502bedce52b450d604eed1c8 (commit) from 5813172221d7e1c19f458dae00fdfa5b19a7df77 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e74ca4050fc64514c0f3bf43027435692afcc9e7 commit e74ca4050fc64514c0f3bf43027435692afcc9e7 Merge: 5813172 70afd65 Author: Stephen Kelly AuthorDate: Thu Jan 8 15:53:19 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 15:53:19 2015 -0500 Merge topic 'sun-better-stdlib' into next 70afd657 fixup! SolarisStudio: Use alternative standard library to build CMake. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=70afd657ebb9c578502bedce52b450d604eed1c8 commit 70afd657ebb9c578502bedce52b450d604eed1c8 Author: Stephen Kelly AuthorDate: Thu Jan 8 21:40:52 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 21:41:01 2015 +0100 fixup! SolarisStudio: Use alternative standard library to build CMake. Move the flag setting into CompileFlags.cmake. diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f383d4..1812b27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,14 +44,6 @@ if(NOT DEFINED CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 14) endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4") - endif() -endif() - # option to set the internal encoding of CMake to UTF-8 option(CMAKE_ENCODING_UTF8 "Use UTF-8 encoding internally (experimental)." OFF) mark_as_advanced(CMAKE_ENCODING_UTF8) diff --git a/CompileFlags.cmake b/CompileFlags.cmake index e7beb3f..b6cc783 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -75,6 +75,14 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc") endif() endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4") + endif() +endif() + # use the ansi CXX compile flag for building cmake if (CMAKE_ANSI_CXXFLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 8 -------- CompileFlags.cmake | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 8 16:21:37 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 8 Jan 2015 16:21:37 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1572-g94c538f Message-ID: <20150108212137.C214BA9787@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 94c538fe4db0eec3c5f059f57882d47f8cc4a272 (commit) via 123ee42138f6504467f747a25557127c4abb210f (commit) via 73afe27ebd5bbd8ec0d316e0a951661d566ccc85 (commit) via 21b8306d13ae7325904adccfadcaf60aed79a1ab (commit) via c3c63f491cbac00a656a3a3e395e6bbbfe0a3434 (commit) via 2a9add9a2b15937160607cd770b1adc93d5594f2 (commit) via f194a009c8efeb6f2fd1f212dee678c54d4ef48d (commit) via 3ec1bb1537c41f58da2dc6715e4964a38d1b1043 (commit) via bb3bce706a2d41efa034f5b8e71ad701982acf5d (commit) via 28fa4923c3299f81659ad3ee644509ea3530fb14 (commit) via 837a8a6312d543f1c46efa532f7d5b5dfb334bc9 (commit) via 4030ddfda8c715601e60e8f0322554f464497807 (commit) via 17d6a6fd59efd98b1644d6f5441bbd36c19e1ffa (commit) via 26fb50114f37366c5c72ec76a1c09bfb2f94d19c (commit) from e74ca4050fc64514c0f3bf43027435692afcc9e7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=94c538fe4db0eec3c5f059f57882d47f8cc4a272 commit 94c538fe4db0eec3c5f059f57882d47f8cc4a272 Merge: e74ca40 123ee42 Author: Stephen Kelly AuthorDate: Thu Jan 8 16:21:33 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 16:21:33 2015 -0500 Merge topic 'drop-ancient-workarounds' into next 123ee421 Remove VS 6 special case. 73afe27e Remove VS7 special case. 21b8306d Remove some obsolete stuff. c3c63f49 cmStandardIncludes: Remove obsolete cmOStringStream. 2a9add9a Port all cmOStringStream to std::ostringstream. f194a009 Remove unused cmIStringStream class. 3ec1bb15 cmStandardIncludes: Remove std namespace hack. bb3bce70 cmStandardIncludes: Remove ANSI_FOR_SCOPE hack. 28fa4923 cmStandardIncludes: Remove iostreams workaround for obsolete Compaq compiler. 837a8a63 cmStandardIncludes: Drop Comeau-related workaround. 4030ddfd Remove Borland-related undef. 17d6a6fd cmStandardIncludes: Remove comment about Borland. 26fb5011 Drop SGI as a CMake host compiler. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=123ee42138f6504467f747a25557127c4abb210f commit 123ee42138f6504467f747a25557127c4abb210f Author: Stephen Kelly AuthorDate: Thu Jan 8 22:12:49 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:16:28 2015 +0100 Remove VS 6 special case. diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 153ba6a..93bfdf8 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -16,9 +16,6 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 7") set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) endif() -if(CMAKE_GENERATOR MATCHES "Visual Studio 6") - set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -endif() if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel") set(_INTEL_WINDOWS 1) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=73afe27ebd5bbd8ec0d316e0a951661d566ccc85 commit 73afe27ebd5bbd8ec0d316e0a951661d566ccc85 Author: Stephen Kelly AuthorDate: Mon Jan 5 20:55:57 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:16:28 2015 +0100 Remove VS7 special case. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 96f4709..72a185f 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -507,11 +507,6 @@ if(APPLE) target_link_libraries(CMakeLib "-framework CoreFoundation") endif() -# On some platforms we need the rpcrt4 library for the VS 7 generators. -if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) - target_link_libraries(CMakeLib rpcrt4) -endif() - # # CTestLib # http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=21b8306d13ae7325904adccfadcaf60aed79a1ab commit 21b8306d13ae7325904adccfadcaf60aed79a1ab Author: Stephen Kelly AuthorDate: Mon Jan 5 20:38:28 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:16:27 2015 +0100 Remove some obsolete stuff. We don't need to run compiler tests for ansi-for etc anymore. All supported compilers support the features tested here. diff --git a/CompileFlags.cmake b/CompileFlags.cmake index e7beb3f..153ba6a 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -83,5 +83,3 @@ endif () if (CMAKE_ANSI_CFLAGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") endif () - -include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index 79776f4..c0a1aa9 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -9,10 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#cmakedefine CMAKE_NO_STD_NAMESPACE -#cmakedefine CMAKE_NO_ANSI_STREAM_HEADERS -#cmakedefine CMAKE_NO_ANSI_STRING_STREAM -#cmakedefine CMAKE_NO_ANSI_FOR_SCOPE #cmakedefine HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE #cmakedefine HAVE_UNSETENV #cmakedefine CMAKE_USE_ELF_PARSER diff --git a/bootstrap b/bootstrap index d92b091..ac82f21 100755 --- a/bootstrap +++ b/bootstrap @@ -1461,35 +1461,6 @@ cmake_compiler_settings_comment="/* cmake_report cmConfigure.h${_tmp} "${cmake_compiler_settings_comment}" -if [ "x$KWSYS_STL_HAVE_STD" = "x1" ]; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_STD_NAMESPACE */" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_STD_NAMESPACE 1" -fi - -if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_STREAM_HEADERS */" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_STREAM_HEADERS 1" -fi - -if [ "x$KWSYS_IOS_USE_SSTREAM" = "x1" ]; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_STRING_STREAM */" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_STRING_STREAM 1" -fi - -# Test for ansi FOR scope -if cmake_try_run "${cmake_cxx_compiler}" \ - "${cmake_cxx_flags}" \ - "${cmake_source_dir}/Modules/TestForAnsiForScope.cxx" >> cmake_bootstrap.log 2>&1; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_FOR_SCOPE */" - echo "${cmake_cxx_compiler} has ANSI for scoping" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_FOR_SCOPE 1" - echo "${cmake_cxx_compiler} does not have ANSI for scoping" -fi - # When bootstrapping on MinGW with MSYS we must convert the source # directory to a windows path. if ${cmake_system_mingw}; then http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c3c63f491cbac00a656a3a3e395e6bbbfe0a3434 commit c3c63f491cbac00a656a3a3e395e6bbbfe0a3434 Author: Stephen Kelly AuthorDate: Mon Jan 5 20:33:18 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:16:27 2015 +0100 cmStandardIncludes: Remove obsolete cmOStringStream. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 97f57a3..96f4709 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -153,7 +153,6 @@ endif() # Sources for CMakeLib # set(SRCS - cmStandardIncludes.cxx cmArchiveWrite.cxx cmBootstrapCommands1.cxx cmBootstrapCommands2.cxx diff --git a/Source/cmStandardIncludes.cxx b/Source/cmStandardIncludes.cxx deleted file mode 100644 index 23c570c..0000000 --- a/Source/cmStandardIncludes.cxx +++ /dev/null @@ -1,16 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2000-2010 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. -============================================================================*/ -#include "cmStandardIncludes.h" -#if !defined(CMAKE_NO_ANSI_STRING_STREAM) -std::ostringstream::cmOStringStream() {} -std::ostringstream::~cmOStringStream() {} -#endif diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index a7db271..f50771f 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -16,8 +16,6 @@ #ifndef cmStandardIncludes_h #define cmStandardIncludes_h -// include configure generated header to define CMAKE_NO_ANSI_STREAM_HEADERS, -// CMAKE_NO_STD_NAMESPACE, and other macros. #include #include @@ -49,23 +47,10 @@ # pragma warning (push,1) #endif -#ifndef CMAKE_NO_ANSI_STREAM_HEADERS -# include -# include -# include -#else -# include -# include -# include -#endif - -#if !defined(CMAKE_NO_ANSI_STRING_STREAM) -# include -#elif !defined(CMAKE_NO_ANSI_STREAM_HEADERS) -# include -#else -# include -#endif +#include +#include +#include +#include // we must have stl with the standard include style #include @@ -97,48 +82,6 @@ typedef unsigned short mode_t; #include //typedef cmsys::String std::string; -// Define cmOStringStream and cmIStringStream wrappers to hide -// differences between std::stringstream and the old strstream. -#if !defined(CMAKE_NO_ANSI_STRING_STREAM) -class cmOStringStream: public std::ostringstream -{ -public: - cmOStringStream(); - ~cmOStringStream(); -private: - cmOStringStream(const cmOStringStream&); - void operator=(const cmOStringStream&); -}; -#else -class cmOStrStreamCleanup -{ -public: - cmOStrStreamCleanup(std::ostrstream& ostr): OStrStream(ostr) {} - ~cmOStrStreamCleanup() { this->OStrStream.rdbuf()->freeze(0); } - static void IgnoreUnusedVariable(const cmOStrStreamCleanup&) {} -protected: - std::ostrstream& OStrStream; -}; - -class cmOStringStream: public std::ostrstream -{ -public: - typedef std::ostrstream Superclass; - cmOStringStream() {} - std::string str() - { - cmOStrStreamCleanup cleanup(*this); - cmOStrStreamCleanup::IgnoreUnusedVariable(cleanup); - int pcount = this->pcount(); - const char* ptr = this->Superclass::str(); - return std::string(ptr?ptr:"", pcount); - } -private: - cmOStringStream(const cmOStringStream&); - void operator=(const cmOStringStream&); -}; -#endif - /* Poison this operator to avoid common mistakes. */ extern void operator << (std::ostream&, const std::ostringstream&); diff --git a/bootstrap b/bootstrap index fe051e1..d92b091 100755 --- a/bootstrap +++ b/bootstrap @@ -240,7 +240,6 @@ CMAKE_UNUSED_SOURCES="\ " CMAKE_CXX_SOURCES="\ - cmStandardIncludes \ cmake \ cmakemain \ cmcmd \ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2a9add9a2b15937160607cd770b1adc93d5594f2 commit 2a9add9a2b15937160607cd770b1adc93d5594f2 Author: Stephen Kelly AuthorDate: Mon Jan 5 20:31:31 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:10:15 2015 +0100 Port all cmOStringStream to std::ostringstream. All compilers hosting CMake support the std class. diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 0644ecb..c1fe404 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -24,7 +24,7 @@ #endif #define cmCPackLogger(logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ if(Generator) { \ Generator->Logger->Log(logType, __FILE__, __LINE__, \ diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 3c45639..86f8a52 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -25,7 +25,7 @@ #endif #define cmCPackLogger(logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ if(Generator) { \ Generator->Logger->Log(logType, __FILE__, __LINE__, \ diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index fbd1d21..e751568 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -112,24 +112,24 @@ int cmCPackBundleGenerator::ConstructBundle() // The staging directory contains everything that will end-up inside the // final disk image ... - cmOStringStream staging; + std::ostringstream staging; staging << toplevel; - cmOStringStream contents; + std::ostringstream contents; contents << staging.str() << "/" << cpack_bundle_name << ".app/" << "Contents"; - cmOStringStream application; + std::ostringstream application; application << contents.str() << "/" << "MacOS"; - cmOStringStream resources; + std::ostringstream resources; resources << contents.str() << "/" << "Resources"; // Install a required, user-provided bundle metadata file ... - cmOStringStream plist_source; + std::ostringstream plist_source; plist_source << cpack_bundle_plist; - cmOStringStream plist_target; + std::ostringstream plist_target; plist_target << contents.str() << "/" << "Info.plist"; if(!this->CopyFile(plist_source, plist_target)) @@ -142,10 +142,10 @@ int cmCPackBundleGenerator::ConstructBundle() } // Install a user-provided bundle icon ... - cmOStringStream icon_source; + std::ostringstream icon_source; icon_source << cpack_bundle_icon; - cmOStringStream icon_target; + std::ostringstream icon_target; icon_target << resources.str() << "/" << cpack_bundle_name << ".icns"; if(!this->CopyFile(icon_source, icon_target)) @@ -161,10 +161,10 @@ int cmCPackBundleGenerator::ConstructBundle() // executable or a script) ... if(!cpack_bundle_startup_command.empty()) { - cmOStringStream command_source; + std::ostringstream command_source; command_source << cpack_bundle_startup_command; - cmOStringStream command_target; + std::ostringstream command_target; command_target << application.str() << "/" << cpack_bundle_name; if(!this->CopyFile(command_source, command_target)) @@ -231,7 +231,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) for(std::vector::iterator it = relFiles.begin(); it != relFiles.end(); ++it) { - cmOStringStream temp_sign_file_cmd; + std::ostringstream temp_sign_file_cmd; temp_sign_file_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_sign_file_cmd << " --deep -f -s \"" << cpack_apple_cert_app; temp_sign_file_cmd << "\" -i "; @@ -251,7 +251,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) } // sign main binary - cmOStringStream temp_sign_binary_cmd; + std::ostringstream temp_sign_binary_cmd; temp_sign_binary_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_sign_binary_cmd << " --deep -f -s \"" << cpack_apple_cert_app; temp_sign_binary_cmd << "\" \"" << bundle_path << "\""; @@ -266,7 +266,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) } // sign app bundle - cmOStringStream temp_codesign_cmd; + std::ostringstream temp_codesign_cmd; temp_codesign_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_codesign_cmd << " --deep -f -s \"" << cpack_apple_cert_app << "\""; if(this->GetOption("CPACK_BUNDLE_APPLE_ENTITLEMENTS")) diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 9f0a77e..5da9234 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -169,8 +169,8 @@ int cmCPackDragNDropGenerator::PackageFiles() } //---------------------------------------------------------------------- -bool cmCPackDragNDropGenerator::CopyFile(cmOStringStream& source, - cmOStringStream& target) +bool cmCPackDragNDropGenerator::CopyFile(std::ostringstream& source, + std::ostringstream& target) { if(!cmSystemTools::CopyFileIfDifferent( source.str().c_str(), @@ -190,7 +190,7 @@ bool cmCPackDragNDropGenerator::CopyFile(cmOStringStream& source, } //---------------------------------------------------------------------- -bool cmCPackDragNDropGenerator::RunCommand(cmOStringStream& command, +bool cmCPackDragNDropGenerator::RunCommand(std::ostringstream& command, std::string* output) { int exit_code = 1; @@ -255,12 +255,12 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // The staging directory contains everything that will end-up inside the // final disk image ... - cmOStringStream staging; + std::ostringstream staging; staging << src_dir; // Add a symlink to /Applications so users can drag-and-drop the bundle // into it - cmOStringStream application_link; + std::ostringstream application_link; application_link << staging.str() << "/Applications"; cmSystemTools::CreateSymlink("/Applications", application_link.str().c_str()); @@ -268,10 +268,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Optionally add a custom volume icon ... if(!cpack_package_icon.empty()) { - cmOStringStream package_icon_source; + std::ostringstream package_icon_source; package_icon_source << cpack_package_icon; - cmOStringStream package_icon_destination; + std::ostringstream package_icon_destination; package_icon_destination << staging.str() << "/.VolumeIcon.icns"; if(!this->CopyFile(package_icon_source, package_icon_destination)) @@ -289,10 +289,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // (e.g. for setting background/layout) ... if(!cpack_dmg_ds_store.empty()) { - cmOStringStream package_settings_source; + std::ostringstream package_settings_source; package_settings_source << cpack_dmg_ds_store; - cmOStringStream package_settings_destination; + std::ostringstream package_settings_destination; package_settings_destination << staging.str() << "/.DS_Store"; if(!this->CopyFile(package_settings_source, package_settings_destination)) @@ -309,10 +309,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Optionally add a custom background image ... if(!cpack_dmg_background_image.empty()) { - cmOStringStream package_background_source; + std::ostringstream package_background_source; package_background_source << cpack_dmg_background_image; - cmOStringStream package_background_destination; + std::ostringstream package_background_destination; package_background_destination << staging.str() << "/background.png"; if(!this->CopyFile(package_background_source, @@ -326,7 +326,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, return 0; } - cmOStringStream temp_background_hiding_command; + std::ostringstream temp_background_hiding_command; temp_background_hiding_command << this->GetOption("CPACK_COMMAND_SETFILE"); temp_background_hiding_command << " -a V \""; temp_background_hiding_command << package_background_destination.str(); @@ -346,7 +346,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::string temp_image = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); temp_image += "/temp.dmg"; - cmOStringStream temp_image_command; + std::ostringstream temp_image_command; temp_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); temp_image_command << " create"; temp_image_command << " -ov"; @@ -368,9 +368,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Optionally set the custom icon flag for the image ... if(!cpack_package_icon.empty()) { - cmOStringStream temp_mount; + std::ostringstream temp_mount; - cmOStringStream attach_command; + std::ostringstream attach_command; attach_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); attach_command << " attach"; attach_command << " \"" << temp_image << "\""; @@ -389,7 +389,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, mountpoint_regex.find(attach_output.c_str()); temp_mount << mountpoint_regex.match(1); - cmOStringStream setfile_command; + std::ostringstream setfile_command; setfile_command << this->GetOption("CPACK_COMMAND_SETFILE"); setfile_command << " -a C"; setfile_command << " \"" << temp_mount.str() << "\""; @@ -403,7 +403,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, return 0; } - cmOStringStream detach_command; + std::ostringstream detach_command; detach_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); detach_command << " detach"; detach_command << " \"" << temp_mount.str() << "\""; @@ -471,7 +471,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::string temp_udco = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); temp_udco += "/temp-udco.dmg"; - cmOStringStream udco_image_command; + std::ostringstream udco_image_command; udco_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); udco_image_command << " convert \"" << temp_image << "\""; udco_image_command << " -format UDCO"; @@ -488,7 +488,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, } // unflatten dmg - cmOStringStream unflatten_command; + std::ostringstream unflatten_command; unflatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); unflatten_command << " unflatten "; unflatten_command << "\"" << temp_udco << "\""; @@ -503,7 +503,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, } // Rez the SLA - cmOStringStream embed_sla_command; + std::ostringstream embed_sla_command; embed_sla_command << this->GetOption("CPACK_COMMAND_REZ"); const char* sysroot = this->GetOption("CPACK_OSX_SYSROOT"); if(sysroot && sysroot[0] != '\0') @@ -524,7 +524,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, } // flatten dmg - cmOStringStream flatten_command; + std::ostringstream flatten_command; flatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); flatten_command << " flatten "; flatten_command << "\"" << temp_udco << "\""; @@ -543,7 +543,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Create the final compressed read-only disk image ... - cmOStringStream final_image_command; + std::ostringstream final_image_command; final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); final_image_command << " convert \"" << temp_image << "\""; final_image_command << " -format "; diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h index 808c618..62218d4 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.h +++ b/Source/CPack/cmCPackDragNDropGenerator.h @@ -33,8 +33,8 @@ protected: bool SupportsComponentInstallation() const; - bool CopyFile(cmOStringStream& source, cmOStringStream& target); - bool RunCommand(cmOStringStream& command, std::string* output = 0); + bool CopyFile(std::ostringstream& source, cmOStringStream& target); + bool RunCommand(std::ostringstream& command, std::string* output = 0); std::string GetComponentInstallDirNameSuffix(const std::string& componentName); diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 2330278..9cd53ea 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -160,7 +160,7 @@ int cmCPackGenerator::PrepareNames() "Cannot open description file name: " << descFileName << std::endl); return 0; } - cmOStringStream ostr; + std::ostringstream ostr; std::string line; cmCPackLogger(cmCPackLog::LOG_VERBOSE, diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index ed89b53..907bb1e 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -29,7 +29,7 @@ #define cmCPackLogger(logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ this->Logger->Log(logType, __FILE__, __LINE__,\ cmCPackLog_msg.str().c_str());\ diff --git a/Source/CPack/cmCPackLog.h b/Source/CPack/cmCPackLog.h index 812f1de..7a7ff58 100644 --- a/Source/CPack/cmCPackLog.h +++ b/Source/CPack/cmCPackLog.h @@ -17,7 +17,7 @@ #define cmCPack_Log(ctSelf, logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ (ctSelf)->Log(logType, __FILE__, __LINE__, cmCPackLog_msg.str().c_str());\ } while ( 0 ) diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index b506b06..8f63ca2 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -71,7 +71,7 @@ int cmCPackNSISGenerator::PackageFiles() tmpFile += "/NSISOutput.log"; std::string nsisInstallOptions = nsisFileName + "/NSIS.InstallOptions.ini"; nsisFileName += "/project.nsi"; - cmOStringStream str; + std::ostringstream str; std::vector::const_iterator it; for ( it = files.begin(); it != files.end(); ++ it ) { @@ -91,7 +91,7 @@ int cmCPackNSISGenerator::PackageFiles() std::vector dirs; this->GetListOfSubdirectories(toplevel.c_str(), dirs); std::vector::const_iterator sit; - cmOStringStream dstr; + std::ostringstream dstr; for ( sit = dirs.begin(); sit != dirs.end(); ++ sit ) { std::string componentName; @@ -190,7 +190,7 @@ int cmCPackNSISGenerator::PackageFiles() std::string groupDescriptions; std::string installTypesCode; std::string defines; - cmOStringStream macrosOut; + std::ostringstream macrosOut; bool anyDownloadedComponents = false; // Create installation types. The order is significant, so we first fill @@ -503,8 +503,8 @@ int cmCPackNSISGenerator::InitializeInternal() << "not set" << std::endl); } - cmOStringStream str; - cmOStringStream deleteStr; + std::ostringstream str; + std::ostringstream deleteStr; if ( cpackPackageExecutables ) { @@ -565,8 +565,8 @@ int cmCPackNSISGenerator::InitializeInternal() } //---------------------------------------------------------------------- -void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str, - cmOStringStream& deleteStr) +void cmCPackNSISGenerator::CreateMenuLinks( std::ostringstream& str, + std::ostringstream& deleteStr) { const char* cpackMenuLinks = this->GetOption("CPACK_NSIS_MENU_LINKS"); @@ -694,7 +694,7 @@ bool cmCPackNSISGenerator::SupportsComponentInstallation() const std::string cmCPackNSISGenerator:: CreateComponentDescription(cmCPackComponent *component, - cmOStringStream& macrosOut) + std::ostringstream& macrosOut) { // Basic description of the component std::string componentCode = "Section "; @@ -714,7 +714,7 @@ CreateComponentDescription(cmCPackComponent *component, } else if (!component->InstallationTypes.empty()) { - cmOStringStream out; + std::ostringstream out; std::vector::iterator installTypeIter; for (installTypeIter = component->InstallationTypes.begin(); installTypeIter != component->InstallationTypes.end(); @@ -734,7 +734,7 @@ CreateComponentDescription(cmCPackComponent *component, // Compute the name of the archive. std::string packagesDir = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); packagesDir += ".dummy"; - cmOStringStream out; + std::ostringstream out; out << cmSystemTools::GetFilenameWithoutLastExtension(packagesDir) << "-" << component->Name << ".zip"; component->ArchiveFile = out.str(); @@ -859,7 +859,7 @@ CreateComponentDescription(cmCPackComponent *component, { totalSizeInKbytes = 1; } - cmOStringStream out; + std::ostringstream out; out << " AddSize " << totalSizeInKbytes << "\n" << " Push \"" << component->ArchiveFile << "\"\n" << " Call DownloadFile\n" @@ -935,7 +935,7 @@ std::string cmCPackNSISGenerator::CreateSelectionDependenciesDescription } visited.insert(component); - cmOStringStream out; + std::ostringstream out; std::vector::iterator dependIt; for (dependIt = component->Dependencies.begin(); dependIt != component->Dependencies.end(); @@ -967,7 +967,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription } visited.insert(component); - cmOStringStream out; + std::ostringstream out; std::vector::iterator dependIt; for (dependIt = component->ReverseDependencies.begin(); dependIt != component->ReverseDependencies.end(); @@ -992,7 +992,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription std::string cmCPackNSISGenerator:: CreateComponentGroupDescription(cmCPackComponentGroup *group, - cmOStringStream& macrosOut) + std::ostringstream& macrosOut) { if (group->Components.empty() && group->Subgroups.empty()) { diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h index e46fbda..c7b2ce1 100644 --- a/Source/CPack/cmCPackNSISGenerator.h +++ b/Source/CPack/cmCPackNSISGenerator.h @@ -38,8 +38,8 @@ public: protected: virtual int InitializeInternal(); - void CreateMenuLinks( cmOStringStream& str, - cmOStringStream& deleteStr); + void CreateMenuLinks( std::ostringstream& str, + std::ostringstream& deleteStr); int PackageFiles(); virtual const char* GetOutputExtension() { return ".exe"; } virtual const char* GetOutputPostfix() { return "win32"; } @@ -56,7 +56,7 @@ protected: /// macrosOut. std::string CreateComponentDescription(cmCPackComponent *component, - cmOStringStream& macrosOut); + std::ostringstream& macrosOut); /// Produce NSIS code that selects all of the components that this component /// depends on, recursively. @@ -75,7 +75,7 @@ protected: /// added macros will be emitted via macrosOut. std::string CreateComponentGroupDescription(cmCPackComponentGroup *group, - cmOStringStream& macrosOut); + std::ostringstream& macrosOut); /// Translations any newlines found in the string into \\r\\n, so that the /// resulting string can be used within NSIS. diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 28c7f1d..313e08b 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -45,8 +45,8 @@ int cmCPackOSXX11Generator::PackageFiles() { cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: " << cpackPackageExecutables << "." << std::endl); - cmOStringStream str; - cmOStringStream deleteStr; + std::ostringstream str; + std::ostringstream deleteStr; std::vector cpackPackageExecutablesVector; cmSystemTools::ExpandListArgument(cpackPackageExecutables, cpackPackageExecutablesVector); @@ -165,7 +165,7 @@ int cmCPackOSXX11Generator::PackageFiles() std::string output; std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/hdiutilOutput.log"; - cmOStringStream dmgCmd; + std::ostringstream dmgCmd; dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") << "\" create -ov -format UDZO -srcfolder \"" << diskImageDirectory.c_str() diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index e799d06..2df8dd9 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -325,7 +325,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() if (this->Components.empty()) { // Use PackageMaker to build the package. - cmOStringStream pkgCmd; + std::ostringstream pkgCmd; pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM") << "\" -build -p \"" << packageDirFileName << "\""; if (this->Components.empty()) @@ -359,7 +359,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/hdiutilOutput.log"; - cmOStringStream dmgCmd; + std::ostringstream dmgCmd; dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") << "\" create -ov -format UDZO -srcfolder \"" << packageDirFileName << "\" \"" << packageFileNames[0] << "\""; @@ -687,7 +687,7 @@ cmCPackPackageMakerGenerator::GetPackageName(const cmCPackComponent& component) { std::string packagesDir = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); packagesDir += ".dummy"; - cmOStringStream out; + std::ostringstream out; out << cmSystemTools::GetFilenameWithoutLastExtension(packagesDir) << "-" << component.Name << ".pkg"; return out.str(); @@ -710,7 +710,7 @@ GenerateComponentPackage(const char *packageFile, packageFile << std::endl); // The command that will be used to run PackageMaker - cmOStringStream pkgCmd; + std::ostringstream pkgCmd; if (this->PackageCompatibilityVersion < 10.5 || this->PackageMakerVersion < 3.0) @@ -800,7 +800,7 @@ WriteDistributionFile(const char* metapackageFile) // Create the choice outline, which provides a tree-based view of // the components in their groups. - cmOStringStream choiceOut; + std::ostringstream choiceOut; choiceOut << "" << std::endl; // Emit the outline for the groups @@ -862,7 +862,7 @@ WriteDistributionFile(const char* metapackageFile) //---------------------------------------------------------------------- void cmCPackPackageMakerGenerator:: -CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out) +CreateChoiceOutline(const cmCPackComponentGroup& group, std::ostringstream& out) { out << "" << std::endl; std::vector::const_iterator groupIt; @@ -885,7 +885,7 @@ CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out) //---------------------------------------------------------------------- void cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group, - cmOStringStream& out) + std::ostringstream& out) { out << "GetOption("CPACK_PACKAGE_VENDOR"); @@ -989,7 +989,7 @@ void cmCPackPackageMakerGenerator:: AddDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out) + std::ostringstream& out) { if (visited.find(&component) != visited.end()) { @@ -1013,7 +1013,7 @@ void cmCPackPackageMakerGenerator:: AddReverseDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out) + std::ostringstream& out) { if (visited.find(&component) != visited.end()) { diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h index e350a60..1b468d7 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.h +++ b/Source/CPack/cmCPackPackageMakerGenerator.h @@ -84,30 +84,30 @@ protected: // dependency attributes for inter-component dependencies. void AddDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out); + std::ostringstream& out); // Subroutine of WriteDistributionFile that writes out the // reverse dependency attributes for inter-component dependencies. void AddReverseDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out); + std::ostringstream& out); // Generates XML that encodes the hierarchy of component groups and // their components in a form that can be used by distribution // metapackages. void CreateChoiceOutline(const cmCPackComponentGroup& group, - cmOStringStream& out); + std::ostringstream& out); /// Create the "choice" XML element to describe a component group /// for the installer GUI. void CreateChoice(const cmCPackComponentGroup& group, - cmOStringStream& out); + std::ostringstream& out); /// Create the "choice" XML element to describe a component for the /// installer GUI. void CreateChoice(const cmCPackComponent& component, - cmOStringStream& out); + std::ostringstream& out); // Escape the given string to make it usable as an XML attribute // value. diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 26bf607..b1b122d 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -426,7 +426,7 @@ int main (int argc, char const* const* argv) = mf->GetDefinition("CPACK_PACKAGE_VERSION_MINOR"); const char* projVersionPatch = mf->GetDefinition("CPACK_PACKAGE_VERSION_PATCH"); - cmOStringStream ostr; + std::ostringstream ostr; ostr << projVersionMajor << "." << projVersionMinor << "." << projVersionPatch; mf->AddDefinition("CPACK_PACKAGE_VERSION", diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index a101e39..b1fb02d 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -55,7 +55,7 @@ int cmCTestBuildAndTestHandler::ProcessHandler() //---------------------------------------------------------------------- int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, - cmOStringStream &out, std::string &cmakeOutString, std::string &cwd, + std::ostringstream &out, std::string &cmakeOutString, std::string &cwd, cmake *cm) { unsigned int k; @@ -209,7 +209,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) std::string cmakeOutString; cmCTestBuildAndTestCaptureRAII captureRAII(cm, cmakeOutString); static_cast(captureRAII); - cmOStringStream out; + std::ostringstream out; if ( this->CTest->GetConfigType().size() == 0 && this->ConfigSample.size()) diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h index 5a7b916..a75c631 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.h +++ b/Source/CTest/cmCTestBuildAndTestHandler.h @@ -50,7 +50,7 @@ public: protected: ///! Run CMake and build a test and then run it as a single test. int RunCMakeAndTest(std::string* output); - int RunCMake(std::string* outstring, cmOStringStream &out, + int RunCMake(std::string* outstring, std::ostringstream &out, std::string &cmakeOutString, std::string &cwd, cmake *cm); diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index a5a593a..c4df741 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -148,7 +148,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() } else { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "has no project to build. If this is a " "\"built with CMake\" project, verify that CTEST_CMAKE_GENERATOR " "and CTEST_PROJECT_NAME are set." @@ -181,7 +181,7 @@ bool cmCTestBuildCommand::InitialPass(std::vector const& args, bool ret = cmCTestHandlerCommand::InitialPass(args, status); if ( this->Values[ctb_NUMBER_ERRORS] && *this->Values[ctb_NUMBER_ERRORS]) { - cmOStringStream str; + std::ostringstream str; str << this->Handler->GetTotalErrors(); this->Makefile->AddDefinition( this->Values[ctb_NUMBER_ERRORS], str.str().c_str()); @@ -189,7 +189,7 @@ bool cmCTestBuildCommand::InitialPass(std::vector const& args, if ( this->Values[ctb_NUMBER_WARNINGS] && *this->Values[ctb_NUMBER_WARNINGS]) { - cmOStringStream str; + std::ostringstream str; str << this->Handler->GetTotalWarnings(); this->Makefile->AddDefinition( this->Values[ctb_NUMBER_WARNINGS], str.str().c_str()); diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index ef62fd3..0f13263 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -66,7 +66,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() const std::string cmakelists_file = source_dir + "/CMakeLists.txt"; if ( !cmSystemTools::FileExists(cmakelists_file.c_str()) ) { - cmOStringStream e; + std::ostringstream e; e << "CMakeLists.txt file does not exist [" << cmakelists_file << "]"; this->SetError(e.str()); diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index a1d770b..25bd96f 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -544,7 +544,7 @@ int cmCTestCoverageHandler::ProcessHandler() cmsys::ifstream ifs(fullFileName.c_str()); if ( !ifs) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Cannot open source file: " << fullFileName; errorsWhileAccumulating.push_back(ostr.str()); error ++; @@ -563,7 +563,7 @@ int cmCTestCoverageHandler::ProcessHandler() if ( !cmSystemTools::GetLineFromStream(ifs, line) && cc != fcov.size() -1 ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Problem reading source file: " << fullFileName << " line:" << cc << " out total: " << fcov.size()-1; errorsWhileAccumulating.push_back(ostr.str()); @@ -584,7 +584,7 @@ int cmCTestCoverageHandler::ProcessHandler() } if ( cmSystemTools::GetLineFromStream(ifs, line) ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Looks like there are more lines in the file: " << fullFileName; errorsWhileAccumulating.push_back(ostr.str()); } @@ -633,7 +633,7 @@ int cmCTestCoverageHandler::ProcessHandler() cmsys::ifstream ifs(fullPath.c_str()); if (!ifs) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Cannot open source file: " << fullPath; errorsWhileAccumulating.push_back(ostr.str()); error ++; diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx index 5ddef01..e175592 100644 --- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx +++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx @@ -24,7 +24,7 @@ bool cmCTestEmptyBinaryDirectoryCommand if ( !cmCTestScriptHandler::EmptyBinaryDirectory(args[0].c_str()) ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "problem removing the binary directory: " << args[0]; this->SetError(ostr.str()); return false; diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 2df2229..13c8ca5 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -103,7 +103,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part, << std::endl;); return false; } - cmOStringStream ostr; + std::ostringstream ostr; ostr << name; if ( this->SubmitIndex > 0 ) { @@ -142,7 +142,7 @@ bool cmCTestGenericHandler::StartLogFile(const char* name, "Cannot create log file without providing the name" << std::endl;); return false; } - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Last" << name; if ( this->SubmitIndex > 0 ) { diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 5b525dd..b886777 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -46,7 +46,7 @@ bool cmCTestHandlerCommand if(!this->CheckArgumentKeyword(args[i]) && !this->CheckArgumentValue(args[i])) { - cmOStringStream e; + std::ostringstream e; e << "called with unknown argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; @@ -141,7 +141,7 @@ bool cmCTestHandlerCommand int res = handler->ProcessHandler(); if ( this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE]) { - cmOStringStream str; + std::ostringstream str; str << res; this->Makefile->AddDefinition( this->Values[ct_RETURN_VALUE], str.str().c_str()); @@ -183,7 +183,7 @@ bool cmCTestHandlerCommand::CheckArgumentValue(std::string const& arg) unsigned int k = this->ArgumentIndex; if(this->Values[k]) { - cmOStringStream e; + std::ostringstream e; e << "Called with more than one value for " << this->Arguments[k]; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->ArgumentDoing = ArgumentDoingError; diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 09cf760..fd0388a 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -75,7 +75,7 @@ public: this->ParseError(atts); } // Create the log - cmOStringStream ostr; + std::ostringstream ostr; ostr << name << ":\n"; int i = 0; for(; atts[i] != 0; i+=2) @@ -198,7 +198,7 @@ void cmCTestMemCheckHandler::GenerateTestCommand( { std::vector::size_type pp; std::string index; - cmOStringStream stream; + std::ostringstream stream; std::string memcheckcommand = cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str()); stream << test; @@ -834,7 +834,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( int defects = 0; std::vector lines; cmSystemTools::Split(str.c_str(), lines); - cmOStringStream ostr; + std::ostringstream ostr; log = ""; for( std::vector::iterator i = lines.begin(); i != lines.end(); ++i) @@ -878,7 +878,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( { std::vector lines; cmSystemTools::Split(str.c_str(), lines); - cmOStringStream ostr; + std::ostringstream ostr; log = ""; cmsys::RegularExpression pfW("^\\[[WEI]\\] ([A-Z][A-Z][A-Z][A-Z]*): "); @@ -941,7 +941,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( std::string::size_type cc; - cmOStringStream ostr; + std::ostringstream ostr; log = ""; int defects = 0; @@ -1269,7 +1269,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(int test, files) { std::string index; - cmOStringStream stream; + std::ostringstream stream; stream << test; index = stream.str(); std::string ofile = this->MemoryTesterOutputFile; diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 4c89caa..a6bc844 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -668,7 +668,7 @@ void cmCTestMultiProcessHandler::PrintTestList() { cmCTestLog(this->CTest, HANDLER_OUTPUT, " Test"); } - cmOStringStream indexStr; + std::ostringstream indexStr; indexStr << " #" << p.Index << ":"; cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex())) diff --git a/Source/CTest/cmCTestRunScriptCommand.cxx b/Source/CTest/cmCTestRunScriptCommand.cxx index bdf9b9c..7afbe04 100644 --- a/Source/CTest/cmCTestRunScriptCommand.cxx +++ b/Source/CTest/cmCTestRunScriptCommand.cxx @@ -54,7 +54,7 @@ bool cmCTestRunScriptCommand int ret; cmCTestScriptHandler::RunScript(this->CTest, args[i].c_str(), !np, &ret); - cmOStringStream str; + std::ostringstream str; str << ret; this->Makefile->AddDefinition(returnVariable, str.str().c_str()); } diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index ff55528..2a39051 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -694,7 +694,7 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) cmCTestLog(this->CTest, HANDLER_OUTPUT, "Test"); } - cmOStringStream indexStr; + std::ostringstream indexStr; indexStr << " #" << this->Index << ":"; cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex())) diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index f958e7b..71edd5b 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -299,7 +299,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) cmsysProcess_Delete(cp); if(failed) { - cmOStringStream message; + std::ostringstream message; message << "Error running command: ["; message << result << "] "; for(std::vector::iterator i = argv.begin(); diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 1a39a8a..8ea6cef 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -126,7 +126,7 @@ bool cmCTestStartCommand } if(!cmSystemTools::FileIsDirectory(sourceDir)) { - cmOStringStream e; + std::ostringstream e; e << "given source path\n" << " " << sourceDir << "\n" << "which is not an existing directory. " diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 07a994d..97ec21e 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -212,7 +212,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "Part name \"" << arg << "\" is invalid."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->ArgumentDoing = ArgumentDoingError; @@ -229,7 +229,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "File \"" << filename << "\" does not exist. Cannot submit " << "a non-existent file."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 231f035..d209094 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -53,7 +53,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler() if ( this->Values[ctt_START] || this->Values[ctt_END] || this->Values[ctt_STRIDE] ) { - cmOStringStream testsToRunString; + std::ostringstream testsToRunString; if ( this->Values[ctt_START] ) { testsToRunString << this->Values[ctt_START]; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 38ce3dc..a398864 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1865,7 +1865,7 @@ std::string cmCTestTestHandler::GenerateRegressionImages( SPACE_REGEX "*(name|type|encoding|compression)=\"([^\"]*)\"" SPACE_REGEX "*>([^<]*)"); - cmOStringStream ostr; + std::ostringstream ostr; bool done = false; std::string cxml = xml; while ( ! done ) @@ -2098,7 +2098,7 @@ bool cmCTestTestHandler::CleanTestOutput(std::string& output, size_t length) output = output.substr(0, current - begin); // Append truncation message. - cmOStringStream msg; + std::ostringstream msg; msg << "...\n" "The rest of the test output was removed since it exceeds the threshold " "of " << length << " bytes.\n"; diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 7206914..772c9aa 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -413,7 +413,7 @@ bool cmCTestUpdateHandler::SelectVCS() } if (this->UpdateCommand.empty()) { - cmOStringStream e; + std::ostringstream e; e << "Cannot find UpdateCommand "; if (key) { diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx index f7de294..5613751 100644 --- a/Source/CTest/cmCTestUploadCommand.cxx +++ b/Source/CTest/cmCTestUploadCommand.cxx @@ -55,7 +55,7 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "File \"" << filename << "\" does not exist. Cannot submit " << "a non-existent file."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index 15f796f..6e93e95 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -105,7 +105,7 @@ bool cmCTestVC::RunChild(char const* const* cmd, OutputParser* out, //---------------------------------------------------------------------------- std::string cmCTestVC::ComputeCommandLine(char const* const* cmd) { - cmOStringStream line; + std::ostringstream line; const char* sep = ""; for(const char* const* arg = cmd; *arg; ++arg) { diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index 818b910..8fb49ca 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -305,7 +305,7 @@ bool cmAddCustomCommandCommand } // No command for this output exists. - cmOStringStream e; + std::ostringstream e; e << "given APPEND option with output \"" << output[0] << "\" which is not already a custom command output."; this->SetError(e.str()); @@ -354,7 +354,7 @@ bool cmAddCustomCommandCommand } if(!okay) { - cmOStringStream e; + std::ostringstream e; e << "could not locate source file with a custom command producing \"" << output[0] << "\" even though this command tried to create it!"; this->SetError(e.str()); @@ -375,7 +375,7 @@ bool cmAddCustomCommandCommand else { bool issueMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0050)) { @@ -436,7 +436,7 @@ cmAddCustomCommandCommand std::string::size_type pos = o->find_first_of("#<>"); if(pos != o->npos) { - cmOStringStream msg; + std::ostringstream msg; msg << "called with OUTPUT containing a \"" << (*o)[pos] << "\". This character is not allowed."; this->SetError(msg.str()); diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 09c8af5..a0e20c8 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -30,7 +30,7 @@ bool cmAddCustomTargetCommand // Check the target name. if(targetName.find_first_of("/\\") != targetName.npos) { - cmOStringStream e; + std::ostringstream e; e << "called with invalid target name \"" << targetName << "\". Target names may not contain a slash. " << "Use ADD_CUSTOM_COMMAND to generate files."; @@ -170,7 +170,7 @@ bool cmAddCustomTargetCommand std::string::size_type pos = targetName.find_first_of("#<>"); if(pos != targetName.npos) { - cmOStringStream msg; + std::ostringstream msg; msg << "called with target name containing a \"" << targetName[pos] << "\". This character is not allowed."; this->SetError(msg.str()); @@ -189,7 +189,7 @@ bool cmAddCustomTargetCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; - cmOStringStream e; + std::ostringstream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx index e897d81..b560452 100644 --- a/Source/cmAddDependenciesCommand.cxx +++ b/Source/cmAddDependenciesCommand.cxx @@ -26,7 +26,7 @@ bool cmAddDependenciesCommand std::string target_name = args[0]; if(this->Makefile->IsAlias(target_name)) { - cmOStringStream e; + std::ostringstream e; e << "Cannot add target-level dependencies to alias target \"" << target_name << "\".\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -35,7 +35,7 @@ bool cmAddDependenciesCommand { if (target->GetType() == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Cannot add target-level dependencies to INTERFACE library " "target \"" << target_name << "\".\n"; this->SetError(e.str()); @@ -51,7 +51,7 @@ bool cmAddDependenciesCommand } else { - cmOStringStream e; + std::ostringstream e; e << "Cannot add target-level dependencies to non-existent target \"" << target_name << "\".\n" << "The add_dependencies works for top-level logical targets created " diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx index c30e764..74dc8eb 100644 --- a/Source/cmAddExecutableCommand.cxx +++ b/Source/cmAddExecutableCommand.cxx @@ -79,7 +79,7 @@ bool cmAddExecutableCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; - cmOStringStream e; + std::ostringstream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { @@ -149,7 +149,7 @@ bool cmAddExecutableCommand } if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << "ALIAS requires exactly one target argument."; this->SetError(e.str()); return false; @@ -158,7 +158,7 @@ bool cmAddExecutableCommand const char *aliasedName = s->c_str(); if(this->Makefile->IsAlias(aliasedName)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" is itself an ALIAS."; this->SetError(e.str()); @@ -168,7 +168,7 @@ bool cmAddExecutableCommand this->Makefile->FindTargetToUse(aliasedName, true); if(!aliasedTarget) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" does not already " "exist."; @@ -178,7 +178,7 @@ bool cmAddExecutableCommand cmTarget::TargetType type = aliasedTarget->GetType(); if(type != cmTarget::EXECUTABLE) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" is not an " "executable."; @@ -187,7 +187,7 @@ bool cmAddExecutableCommand } if(aliasedTarget->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" is IMPORTED."; this->SetError(e.str()); @@ -203,7 +203,7 @@ bool cmAddExecutableCommand // Make sure the target does not already exist. if(this->Makefile->FindTargetToUse(exename)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create imported target \"" << exename << "\" because another target with the same name already exists."; this->SetError(e.str()); diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index bba4d41..db2f6fb 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -51,7 +51,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting STATIC type."; this->SetError(e.str()); return false; @@ -64,7 +64,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting SHARED type."; this->SetError(e.str()); return false; @@ -77,7 +77,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting MODULE type."; this->SetError(e.str()); return false; @@ -90,7 +90,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting OBJECT type."; this->SetError(e.str()); return false; @@ -103,7 +103,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting UNKNOWN type."; this->SetError(e.str()); return false; @@ -116,7 +116,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting ALIAS type."; this->SetError(e.str()); return false; @@ -128,21 +128,21 @@ bool cmAddLibraryCommand { if (haveSpecifiedType) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting/multiple types."; this->SetError(e.str()); return false; } if (isAlias) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting ALIAS type."; this->SetError(e.str()); return false; } if (excludeFromAll) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL."; this->SetError(e.str()); return false; @@ -155,7 +155,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL."; this->SetError(e.str()); return false; @@ -175,7 +175,7 @@ bool cmAddLibraryCommand } else if(type == cmTarget::INTERFACE_LIBRARY && *s == "GLOBAL") { - cmOStringStream e; + std::ostringstream e; e << "GLOBAL option may only be used with IMPORTED libraries."; this->SetError(e.str()); return false; @@ -190,14 +190,14 @@ bool cmAddLibraryCommand { if (s != args.end()) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library requires no source arguments."; this->SetError(e.str()); return false; } if (importGlobal && !importTarget) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified as GLOBAL, but not as IMPORTED."; this->SetError(e.str()); return false; @@ -214,7 +214,7 @@ bool cmAddLibraryCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; - cmOStringStream e; + std::ostringstream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { @@ -267,7 +267,7 @@ bool cmAddLibraryCommand } if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << "ALIAS requires exactly one target argument."; this->SetError(e.str()); return false; @@ -276,7 +276,7 @@ bool cmAddLibraryCommand const char *aliasedName = s->c_str(); if(this->Makefile->IsAlias(aliasedName)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" is itself an ALIAS."; this->SetError(e.str()); @@ -286,7 +286,7 @@ bool cmAddLibraryCommand this->Makefile->FindTargetToUse(aliasedName, true); if(!aliasedTarget) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" does not already " "exist."; @@ -300,7 +300,7 @@ bool cmAddLibraryCommand && aliasedType != cmTarget::OBJECT_LIBRARY && aliasedType != cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" is not a library."; this->SetError(e.str()); @@ -308,7 +308,7 @@ bool cmAddLibraryCommand } if(aliasedTarget->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" is IMPORTED."; this->SetError(e.str()); @@ -333,7 +333,7 @@ bool cmAddLibraryCommand (this->Makefile->GetCMakeInstance()->GetPropertyAsBool( "TARGET_SUPPORTS_SHARED_LIBS") == false)) { - cmOStringStream w; + std::ostringstream w; w << "ADD_LIBRARY called with " << (type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE") << @@ -364,7 +364,7 @@ bool cmAddLibraryCommand { if (!cmGeneratorExpression::IsValidTargetName(libName)) { - cmOStringStream e; + std::ostringstream e; e << "Invalid name for IMPORTED INTERFACE library target: " << libName; this->SetError(e.str()); return false; @@ -374,7 +374,7 @@ bool cmAddLibraryCommand // Make sure the target does not already exist. if(this->Makefile->FindTargetToUse(libName)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create imported target \"" << libName << "\" because another target with the same name already exists."; this->SetError(e.str()); @@ -413,7 +413,7 @@ bool cmAddLibraryCommand if (!cmGeneratorExpression::IsValidTargetName(libName) || libName.find("::") != std::string::npos) { - cmOStringStream e; + std::ostringstream e; e << "Invalid name for INTERFACE library target: " << libName; this->SetError(e.str()); return false; diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 477a3d9..8db5078 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -81,7 +81,7 @@ bool cmAddSubDirectoryCommand::InitialPass if(!cmSystemTools::IsSubDirectory(srcPath, this->Makefile->GetCurrentDirectory())) { - cmOStringStream e; + std::ostringstream e; e << "not given a binary directory but the given source directory " << "\"" << srcPath << "\" is not a subdirectory of \"" << this->Makefile->GetCurrentDirectory() << "\". " diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx index 2531a1a..65d295b 100644 --- a/Source/cmAddTestCommand.cxx +++ b/Source/cmAddTestCommand.cxx @@ -51,7 +51,7 @@ bool cmAddTestCommand // allow it to be duplicated. if(!test->GetOldStyle()) { - cmOStringStream e; + std::ostringstream e; e << " given test name \"" << args[0] << "\" which already exists in this directory."; this->SetError(e.str()); @@ -135,7 +135,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << " given unknown argument:\n " << args[i] << "\n"; this->SetError(e.str()); return false; @@ -159,7 +159,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector const& args) // Require a unique test name within the directory. if(this->Makefile->GetTest(name)) { - cmOStringStream e; + std::ostringstream e; e << " given test NAME \"" << name << "\" which already exists in this directory."; this->SetError(e.str()); diff --git a/Source/cmBreakCommand.cxx b/Source/cmBreakCommand.cxx index ff527db..34245b3 100644 --- a/Source/cmBreakCommand.cxx +++ b/Source/cmBreakCommand.cxx @@ -18,7 +18,7 @@ bool cmBreakCommand::InitialPass(std::vector const &args, if(!this->Makefile->IsLoopBlock()) { bool issueMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) { @@ -53,7 +53,7 @@ bool cmBreakCommand::InitialPass(std::vector const &args, if(!args.empty()) { bool issueMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) { diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 93f7801..5d32437 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -78,7 +78,7 @@ bool cmBuildCommand } else { - cmOStringStream e; + std::ostringstream e; e << "unknown argument \"" << args[i] << "\""; this->SetError(e.str()); return false; diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index 384e0a7..8591ed6 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/Source/cmCMakeMinimumRequired.cxx @@ -78,7 +78,7 @@ bool cmCMakeMinimumRequired &required_major, &required_minor, &required_patch, &required_tweak) < 2) { - cmOStringStream e; + std::ostringstream e; e << "could not parse VERSION \"" << version_string << "\"."; this->SetError(e.str()); return false; @@ -97,7 +97,7 @@ bool cmCMakeMinimumRequired current_tweak < required_tweak)) { // The current version is too low. - cmOStringStream e; + std::ostringstream e; e << "CMake " << version_string << " or higher is required. You are running version " << cmVersion::GetCMakeVersion(); @@ -132,7 +132,7 @@ bool cmCMakeMinimumRequired::EnforceUnknownArguments() { if(!this->UnknownArguments.empty()) { - cmOStringStream e; + std::ostringstream e; e << "called with unknown argument \"" << this->UnknownArguments[0] << "\"."; this->SetError(e.str()); diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx index ddd5d6a..9662fbf 100644 --- a/Source/cmCMakePolicyCommand.cxx +++ b/Source/cmCMakePolicyCommand.cxx @@ -56,7 +56,7 @@ bool cmCMakePolicyCommand return this->HandleVersionMode(args); } - cmOStringStream e; + std::ostringstream e; e << "given unknown first argument \"" << args[0] << "\""; this->SetError(e.str()); return false; @@ -82,7 +82,7 @@ bool cmCMakePolicyCommand::HandleSetMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "SET given unrecognized policy status \"" << args[2] << "\""; this->SetError(e.str()); return false; @@ -113,7 +113,7 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector const& args) cmPolicies::PolicyID pid; if(!this->Makefile->GetPolicies()->GetPolicyID(id.c_str(), pid)) { - cmOStringStream e; + std::ostringstream e; e << "GET given policy \"" << id << "\" which is not known to this " << "version of CMake."; this->SetError(e.str()); @@ -140,7 +140,7 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector const& args) case cmPolicies::REQUIRED_ALWAYS: // The policy is required to be set before anything needs it. { - cmOStringStream e; + std::ostringstream e; e << this->Makefile->GetPolicies()->GetRequiredPolicyError(pid) << "\n" << "The call to cmake_policy(GET " << id << " ...) at which this " diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index b304f28..d0dc30a 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -769,7 +769,7 @@ void CCONV cmSourceFileSetName(void *arg, const char* name, const char* dir, } } - cmOStringStream e; + std::ostringstream e; e << "Cannot find source file \"" << pathname << "\""; e << "\n\nTried extensions"; for( std::vector::const_iterator ext = sourceExts.begin(); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 2f1cf10..0c4d76c 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -240,7 +240,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method, //---------------------------------------------------------------------- std::string cmCTest::MakeURLSafe(const std::string& str) { - cmOStringStream ost; + std::ostringstream ost; char buffer[10]; for ( std::string::size_type pos = 0; pos < str.size(); pos ++ ) { @@ -1302,7 +1302,7 @@ int cmCTest::RunTest(std::vector argv, inst.TimeOut = timeout; // Capture output of the child ctest. - cmOStringStream oss; + std::ostringstream oss; inst.SetStreams(&oss, &oss); std::vector args; @@ -1316,7 +1316,7 @@ int cmCTest::RunTest(std::vector argv, if (strcmp(argv[i],"--build-generator") == 0 && timeout > 0) { args.push_back("--test-timeout"); - cmOStringStream msg; + std::ostringstream msg; msg << timeout; args.push_back(msg.str()); } diff --git a/Source/cmCTest.h b/Source/cmCTest.h index e19d32c..deb8896 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -27,7 +27,7 @@ class cmCTestStartCommand; #define cmCTestLog(ctSelf, logType, msg) \ do { \ - cmOStringStream cmCTestLog_msg; \ + std::ostringstream cmCTestLog_msg; \ cmCTestLog_msg << msg; \ (ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__,\ cmCTestLog_msg.str().c_str());\ diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 64b67c9..747b7e4 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -103,7 +103,7 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } return this->EmptyVariable; } - cmOStringStream e; + std::ostringstream e; e << "Syntax $" << key << "{} is not supported. " << "Only ${}, $ENV{}, and $CACHE{} are allowed."; this->SetError(e.str()); @@ -118,7 +118,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) } if(this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << this->FileLine; return this->AddString(ostr.str()); } @@ -136,7 +136,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) cmSystemTools::IsSubDirectory(this->FileName, this->Makefile->GetHomeOutputDirectory())) { - cmOStringStream msg; + std::ostringstream msg; cmListFileBacktrace bt(this->Makefile->GetLocalGenerator()); cmListFileContext lfc; lfc.FilePath = this->FileName; @@ -253,7 +253,7 @@ bool cmCommandArgumentParserHelper::HandleEscapeSymbol break; default: { - cmOStringStream e; + std::ostringstream e; e << "Invalid escape sequence \\" << symbol; this->SetError(e.str()); } @@ -335,7 +335,7 @@ int cmCommandArgumentParserHelper::LexInput(char* buf, int maxlen) void cmCommandArgumentParserHelper::Error(const char* str) { unsigned long pos = static_cast(this->InputBufferPos); - cmOStringStream ostr; + std::ostringstream ostr; ostr << str << " (" << pos << ")"; this->SetError(ostr.str()); } diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index a636d23..20c71fb 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -710,7 +710,7 @@ void cmComputeLinkDepends::CleanConstraintGraph() void cmComputeLinkDepends::DisplayConstraintGraph() { // Display the graph nodes and their edges. - cmOStringStream e; + std::ostringstream e; for(unsigned int i=0; i < this->EntryConstraintGraph.size(); ++i) { EdgeList const& nl = this->EntryConstraintGraph[i]; diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index f4fa5c6..8d24bd0 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1342,7 +1342,7 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item) // Try to separate the framework name and path. if(!this->SplitFramework.find(item.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "Could not parse framework path \"" << item << "\" " << "linked by target " << this->Target->GetName() << "."; cmSystemTools::Error(e.str().c_str()); @@ -1389,7 +1389,7 @@ void cmComputeLinkInformation::DropDirectoryItem(std::string const& item) { // A full path to a directory was found as a link item. Warn the // user. - cmOStringStream e; + std::ostringstream e; e << "WARNING: Target \"" << this->Target->GetName() << "\" requests linking to directory \"" << item << "\". " << "Targets may link only to libraries. " @@ -1505,7 +1505,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item, if(!this->CMakeInstance->GetPropertyAsBool(wid)) { this->CMakeInstance->SetProperty(wid, "1"); - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0008)) << "\n" << "Target \"" << this->Target->GetName() << "\" links to item\n" @@ -1524,7 +1524,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item, case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile->GetPolicies()-> GetRequiredPolicyError(cmPolicies::CMP0008)) << "\n" << "Target \"" << this->Target->GetName() << "\" links to item\n" @@ -1554,7 +1554,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories() if(!this->CMakeInstance->GetPropertyAsBool("CMP0003-WARNING-GIVEN")) { this->CMakeInstance->SetProperty("CMP0003-WARNING-GIVEN", "1"); - cmOStringStream w; + std::ostringstream w; this->PrintLinkPolicyDiagnosis(w); this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), this->Target->GetBacktrace()); @@ -1569,7 +1569,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories() case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile->GetPolicies()-> GetRequiredPolicyError(cmPolicies::CMP0003)) << "\n"; this->PrintLinkPolicyDiagnosis(e); diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 75d3967..cf2b88e 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -361,7 +361,7 @@ void cmComputeTargetDepends::AddTargetDepend( cmMakefile *makefile = depender->GetMakefile(); cmake::MessageType messageType = cmake::AUTHOR_WARNING; bool issueMessage = false; - cmOStringStream e; + std::ostringstream e; switch(depender->GetPolicyStatusCMP0046()) { case cmPolicies::WARN: @@ -539,7 +539,7 @@ cmComputeTargetDepends bool strong) { // Construct the error message. - cmOStringStream e; + std::ostringstream e; e << "The inter-target dependency graph contains the following " << "strongly connected component (cycle):\n"; std::vector const& components = ccg.GetComponents(); diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index aba26de..73b4ba2 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -119,7 +119,7 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted( if(!hasBeenReported) { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile.GetPolicies()->GetPolicyWarning( cmPolicies::CMP0054)) << "\n"; e << "Quoted variables like \"" << argument.GetValue() << @@ -169,7 +169,7 @@ bool cmConditionEvaluator::IsKeyword(std::string const& keyword, if(!hasBeenReported) { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile.GetPolicies()->GetPolicyWarning( cmPolicies::CMP0054)) << "\n"; e << "Quoted keywords like \"" << argument.GetValue() << @@ -559,7 +559,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList &newArgs, cmsys::RegularExpression regEntry; if ( !regEntry.compile(rex) ) { - cmOStringStream error; + std::ostringstream error; error << "Regular expression \"" << rex << "\" cannot compile"; errorString = error.str(); status = cmake::FATAL_ERROR; diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index cc6cf5f..fa7f486 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -34,7 +34,7 @@ bool cmConfigureFileCommand // If the input location is a directory, error out. if(cmSystemTools::FileIsDirectory(this->InputFile)) { - cmOStringStream e; + std::ostringstream e; e << "input location\n" << " " << this->InputFile << "\n" << "is a directory but a file was expected."; diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 0030b84..002e75a 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -150,7 +150,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) } else { - cmOStringStream m; + std::ostringstream m; m << "try_compile given unknown argument \"" << argv[i] << "\"."; this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str()); } @@ -220,7 +220,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) // do not allow recursive try Compiles if (this->BinaryDirectory == this->Makefile->GetHomeOutputDirectory()) { - cmOStringStream e; + std::ostringstream e; e << "Attempt at a recursive or nested TRY_COMPILE in directory\n" << " " << this->BinaryDirectory << "\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -256,7 +256,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) } else { - cmOStringStream err; + std::ostringstream err; err << "Unknown extension \"" << ext << "\" for file\n" << " " << *si << "\n" << "try_compile() works only for enabled languages. " @@ -282,7 +282,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) FILE *fout = cmsys::SystemTools::Fopen(outFileName,"w"); if (!fout) { - cmOStringStream e; + std::ostringstream e; e << "Failed to open\n" << " " << outFileName << "\n" << cmSystemTools::GetLastSystemError(); @@ -337,7 +337,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) if(this->Makefile->PolicyOptionalWarningEnabled( "CMAKE_POLICY_WARNING_CMP0056")) { - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetCMakeInstance()->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0056)) << "\n" "For compatibility with older versions of CMake, try_compile " @@ -553,7 +553,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) !cmSystemTools::CopyFileAlways(this->OutputFile, copyFile)) { - cmOStringStream emsg; + std::ostringstream emsg; emsg << "Cannot copy output executable\n" << " '" << this->OutputFile << "'\n" << "to destination specified by COPY_FILE:\n" @@ -691,7 +691,7 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName) } } - cmOStringStream emsg; + std::ostringstream emsg; emsg << "Unable to find the executable at any of:\n"; for (unsigned int i = 0; i < searchDirs.size(); ++i) { diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx index 6b729de..5ff0186 100644 --- a/Source/cmDefinePropertyCommand.cxx +++ b/Source/cmDefinePropertyCommand.cxx @@ -53,7 +53,7 @@ bool cmDefinePropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid scope " << args[0] << ". " << "Valid scopes are " << "GLOBAL, DIRECTORY, TARGET, SOURCE, " @@ -100,7 +100,7 @@ bool cmDefinePropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index 947db82..d419011 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -123,7 +123,7 @@ void cmDepends::Clear(const char *file) // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Clearing dependencies in \"" << file << "\"." << std::endl; cmSystemTools::Stdout(msg.str().c_str()); } @@ -213,7 +213,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dependee << "\" does not exist for depender \"" << depender << "\"." << std::endl; @@ -235,7 +235,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dependee << "\" is newer than depender \"" << depender << "\"." << std::endl; @@ -257,7 +257,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dependee << "\" is newer than depends file \"" << internalDependsFileName << "\"." << std::endl; diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index cab23b7..d062987 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -532,7 +532,7 @@ cmELFInternalImpl break; } #endif - cmOStringStream e; + std::ostringstream e; e << "Unknown ELF file type " << eti; this->SetErrorMessage(e.str().c_str()); return; diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 11f8ae5..0707906 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -189,7 +189,7 @@ bool cmExecuteProcessCommand } else { - cmOStringStream e; + std::ostringstream e; e << " given unknown argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 134ee98..a28ec48 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -45,7 +45,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) } else { - cmOStringStream e; + std::ostringstream e; e << "given target \"" << te->GetName() << "\" more than once."; this->Makefile->GetCMakeInstance() ->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace); @@ -70,7 +70,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) cmTarget* te = *tei; if (te->GetProperty("INTERFACE_SOURCES")) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << te->GetName() << "\" has a populated INTERFACE_SOURCES property. This is not " @@ -313,7 +313,7 @@ cmExportBuildFileGenerator return; } - cmOStringStream e; + std::ostringstream e; e << "export called with target \"" << depender->GetName() << "\" which requires target \"" << dependee->GetName() << "\" "; if (occurrences == 0) diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index db21c49..76283d4 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -89,7 +89,7 @@ bool cmExportCommand if(cmSystemTools::GetFilenameLastExtension(this->Filename.GetCString()) != ".cmake") { - cmOStringStream e; + std::ostringstream e; e << "FILE option given filename \"" << this->Filename.GetString() << "\" which does not have an extension of \".cmake\".\n"; this->SetError(e.str()); @@ -103,7 +103,7 @@ bool cmExportCommand { if(!this->Makefile->CanIWriteThisFile(fname.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "FILE option given filename \"" << fname << "\" which is in the source tree.\n"; this->SetError(e.str()); @@ -126,7 +126,7 @@ bool cmExportCommand { if (this->Append.IsEnabled()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT signature does not recognise the APPEND option."; this->SetError(e.str()); return false; @@ -134,7 +134,7 @@ bool cmExportCommand if (this->ExportOld.IsEnabled()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT signature does not recognise the " "EXPORT_LINK_INTERFACE_LIBRARIES option."; this->SetError(e.str()); @@ -145,7 +145,7 @@ bool cmExportCommand std::string setName = this->ExportSetName.GetString(); if (setMap.find(setName) == setMap.end()) { - cmOStringStream e; + std::ostringstream e; e << "Export set \"" << setName << "\" not found."; this->SetError(e.str()); return false; @@ -161,7 +161,7 @@ bool cmExportCommand { if (this->Makefile->IsAlias(*currentTarget)) { - cmOStringStream e; + std::ostringstream e; e << "given ALIAS target \"" << *currentTarget << "\" which may not be exported."; this->SetError(e.str()); @@ -172,7 +172,7 @@ bool cmExportCommand { if(target->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "given OBJECT library \"" << *currentTarget << "\" which may not be exported."; this->SetError(e.str()); @@ -181,7 +181,7 @@ bool cmExportCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given target \"" << *currentTarget << "\" which is not built by this project."; this->SetError(e.str()); @@ -261,7 +261,7 @@ bool cmExportCommand::HandlePackage(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "PACKAGE given unknown argument: " << args[i]; this->SetError(e.str()); return false; @@ -278,7 +278,7 @@ bool cmExportCommand::HandlePackage(std::vector const& args) cmsys::RegularExpression packageRegex(packageExpr); if(!packageRegex.find(package.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "PACKAGE given invalid package name \"" << package << "\". " << "Package names must match \"" << packageExpr << "\"."; this->SetError(e.str()); @@ -314,7 +314,7 @@ void cmExportCommand::ReportRegistryError(std::string const& msg, std::string const& key, long err) { - cmOStringStream e; + std::ostringstream e; e << msg << "\n" << " HKEY_CURRENT_USER\\" << key << "\n"; wchar_t winmsg[1024]; @@ -355,7 +355,7 @@ void cmExportCommand::StorePackageRegistryWin(std::string const& package, RegCloseKey(hKey); if(err != ERROR_SUCCESS) { - cmOStringStream msg; + std::ostringstream msg; msg << "Cannot set registry value \"" << hash << "\" under key"; this->ReportRegistryError(msg.str(), key, err); return; @@ -400,7 +400,7 @@ void cmExportCommand::StorePackageRegistryDir(std::string const& package, } else { - cmOStringStream e; + std::ostringstream e; e << "Cannot create package registry file:\n" << " " << fname << "\n" << cmSystemTools::GetLastSystemError() << "\n"; diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 1f39d7a..0254cb4 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -81,7 +81,7 @@ bool cmExportFileGenerator::GenerateImportFile() if(!foutPtr.get() || !*foutPtr) { std::string se = cmSystemTools::GetLastSystemError(); - cmOStringStream e; + std::ostringstream e; e << "cannot write to file \"" << this->MainImportFile << "\": " << se; cmSystemTools::Error(e.str().c_str()); @@ -247,7 +247,7 @@ static bool checkInterfaceDirs(const std::string &prepro, continue; } cmake::MessageType messageType = cmake::FATAL_ERROR; - cmOStringStream e; + std::ostringstream e; if (genexPos != std::string::npos) { switch (target->GetPolicyStatusCMP0041()) @@ -295,7 +295,7 @@ static bool checkInterfaceDirs(const std::string &prepro, { case cmPolicies::WARN: { - cmOStringStream s; + std::ostringstream s; s << target->GetMakefile()->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0052) << "\n"; s << "Directory:\n \"" << *li << "\"\nin " @@ -391,7 +391,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( if (cge->GetHadContextSensitiveCondition()) { cmMakefile* mf = target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target->GetName() << "\" is installed with " "INCLUDES DESTINATION set to a context sensitive path. Paths which " "depend on the configuration, policy values or the link interface are " @@ -473,7 +473,7 @@ void getCompatibleInterfaceProperties(cmTarget *target, if (!info) { cmMakefile* mf = target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "Exporting the target \"" << target->GetName() << "\" is not " "allowed since its linker language cannot be determined"; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -773,7 +773,7 @@ cmExportFileGenerator if(newCMP0022Behavior && !this->ExportOld) { cmMakefile *mf = target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, " "but also has old-style LINK_INTERFACE_LIBRARIES properties " "populated, but it was exported without the " @@ -857,7 +857,7 @@ cmExportFileGenerator { std::string prop = "IMPORTED_LINK_INTERFACE_MULTIPLICITY"; prop += suffix; - cmOStringStream m; + std::ostringstream m; m << iface->Multiplicity; properties[prop] = m.str(); } diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 3f5866a..98ed818 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -56,7 +56,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) } else { - cmOStringStream e; + std::ostringstream e; e << "install(EXPORT \"" << this->IEGen->GetExportSet()->GetName() << "\" ...) " << "includes target \"" << te->Target->GetName() @@ -133,7 +133,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) if (te->GetProperty("INTERFACE_SOURCES")) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << te->GetName() << "\" has a populated INTERFACE_SOURCES property. This is not " @@ -290,7 +290,7 @@ cmExportInstallFileGenerator::GenerateImportFileConfig( if(!exportFileStream) { std::string se = cmSystemTools::GetLastSystemError(); - cmOStringStream e; + std::ostringstream e; e << "cannot write to file \"" << fileName << "\": " << se; cmSystemTools::Error(e.str().c_str()); @@ -516,7 +516,7 @@ cmExportInstallFileGenerator cmTarget* dependee, int occurrences) { - cmOStringStream e; + std::ostringstream e; e << "install(EXPORT \"" << this->IEGen->GetExportSet()->GetName() << "\" ...) " diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx index cc35f84..6016c4c 100644 --- a/Source/cmExprParserHelper.cxx +++ b/Source/cmExprParserHelper.cxx @@ -99,7 +99,7 @@ int cmExprParserHelper::LexInput(char* buf, int maxlen) void cmExprParserHelper::Error(const char* str) { unsigned long pos = static_cast(this->InputBufferPos); - cmOStringStream ostr; + std::ostringstream ostr; ostr << str << " (" << pos << ")"; this->ErrorString = ostr.str(); } diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index cc42bca..eb50a7d 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -454,7 +454,7 @@ cmExtraCodeLiteGenerator::GetBuildCommand(const cmMakefile* mf) const else if ( generator == "MinGW Makefiles" || generator == "Unix Makefiles" ) { - cmOStringStream ss; + std::ostringstream ss; ss << make << " -j " << this->CpuCount; buildCommand = ss.str(); } @@ -482,7 +482,7 @@ cmExtraCodeLiteGenerator::GetSingleFileBuildCommand std::string generator = mf->GetSafeDefinition("CMAKE_GENERATOR"); if ( generator == "Unix Makefiles" || generator == "MinGW Makefiles" ) { - cmOStringStream ss; + std::ostringstream ss; ss << make << " -f$(ProjectPath)/Makefile $(CurrentFileName).cpp.o"; buildCommand = ss.str(); } diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 3c2dfa5..0306f18 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -404,7 +404,7 @@ bool cmFileCommand::HandleHashCommand(std::vector const& args) #if defined(CMAKE_BUILD_WITH_CMAKE) if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " requires a file name and output variable"; this->SetError(e.str()); return false; @@ -419,14 +419,14 @@ bool cmFileCommand::HandleHashCommand(std::vector const& args) this->Makefile->AddDefinition(args[2], out.c_str()); return true; } - cmOStringStream e; + std::ostringstream e; e << args[0] << " failed to read file \"" << args[1] << "\": " << cmSystemTools::GetLastSystemError(); this->SetError(e.str()); } return false; #else - cmOStringStream e; + std::ostringstream e; e << args[0] << " not available during bootstrap"; this->SetError(e.str().c_str()); return false; @@ -519,7 +519,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) if(sscanf(args[i].c_str(), "%d", &limit_input) != 1 || limit_input < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LIMIT_INPUT value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -532,7 +532,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) if(sscanf(args[i].c_str(), "%d", &limit_output) != 1 || limit_output < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LIMIT_OUTPUT value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -545,7 +545,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) int count; if(sscanf(args[i].c_str(), "%d", &count) != 1 || count < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LIMIT_COUNT value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -559,7 +559,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) int len; if(sscanf(args[i].c_str(), "%d", &len) != 1 || len < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LENGTH_MINIMUM value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -573,7 +573,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) int len; if(sscanf(args[i].c_str(), "%d", &len) != 1 || len < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LENGTH_MAXIMUM value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -586,7 +586,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) { if(!regex.compile(args[i].c_str())) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option REGEX value \"" << args[i] << "\" could not be compiled."; this->SetError(e.str()); @@ -603,7 +603,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option ENCODING \"" << args[i] << "\" not recognized."; this->SetError(e.str()); @@ -613,7 +613,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "STRINGS given unknown argument \"" << args[i] << "\""; this->SetError(e.str()); @@ -641,7 +641,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) #endif if(!fin) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS file \"" << fileName << "\" cannot be read."; this->SetError(e.str()); return false; @@ -1037,7 +1037,7 @@ cmFileCommand::HandleDifferentCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "DIFFERENT given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -1152,7 +1152,7 @@ protected: { if(permissions && !cmSystemTools::SetPermissions(toFile, permissions)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot set permissions on \"" << toFile << "\""; this->FileCommand->SetError(e.str()); return false; @@ -1176,7 +1176,7 @@ protected: else if(arg == "SETGID") { permissions |= mode_setgid; } else { - cmOStringStream e; + std::ostringstream e; e << this->Name << " given invalid permission \"" << arg << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -1203,7 +1203,7 @@ protected: virtual bool ReportMissing(const char* fromFile) { // The input file does not exist and installation is not optional. - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot find \"" << fromFile << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -1236,14 +1236,14 @@ protected: void NotBeforeMatch(std::string const& arg) { - cmOStringStream e; + std::ostringstream e; e << "option " << arg << " may not appear before PATTERN or REGEX."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; } void NotAfterMatch(std::string const& arg) { - cmOStringStream e; + std::ostringstream e; e << "option " << arg << " may not appear after PATTERN or REGEX."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; @@ -1281,7 +1281,7 @@ bool cmFileCopier::Parse(std::vector const& args) if(!this->CheckKeyword(args[i]) && !this->CheckValue(args[i])) { - cmOStringStream e; + std::ostringstream e; e << "called with unknown argument \"" << args[i] << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -1297,7 +1297,7 @@ bool cmFileCopier::Parse(std::vector const& args) // Require a destination. if(this->Destination.empty()) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " given no DESTINATION"; this->FileCommand->SetError(e.str()); return false; @@ -1477,7 +1477,7 @@ bool cmFileCopier::CheckValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "could not compile PATTERN \"" << arg << "\"."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; @@ -1493,7 +1493,7 @@ bool cmFileCopier::CheckValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "could not compile REGEX \"" << arg << "\"."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; @@ -1573,7 +1573,7 @@ bool cmFileCopier::Install(const char* fromFile, const char* toFile) { if(!*fromFile) { - cmOStringStream e; + std::ostringstream e; e << "INSTALL encountered an empty string input file name."; this->FileCommand->SetError(e.str()); return false; @@ -1614,7 +1614,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile) std::string symlinkTarget; if(!cmSystemTools::ReadSymlink(fromFile, symlinkTarget)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot read symlink \"" << fromFile << "\" to duplicate at \"" << toFile << "\"."; this->FileCommand->SetError(e.str()); @@ -1647,7 +1647,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile) // Create the symlink. if(!cmSystemTools::CreateSymlink(symlinkTarget, toFile)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot duplicate symlink \"" << fromFile << "\" at \"" << toFile << "\"."; this->FileCommand->SetError(e.str()); @@ -1679,7 +1679,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile, // Copy the file. if(copy && !cmSystemTools::CopyAFile(fromFile, toFile, true)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot copy file \"" << fromFile << "\" to \"" << toFile << "\"."; this->FileCommand->SetError(e.str()); @@ -1698,7 +1698,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile, } if (!cmSystemTools::CopyFileTime(fromFile, toFile)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot set modification time on \"" << toFile << "\""; this->FileCommand->SetError(e.str()); @@ -1730,7 +1730,7 @@ bool cmFileCopier::InstallDirectory(const char* source, // Make sure the destination directory exists. if(!cmSystemTools::MakeDirectory(destination)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot make directory \"" << destination << "\": " << cmSystemTools::GetLastSystemError(); this->FileCommand->SetError(e.str()); @@ -2075,7 +2075,7 @@ bool cmFileInstaller::CheckKeyword(std::string const& arg) else if(arg == "COMPONENTS" || arg == "CONFIGURATIONS" || arg == "PROPERTIES") { - cmOStringStream e; + std::ostringstream e; e << "INSTALL called with old-style " << arg << " argument. " << "This script was generated with an older version of CMake. " << "Re-run this cmake version on your build tree."; @@ -2143,7 +2143,7 @@ bool cmFileInstaller } else { - cmOStringStream e; + std::ostringstream e; e << "Option TYPE given unknown value \"" << stype << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -2288,7 +2288,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHANGE given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -2311,7 +2311,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector const& args) } if(!cmSystemTools::FileExists(file, true)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHANGE given FILE \"" << file << "\" that does not exist."; this->SetError(e.str()); return false; @@ -2323,7 +2323,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector const& args) bool changed; if(!cmSystemTools::ChangeRPath(file, oldRPath, newRPath, &emsg, &changed)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHANGE could not write new RPATH:\n" << " " << newRPath << "\n" << "to the file:\n" @@ -2373,7 +2373,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "RPATH_REMOVE given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -2386,7 +2386,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector const& args) } if(!cmSystemTools::FileExists(file, true)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_REMOVE given FILE \"" << file << "\" that does not exist."; this->SetError(e.str()); return false; @@ -2398,7 +2398,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector const& args) bool removed; if(!cmSystemTools::RemoveRPath(file, &emsg, &removed)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_REMOVE could not remove RPATH from file:\n" << " " << file << "\n" << emsg; @@ -2454,7 +2454,7 @@ cmFileCommand::HandleRPathCheckCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHECK given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -2555,7 +2555,7 @@ bool cmFileCommand::HandleRename(std::vector const& args) if(!cmSystemTools::RenameFile(oldname.c_str(), newname.c_str())) { std::string err = cmSystemTools::GetLastSystemError(); - cmOStringStream e; + std::ostringstream e; e << "RENAME failed to rename\n" << " " << oldname << "\n" << "to\n" @@ -2722,7 +2722,7 @@ namespace { if (updated) { - cmOStringStream oss; + std::ostringstream oss; oss << "[" << this->Text << " " << this->CurrentPercentage << "% complete]"; status = oss.str(); @@ -2994,7 +2994,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) msg += "\""; if(statusVar.size()) { - cmOStringStream result; + std::ostringstream result; result << (int)0 << ";\"" << msg; this->Makefile->AddDefinition(statusVar, result.str().c_str()); @@ -3133,7 +3133,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) if(statusVar.size()) { - cmOStringStream result; + std::ostringstream result; result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\""; this->Makefile->AddDefinition(statusVar, result.str().c_str()); @@ -3159,7 +3159,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) if (expectedHash != actualHash) { - cmOStringStream oss; + std::ostringstream oss; oss << "DOWNLOAD HASH mismatch" << std::endl << " for file: [" << file << "]" << std::endl << " expected hash: [" << expectedHash << "]" << std::endl @@ -3392,7 +3392,7 @@ cmFileCommand::HandleUploadCommand(std::vector const& args) if(statusVar.size()) { - cmOStringStream result; + std::ostringstream result; result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\""; this->Makefile->AddDefinition(statusVar, result.str().c_str()); @@ -3568,7 +3568,7 @@ bool cmFileCommand::HandleLockCommand( } else { - cmOStringStream e; + std::ostringstream e; e << merr << ", but got:\n \"" << args[i] << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -3601,7 +3601,7 @@ bool cmFileCommand::HandleLockCommand( if(!cmSystemTools::StringToLong(args[i].c_str(), &scanned) || scanned < 0) { - cmOStringStream e; + std::ostringstream e; e << "TIMEOUT value \"" << args[i] << "\" is not an unsigned integer."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -3610,7 +3610,7 @@ bool cmFileCommand::HandleLockCommand( } else { - cmOStringStream e; + std::ostringstream e; e << "expected DIRECTORY, RELEASE, GUARD, RESULT_VARIABLE or TIMEOUT\n"; e << "but got: \"" << args[i] << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -3635,7 +3635,7 @@ bool cmFileCommand::HandleLockCommand( std::string parentDir = cmSystemTools::GetParentDirectory(path); if (!cmSystemTools::MakeDirectory(parentDir)) { - cmOStringStream e; + std::ostringstream e; e << "directory\n \"" << parentDir << "\"\ncreation failed "; e << "(check permissions)."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -3645,7 +3645,7 @@ bool cmFileCommand::HandleLockCommand( FILE *file = cmsys::SystemTools::Fopen(path, "w"); if (!file) { - cmOStringStream e; + std::ostringstream e; e << "file\n \"" << path << "\"\ncreation failed (check permissions)."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); cmSystemTools::SetFatalErrorOccured(); @@ -3685,7 +3685,7 @@ bool cmFileCommand::HandleLockCommand( if (resultVariable.empty() && !fileLockResult.IsOk()) { - cmOStringStream e; + std::ostringstream e; e << "error locking file\n \"" << path << "\"\n" << result << "."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); cmSystemTools::SetFatalErrorOccured(); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 8410cda..9386e42 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -301,7 +301,7 @@ bool cmFindPackageCommand if(args[i].find_first_of(":/\\") != args[i].npos || cmSystemTools::GetFilenameLastExtension(args[i]) != ".cmake") { - cmOStringStream e; + std::ostringstream e; e << "given CONFIGS option followed by invalid file name \"" << args[i] << "\". The names given must be file names without " << "a path and with a \".cmake\" extension."; @@ -317,7 +317,7 @@ bool cmFindPackageCommand } else { - cmOStringStream e; + std::ostringstream e; e << "called with invalid argument \"" << args[i] << "\""; this->SetError(e.str()); return false; @@ -330,7 +330,7 @@ bool cmFindPackageCommand std::back_inserter(doubledComponents)); if(!doubledComponents.empty()) { - cmOStringStream e; + std::ostringstream e; e << "called with components that are both required and optional:\n"; for(unsigned int i=0; iUseConfigFiles = moduleArgs.empty(); if(!this->UseFindModules && !this->UseConfigFiles) { - cmOStringStream e; + std::ostringstream e; e << "given options exclusive to Module mode:\n"; for(std::set::const_iterator si = moduleArgs.begin(); si != moduleArgs.end(); ++si) @@ -427,7 +427,7 @@ bool cmFindPackageCommand { if (this->Required) { - cmOStringStream e; + std::ostringstream e; e << "for module " << this->Name << " called with REQUIRED, but " << disableFindPackageVar << " is enabled. A REQUIRED package cannot be disabled."; @@ -460,7 +460,7 @@ bool cmFindPackageCommand if(this->UseFindModules && this->UseConfigFiles && this->Makefile->IsOn("CMAKE_FIND_PACKAGE_WARN_NO_MODULE")) { - cmOStringStream aw; + std::ostringstream aw; if(this->RequiredCMakeVersion >= CMake_VERSION_ENCODE(2,8,8)) { aw << "find_package called without either MODULE or CONFIG option and " @@ -751,8 +751,8 @@ bool cmFindPackageCommand::HandlePackageMode() if (result && !found && (!this->Quiet || this->Required)) { // The variable is not set. - cmOStringStream e; - cmOStringStream aw; + std::ostringstream e; + std::ostringstream aw; if (configFileSetFOUNDFalse) { e << "Found package configuration file:\n" @@ -1470,7 +1470,7 @@ void cmFindPackageCommand::FillPrefixesBuilds() // It is likely that CMake will have recently built the project. for(int i=0; i <= 10; ++i) { - cmOStringStream r; + std::ostringstream r; r << "[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\" "Settings\\StartPath;WhereBuild" << i << "]"; diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 03d6590..8e3510d 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -170,7 +170,7 @@ bool cmForEachCommand step == 0 ) { - cmOStringStream str; + std::ostringstream str; str << "called with incorrect range specification: start "; str << start << ", stop " << stop << ", step " << step; this->SetError(str.str()); @@ -243,7 +243,7 @@ bool cmForEachCommand::HandleInMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "Unknown argument:\n" << " " << args[i] << "\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return true; diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 3580374..556ef19 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -103,7 +103,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies); // set the value of argc - cmOStringStream strStream; + std::ostringstream strStream; strStream << expandedArgs.size(); this->Makefile->AddDefinition("ARGC",strStream.str().c_str()); this->Makefile->MarkVariableAsUsed("ARGC"); @@ -111,7 +111,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass // set the values for ARGV0 ARGV1 ... for (unsigned int t = 0; t < expandedArgs.size(); ++t) { - cmOStringStream tmpStream; + std::ostringstream tmpStream; tmpStream << "ARGV" << t; this->Makefile->AddDefinition(tmpStream.str(), expandedArgs[t].c_str()); diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index 75a84cb..bfbe918 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -106,7 +106,7 @@ void cmGeneratorExpressionDAGChecker::ReportError( if (parent && !parent->Parent) { - cmOStringStream e; + std::ostringstream e; e << "Error evaluating generator expression:\n" << " " << expr << "\n" << "Self reference on target \"" @@ -118,7 +118,7 @@ void cmGeneratorExpressionDAGChecker::ReportError( } { - cmOStringStream e; + std::ostringstream e; e << "Error evaluating generator expression:\n" << " " << expr << "\n" << "Dependency loop found."; @@ -130,7 +130,7 @@ void cmGeneratorExpressionDAGChecker::ReportError( int loopStep = 1; while (parent) { - cmOStringStream e; + std::ostringstream e; e << "Loop step " << loopStep << "\n" << " " << (parent->Content ? parent->Content->GetOriginalExpression() : expr) diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index 03d0bc6..4e2a868 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -51,7 +51,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config, } if (condResult != "1") { - cmOStringStream e; + std::ostringstream e; e << "Evaluation file condition \"" << rawCondition << "\" did " "not evaluate to valid content. Got \"" << condResult << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -73,7 +73,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config, { return; } - cmOStringStream e; + std::ostringstream e; e << "Evaluation file to be written multiple times for different " "configurations with different content:\n " << outputFileName; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -123,7 +123,7 @@ void cmGeneratorExpressionEvaluationFile::Generate() cmsys::ifstream fin(this->Input.c_str()); if(!fin) { - cmOStringStream e; + std::ostringstream e; e << "Evaluation file \"" << this->Input << "\" cannot be read."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 7ddf4d0..2975c43 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -36,7 +36,7 @@ void reportError(cmGeneratorExpressionContext *context, return; } - cmOStringStream e; + std::ostringstream e; e << "Error evaluating generator expression:\n" << " " << expr << "\n" << result; @@ -456,7 +456,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << context->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0044); context->Makefile->GetCMakeInstance() @@ -953,7 +953,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode if (!target) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << targetName << "\" not found."; @@ -1253,7 +1253,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode { if (!context->EvaluateForBuildsystem) { - cmOStringStream e; + std::ostringstream e; e << "The evaluation of the TARGET_OBJECTS generator expression " "is only suitable for consumption by CMake. It is not suitable " "for writing out elsewhere."; @@ -1266,7 +1266,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode context->Makefile->FindGeneratorTargetToUse(tgtName); if (!gt) { - cmOStringStream e; + std::ostringstream e; e << "Objects of target \"" << tgtName << "\" referenced but no such target exists."; reportError(context, content->GetOriginalExpression(), e.str()); @@ -1274,7 +1274,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode } if (gt->GetType() != cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Objects of target \"" << tgtName << "\" referenced but is not an OBJECT library."; reportError(context, content->GetOriginalExpression(), e.str()); @@ -2028,7 +2028,7 @@ std::string GeneratorExpressionContent::EvaluateParameters( } else { - cmOStringStream e; + std::ostringstream e; e << "$<" + identifier + "> expression requires " << numExpected << " comma separated parameters, but got " diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 2b531e2..cca06bb 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -31,7 +31,7 @@ void reportBadObjLib(std::vector const& badObjLib, { if(!badObjLib.empty()) { - cmOStringStream e; + std::ostringstream e; e << "OBJECT library \"" << target->GetName() << "\" contains:\n"; for(std::vector::const_iterator i = badObjLib.begin(); i != badObjLib.end(); ++i) @@ -630,7 +630,7 @@ cmTargetTraceDependencies this->GlobalGenerator->GetFilenameTargetDepends(sf); if (tgts.find(this->Target) != tgts.end()) { - cmOStringStream e; + std::ostringstream e; e << "Evaluation output file\n \"" << sf->GetFullPath() << "\"\ndepends on the sources of a target it is used in. This " "is a dependency loop and is not allowed."; diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 3c59c25..f0b2686 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -73,7 +73,7 @@ bool cmGetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid scope " << args[1] << ". " << "Valid scopes are " << "GLOBAL, DIRECTORY, TARGET, SOURCE, TEST, VARIABLE, CACHE, INSTALL."; @@ -122,7 +122,7 @@ bool cmGetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; @@ -312,7 +312,7 @@ bool cmGetPropertyCommand::HandleTargetMode() } else { - cmOStringStream e; + std::ostringstream e; e << "could not find TARGET " << this->Name << ". Perhaps it has not yet been created."; this->SetError(e.str()); @@ -338,7 +338,7 @@ bool cmGetPropertyCommand::HandleSourceMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given SOURCE name that could not be found or created: " << this->Name; this->SetError(e.str()); @@ -362,7 +362,7 @@ bool cmGetPropertyCommand::HandleTestMode() } // If not found it is an error. - cmOStringStream e; + std::ostringstream e; e << "given TEST name that does not exist: " << this->Name; this->SetError(e.str()); return false; @@ -423,7 +423,7 @@ bool cmGetPropertyCommand::HandleInstallMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given INSTALL name that could not be found or created: " << this->Name; this->SetError(e.str()); diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index aa6f0c1..d8f7679 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -47,7 +47,7 @@ bool cmGetTargetPropertyCommand else { bool issueMessage = false; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0045)) { diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index dd7fbc8..aee96dd 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -88,7 +88,7 @@ bool cmGlobalGenerator::SetGeneratorPlatform(std::string const& p, } else { - cmOStringStream e; + std::ostringstream e; e << "Generator\n" " " << this->GetName() << "\n" @@ -109,7 +109,7 @@ bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts, } else { - cmOStringStream e; + std::ostringstream e; e << "Generator\n" " " << this->GetName() << "\n" @@ -284,7 +284,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM") || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) { - cmOStringStream err; + std::ostringstream err; err << "CMake was unable to find a build program corresponding to \"" << this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You " << "probably need to select a different build tool."; @@ -405,7 +405,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, const char* lang = li->c_str(); if(this->LanguagesReady.find(lang) == this->LanguagesReady.end()) { - cmOStringStream e; + std::ostringstream e; e << "The test project needs language " << lang << " which is not enabled."; this->TryCompileOuterMakefile @@ -467,7 +467,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (pop) #endif - cmOStringStream windowsVersionString; + std::ostringstream windowsVersionString; windowsVersionString << osvi.dwMajorVersion << "." << osvi.dwMinorVersion; windowsVersionString.str(); mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", @@ -660,7 +660,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, std::string compilerEnv = "CMAKE_"; compilerEnv += lang; compilerEnv += "_COMPILER_ENV_VAR"; - cmOStringStream noCompiler; + std::ostringstream noCompiler; const char* compilerFile = mf->GetDefinition(compilerName); if(!compilerFile || !*compilerFile || cmSystemTools::IsNOTFOUND(compilerFile)) @@ -852,7 +852,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf, if(!this->CMakeInstance->GetIsInTryCompile() && mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0025")) { - cmOStringStream w; + std::ostringstream w; w << policies->GetPolicyWarning(cmPolicies::CMP0025) << "\n" "Converting " << lang << " compiler id \"AppleClang\" to \"Clang\" for compatibility." @@ -884,7 +884,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf, if(!this->CMakeInstance->GetIsInTryCompile() && mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0047")) { - cmOStringStream w; + std::ostringstream w; w << policies->GetPolicyWarning(cmPolicies::CMP0047) << "\n" "Converting " << lang << " compiler id \"QCC\" to \"GNU\" for compatibility." @@ -1147,7 +1147,7 @@ void cmGlobalGenerator::Configure() if ( this->CMakeInstance->GetWorkingMode() == cmake::NORMAL_MODE) { - cmOStringStream msg; + std::ostringstream msg; if(cmSystemTools::GetErrorOccuredFlag()) { msg << "Configuring incomplete, errors occurred!"; @@ -1196,7 +1196,7 @@ bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const } // This generator does not support duplicate custom targets. - cmOStringStream e; + std::ostringstream e; e << "This project has enabled the ALLOW_DUPLICATE_CUSTOM_TARGETS " << "global property. " << "The \"" << this->GetName() << "\" generator does not support " @@ -1346,7 +1346,7 @@ void cmGlobalGenerator::Generate() if(!this->CMP0042WarnTargets.empty()) { - cmOStringStream w; + std::ostringstream w; w << (this->GetCMakeInstance()->GetPolicies()-> GetPolicyWarning(cmPolicies::CMP0042)) << "\n"; @@ -2331,7 +2331,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end()); depends.erase(depends.begin(), depends.end()); - cmOStringStream ostr; + std::ostringstream ostr; if ( componentsSet->size() > 0 ) { ostr << "Available install components are:"; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 6f0586b..b93fbb3 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -71,7 +71,7 @@ std::string cmGlobalNinjaGenerator::EncodeIdent(const std::string &ident, if (std::find_if(ident.begin(), ident.end(), std::not1(std::ptr_fun(IsIdentChar))) != ident.end()) { static unsigned VarNum = 0; - cmOStringStream names; + std::ostringstream names; names << "ident" << VarNum++; vars << names.str() << " = " << ident << "\n"; return "$" + names.str(); @@ -191,7 +191,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, build += " " + rule; // Write the variables bound to this build statement. - cmOStringStream variable_assignments; + std::ostringstream variable_assignments; for(cmNinjaVars::const_iterator i = variables.begin(); i != variables.end(); ++i) cmGlobalNinjaGenerator::WriteVariable(variable_assignments, @@ -295,7 +295,7 @@ cmGlobalNinjaGenerator::AddMacOSXContentRule() cmLocalGenerator *lg = this->LocalGenerators[0]; cmMakefile* mfRoot = lg->GetMakefile(); - cmOStringStream cmd; + std::ostringstream cmd; cmd << lg->ConvertToOutputFormat( mfRoot->GetRequiredDefinition("CMAKE_COMMAND"), cmLocalGenerator::SHELL) @@ -1103,7 +1103,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) cmLocalGenerator *lg = this->LocalGenerators[0]; cmMakefile* mfRoot = lg->GetMakefile(); - cmOStringStream cmd; + std::ostringstream cmd; cmd << lg->ConvertToOutputFormat( mfRoot->GetRequiredDefinition("CMAKE_COMMAND"), cmLocalGenerator::SHELL) diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 3478534..1f08629 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -783,7 +783,7 @@ cmGlobalUnixMakefileGenerator3 lg->GetMakefile()->GetHomeOutputDirectory(); progressDir += cmake::GetCMakeFilesDirectory(); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; // all target counts progCmd << lg->Convert(progressDir, @@ -824,7 +824,7 @@ cmGlobalUnixMakefileGenerator3 { // TODO: Convert the total progress count to a make variable. - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # in target progCmd << lg->Convert(progressDir, @@ -841,7 +841,7 @@ cmGlobalUnixMakefileGenerator3 commands.push_back(lg->GetRecursiveMakeCall (tmp.c_str(),localName)); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 progCmd << lg->Convert(progressDir, cmLocalGenerator::FULL, diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 499ac56..531a714 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -156,7 +156,7 @@ cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts, if (this->SystemIsWindowsCE && ts.empty() && this->DefaultPlatformToolset.empty()) { - cmOStringStream e; + std::ostringstream e; e << this->GetName() << " Windows CE version '" << this->SystemVersion << "' requires CMAKE_GENERATOR_TOOLSET to be set."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -202,7 +202,7 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf) { if(this->DefaultPlatformName != "Win32") { - cmOStringStream e; + std::ostringstream e; e << "CMAKE_SYSTEM_NAME is 'Android' but CMAKE_GENERATOR " << "specifies a platform too: '" << this->GetName() << "'"; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -231,7 +231,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf) { if (this->DefaultPlatformName != "Win32") { - cmOStringStream e; + std::ostringstream e; e << "CMAKE_SYSTEM_NAME is 'WindowsCE' but CMAKE_GENERATOR " << "specifies a platform too: '" << this->GetName() << "'"; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -246,7 +246,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf) //---------------------------------------------------------------------------- bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf) { - cmOStringStream e; + std::ostringstream e; e << this->GetName() << " does not support Windows Phone."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -255,7 +255,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf) //---------------------------------------------------------------------------- bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf) { - cmOStringStream e; + std::ostringstream e; e << this->GetName() << " does not support Windows Store."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -320,7 +320,7 @@ void cmGlobalVisualStudio10Generator::Generate() if(this->LongestSource.Length > 0) { cmMakefile* mf = this->LongestSource.Target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "The binary and/or source directory paths may be too long to generate " "Visual Studio 10 files for this project. " @@ -574,7 +574,7 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf) "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\" "Windows\\v7.1;InstallationFolder", winSDK_7_1)) { - cmOStringStream m; + std::ostringstream m; m << "Found Windows SDK v7.1: " << winSDK_7_1; mf->DisplayStatus(m.str().c_str(), -1); this->DefaultPlatformToolset = "Windows7.1SDK"; @@ -582,7 +582,7 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf) } else { - cmOStringStream e; + std::ostringstream e; e << "Cannot enable 64-bit tools with Visual Studio 2010 Express.\n" << "Install the Microsoft Windows SDK v7.1 to get 64-bit tools:\n" << " http://msdn.microsoft.com/en-us/windows/bb980924.aspx"; diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 2b69222..3013200 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -133,7 +133,7 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf) { if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Phone '8.0', but not '" @@ -156,7 +156,7 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf) { if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Store '8.0', but not '" diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index 047f2ad..2bc9379 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -113,7 +113,7 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf) { if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Phone '8.0' and '8.1', but " @@ -136,7 +136,7 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf) { if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Store '8.0' and '8.1', but " diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 6a480a9..8831a8b 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1170,7 +1170,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, this->CreateString("2147483647")); copyFilesBuildPhase->AddAttribute("dstSubfolderSpec", this->CreateString("6")); - cmOStringStream ostr; + std::ostringstream ostr; if (cmtarget.IsFrameworkOnApple()) { // dstPath in frameworks is relative to Versions/ @@ -1581,7 +1581,7 @@ void cmGlobalXCodeGenerator } else { - cmOStringStream str; + std::ostringstream str; str << "_buildpart_" << count++ ; tname[&ccg.GetCC()] = std::string(target.GetName()) + str.str(); makefileStream << "\\\n\t" << tname[&ccg.GetCC()]; @@ -2299,7 +2299,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, // VERSION -> current_version target.GetTargetVersion(false, major, minor, patch); - cmOStringStream v; + std::ostringstream v; // Xcode always wants at least 1.0.0 or nothing if(!(major == 0 && minor == 0 && patch == 0)) @@ -2311,7 +2311,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, // SOVERSION -> compatibility_version target.GetTargetVersion(true, major, minor, patch); - cmOStringStream vso; + std::ostringstream vso; // Xcode always wants at least 1.0.0 or nothing if(!(major == 0 && minor == 0 && patch == 0)) diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 601993f..11a5466 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -497,7 +497,7 @@ int cmGraphVizWriter::CollectAllTargets() continue; } //std::cout << "Found target: " << tit->first.c_str() << std::endl; - cmOStringStream ostr; + std::ostringstream ostr; ostr << this->GraphNodePrefix << cnt++; this->TargetNamesNodes[realTargetName] = ostr.str(); this->TargetPtrs[realTargetName] = &tit->second; @@ -544,7 +544,7 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt) this->TargetPtrs.find(libName); if ( tarIt == this->TargetPtrs.end() ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << this->GraphNodePrefix << cnt++; this->TargetNamesNodes[libName] = ostr.str(); this->TargetPtrs[libName] = NULL; diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 0a1d280..9d44db1 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -98,7 +98,7 @@ bool cmIncludeCommand if (gg->IsExportedTargetsFile(fname_abs)) { const char *modal = 0; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0024)) diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index c3c9c55..c30cf85 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -273,7 +273,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) if(!unknownArgs.empty()) { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << "TARGETS given unknown argument \"" << unknownArgs[0] << "\"."; this->SetError(e.str()); return false; @@ -373,7 +373,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) if (this->Makefile->IsAlias(*targetIt)) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given target \"" << (*targetIt) << "\" which is an alias."; this->SetError(e.str()); @@ -390,7 +390,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) target->GetType() != cmTarget::OBJECT_LIBRARY && target->GetType() != cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given target \"" << (*targetIt) << "\" which is not an executable, library, or module."; this->SetError(e.str()); @@ -398,7 +398,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else if(target->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given OBJECT library \"" << (*targetIt) << "\" which may not be installed."; this->SetError(e.str()); @@ -410,7 +410,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) else { // Did not find the target. - cmOStringStream e; + std::ostringstream e; e << "TARGETS given target \"" << (*targetIt) << "\" which does not exist in this directory."; this->SetError(e.str()); @@ -502,7 +502,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no FRAMEWORK DESTINATION for shared library " "FRAMEWORK target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -522,7 +522,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no LIBRARY DESTINATION for shared library " "target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -542,7 +542,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no ARCHIVE DESTINATION for static library " "target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -563,7 +563,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no LIBRARY DESTINATION for module target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -598,7 +598,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } if(!bundleGenerator) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE " "executable target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -615,7 +615,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no RUNTIME DESTINATION for executable " "target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -681,7 +681,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "INSTALL TARGETS - target " << target.GetName() << " has " << "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION."; cmSystemTools::Message(e.str().c_str(), "Warning"); @@ -708,7 +708,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "INSTALL TARGETS - target " << target.GetName() << " has " << "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION."; cmSystemTools::Message(e.str().c_str(), "Warning"); @@ -734,7 +734,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "INSTALL TARGETS - target " << target.GetName() << " has " << "RESOURCE files but no RESOURCE DESTINATION."; cmSystemTools::Message(e.str().c_str(), "Warning"); @@ -855,7 +855,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) if(!unknownArgs.empty()) { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given unknown argument \"" << unknownArgs[0] << "\"."; this->SetError(e.str()); return false; @@ -870,7 +870,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) if(!ica.GetRename().empty() && files.GetVector().size() > 1) { // The rename option works only with one file. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given RENAME option with more than one file."; this->SetError(e.str()); return false; @@ -890,7 +890,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) if(ica.GetDestination().empty()) { // A destination is required. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given no DESTINATION!"; this->SetError(e.str()); return false; @@ -931,7 +931,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -945,7 +945,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -960,7 +960,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -988,7 +988,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Add this property to the current match rule. if(!in_match_mode || doing == DoingPattern || doing == DoingRegex) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" before a PATTERN or REGEX is given."; this->SetError(e.str()); @@ -1001,7 +1001,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(!in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" before a PATTERN or REGEX is given."; this->SetError(e.str()); @@ -1016,7 +1016,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1030,7 +1030,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1044,7 +1044,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1059,7 +1059,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1074,7 +1074,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1088,7 +1088,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1113,7 +1113,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) if(cmSystemTools::FileExists(dir.c_str()) && !cmSystemTools::FileIsDirectory(dir)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given non-directory \"" << args[i] << "\" to install."; this->SetError(e.str()); @@ -1169,7 +1169,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Check the requested permission. if(!cmInstallCommandArguments::CheckPermissions(args[i],permissions_file)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid file permission \"" << args[i] << "\"."; this->SetError(e.str()); @@ -1181,7 +1181,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Check the requested permission. if(!cmInstallCommandArguments::CheckPermissions(args[i],permissions_dir)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid directory permission \"" << args[i] << "\"."; this->SetError(e.str()); @@ -1193,7 +1193,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Check the requested permission. if(!cmInstallCommandArguments::CheckPermissions(args[i], literal_args)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid permission \"" << args[i] << "\"."; this->SetError(e.str()); @@ -1203,7 +1203,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) else { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given unknown argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; @@ -1224,7 +1224,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) if(!destination) { // A destination is required. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given no DESTINATION!"; this->SetError(e.str()); return false; @@ -1271,7 +1271,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if (!unknownArgs.empty()) { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given unknown argument \"" << unknownArgs[0] << "\"."; this->SetError(e.str()); return false; @@ -1286,7 +1286,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(ica.GetDestination().empty()) { // A destination is required. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given no DESTINATION!"; this->SetError(e.str()); return false; @@ -1296,7 +1296,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) std::string fname = filename.GetString(); if(fname.find_first_of(":/\\") != fname.npos) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid export file name \"" << fname << "\". " << "The FILE argument may not contain a path. " << "Specify the path in the DESTINATION argument."; @@ -1308,7 +1308,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(!fname.empty() && cmSystemTools::GetFilenameLastExtension(fname) != ".cmake") { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid export file name \"" << fname << "\". " << "The FILE argument must specify a name ending in \".cmake\"."; this->SetError(e.str()); @@ -1323,7 +1323,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(fname.find_first_of(":/\\") != fname.npos) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given export name \"" << exp.GetString() << "\". " << "This name cannot be safely converted to a file name. " << "Specify a different export name or use the FILE option to set " @@ -1348,7 +1348,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(!newCMP0022Behavior) { - cmOStringStream e; + std::ostringstream e; e << "INSTALL(EXPORT) given keyword \"" << "EXPORT_LINK_INTERFACE_LIBRARIES" << "\", but target \"" << te->Target->GetName() @@ -1395,7 +1395,7 @@ bool cmInstallCommand::MakeFilesFullPath(const char* modeName, // Make sure the file is not a directory. if(gpos == file.npos && cmSystemTools::FileIsDirectory(file)) { - cmOStringStream e; + std::ostringstream e; e << modeName << " given directory \"" << (*fileIt) << "\" to install."; this->SetError(e.str()); return false; diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index ddfd6c5..4480cc6 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -121,7 +121,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os) // Skip empty sets. if(ExportSet->GetTargetExports()->empty()) { - cmOStringStream e; + std::ostringstream e; e << "INSTALL(EXPORT) given unknown export \"" << ExportSet->GetName() << "\""; cmSystemTools::Error(e.str().c_str()); diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index bb346fb..8701b73 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -47,7 +47,7 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os) // Warn if installing an exclude-from-all target. if(this->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) { - cmOStringStream msg; + std::ostringstream msg; msg << "WARNING: Target \"" << this->Target->GetName() << "\" has EXCLUDE_FROM_ALL set and will not be built by default " << "but an install rule has been provided for it. CMake does " @@ -424,7 +424,7 @@ cmInstallTargetGenerator ::AddTweak(std::ostream& os, Indent const& indent, const std::string& config, std::string const& file, TweakMethod tweak) { - cmOStringStream tw; + std::ostringstream tw; (this->*tweak)(tw, indent.Next(), config, file); std::string tws = tw.str(); if(!tws.empty()) @@ -450,7 +450,7 @@ cmInstallTargetGenerator else { // Generate a foreach loop to tweak multiple files. - cmOStringStream tw; + std::ostringstream tw; this->AddTweak(tw, indent.Next(), config, "${file}", tweak); std::string tws = tw.str(); if(!tws.empty()) @@ -699,7 +699,7 @@ cmInstallTargetGenerator (!oldRuntimeDirs.empty() || !newRuntimeDirs.empty()) ) { - cmOStringStream msg; + std::ostringstream msg; msg << "WARNING: Target \"" << this->Target->GetName() << "\" has runtime paths which cannot be changed during install. " << "To change runtime paths, OS X version 10.6 or newer is required. " diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx index 3644d93..ade1feb 100644 --- a/Source/cmLinkDirectoriesCommand.cxx +++ b/Source/cmLinkDirectoriesCommand.cxx @@ -36,7 +36,7 @@ void cmLinkDirectoriesCommand::AddLinkDir(std::string const& dir) if(!cmSystemTools::FileIsFullPath(unixPath.c_str())) { bool convertToAbsolute = false; - cmOStringStream e; + std::ostringstream e; e << "This command specifies the relative path\n" << " " << unixPath << "\n" << "as a link directory.\n"; diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index f1ea088..47b8be5 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -225,7 +225,7 @@ bool cmListCommand::HandleGetCommand(std::vector const& args) } if ( item < 0 || nitem <= (size_t)item ) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << varArgsExpanded.size()-1 << ")"; @@ -322,7 +322,7 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) if((!this->GetList(varArgsExpanded, listName) || varArgsExpanded.empty()) && item != 0) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (0, 0)"; this->SetError(str.str()); return false; @@ -337,7 +337,7 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) } if ( item < 0 || nitem <= (size_t)item ) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << (varArgsExpanded.size() == 0?0:(varArgsExpanded.size()-1)) << ")"; @@ -570,7 +570,7 @@ bool cmListCommand::HandleRemoveAtCommand( } if ( item < 0 || nitem <= (size_t)item ) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << varArgsExpanded.size()-1 << ")"; diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 1c39563..3e26349 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -68,7 +68,7 @@ bool cmListFileParser::ParseFile() bom != cmListFileLexer_BOM_UTF8) { cmListFileLexer_SetFileName(this->Lexer, 0, 0); - cmOStringStream m; + std::ostringstream m; m << "File\n " << this->FileName << "\n" << "starts with a Byte-Order-Mark that is not UTF-8."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, m.str()); @@ -108,7 +108,7 @@ bool cmListFileParser::ParseFile() } else { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << token->line << ":\n" << "Parse error. Expected a newline, got " @@ -120,7 +120,7 @@ bool cmListFileParser::ParseFile() } else { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << token->line << ":\n" << "Parse error. Expected a command name, got " @@ -268,7 +268,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) token->type == cmListFileLexer_Token_Space) {} if(!token) { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << "Parse error. Function missing opening \"(\"."; @@ -277,7 +277,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) } if(token->type != cmListFileLexer_Token_ParenLeft) { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << "Parse error. Expected \"(\", got " @@ -355,7 +355,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) else { // Error. - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << "Parse error. Function missing ending \")\". " @@ -367,7 +367,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) } } - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << lastLine << ":\n" << "Parse error. Function missing ending \")\". " @@ -389,7 +389,7 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token, } bool isError = (this->Separation == SeparationError || delim == cmListFileArgument::Bracket); - cmOStringStream m; + std::ostringstream m; m << "Syntax " << (isError? "Error":"Warning") << " in cmake code at\n" << " " << this->FileName << ":" << token->line << ":" << token->column << "\n" diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index a4063a6..cdfd00c 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -226,7 +226,7 @@ bool cmLoadCommandCommand std::string fullPath = cmSystemTools::FindFile(moduleName.c_str(), path); if (fullPath == "") { - cmOStringStream e; + std::ostringstream e; e << "Attempt to load command failed from file \"" << moduleName << "\""; this->SetError(e.str()); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2de6c93..52d312e 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -153,7 +153,7 @@ void cmLocalGenerator::ComputeObjectMaxPath() } else { - cmOStringStream w; + std::ostringstream w; w << "CMAKE_OBJECT_PATH_MAX is set to " << pmax << ", which is less than the minimum of 128. " << "The value will be ignored."; @@ -162,7 +162,7 @@ void cmLocalGenerator::ComputeObjectMaxPath() } else { - cmOStringStream w; + std::ostringstream w; w << "CMAKE_OBJECT_PATH_MAX is set to \"" << plen << "\", which fails to parse as a positive integer. " << "The value will be ignored."; @@ -191,7 +191,7 @@ void cmLocalGenerator::ReadInputFile() // The file is missing. Check policy CMP0014. cmMakefile* mf = this->Parent->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "The source directory\n" << " " << this->Makefile->GetStartDirectory() << "\n" << "does not contain a CMakeLists.txt file."; @@ -1245,7 +1245,7 @@ void cmLocalGenerator::InsertRuleLauncher(std::string& s, cmTarget* target, { if(const char* val = this->GetRuleLauncher(target, prop)) { - cmOStringStream wrapped; + std::ostringstream wrapped; wrapped << val << " " << s; s = wrapped.str(); } @@ -1326,7 +1326,7 @@ std::string cmLocalGenerator::GetIncludeFlags( } OutputFormat shellFormat = forResponseFile? RESPONSE : SHELL; - cmOStringStream includeFlags; + std::ostringstream includeFlags; std::string flagVar = "CMAKE_INCLUDE_FLAG_"; flagVar += lang; @@ -1521,7 +1521,7 @@ void cmLocalGenerator::AddCompileOptions( } if (this->Makefile->IsLaterStandard(it->first, standard, it->second)) { - cmOStringStream e; + std::ostringstream e; e << "The COMPILE_FEATURES property of target \"" << target->GetName() << "\" was evaluated when computing the link " "implementation, and the \"" << it->first << "_STANDARD\" was \"" @@ -1880,7 +1880,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries, OutputFormat shellFormat = (forResponseFile) ? RESPONSE : ((useWatcomQuote) ? WATCOMQUOTE : SHELL); bool escapeAllowMakeVars = !forResponseFile; - cmOStringStream fout; + std::ostringstream fout; std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); cmComputeLinkInformation* pcli = tgt.Target->GetLinkInformation(config); if(!pcli) @@ -2242,7 +2242,7 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, const char *opt = target->GetMakefile()->GetDefinition(option_flag); if (!opt) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target->GetName() << "\" requires the language " "dialect \"" << lang << standardProp << "\" " << (ext ? "(with compiler extensions)" : "") << ", but CMake " @@ -2327,7 +2327,7 @@ static void AddVisibilityCompileOption(std::string &flags, cmTarget* target, && strcmp(prop, "protected") != 0 && strcmp(prop, "internal") != 0 ) { - cmOStringStream e; + std::ostringstream e; e << "Target " << target->GetName() << " uses unsupported value \"" << prop << "\" for " << flagDefine << "."; cmSystemTools::Error(e.str().c_str()); @@ -2442,7 +2442,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared, { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << "Variable " << flagsVar << " has been modified. CMake " "will ignore the POSITION_INDEPENDENT_CODE target property for " "shared libraries and will use the " << flagsVar << " variable " @@ -3251,7 +3251,7 @@ cmLocalGenerator // Warn if this is the first time the path has been seen. if(this->ObjectMaxPathViolations.insert(dir_max).second) { - cmOStringStream m; + std::ostringstream m; m << "The object file directory\n" << " " << dir_max << "\n" << "has " << dir_max.size() << " characters. " @@ -3649,7 +3649,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const } if(function_style) { - cmOStringStream e; + std::ostringstream e; e << "WARNING: Function-style preprocessor definitions may not be " << "passed on the compiler command line because many compilers " << "do not support it.\n" @@ -3662,7 +3662,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const // Many compilers do not support # in the value so we disable it. if(define.find_first_of("#") != define.npos) { - cmOStringStream e; + std::ostringstream e; e << "WARNING: Preprocessor definitions containing '#' may not be " << "passed on the compiler command line because many compilers " << "do not support it.\n" @@ -3704,7 +3704,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmTarget* target, } if(!cmSystemTools::FileExists(inFile.c_str(), true)) { - cmOStringStream e; + std::ostringstream e; e << "Target " << target->GetName() << " Info.plist template \"" << inFile << "\" could not be found."; cmSystemTools::Error(e.str().c_str()); @@ -3748,7 +3748,7 @@ void cmLocalGenerator::GenerateFrameworkInfoPList(cmTarget* target, } if(!cmSystemTools::FileExists(inFile.c_str(), true)) { - cmOStringStream e; + std::ostringstream e; e << "Target " << target->GetName() << " Info.plist template \"" << inFile << "\" could not be found."; cmSystemTools::Error(e.str().c_str()); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 0b0d971..413dc0f 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -369,7 +369,7 @@ std::string cmLocalNinjaGenerator::BuildCommandLine( return ":"; #endif - cmOStringStream cmd; + std::ostringstream cmd; for (std::vector::const_iterator li = cmdLines.begin(); li != cmdLines.end(); ++li) #ifdef _WIN32 @@ -409,7 +409,7 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines( if (wd.empty()) wd = this->GetMakefile()->GetStartOutputDirectory(); - cmOStringStream cdCmd; + std::ostringstream cdCmd; #ifdef _WIN32 std::string cdStr = "cd /D "; #else diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 812ded3..75231b7 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1554,7 +1554,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo, { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << tgtInfo << "\" is newer than depender \"" << internalDependFile << "\"." << std::endl; @@ -1577,7 +1577,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo, { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dirInfoFile << "\" is newer than depender \"" << internalDependFile << "\"." << std::endl; @@ -1788,7 +1788,7 @@ void cmLocalUnixMakefileGenerator3::CheckMultipleOutputs(bool verbose) { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Deleting primary custom command output \"" << dependee << "\" because another output \"" << depender << "\" does not exist." << std::endl; @@ -1918,7 +1918,7 @@ void cmLocalUnixMakefileGenerator3 std::string progressDir = this->Makefile->GetHomeOutputDirectory(); progressDir += cmake::GetCMakeFilesDirectory(); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; progCmd << this->Convert(progressDir, @@ -1942,7 +1942,7 @@ void cmLocalUnixMakefileGenerator3 this->Makefile->GetHomeOutputDirectory(), cmLocalGenerator::START_OUTPUT); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 progCmd << this->Convert(progressDir, cmLocalGenerator::FULL, diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index b9a5074..1d62093 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -1321,7 +1321,7 @@ void cmLocalVisualStudio6Generator int major; int minor; target.GetTargetVersion(major, minor); - cmOStringStream targetVersionStream; + std::ostringstream targetVersionStream; targetVersionStream << "/version:" << major << "." << minor; targetVersionFlag = targetVersionStream.str(); } @@ -1998,7 +1998,7 @@ cmLocalVisualStudio6Generator if(define.find_first_of(" ") != define.npos && define.find_first_of("\"$;") != define.npos) { - cmOStringStream e; + std::ostringstream e; e << "WARNING: The VS6 IDE does not support preprocessor definition " << "values with spaces and '\"', '$', or ';'.\n" << "CMake is dropping a preprocessor definition: " << define << "\n" diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 0e66764..914df5f 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1115,7 +1115,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, if(this->GetVersion() < VS8 || this->FortranProject) { - cmOStringStream libdeps; + std::ostringstream libdeps; this->Internal->OutputObjects(libdeps, &target); if(!libdeps.str().empty()) { @@ -1713,7 +1713,7 @@ bool cmLocalVisualStudio7Generator // Write the children to temporary output. bool hasChildrenWithSources = false; - cmOStringStream tmpOut; + std::ostringstream tmpOut; for(unsigned int i=0;iWriteGroup(&children[i], target, tmpOut, libName, configs)) diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index ae81c58..8c2489a 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -107,7 +107,7 @@ bool cmMacroHelperCommand::InvokeInitialPass cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies); // set the value of argc - cmOStringStream argcDefStream; + std::ostringstream argcDefStream; argcDefStream << expandedArgs.size(); std::string argcDef = argcDefStream.str(); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 20dae5a..1438f7e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -363,7 +363,7 @@ cmListFileBacktrace cmMakefile::GetBacktrace() const //---------------------------------------------------------------------------- void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const { - cmOStringStream msg; + std::ostringstream msg; msg << lff.FilePath << "(" << lff.Line << "): "; msg << lff.Name << "("; for(std::vector::const_iterator i = @@ -556,7 +556,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011() case cmPolicies::WARN: // Warn because the user did not set this policy. { - cmOStringStream w; + std::ostringstream w; w << policies->GetPolicyWarning(cmPolicies::CMP0011) << "\n" << "The included script\n " << this->File << "\n" << "affects policy settings. " @@ -568,7 +568,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011() case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << policies->GetRequiredPolicyError(cmPolicies::CMP0011) << "\n" << "The included script\n " << this->File << "\n" << "affects policy settings, so it requires this policy to be set."; @@ -741,7 +741,7 @@ void cmMakefile::EnforceDirectoryLevelRules() const // Diagnose a violation of CMP0000 if necessary. if(this->CheckCMP0000) { - cmOStringStream msg; + std::ostringstream msg; msg << "No cmake_minimum_required command is present. " << "A line of code such as\n" << " cmake_minimum_required(VERSION " @@ -897,7 +897,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target, { cmake::MessageType messageType = cmake::AUTHOR_WARNING; bool issueMessage = false; - cmOStringStream e; + std::ostringstream e; switch(this->GetPolicyStatus(cmPolicies::CMP0040)) { case cmPolicies::WARN: @@ -924,7 +924,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target, if(ti->second.GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target << "\" is an OBJECT library " "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -932,7 +932,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target, } if(ti->second.GetType() == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target << "\" is an INTERFACE library " "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -997,7 +997,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector& outputs, cmCustomCommandLine const& cl = *i; if(!cl.empty() && !cl[0].empty() && cl[0][0] == '"') { - cmOStringStream e; + std::ostringstream e; e << "COMMAND may not contain literal quotes:\n " << cl[0] << "\n"; this->IssueMessage(cmake::FATAL_ERROR, e.str()); return 0; @@ -1555,7 +1555,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target, (tgt->GetType() == cmTarget::INTERFACE_LIBRARY) || tgt->IsExecutableWithExports())) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << lib << "\" of type " << cmTarget::GetTargetTypeName(tgt->GetType()) << " may not be linked into another target. " @@ -1568,7 +1568,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target, } else { - cmOStringStream e; + std::ostringstream e; e << "Attempt to add link library \"" << lib << "\" to target \"" << target << "\" which is not built in this directory."; @@ -1584,7 +1584,7 @@ void cmMakefile::AddLinkDirectoryForTarget(const std::string& target, { if(this->IsAlias(target)) { - cmOStringStream e; + std::ostringstream e; e << "ALIAS target \"" << target << "\" " << "may not be linked into another target."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -2006,7 +2006,7 @@ void cmMakefile::CheckForUnused(const char* reason, !cmSystemTools::IsSubDirectory(path, cmake::GetCMakeFilesDirectory()))) { - cmOStringStream msg; + std::ostringstream msg; msg << "unused variable (" << reason << ") \'" << name << "\'"; this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, msg.str(), @@ -2311,7 +2311,7 @@ void cmMakefile::ExpandVariablesCMP0019() { return; } - cmOStringStream w; + std::ostringstream w; const char *includeDirs = this->GetProperty("INCLUDE_DIRECTORIES"); if(mightExpandVariablesCMP0019(includeDirs)) @@ -2389,7 +2389,7 @@ void cmMakefile::ExpandVariablesCMP0019() if(!w.str().empty()) { - cmOStringStream m; + std::ostringstream m; m << this->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0019) << "\n" << "The following variable evaluations were encountered:\n" @@ -2782,7 +2782,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld( else { // Construct the main error message. - cmOStringStream error; + std::ostringstream error; error << "Syntax error in cmake code "; if(filename && line > 0) { @@ -2890,7 +2890,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( case NORMAL: if(filename && lookup == lineVar) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << line; varresult = ostr.str(); } @@ -2932,7 +2932,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( cmSystemTools::IsSubDirectory(filename, this->GetHomeOutputDirectory())) { - cmOStringStream msg; + std::ostringstream msg; cmListFileBacktrace bt(this->GetLocalGenerator()); cmListFileContext lfc; lfc.FilePath = filename; @@ -3126,7 +3126,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( if(error) { - cmOStringStream emsg; + std::ostringstream emsg; emsg << "Syntax error in cmake code "; if(filename) { @@ -3341,7 +3341,7 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError) { // Report the context in which the unclosed block was opened. cmListFileContext const& lfc = fb->GetStartingContext(); - cmOStringStream e; + std::ostringstream e; e << "A logical block opening on the line\n" << " " << lfc << "\n" << "is not closed."; @@ -3499,7 +3499,7 @@ cmMakefile::RemoveFunctionBlocker(cmFunctionBlocker* fb, if(!(*pos)->ShouldRemove(lff, *this)) { cmListFileContext const& lfc = fb->GetStartingContext(); - cmOStringStream e; + std::ostringstream e; e << "A logical block opening on the line\n" << " " << lfc << "\n" << "closes on the line\n" @@ -3559,14 +3559,14 @@ void cmMakefile::SetScriptModeFile(const char* scriptfile) void cmMakefile::SetArgcArgv(const std::vector& args) { - cmOStringStream strStream; + std::ostringstream strStream; strStream << args.size(); this->AddDefinition("CMAKE_ARGC", strStream.str().c_str()); //this->MarkVariableAsUsed("CMAKE_ARGC"); for (unsigned int t = 0; t < args.size(); ++t) { - cmOStringStream tmpStream; + std::ostringstream tmpStream; tmpStream << "CMAKE_ARGV" << t; this->AddDefinition(tmpStream.str(), args[t].c_str()); //this->MarkVariableAsUsed(tmpStream.str().c_str()); @@ -3918,7 +3918,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << "File " << currentFile << " includes " << moduleInCMakeModulePath << " (found via CMAKE_MODULE_PATH) which shadows " @@ -4098,7 +4098,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile, if(bom != cmsys::FStream::BOM_None && bom != cmsys::FStream::BOM_UTF8) { - cmOStringStream e; + std::ostringstream e; e << "File starts with a Byte-Order-Mark that is not UTF-8:\n " << sinfile; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -4310,7 +4310,7 @@ const char *cmMakefile::GetProperty(const std::string& prop, } else if (prop == "LINK_DIRECTORIES") { - cmOStringStream str; + std::ostringstream str; for (std::vector::const_iterator it = this->GetLinkDirectories().begin(); it != this->GetLinkDirectories().end(); @@ -4488,7 +4488,7 @@ void cmMakefile::AddCMakeDependFilesFromUser() std::string cmMakefile::GetListFileStack() const { - cmOStringStream tmp; + std::ostringstream tmp; size_t depth = this->ListFileStack.size(); if (depth > 0) { @@ -4606,7 +4606,7 @@ void cmMakefile::RaiseScope(const std::string& var, const char *varDef) } else { - cmOStringStream m; + std::ostringstream m; m << "Cannot set \"" << var << "\": current scope has no parent."; this->IssueMessage(cmake::AUTHOR_WARNING, m.str()); } @@ -4701,7 +4701,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, { if(this->IsAlias(name)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create target \"" << name << "\" because an alias with the same name already exists."; msg = e.str(); @@ -4715,7 +4715,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, { // Imported targets were not supported in previous versions. // This is new code, so we can make it an error. - cmOStringStream e; + std::ostringstream e; e << "cannot create target \"" << name << "\" because an imported target with the same name already exists."; msg = e.str(); @@ -4754,7 +4754,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, // Produce an error that tells the user how to work around the // problem. - cmOStringStream e; + std::ostringstream e; e << "cannot create target \"" << name << "\" because another target with the same name already exists. " << "The existing target is "; @@ -4800,7 +4800,7 @@ bool cmMakefile::EnforceUniqueDir(const std::string& srcPath, { return true; } - cmOStringStream e; + std::ostringstream e; switch (this->GetPolicyStatus(cmPolicies::CMP0013)) { case cmPolicies::WARN: @@ -4985,7 +4985,7 @@ bool cmMakefile::SetPolicy(const char *id, cmPolicies::PolicyID pid; if (!this->GetPolicies()->GetPolicyID(id, /* out */ pid)) { - cmOStringStream e; + std::ostringstream e; e << "Policy \"" << id << "\" is not known to this version of CMake."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -5200,7 +5200,7 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature, availableFeatures.end(), feature) == availableFeatures.end()) { - cmOStringStream e; + std::ostringstream e; e << "The compiler feature \"" << feature << "\" is not known to " << lang << " compiler\n\"" << this->GetDefinition("CMAKE_" + lang + "_COMPILER_ID") @@ -5240,7 +5240,7 @@ CompileFeatureKnown(cmTarget const* target, const std::string& feature, lang = "CXX"; return true; } - cmOStringStream e; + std::ostringstream e; if (error) { e << "specified"; @@ -5271,7 +5271,7 @@ CompileFeaturesAvailable(const std::string& lang, std::string *error) const if (!featuresKnown || !*featuresKnown) { - cmOStringStream e; + std::ostringstream e; if (error) { e << "no"; @@ -5326,7 +5326,7 @@ HaveCFeatureAvailable(cmTarget const* target, const std::string& feature) const if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The C_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -5403,7 +5403,7 @@ bool cmMakefile::HaveCxxFeatureAvailable(cmTarget const* target, if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), cmStrCmp(existingCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The CXX_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCxxStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -5478,7 +5478,7 @@ AddRequiredTargetCxxFeature(cmTarget *target, if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), cmStrCmp(existingCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The CXX_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCxxStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -5577,7 +5577,7 @@ AddRequiredTargetCFeature(cmTarget *target, const std::string& feature) const if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The C_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index fc52ccc..d4036d2 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -371,8 +371,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) std::string targetVersionMajor; std::string targetVersionMinor; { - cmOStringStream majorStream; - cmOStringStream minorStream; + std::ostringstream majorStream; + std::ostringstream minorStream; int major; int minor; this->Target->GetTargetVersion(major, minor); diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 305d81d..cdda36c 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -566,8 +566,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules std::string targetVersionMajor; std::string targetVersionMinor; { - cmOStringStream majorStream; - cmOStringStream minorStream; + std::ostringstream majorStream; + std::ostringstream minorStream; int major; int minor; this->Target->GetTargetVersion(major, minor); @@ -805,7 +805,7 @@ cmMakefileLibraryTargetGenerator if(major > 0 || minor > 0 || patch > 0) { // Append the flag since a non-zero version is specified. - cmOStringStream vflag; + std::ostringstream vflag; vflag << flag << major << "." << minor << "." << patch; this->LocalGenerator->AppendFlags(flags, vflag.str()); } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index cbf8573..ef08c21 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -451,7 +451,7 @@ void cmMakefileTargetGenerator } else { - cmOStringStream err; + std::ostringstream err; err << "Warning: Source file \"" << source.GetFullPath() << "\" is listed multiple times for target \"" @@ -1101,7 +1101,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() // Add a command to call CMake to scan dependencies. CMake will // touch the corresponding depends file after scanning dependencies. - cmOStringStream depCmd; + std::ostringstream depCmd; // TODO: Account for source file properties and directory-level // definitions when scanning for dependencies. #if !defined(_WIN32) || defined(__CYGWIN__) @@ -1217,7 +1217,7 @@ void cmMakefileTargetGenerator } // Now append the actual user-specified commands. - cmOStringStream content; + std::ostringstream content; this->LocalGenerator->AppendCustomCommand(commands, ccg, this->Target, false, cmLocalGenerator::HOME_OUTPUT, &content); @@ -1279,7 +1279,7 @@ cmMakefileTargetGenerator::AppendProgress(std::vector& commands) } std::string progressDir = this->Makefile->GetHomeOutputDirectory(); progressDir += cmake::GetCMakeFilesDirectory(); - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; progCmd << this->LocalGenerator->Convert(progressDir, cmLocalGenerator::FULL, diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 53b7a8e..32a5ccf 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -218,8 +218,8 @@ cmNinjaNormalTargetGenerator std::string targetVersionMajor; std::string targetVersionMinor; { - cmOStringStream majorStream; - cmOStringStream minorStream; + std::ostringstream majorStream; + std::ostringstream minorStream; int major; int minor; this->GetTarget()->GetTargetVersion(major, minor); @@ -255,10 +255,10 @@ cmNinjaNormalTargetGenerator this->GetLocalGenerator()->BuildCommandLine(linkCmds); // Write the linker rule with response file if needed. - cmOStringStream comment; + std::ostringstream comment; comment << "Rule for linking " << this->TargetLinkLanguage << " " << this->GetVisibleTypeName() << "."; - cmOStringStream description; + std::ostringstream description; description << "Linking " << this->TargetLinkLanguage << " " << this->GetVisibleTypeName() << " $TARGET_FILE"; this->GetGlobalGenerator()->AddRule(ruleName, @@ -435,7 +435,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() cmNinjaVars vars; // Compute the comment. - cmOStringStream comment; + std::ostringstream comment; comment << "Link the " << this->GetVisibleTypeName() << " " << targetOutputReal; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index b36ff93..c019ceb 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -468,9 +468,9 @@ cmNinjaTargetGenerator // Write the rule for compiling file of the given language. - cmOStringStream comment; + std::ostringstream comment; comment << "Rule for compiling " << lang << " files."; - cmOStringStream description; + std::ostringstream description; description << "Building " << lang << " object $out"; this->GetGlobalGenerator()->AddRule(this->LanguageCompilerRule(lang), cmdLine, diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 3cdd2f6..116d42f 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -86,7 +86,7 @@ public: } } - void FindImplicitConflicts(cmOStringStream& w) + void FindImplicitConflicts(std::ostringstream& w) { bool first = true; for(unsigned int i=0; i < this->OD->OriginalDirectories.size(); ++i) @@ -541,7 +541,7 @@ void cmOrderDirectories::FindImplicitConflicts() { // Check for items in implicit link directories that have conflicts // in the explicit directories. - cmOStringStream conflicts; + std::ostringstream conflicts; for(unsigned int i=0; i < this->ImplicitDirEntries.size(); ++i) { this->ImplicitDirEntries[i]->FindImplicitConflicts(conflicts); @@ -555,7 +555,7 @@ void cmOrderDirectories::FindImplicitConflicts() } // Warn about the conflicts. - cmOStringStream w; + std::ostringstream w; w << "Cannot generate a safe " << this->Purpose << " for target " << this->Target->GetName() << " because files in some directories may conflict with " @@ -624,7 +624,7 @@ void cmOrderDirectories::DiagnoseCycle() this->CycleDiagnosed = true; // Construct the message. - cmOStringStream e; + std::ostringstream e; e << "Cannot generate a safe " << this->Purpose << " for target " << this->Target->GetName() << " because there is a cycle in the constraint graph:\n"; diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 1a27a25..da64617 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -41,7 +41,7 @@ public: std::string GetVersionString() { - cmOStringStream v; + std::ostringstream v; v << this->MajorVersionIntroduced << "." << this->MinorVersionIntroduced; if(this->PatchVersionIntroduced > 0) { @@ -432,7 +432,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, if(sscanf(ver.c_str(), "%u.%u.%u.%u", &majorVer, &minorVer, &patchVer, &tweakVer) < 2) { - cmOStringStream e; + std::ostringstream e; e << "Invalid policy version value \"" << ver << "\". " << "A numeric major.minor[.patch[.tweak]] must be given."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -462,7 +462,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, patchVer == cmVersion::GetPatchVersion() && tweakVer > cmVersion::GetTweakVersion())) { - cmOStringStream e; + std::ostringstream e; e << "An attempt was made to set the policy version of CMake to \"" << version << "\" which is greater than this version of CMake. " << "This is not allowed because the greater version may have new " @@ -534,7 +534,7 @@ bool cmPolicies::GetPolicyDefault(cmMakefile* mf, std::string const& policy, } else { - cmOStringStream e; + std::ostringstream e; e << defaultVar << " has value \"" << defaultValue << "\" but must be \"OLD\", \"NEW\", or \"\" (empty)."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -584,7 +584,7 @@ std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id) return "Request for warning text for undefined policy!"; } - cmOStringStream msg; + std::ostringstream msg; msg << "Policy " << pos->second->IDString << " is not set: " "" << pos->second->ShortDescription << " " @@ -608,7 +608,7 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id) return "Request for error text for undefined policy!"; } - cmOStringStream error; + std::ostringstream error; error << "Policy " << pos->second->IDString << " is not set to NEW: " "" << pos->second->ShortDescription << " " @@ -645,7 +645,7 @@ std::string cmPolicies::GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id) { std::string pid = this->GetPolicyIDString(id); - cmOStringStream e; + std::ostringstream e; e << "Policy " << pid << " may not be set to OLD behavior because this " << "version of CMake no longer supports it. " << "The policy was introduced in " @@ -667,7 +667,7 @@ cmPolicies::DiagnoseAncientPolicies(std::vector const& ancient, unsigned int patchVer, cmMakefile* mf) { - cmOStringStream e; + std::ostringstream e; e << "The project requests behavior compatible with CMake version \"" << majorVer << "." << minorVer << "." << patchVer << "\", which requires the OLD behavior for some policies:\n"; diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 12318c8..61c0133 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -215,7 +215,7 @@ bool cmProjectCommand } if(!vw.empty()) { - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0048)) << "\nThe following variable(s) would be set to empty:" << vw; diff --git a/Source/cmSeparateArgumentsCommand.cxx b/Source/cmSeparateArgumentsCommand.cxx index 1ee3f29..8e6c311 100644 --- a/Source/cmSeparateArgumentsCommand.cxx +++ b/Source/cmSeparateArgumentsCommand.cxx @@ -51,7 +51,7 @@ bool cmSeparateArgumentsCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given unknown argument " << args[i]; this->SetError(e.str()); return false; diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 653d764..1150bc7 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -67,7 +67,7 @@ bool cmSetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid scope " << *arg << ". " << "Valid scopes are GLOBAL, DIRECTORY, " "TARGET, SOURCE, TEST, CACHE, INSTALL."; @@ -117,7 +117,7 @@ bool cmSetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid argument \"" << *arg << "\"."; this->SetError(e.str()); return false; @@ -265,7 +265,7 @@ bool cmSetPropertyCommand::HandleTargetMode() } else { - cmOStringStream e; + std::ostringstream e; e << "could not find TARGET " << *ni << ". Perhaps it has not yet been created."; this->SetError(e.str()); @@ -316,7 +316,7 @@ bool cmSetPropertyCommand::HandleSourceMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given SOURCE name that could not be found or created: " << *ni; this->SetError(e.str()); return false; @@ -373,7 +373,7 @@ bool cmSetPropertyCommand::HandleTestMode() // Names that are still left were not found. if(!this->Names.empty()) { - cmOStringStream e; + std::ostringstream e; e << "given TEST names that do not exist:\n"; for(std::set::const_iterator ni = this->Names.begin(); ni != this->Names.end(); ++ni) @@ -417,7 +417,7 @@ bool cmSetPropertyCommand::HandleCacheMode() !cmSystemTools::IsOn(this->PropertyValue.c_str()) && !cmSystemTools::IsOff(this->PropertyValue.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "given non-boolean value \"" << this->PropertyValue << "\" for CACHE property \"ADVANCED\". "; this->SetError(e.str()); @@ -428,7 +428,7 @@ bool cmSetPropertyCommand::HandleCacheMode() { if(!cmCacheManager::IsType(this->PropertyValue.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "given invalid CACHE entry TYPE \"" << this->PropertyValue << "\""; this->SetError(e.str()); return false; @@ -438,7 +438,7 @@ bool cmSetPropertyCommand::HandleCacheMode() this->PropertyName != "STRINGS" && this->PropertyName != "VALUE") { - cmOStringStream e; + std::ostringstream e; e << "given invalid CACHE property " << this->PropertyName << ". " << "Settable CACHE properties are: " << "ADVANCED, HELPSTRING, STRINGS, TYPE, and VALUE."; @@ -463,7 +463,7 @@ bool cmSetPropertyCommand::HandleCacheMode() } else { - cmOStringStream e; + std::ostringstream e; e << "could not find CACHE variable " << *ni << ". Perhaps it has not yet been created."; this->SetError(e.str()); @@ -513,7 +513,7 @@ bool cmSetPropertyCommand::HandleInstallMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given INSTALL name that could not be found or created: " << *i; this->SetError(e.str()); return false; diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 6fe5c62..27fda40 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -202,7 +202,7 @@ bool cmSourceFile::FindFullPath(std::string* error) } } - cmOStringStream e; + std::ostringstream e; std::string missing = this->Location.GetDirectory(); if(!missing.empty()) { diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index edba5ba..1741e05 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -90,7 +90,7 @@ bool cmSourceGroupCommand } else { - cmOStringStream err; + std::ostringstream err; err << "Unknown argument \"" << args[i] << "\". " << "Perhaps the FILES keyword is missing.\n"; this->SetError(err.str()); diff --git a/Source/cmStandardIncludes.cxx b/Source/cmStandardIncludes.cxx index a4bdb2e..23c570c 100644 --- a/Source/cmStandardIncludes.cxx +++ b/Source/cmStandardIncludes.cxx @@ -11,6 +11,6 @@ ============================================================================*/ #include "cmStandardIncludes.h" #if !defined(CMAKE_NO_ANSI_STRING_STREAM) -cmOStringStream::cmOStringStream() {} -cmOStringStream::~cmOStringStream() {} +std::ostringstream::cmOStringStream() {} +std::ostringstream::~cmOStringStream() {} #endif diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index df031b9..a7db271 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -140,7 +140,7 @@ private: #endif /* Poison this operator to avoid common mistakes. */ -extern void operator << (std::ostream&, const cmOStringStream&); +extern void operator << (std::ostream&, const std::ostringstream&); /** Standard documentation entry for cmDocumentation's formatting. */ struct cmDocumentationEntry diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 8341027..fe962ba 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -122,7 +122,7 @@ bool cmStringCommand::HandleHashCommand(std::vector const& args) #if defined(CMAKE_BUILD_WITH_CMAKE) if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " requires an output variable and an input string"; this->SetError(e.str()); return false; @@ -137,7 +137,7 @@ bool cmStringCommand::HandleHashCommand(std::vector const& args) } return false; #else - cmOStringStream e; + std::ostringstream e; e << args[0] << " not available during bootstrap"; this->SetError(e.str().c_str()); return false; @@ -233,7 +233,7 @@ bool cmStringCommand::HandleConfigureCommand( } else { - cmOStringStream err; + std::ostringstream err; err << "Unrecognized argument \"" << args[i] << "\""; this->SetError(err.str()); return false; @@ -591,7 +591,7 @@ bool cmStringCommand::HandleFindCommand(std::vector const& } if(std::string::npos != pos) { - cmOStringStream s; + std::ostringstream s; s << pos; this->Makefile->AddDefinition(outvar, s.str().c_str()); return true; @@ -705,7 +705,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector const& int intStringLength = static_cast(stringLength); if ( begin < 0 || begin > intStringLength ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "begin index: " << begin << " is out of range 0 - " << stringLength; this->SetError(ostr.str()); @@ -713,7 +713,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector const& } if ( end < -1 ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "end index: " << end << " should be -1 or greater"; this->SetError(ostr.str()); return false; @@ -1089,7 +1089,7 @@ bool cmStringCommand this->Makefile->AddDefinition(outputVariable, uuid.c_str()); return true; #else - cmOStringStream e; + std::ostringstream e; e << args[0] << " not available during bootstrap"; this->SetError(e.str().c_str()); return false; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1d36ff5..16e71cc 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2501,7 +2501,7 @@ bool cmSystemTools::ChangeRPath(std::string const& file, } if(emsg) { - cmOStringStream e; + std::ostringstream e; e << "The current " << se_name[i] << " is:\n" << " " << se[i]->Value << "\n" << "which does not contain:\n" diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 94a6de3..5d68d9d 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -686,7 +686,7 @@ static bool processSources(cmTarget const* tgt, if (!targetName.empty() && !cmSystemTools::FileIsFullPath(src.c_str())) { - cmOStringStream err; + std::ostringstream err; if (!targetName.empty()) { err << "Target \"" << targetName << "\" contains relative " @@ -863,7 +863,7 @@ cmTarget::GetConfigCommonSourceFiles(std::vector& files) const thisConfigFiles += (*fi)->GetFullPath(); sep = "\n "; } - cmOStringStream e; + std::ostringstream e; e << "Target \"" << this->Name << "\" has source files which vary by " "configuration. This is not supported by the \"" << this->Makefile->GetLocalGenerator() @@ -996,7 +996,7 @@ std::string cmTarget::ProcessSourceItemCMP0049(const std::string& s) this->Makefile->ExpandVariablesInString(src); if (src != s) { - cmOStringStream e; + std::ostringstream e; bool noMessage = false; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0049)) @@ -1279,7 +1279,7 @@ bool cmTarget::PushTLLCommandTrace(TLLSignature signature) } //---------------------------------------------------------------------------- -void cmTarget::GetTllSignatureTraces(cmOStringStream &s, +void cmTarget::GetTllSignatureTraces(std::ostringstream &s, TLLSignature sig) const { std::vector sigs; @@ -1307,7 +1307,7 @@ void cmTarget::GetTllSignatureTraces(cmOStringStream &s, if(i != it->end()) { cmListFileContext const& lfc = *i; - cmOStringStream line; + std::ostringstream line; line << " * " << (lfc.Line? "": " in ") << lfc << std::endl; if (emitted.insert(line.str()).second) { @@ -1749,7 +1749,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) if (this->GetType() == INTERFACE_LIBRARY && !whiteListedInterfaceProperty(prop)) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " "The property \"" << prop << "\" is not allowed."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1757,7 +1757,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) } else if (prop == "NAME") { - cmOStringStream e; + std::ostringstream e; e << "NAME property is read-only\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; @@ -1800,7 +1800,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) } else if(prop == "EXPORT_NAME" && this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT_NAME property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1816,7 +1816,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) { if(this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "SOURCES property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1844,7 +1844,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, if (this->GetType() == INTERFACE_LIBRARY && !whiteListedInterfaceProperty(prop)) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " "The property \"" << prop << "\" is not allowed."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1852,7 +1852,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } else if (prop == "NAME") { - cmOStringStream e; + std::ostringstream e; e << "NAME property is read-only\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; @@ -1887,7 +1887,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } else if(prop == "EXPORT_NAME" && this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT_NAME property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1902,7 +1902,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, { if(this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "SOURCES property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1931,7 +1931,7 @@ std::string cmTarget::GetExportName() const { if (!cmGeneratorExpression::IsValidTargetName(exportName)) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT_NAME property \"" << exportName << "\" for \"" << this->GetName() << "\": is not valid."; cmSystemTools::Error(e.str().c_str()); @@ -2043,7 +2043,7 @@ static void processIncludeDirectories(cmTarget const* tgt, if (fromImported && !cmSystemTools::FileExists(li->c_str())) { - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::FATAL_ERROR; if (checkCMP0027) { @@ -2076,7 +2076,7 @@ static void processIncludeDirectories(cmTarget const* tgt, if (!cmSystemTools::FileIsFullPath(li->c_str())) { - cmOStringStream e; + std::ostringstream e; bool noMessage = false; cmake::MessageType messageType = cmake::FATAL_ERROR; if (!targetName.empty()) @@ -2426,7 +2426,7 @@ void cmTarget::GetCompileDefinitions(std::vector &list, { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << this->Makefile->GetCMakeInstance()->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0043); this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, @@ -2559,7 +2559,7 @@ static void cmTargetCheckLINK_INTERFACE_LIBRARIES( "LINK_INTERFACE_LIBRARIES"); // Report an error. - cmOStringStream e; + std::ostringstream e; e << "Property " << prop << " may not contain link-type keyword \"" << keys.match(2) << "\". " << "The " << base << " property has a per-configuration " @@ -2596,7 +2596,7 @@ static void cmTargetCheckINTERFACE_LINK_LIBRARIES(const char* value, } // Report an error. - cmOStringStream e; + std::ostringstream e; e << "Property INTERFACE_LINK_LIBRARIES may not contain link-type " "keyword \"" << keys.match(2) << "\". The INTERFACE_LINK_LIBRARIES " @@ -2895,7 +2895,7 @@ bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const { return true; } - cmOStringStream e; + std::ostringstream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch (context->GetPolicyStatus(cmPolicies::CMP0026)) @@ -2954,7 +2954,7 @@ const char *cmTarget::GetProperty(const std::string& prop, if (this->GetType() == INTERFACE_LIBRARY && !whiteListedInterfaceProperty(prop)) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " "The property \"" << prop << "\" is not allowed."; context->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -3130,7 +3130,7 @@ const char *cmTarget::GetProperty(const std::string& prop, return 0; } - cmOStringStream ss; + std::ostringstream ss; const char* sep = ""; typedef cmTargetInternals::TargetPropertyEntry TargetPropertyEntry; @@ -3160,7 +3160,7 @@ const char *cmTarget::GetProperty(const std::string& prop, bool addContent = false; bool noMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(context->GetPolicyStatus(cmPolicies::CMP0051)) { @@ -3258,7 +3258,7 @@ public: { bool noMessage = false; cmake::MessageType messageType = cmake::FATAL_ERROR; - cmOStringStream e; + std::ostringstream e; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028)) { case cmPolicies::WARN: @@ -3379,7 +3379,7 @@ public: } else if(this->Preferred.size() > 1) { - cmOStringStream e; + std::ostringstream e; e << "Target " << this->Target->GetName() << " contains multiple languages with the highest linker preference" << " (" << this->Preference << "):\n"; @@ -3751,7 +3751,7 @@ bool cmTarget::HasMacOSXRpathInstallNameDir(const std::string& config) const if(!this->Makefile->IsSet("CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG")) { - cmOStringStream w; + std::ostringstream w; w << "Attempting to use"; if(macosx_rpath) { @@ -5049,7 +5049,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, report += compatibilityAgree(t, propContent != consistent.second); if (!consistent.first) { - cmOStringStream e; + std::ostringstream e; e << "Property " << p << " on target \"" << tgt->GetName() << "\" does\nnot match the " "INTERFACE_" << p << " property requirement\nof " @@ -5082,7 +5082,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, report += compatibilityAgree(t, propContent != consistent.second); if (!consistent.first) { - cmOStringStream e; + std::ostringstream e; e << "Property " << p << " on target \"" << tgt->GetName() << "\" is\nimplied to be " << defaultValue << " because it was used to determine the link libraries\n" @@ -5116,7 +5116,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, report += compatibilityAgree(t, propContent != consistent.second); if (!consistent.first) { - cmOStringStream e; + std::ostringstream e; e << "The INTERFACE_" << p << " property of \"" << theTarget->GetName() << "\" does\nnot agree with the value " "of " << p << " already determined\nfor \"" @@ -6024,7 +6024,7 @@ cmTargetInternals::ComputeLinkInterfaceLibraries( if (newExplicitLibraries && strcmp(newExplicitLibraries, explicitLibraries) != 0) { - cmOStringStream w; + std::ostringstream w; w << (thisTarget->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n" @@ -6111,7 +6111,7 @@ cmTargetInternals::ComputeLinkInterfaceLibraries( if(newLibraries.empty()) { newLibraries = "(empty)"; } - cmOStringStream w; + std::ostringstream w; w << (thisTarget->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n" @@ -6366,7 +6366,7 @@ cmTargetInternals::ComputeLinkImplementationLibraries( { bool noMessage = false; cmake::MessageType messageType = cmake::FATAL_ERROR; - cmOStringStream e; + std::ostringstream e; switch(thisTarget->GetPolicyStatusCMP0038()) { case cmPolicies::WARN: @@ -6472,7 +6472,7 @@ cmTarget const* cmTarget::FindTargetToLink(std::string const& name) const if(tgt && tgt->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << this->GetName() << "\" links to " "OBJECT library \"" << tgt->GetName() << "\" but this is not " "allowed. " @@ -6511,7 +6511,7 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const { case cmPolicies::WARN: { - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0004)) << "\n" << "Target \"" << this->GetName() << "\" links to item \"" @@ -6523,7 +6523,7 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const break; case cmPolicies::NEW: { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << this->GetName() << "\" links to item \"" << item << "\" which has leading or trailing whitespace. " << "This is now an error according to policy CMP0004."; @@ -6533,7 +6533,7 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile->GetPolicies() ->GetRequiredPolicyError(cmPolicies::CMP0004)) << "\n" << "Target \"" << this->GetName() << "\" links to item \"" @@ -6614,7 +6614,7 @@ void checkPropertyConsistency(cmTarget const* depender, std::string pfile = pdir + pname + ".rst"; if(cmSystemTools::FileExists(pfile.c_str(), true)) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << dependee->GetName() << "\" has property \"" << *pi << "\" listed in its " << propName << " property. " "This is not allowed. Only user-defined properties may appear " @@ -6776,7 +6776,7 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info, { propsString += " and the " + *props.begin(); } - cmOStringStream e; + std::ostringstream e; e << "Property \"" << prop << "\" appears in both the " << propsString << " property in the dependencies of target \"" << this->GetName() << diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a3ecca0..ddd9859 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -202,7 +202,7 @@ public: PlainTLLSignature }; bool PushTLLCommandTrace(TLLSignature signature); - void GetTllSignatureTraces(cmOStringStream &s, TLLSignature sig) const; + void GetTllSignatureTraces(std::ostringstream &s, TLLSignature sig) const; void MergeLinkLibraries( cmMakefile& mf, const std::string& selfname, const LinkLibraryVectorType& libs ); diff --git a/Source/cmTargetCompileDefinitionsCommand.cxx b/Source/cmTargetCompileDefinitionsCommand.cxx index 66d8ad3..dc19720 100644 --- a/Source/cmTargetCompileDefinitionsCommand.cxx +++ b/Source/cmTargetCompileDefinitionsCommand.cxx @@ -20,7 +20,7 @@ bool cmTargetCompileDefinitionsCommand void cmTargetCompileDefinitionsCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile definitions for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -29,7 +29,7 @@ void cmTargetCompileDefinitionsCommand void cmTargetCompileDefinitionsCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile definitions for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx index 10daad4..15a9a38 100644 --- a/Source/cmTargetCompileFeaturesCommand.cxx +++ b/Source/cmTargetCompileFeaturesCommand.cxx @@ -21,7 +21,7 @@ bool cmTargetCompileFeaturesCommand::InitialPass( void cmTargetCompileFeaturesCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile features for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -30,7 +30,7 @@ void cmTargetCompileFeaturesCommand void cmTargetCompileFeaturesCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile features for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx index 3fb76a6..e16468b 100644 --- a/Source/cmTargetCompileOptionsCommand.cxx +++ b/Source/cmTargetCompileOptionsCommand.cxx @@ -20,7 +20,7 @@ bool cmTargetCompileOptionsCommand void cmTargetCompileOptionsCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile options for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -29,7 +29,7 @@ void cmTargetCompileOptionsCommand void cmTargetCompileOptionsCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile options for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx index e9f0e04..6dc58b1 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.cxx +++ b/Source/cmTargetIncludeDirectoriesCommand.cxx @@ -25,7 +25,7 @@ bool cmTargetIncludeDirectoriesCommand void cmTargetIncludeDirectoriesCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify include directories for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -35,7 +35,7 @@ void cmTargetIncludeDirectoriesCommand void cmTargetIncludeDirectoriesCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify include directories for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 56e1338..75c94c5 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -43,7 +43,7 @@ bool cmTargetLinkLibrariesCommand if(!this->Target) { cmake::MessageType t = cmake::FATAL_ERROR; // fail by default - cmOStringStream e; + std::ostringstream e; e << "Cannot specify link libraries for target \"" << args[0] << "\" " << "which is not built by this project."; // The bad target is the only argument. Check how policy CMP0016 is set, @@ -92,7 +92,7 @@ bool cmTargetLinkLibrariesCommand if(this->Target->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Object library target \"" << args[0] << "\" " << "may not link to anything."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -102,7 +102,7 @@ bool cmTargetLinkLibrariesCommand if (this->Target->GetType() == cmTarget::UTILITY) { - cmOStringStream e; + std::ostringstream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0039)) @@ -311,7 +311,7 @@ bool cmTargetLinkLibrariesCommand // Make sure the last argument was not a library type specifier. if(haveLLT) { - cmOStringStream e; + std::ostringstream e; e << "The \"" << this->LinkLibraryTypeNames[llt] << "\" argument must be followed by a library."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -342,7 +342,7 @@ void cmTargetLinkLibrariesCommand ::LinkLibraryTypeSpecifierWarning(int left, int right) { - cmOStringStream w; + std::ostringstream w; w << "Link library type specifier \"" << this->LinkLibraryTypeNames[left] << "\" is followed by specifier \"" << this->LinkLibraryTypeNames[right] << "\" instead of a library name. " @@ -373,7 +373,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, ? cmTarget::KeywordTLLSignature : cmTarget::PlainTLLSignature; if (!this->Target->PushTLLCommandTrace(sig)) { - cmOStringStream e; + std::ostringstream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0023)) diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index ce3b11e..5153926 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -24,7 +24,7 @@ bool cmTargetSourcesCommand void cmTargetSourcesCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify sources for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -34,7 +34,7 @@ void cmTargetSourcesCommand void cmTargetSourcesCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify sources for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index debe243..9473008 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -70,7 +70,7 @@ static void cmVariableWatchCommandVariableAccessed( { arg.FilePath = "Unknown"; arg.Line = 0; - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << arg.FilePath << ":" << arg.Line << ":\n" << "A command failed during the invocation of callback \"" @@ -83,7 +83,7 @@ static void cmVariableWatchCommandVariableAccessed( } if ( !processed ) { - cmOStringStream msg; + std::ostringstream msg; msg << "Variable \"" << variable << "\" was accessed using " << accessString << " with value \"" << (newValue?newValue:"") << "\"."; makefile->IssueMessage(cmake::LOG, msg.str()); @@ -135,7 +135,7 @@ bool cmVariableWatchCommand } if ( variable == "CMAKE_CURRENT_LIST_FILE" ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "cannot be set on the variable: " << variable; this->SetError(ostr.str()); return false; diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx index 391b874..1d3e0e9 100644 --- a/Source/cmXMLParser.cxx +++ b/Source/cmXMLParser.cxx @@ -54,7 +54,7 @@ int cmXMLParser::ParseFile(const char* file) return 0; } - cmOStringStream str; + std::ostringstream str; str << ifs.rdbuf(); return this->Parse(str.str().c_str()); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bbd3fe4..5edb7dd 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1182,7 +1182,7 @@ int cmake::DoPreConfigureChecks() srcList += "/CMakeLists.txt"; if(!cmSystemTools::FileExists(srcList.c_str())) { - cmOStringStream err; + std::ostringstream err; if(cmSystemTools::FileIsDirectory(this->GetHomeDirectory())) { err << "The source directory \"" << this->GetHomeDirectory() @@ -1250,7 +1250,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) } cmCacheManager::CacheIterator ci = this->CacheManager->NewIterator(); std::vector saved; - cmOStringStream warning; + std::ostringstream warning; warning << "You have changed variables that require your cache to be deleted.\n" << "Configure will be re-run and you may have to reset some variables.\n" @@ -1971,7 +1971,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake no build system arguments\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -1983,7 +1983,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake missing file: " << this->CheckBuildSystemArgument << "\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2003,7 +2003,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake error reading : " << this->CheckBuildSystemArgument << "\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2045,7 +2045,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake, missing byproduct: " << *pi << "\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -2068,7 +2068,7 @@ int cmake::CheckBuildSystem() // Not enough information was provided to do the test. Just rerun. if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake no CMAKE_MAKEFILE_DEPENDS " "or CMAKE_MAKEFILE_OUTPUTS :\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2094,7 +2094,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake: build system dependency is missing\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -2120,7 +2120,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake: build system output is missing\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -2138,7 +2138,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake file: " << out_oldest << " older than: " << dep_newest << "\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2563,7 +2563,7 @@ static bool cmakeCheckStampFile(const char* stampName) // The build system is up to date. The stamp file has been removed // by the VS IDE due to a "rebuild" request. Restore it atomically. - cmOStringStream stampTempStream; + std::ostringstream stampTempStream; stampTempStream << stampName << ".tmp" << cmSystemTools::RandomSeed(); std::string stampTempString = stampTempStream.str(); const char* stampTemp = stampTempString.c_str(); @@ -2627,7 +2627,7 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, cmListFileBacktrace backtrace = bt; backtrace.MakeRelative(); - cmOStringStream msg; + std::ostringstream msg; bool isError = false; // Construct the message header. if(t == cmake::FATAL_ERROR) @@ -2835,7 +2835,7 @@ void cmake::RunCheckForUnusedVariables() { #ifdef CMAKE_BUILD_WITH_CMAKE bool haveUnused = false; - cmOStringStream msg; + std::ostringstream msg; msg << "Manually-specified variables were not used by the project:"; for(std::map::const_iterator it = this->UsedCliVariables.begin(); diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 37d2916..d3d85a5 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -36,7 +36,7 @@ void CMakeCommandUsage(const char* program) { - cmOStringStream errorStream; + std::ostringstream errorStream; #ifdef CMAKE_BUILD_WITH_CMAKE errorStream diff --git a/Tests/CMakeLib/testXMLSafe.cxx b/Tests/CMakeLib/testXMLSafe.cxx index 60442fa..9e4960c 100644 --- a/Tests/CMakeLib/testXMLSafe.cxx +++ b/Tests/CMakeLib/testXMLSafe.cxx @@ -34,7 +34,7 @@ int testXMLSafe(int, char*[]) for(test_pair const* p = pairs; p->in; ++p) { cmXMLSafe xs(p->in); - cmOStringStream oss; + std::ostringstream oss; oss << xs; std::string out = oss.str(); if(out != p->out) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f194a009c8efeb6f2fd1f212dee678c54d4ef48d commit f194a009c8efeb6f2fd1f212dee678c54d4ef48d Author: Stephen Kelly AuthorDate: Mon Jan 5 20:30:33 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:10:15 2015 +0100 Remove unused cmIStringStream class. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 36f2535..df031b9 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -109,16 +109,6 @@ private: cmOStringStream(const cmOStringStream&); void operator=(const cmOStringStream&); }; -class cmIStringStream: public std::istringstream -{ -public: - typedef std::istringstream Superclass; - cmIStringStream() {} - cmIStringStream(const std::string& s): Superclass(s) {} -private: - cmIStringStream(const cmIStringStream&); - void operator=(const cmIStringStream&); -}; #else class cmOStrStreamCleanup { @@ -147,27 +137,6 @@ private: cmOStringStream(const cmOStringStream&); void operator=(const cmOStringStream&); }; - -class cmIStringStream: private std::string, public std::istrstream -{ -public: - typedef std::string StdString; - typedef std::istrstream IStrStream; - cmIStringStream(): StdString(), IStrStream(StdString::c_str()) {} - cmIStringStream(const std::string& s): - StdString(s), IStrStream(StdString::c_str()) {} - std::string str() const { return *this; } - void str(const std::string& s) - { - // Very dangerous. If this throws, the object is hosed. When the - // destructor is later called, the program is hosed too. - this->~cmIStringStream(); - new (this) cmIStringStream(s); - } -private: - cmIStringStream(const cmIStringStream&); - void operator=(const cmIStringStream&); -}; #endif /* Poison this operator to avoid common mistakes. */ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3ec1bb1537c41f58da2dc6715e4964a38d1b1043 commit 3ec1bb1537c41f58da2dc6715e4964a38d1b1043 Author: Stephen Kelly AuthorDate: Mon Jan 5 20:29:07 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:10:15 2015 +0100 cmStandardIncludes: Remove std namespace hack. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 5fbb67d..36f2535 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -87,11 +87,6 @@ #include #include -// if std:: is not supported, then just #define it away -#ifdef CMAKE_NO_STD_NAMESPACE -#define std -#endif - #if defined( _MSC_VER ) typedef unsigned short mode_t; #endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb3bce706a2d41efa034f5b8e71ad701982acf5d commit bb3bce706a2d41efa034f5b8e71ad701982acf5d Author: Stephen Kelly AuthorDate: Mon Jan 5 20:26:30 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:10:15 2015 +0100 cmStandardIncludes: Remove ANSI_FOR_SCOPE hack. All compilers hosting CMake support proper for scoping. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 6b40bba..5fbb67d 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -25,7 +25,6 @@ #pragma warning ( disable : 4786 ) #pragma warning ( disable : 4503 ) #pragma warning ( disable : 4512 ) /* operator=() could not be generated */ -#define CMAKE_NO_ANSI_FOR_SCOPE #endif @@ -93,12 +92,6 @@ #define std #endif -// if the compiler does not support ansi for scoping of vars use a -// #define hack -#ifdef CMAKE_NO_ANSI_FOR_SCOPE -#define for if(false) {} else for -#endif - #if defined( _MSC_VER ) typedef unsigned short mode_t; #endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28fa4923c3299f81659ad3ee644509ea3530fb14 commit 28fa4923c3299f81659ad3ee644509ea3530fb14 Author: Stephen Kelly AuthorDate: Mon Jan 5 20:10:58 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:10:15 2015 +0100 cmStandardIncludes: Remove iostreams workaround for obsolete Compaq compiler. It is no longer tested on the dashboard. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 981c75e..6b40bba 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -99,59 +99,10 @@ #define for if(false) {} else for #endif -#ifdef __DECCXX_VER -# if __DECCXX_VER <= 60390008 -# define CM_HAS_STD_BUT_NOT_FOR_IOSTREAM -# endif -#endif - #if defined( _MSC_VER ) typedef unsigned short mode_t; #endif - -#ifdef CM_HAS_STD_BUT_NOT_FOR_IOSTREAM -// some compilers have std:: but not for the stream library, -// so we have to bring it into the std namespace by hand. -namespace std { -using ::ostream; -using ::istream; -using ::ios; -using ::cout; -using ::cerr; -using ::cin; -using ::ifstream; -using ::ofstream; - -#if !defined(CMAKE_NO_ANSI_STRING_STREAM) - using ::ostringstream; - using ::istringstream; -#else - using ::ostrstream; - using ::istrstream; -#endif - -using ::endl; -using ::ends; -using ::flush; -using ::dec; -using ::hex; -using ::setw; -using ::setiosflags; -using ::setfill; -using ::setprecision; -} -// The string class is missing these operators so add them -#if !defined(cmsys_STL_STRING_NEQ_CHAR_DEFINED) -# define cmsys_STL_STRING_NO_NEQ_CHAR -inline bool operator!=(std::string const& a, const char* b) -{ return !(a==std::string(b)); } -#endif - -inline bool operator==(std::string const& a, const char* b) -{ return (a==std::string(b)); } -# endif // end CM_HAS_STD_BUT_NOT_FOR_IOSTREAM - // use this class to shrink the size of symbols in .o files // std::string is really basic_string<....lots of stuff....> // when combined with a map or set, the symbols can be > 2000 chars! http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=837a8a6312d543f1c46efa532f7d5b5dfb334bc9 commit 837a8a6312d543f1c46efa532f7d5b5dfb334bc9 Author: Stephen Kelly AuthorDate: Mon Jan 5 19:53:30 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:10:15 2015 +0100 cmStandardIncludes: Drop Comeau-related workaround. The compiler is not tested on the dashboard, and on Windows there are more-natural compilers to use to build CMake. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index d158b09..981c75e 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -88,19 +88,6 @@ #include #include -#if !defined(_WIN32) && defined(__COMO__) -// Hack for como strict mode to avoid defining _SVID_SOURCE or _BSD_SOURCE. -extern "C" -{ -extern FILE *popen (__const char *__command, __const char *__modes) __THROW; -extern int pclose (FILE *__stream) __THROW; -extern char *realpath (__const char *__restrict __name, - char *__restrict __resolved) __THROW; -extern char *strdup (__const char *__s) __THROW; -extern int putenv (char *__string) __THROW; -} -#endif - // if std:: is not supported, then just #define it away #ifdef CMAKE_NO_STD_NAMESPACE #define std http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4030ddfda8c715601e60e8f0322554f464497807 commit 4030ddfda8c715601e60e8f0322554f464497807 Author: Stephen Kelly AuthorDate: Mon Jan 5 19:52:37 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:10:14 2015 +0100 Remove Borland-related undef. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index ca85010..d158b09 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -43,7 +43,6 @@ // support the large integer types. #if defined(CMAKE_BUILD_WITH_CMAKE) # include -# undef GetCurrentDirectory // Borland includes windows.h #endif // Avoid warnings in system headers. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=17d6a6fd59efd98b1644d6f5441bbd36c19e1ffa commit 17d6a6fd59efd98b1644d6f5441bbd36c19e1ffa Author: Stephen Kelly AuthorDate: Mon Jan 5 19:50:34 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:10:14 2015 +0100 cmStandardIncludes: Remove comment about Borland. The code the comment refers to was removed in commit 2db55ffa (Remove borland workarounds., 2014-08-06) diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 692e94b..ca85010 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -89,17 +89,6 @@ #include #include -// Borland C++ defines several of the stdlib.h and string.h symbols in -// sub-headers search.h and mem.h. These sub-headers have using -// declarations to pull functions from the std namespace to the global -// namespace, but they are defined only if the header was not included -// through the C++-style cstdlib or cstring header. These outer -// headers are included by the streams library in C++-style and -// include blockers are put in place that prevent including the -// C-style versions from ever including the sub-headers. Therefore we -// have to include the sub-headers here to get the using declarations. - - #if !defined(_WIN32) && defined(__COMO__) // Hack for como strict mode to avoid defining _SVID_SOURCE or _BSD_SOURCE. extern "C" http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=26fb50114f37366c5c72ec76a1c09bfb2f94d19c commit 26fb50114f37366c5c72ec76a1c09bfb2f94d19c Author: Stephen Kelly AuthorDate: Mon Jan 5 19:48:33 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:10:14 2015 +0100 Drop SGI as a CMake host compiler. It has not been tested since commit v3.1.0-rc1~584^2 (Utilities/Release: Drop IRIX binary generation on ferrari, 2014-04-30). diff --git a/Source/CTest/cmCTestUpdateHandler.h b/Source/CTest/cmCTestUpdateHandler.h index 954c024..d2423c0 100644 --- a/Source/CTest/cmCTestUpdateHandler.h +++ b/Source/CTest/cmCTestUpdateHandler.h @@ -17,10 +17,6 @@ #include "cmCTestGenericHandler.h" #include "cmListFileCache.h" -#if defined(__sgi) && !defined(__GNUC__) -# pragma set woff 1375 /* base class destructor not virtual */ -#endif - /** \class cmCTestUpdateHandler * \brief A class that handles ctest -S invocations * @@ -70,8 +66,4 @@ private: bool SelectVCS(); }; -#if defined(__sgi) && !defined(__GNUC__) -# pragma reset woff 1375 /* base class destructor not virtual */ -#endif - #endif diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h index 791ac9b..6047ec5 100644 --- a/Source/CursesDialog/cmCursesStandardIncludes.h +++ b/Source/CursesDialog/cmCursesStandardIncludes.h @@ -22,25 +22,6 @@ #include -// This is a hack to prevent warnings about these functions being -// declared but not referenced. -#if defined(__sgi) && !defined(__GNUC__) -class cmCursesStandardIncludesHack -{ -public: - enum - { - Ref1 = sizeof(cfgetospeed(0)), - Ref2 = sizeof(cfgetispeed(0)), - Ref3 = sizeof(tcgetattr(0, 0)), - Ref4 = sizeof(tcsetattr(0, 0, 0)), - Ref5 = sizeof(cfsetospeed(0,0)), - Ref6 = sizeof(cfsetispeed(0,0)) - }; -}; -#endif - - // on some machines move erase and clear conflict with stl // so remove them from the namespace inline void curses_move(unsigned int x, unsigned int y) diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index 7adee7b..2aa6beb 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -15,10 +15,6 @@ #include "cmStandardIncludes.h" #include -#if defined(__sgi) && !defined(__GNUC__) -# pragma set woff 1375 /* base class destructor not virtual */ -#endif - // This is the first base class of cmGeneratedFileStream. It will be // created before and destroyed after the ofstream portion and can // therefore be used to manage the temporary file. @@ -146,8 +142,4 @@ private: cmGeneratedFileStream(cmGeneratedFileStream const&); // not implemented }; -#if defined(__sgi) && !defined(__GNUC__) -# pragma reset woff 1375 /* base class destructor not virtual */ -#endif - #endif diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index e4f5760..692e94b 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -37,28 +37,6 @@ // Provide fixed-size integer types. #include -#include // Work-around for SGI MIPSpro 7.4.2m header bug - -// This is a hack to prevent warnings about these functions being -// declared but not referenced. -#if defined(__sgi) && !defined(__GNUC__) -# pragma set woff 3970 /* conversion from pointer to same-sized */ -# include -class cmStandardIncludesHack -{ -public: - enum - { - Ref1 = sizeof(cfgetospeed(0)), - Ref2 = sizeof(cfgetispeed(0)), - Ref3 = sizeof(tcgetattr(0, 0)), - Ref4 = sizeof(tcsetattr(0, 0, 0)), - Ref5 = sizeof(cfsetospeed(0,0)), - Ref6 = sizeof(cfsetispeed(0,0)) - }; -}; -#endif - // Include stream compatibility layer from KWSys. // This is needed to work with large file support // on some platforms whose stream operators do not @@ -146,17 +124,6 @@ extern int putenv (char *__string) __THROW; #define for if(false) {} else for #endif -// check for the 720 compiler on the SGI -// which has some strange properties that I don't think are worth -// checking for in a general way in configure -#if defined(__sgi) && !defined(__GNUC__) -# if (_COMPILER_VERSION >= 730) -# define CM_SGI_CC_730 -# elif (_COMPILER_VERSION >= 720) -# define CM_HAS_STD_BUT_NOT_FOR_IOSTREAM -# endif -#endif - #ifdef __DECCXX_VER # if __DECCXX_VER <= 60390008 # define CM_HAS_STD_BUT_NOT_FOR_IOSTREAM @@ -208,11 +175,7 @@ inline bool operator!=(std::string const& a, const char* b) inline bool operator==(std::string const& a, const char* b) { return (a==std::string(b)); } -# endif // end CM_SGI_CC_720 - -#if defined(__sgi) && !defined(__GNUC__) -# pragma set woff 1375 /* base class destructor not virtual */ -#endif +# endif // end CM_HAS_STD_BUT_NOT_FOR_IOSTREAM // use this class to shrink the size of symbols in .o files // std::string is really basic_string<....lots of stuff....> @@ -327,10 +290,6 @@ public: typedef Superclass::const_iterator const_iterator; }; -#if defined(__sgi) && !defined(__GNUC__) -# pragma reset woff 1375 /* base class destructor not virtual */ -#endif - // All subclasses of cmCommand or cmCTestGenericHandler should // invoke this macro. #define cmTypeMacro(thisClass,superclass) \ diff --git a/Source/cmStandardLexer.h b/Source/cmStandardLexer.h index 981e03e..bd08ac7 100644 --- a/Source/cmStandardLexer.h +++ b/Source/cmStandardLexer.h @@ -25,12 +25,6 @@ # pragma warning ( disable : 4786 ) #endif -/* Make sure SGI termios does not define ECHO differently. */ -#if defined(__sgi) && !defined(__GNUC__) -# include -# undef ECHO -#endif - /* Define isatty on windows. */ #if defined(_WIN32) && !defined(__CYGWIN__) # include diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1c8c387..1d36ff5 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -79,10 +79,6 @@ public: #endif }; -#if defined(__sgi) && !defined(__GNUC__) -# pragma set woff 1375 /* base class destructor not virtual */ -#endif - #if !defined(HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE) // For GetEnvironmentVariables # if defined(_WIN32) ----------------------------------------------------------------------- Summary of changes: CompileFlags.cmake | 5 - Source/CMakeLists.txt | 6 - Source/CPack/IFW/cmCPackIFWInstaller.cxx | 2 +- Source/CPack/IFW/cmCPackIFWPackage.cxx | 2 +- Source/CPack/cmCPackBundleGenerator.cxx | 26 +-- Source/CPack/cmCPackDragNDropGenerator.cxx | 44 ++-- Source/CPack/cmCPackDragNDropGenerator.h | 4 +- Source/CPack/cmCPackGenerator.cxx | 2 +- Source/CPack/cmCPackGenerator.h | 2 +- Source/CPack/cmCPackLog.h | 2 +- Source/CPack/cmCPackNSISGenerator.cxx | 28 +-- Source/CPack/cmCPackNSISGenerator.h | 8 +- Source/CPack/cmCPackOSXX11Generator.cxx | 6 +- Source/CPack/cmCPackPackageMakerGenerator.cxx | 20 +- Source/CPack/cmCPackPackageMakerGenerator.h | 10 +- Source/CPack/cpack.cxx | 2 +- Source/CTest/cmCTestBuildAndTestHandler.cxx | 4 +- Source/CTest/cmCTestBuildAndTestHandler.h | 2 +- Source/CTest/cmCTestBuildCommand.cxx | 6 +- Source/CTest/cmCTestConfigureCommand.cxx | 2 +- Source/CTest/cmCTestCoverageHandler.cxx | 8 +- .../CTest/cmCTestEmptyBinaryDirectoryCommand.cxx | 2 +- Source/CTest/cmCTestGenericHandler.cxx | 4 +- Source/CTest/cmCTestHandlerCommand.cxx | 6 +- Source/CTest/cmCTestMemCheckHandler.cxx | 12 +- Source/CTest/cmCTestMultiProcessHandler.cxx | 2 +- Source/CTest/cmCTestRunScriptCommand.cxx | 2 +- Source/CTest/cmCTestRunTest.cxx | 2 +- Source/CTest/cmCTestScriptHandler.cxx | 2 +- Source/CTest/cmCTestStartCommand.cxx | 2 +- Source/CTest/cmCTestSubmitCommand.cxx | 4 +- Source/CTest/cmCTestTestCommand.cxx | 2 +- Source/CTest/cmCTestTestHandler.cxx | 4 +- Source/CTest/cmCTestUpdateHandler.cxx | 2 +- Source/CTest/cmCTestUpdateHandler.h | 8 - Source/CTest/cmCTestUploadCommand.cxx | 2 +- Source/CTest/cmCTestVC.cxx | 2 +- Source/CursesDialog/cmCursesStandardIncludes.h | 19 -- Source/cmAddCustomCommandCommand.cxx | 8 +- Source/cmAddCustomTargetCommand.cxx | 6 +- Source/cmAddDependenciesCommand.cxx | 6 +- Source/cmAddExecutableCommand.cxx | 14 +- Source/cmAddLibraryCommand.cxx | 46 ++-- Source/cmAddSubDirectoryCommand.cxx | 2 +- Source/cmAddTestCommand.cxx | 6 +- Source/cmBreakCommand.cxx | 4 +- Source/cmBuildCommand.cxx | 2 +- Source/cmCMakeMinimumRequired.cxx | 6 +- Source/cmCMakePolicyCommand.cxx | 8 +- Source/cmCPluginAPI.cxx | 2 +- Source/cmCTest.cxx | 6 +- Source/cmCTest.h | 2 +- Source/cmCommandArgumentParserHelper.cxx | 10 +- Source/cmComputeLinkDepends.cxx | 2 +- Source/cmComputeLinkInformation.cxx | 12 +- Source/cmComputeTargetDepends.cxx | 4 +- Source/cmConditionEvaluator.cxx | 6 +- Source/cmConfigure.cmake.h.in | 4 - Source/cmConfigureFileCommand.cxx | 2 +- Source/cmCoreTryCompile.cxx | 14 +- Source/cmDefinePropertyCommand.cxx | 4 +- Source/cmDepends.cxx | 8 +- Source/cmELF.cxx | 2 +- Source/cmExecuteProcessCommand.cxx | 2 +- Source/cmExportBuildFileGenerator.cxx | 6 +- Source/cmExportCommand.cxx | 26 +-- Source/cmExportFileGenerator.cxx | 14 +- Source/cmExportInstallFileGenerator.cxx | 8 +- Source/cmExprParserHelper.cxx | 2 +- Source/cmExtraCodeLiteGenerator.cxx | 4 +- Source/cmFileCommand.cxx | 98 ++++----- Source/cmFindPackageCommand.cxx | 18 +- Source/cmForEachCommand.cxx | 4 +- Source/cmFunctionCommand.cxx | 4 +- Source/cmGeneratedFileStream.h | 8 - Source/cmGeneratorExpressionDAGChecker.cxx | 6 +- Source/cmGeneratorExpressionEvaluationFile.cxx | 6 +- Source/cmGeneratorExpressionEvaluator.cxx | 14 +- Source/cmGeneratorTarget.cxx | 4 +- Source/cmGetPropertyCommand.cxx | 12 +- Source/cmGetTargetPropertyCommand.cxx | 2 +- Source/cmGlobalGenerator.cxx | 24 +-- Source/cmGlobalNinjaGenerator.cxx | 8 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 6 +- Source/cmGlobalVisualStudio10Generator.cxx | 16 +- Source/cmGlobalVisualStudio11Generator.cxx | 4 +- Source/cmGlobalVisualStudio12Generator.cxx | 4 +- Source/cmGlobalXCodeGenerator.cxx | 8 +- Source/cmGraphVizWriter.cxx | 4 +- Source/cmIncludeCommand.cxx | 2 +- Source/cmInstallCommand.cxx | 82 +++---- Source/cmInstallExportGenerator.cxx | 2 +- Source/cmInstallTargetGenerator.cxx | 8 +- Source/cmLinkDirectoriesCommand.cxx | 2 +- Source/cmListCommand.cxx | 8 +- Source/cmListFileCache.cxx | 16 +- Source/cmLoadCommandCommand.cxx | 2 +- Source/cmLocalGenerator.cxx | 30 +-- Source/cmLocalNinjaGenerator.cxx | 4 +- Source/cmLocalUnixMakefileGenerator3.cxx | 10 +- Source/cmLocalVisualStudio6Generator.cxx | 4 +- Source/cmLocalVisualStudio7Generator.cxx | 4 +- Source/cmMacroCommand.cxx | 2 +- Source/cmMakefile.cxx | 78 +++---- Source/cmMakefileExecutableTargetGenerator.cxx | 4 +- Source/cmMakefileLibraryTargetGenerator.cxx | 6 +- Source/cmMakefileTargetGenerator.cxx | 8 +- Source/cmNinjaNormalTargetGenerator.cxx | 10 +- Source/cmNinjaTargetGenerator.cxx | 4 +- Source/cmOrderDirectories.cxx | 8 +- Source/cmPolicies.cxx | 16 +- Source/cmProjectCommand.cxx | 2 +- Source/cmSeparateArgumentsCommand.cxx | 2 +- Source/cmSetPropertyCommand.cxx | 20 +- Source/cmSourceFile.cxx | 2 +- Source/cmSourceGroupCommand.cxx | 2 +- Source/cmStandardIncludes.cxx | 16 -- Source/cmStandardIncludes.h | 225 +------------------- Source/cmStandardLexer.h | 6 - Source/cmStringCommand.cxx | 14 +- Source/cmSystemTools.cxx | 6 +- Source/cmTarget.cxx | 76 +++---- Source/cmTarget.h | 2 +- Source/cmTargetCompileDefinitionsCommand.cxx | 4 +- Source/cmTargetCompileFeaturesCommand.cxx | 4 +- Source/cmTargetCompileOptionsCommand.cxx | 4 +- Source/cmTargetIncludeDirectoriesCommand.cxx | 4 +- Source/cmTargetLinkLibrariesCommand.cxx | 12 +- Source/cmTargetSourcesCommand.cxx | 4 +- Source/cmVariableWatchCommand.cxx | 6 +- Source/cmXMLParser.cxx | 2 +- Source/cmake.cxx | 26 +-- Source/cmcmd.cxx | 2 +- Tests/CMakeLib/testXMLSafe.cxx | 2 +- bootstrap | 30 --- 135 files changed, 614 insertions(+), 935 deletions(-) delete mode 100644 Source/cmStandardIncludes.cxx hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 8 16:32:38 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 8 Jan 2015 16:32:38 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1576-g7f21811 Message-ID: <20150108213238.5A703A9F3D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7f218113baea90ff726b2f72be85242d038a60ba (commit) via 55a73e6b1f70b3c8a783b130dff4c4689cea5ba2 (commit) via 8dc8d756bc278cd02f329b31218c2459908dc0bb (commit) via b5813ceeb5b5f78351dd9f9c6af904db2f4451c9 (commit) from 94c538fe4db0eec3c5f059f57882d47f8cc4a272 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f218113baea90ff726b2f72be85242d038a60ba commit 7f218113baea90ff726b2f72be85242d038a60ba Merge: 94c538f 55a73e6 Author: Stephen Kelly AuthorDate: Thu Jan 8 16:32:36 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 16:32:36 2015 -0500 Merge topic 'join-algorithm' into next 55a73e6b Use the cmJoin algorithm where possible. 8dc8d756 cmStandardIncludes: Add a join algorithm for string containers. b5813cee cmInstallCommand: Remove unused variable. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=55a73e6b1f70b3c8a783b130dff4c4689cea5ba2 commit 55a73e6b1f70b3c8a783b130dff4c4689cea5ba2 Author: Stephen Kelly AuthorDate: Wed Jan 7 08:58:51 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:28:18 2015 +0100 Use the cmJoin algorithm where possible. diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index f4fa5c6..09bd58c 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -448,18 +448,7 @@ std::string cmComputeLinkInformation::GetRPathLinkString() } // Construct the linker runtime search path. - std::string rpath_link; - const char* sep = ""; - std::vector const& dirs = - this->OrderDependentRPath->GetOrderedDirectories(); - for(std::vector::const_iterator di = dirs.begin(); - di != dirs.end(); ++di) - { - rpath_link += sep; - sep = ":"; - rpath_link += *di; - } - return rpath_link; + return cmJoin(this->OrderDependentRPath->GetOrderedDirectories(), ":"); } //---------------------------------------------------------------------------- @@ -1999,18 +1988,7 @@ std::string cmComputeLinkInformation::GetRPathString(bool for_install) this->GetRPath(runtimeDirs, for_install); // Concatenate the paths. - std::string rpath; - const char* sep = ""; - for(std::vector::const_iterator ri = runtimeDirs.begin(); - ri != runtimeDirs.end(); ++ri) - { - // Separate from previous path. - rpath += sep; - sep = this->GetRuntimeSep().c_str(); - - // Add this path. - rpath += *ri; - } + std::string rpath = cmJoin(runtimeDirs, this->GetRuntimeSep()); // If the rpath will be replaced at install time, prepare space. if(!for_install && this->RuntimeUseChrpath) diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 7ddf4d0..11c0c65 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -803,18 +803,9 @@ static const struct JoinNode : public cmGeneratorExpressionNode const GeneratorExpressionContent *, cmGeneratorExpressionDAGChecker *) const { - std::string result; - std::vector list; cmSystemTools::ExpandListArgument(parameters.front(), list); - std::string sep; - for(std::vector::const_iterator li = list.begin(); - li != list.end(); ++li) - { - result += sep + *li; - sep = parameters[1]; - } - return result; + return cmJoin(list, parameters[1]); } } joinNode; diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 12bb867..7997720 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -777,18 +777,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) this->Makefile->GetLocalGenerator()->GetGlobalGenerator() ->GetExportSets()[exports.GetString()]->AddTargetExport(te); - std::vector dirs = includesArgs.GetIncludeDirs(); - if(!dirs.empty()) - { - const char *sep = ""; - for (std::vector::const_iterator it = dirs.begin(); - it != dirs.end(); ++it) - { - te->InterfaceIncludeDirectories += sep; - te->InterfaceIncludeDirectories += *it; - sep = ";"; - } - } + te->InterfaceIncludeDirectories = + cmJoin(includesArgs.GetIncludeDirs(), ";"); } } diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index f1ea088..b58f240 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -353,15 +353,7 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) cnt ++; } - std::string value; - const char* sep = ""; - for ( cc = 0; cc < varArgsExpanded.size(); cc ++ ) - { - value += sep; - value += varArgsExpanded[cc]; - sep = ";"; - } - + std::string value = cmJoin(varArgsExpanded, ";"); this->Makefile->AddDefinition(listName, value.c_str()); return true; } @@ -402,15 +394,8 @@ bool cmListCommand } } - std::string value; - const char* sep = ""; - for ( cc = 0; cc < varArgsExpanded.size(); cc ++ ) - { - value += sep; - value += varArgsExpanded[cc]; - sep = ";"; - } + std::string value = cmJoin(varArgsExpanded, ";"); this->Makefile->AddDefinition(listName, value.c_str()); return true; } @@ -518,16 +503,7 @@ bool cmListCommand std::sort(varArgsExpanded.begin(), varArgsExpanded.end()); - std::string value; - std::vector::iterator it; - const char* sep = ""; - for ( it = varArgsExpanded.begin(); it != varArgsExpanded.end(); ++ it ) - { - value += sep; - value += it->c_str(); - sep = ";"; - } - + std::string value = cmJoin(varArgsExpanded, ";"); this->Makefile->AddDefinition(listName, value.c_str()); return true; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 20dae5a..590aa5f 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1791,22 +1791,12 @@ void cmMakefile::AddIncludeDirectories(const std::vector &incs, return; } - std::string incString; - std::string sep; - - for(std::vector::const_iterator li = incs.begin(); - li != incs.end(); ++li) - { - incString += sep + *li; - sep = ";"; - } - std::vector::iterator position = before ? this->IncludeDirectoriesEntries.begin() : this->IncludeDirectoriesEntries.end(); cmListFileBacktrace lfbt = this->GetBacktrace(); - cmValueWithOrigin entry(incString, lfbt); + cmValueWithOrigin entry(cmJoin(incs, ";"), lfbt); this->IncludeDirectoriesEntries.insert(position, entry); // Property on each target: diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index a01a384..ec9f7c7 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -224,16 +224,7 @@ std::string cmQtAutoGenerators::ListQt5RccInputs(cmSourceFile* sf, } } depends.insert(depends.end(), qrcEntries.begin(), qrcEntries.end()); - std::string entriesList; - const char* sep = ""; - for(std::vector::const_iterator it = qrcEntries.begin(); - it != qrcEntries.end(); ++it) - { - entriesList += sep; - entriesList += *it; - sep = "@list_sep@"; - } - return entriesList; + return cmJoin(qrcEntries, "@list_sep@"); } std::string cmQtAutoGenerators::ListQt4RccInputs(cmSourceFile* sf, @@ -512,29 +503,13 @@ static void GetCompileDefinitionsAndDirectories(cmTarget const* target, // Get the include dirs for this target, without stripping the implicit // include dirs off, see http://public.kitware.com/Bug/view.php?id=13667 localGen->GetIncludeDirectories(includeDirs, gtgt, "CXX", config, false); - const char* sep = ""; - incs = ""; - for(std::vector::const_iterator incDirIt = includeDirs.begin(); - incDirIt != includeDirs.end(); - ++incDirIt) - { - incs += sep; - sep = ";"; - incs += *incDirIt; - } + + incs = cmJoin(includeDirs, ";"); std::set defines; localGen->AddCompileDefinitions(defines, target, config); - sep = ""; - for(std::set::const_iterator defIt = defines.begin(); - defIt != defines.end(); - ++defIt) - { - defs += sep; - sep = ";"; - defs += *defIt; - } + defs += cmJoin(defines, ";"); } void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target) @@ -879,16 +854,7 @@ static void GetUicOpts(cmTarget const* target, const std::string& config, { std::vector opts; target->GetAutoUicOptions(opts, config); - - const char* sep = ""; - for(std::vector::const_iterator optIt = opts.begin(); - optIt != opts.end(); - ++optIt) - { - optString += sep; - sep = ";"; - optString += *optIt; - } + optString = cmJoin(opts, ";"); } void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target, diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx index cca995b..f4607c6 100644 --- a/Source/cmRST.cxx +++ b/Source/cmRST.cxx @@ -417,14 +417,7 @@ void cmRST::ProcessDirectiveReplace() { // Record markup lines as replacement text. std::string& replacement = this->Replace[this->ReplaceName]; - const char* sep = ""; - for(std::vector::iterator i = this->MarkupLines.begin(); - i != this->MarkupLines.end(); ++i) - { - replacement += sep; - replacement += *i; - sep = " "; - } + replacement += cmJoin(this->MarkupLines, " "); this->ReplaceName = ""; } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1c8c387..28dd619 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -828,18 +828,12 @@ bool cmSystemTools::RunSingleCommand( std::string cmSystemTools::PrintSingleCommand(std::vector const& command) { - std::string commandStr; - const char* sep = ""; - for(std::vector::const_iterator i = command.begin(); - i != command.end(); ++i) - { - commandStr += sep; - commandStr += "\""; - commandStr += *i; - commandStr += "\""; - sep = " "; - } - return commandStr; + if (command.empty()) + { + return std::string(); + } + + return "\"" + cmJoin(command, "\" \"") + "\""; } bool cmSystemTools::DoesFileExistWithExtensions( diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 94a6de3..52b8727 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -923,16 +923,7 @@ void cmTarget::GetSourceFiles(std::vector &files, //---------------------------------------------------------------------------- void cmTarget::AddTracedSources(std::vector const& srcs) { - std::string srcFiles; - const char* sep = ""; - for(std::vector::const_iterator i = srcs.begin(); - i != srcs.end(); ++i) - { - std::string filename = *i; - srcFiles += sep; - srcFiles += filename; - sep = ";"; - } + std::string srcFiles = cmJoin(srcs, ";"); if (!srcFiles.empty()) { this->Internal->SourceFilesMap.clear(); @@ -6088,24 +6079,8 @@ cmTargetInternals::ComputeLinkInterfaceLibraries( } if (ifaceLibs != iface.Libraries) { - std::string oldLibraries; - std::string newLibraries; - const char *sep = ""; - for(std::vector::const_iterator it - = impl->Libraries.begin(); it != impl->Libraries.end(); ++it) - { - oldLibraries += sep; - oldLibraries += *it; - sep = ";"; - } - sep = ""; - for(std::vector::const_iterator it - = ifaceLibs.begin(); it != ifaceLibs.end(); ++it) - { - newLibraries += sep; - newLibraries += *it; - sep = ";"; - } + std::string oldLibraries = cmJoin(impl->Libraries, ";"); + std::string newLibraries = cmJoin(ifaceLibs, ";"); if(oldLibraries.empty()) { oldLibraries = "(empty)"; } if(newLibraries.empty()) diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx index 10daad4..82ce1e3 100644 --- a/Source/cmTargetCompileFeaturesCommand.cxx +++ b/Source/cmTargetCompileFeaturesCommand.cxx @@ -40,15 +40,7 @@ void cmTargetCompileFeaturesCommand std::string cmTargetCompileFeaturesCommand ::Join(const std::vector &content) { - std::string defs; - std::string sep; - for(std::vector::const_iterator it = content.begin(); - it != content.end(); ++it) - { - defs += sep + *it; - sep = ";"; - } - return defs; + return cmJoin(content, ";"); } //---------------------------------------------------------------------------- diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx index 3fb76a6..e1d9b4f 100644 --- a/Source/cmTargetCompileOptionsCommand.cxx +++ b/Source/cmTargetCompileOptionsCommand.cxx @@ -39,15 +39,7 @@ void cmTargetCompileOptionsCommand std::string cmTargetCompileOptionsCommand ::Join(const std::vector &content) { - std::string defs; - std::string sep; - for(std::vector::const_iterator it = content.begin(); - it != content.end(); ++it) - { - defs += sep + *it; - sep = ";"; - } - return defs; + return cmJoin(content, ";"); } //---------------------------------------------------------------------------- diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx index e9f0e04..cf8b656 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.cxx +++ b/Source/cmTargetIncludeDirectoriesCommand.cxx @@ -91,15 +91,7 @@ void cmTargetIncludeDirectoriesCommand if (system) { - std::string joined; - std::string sep; - for(std::vector::const_iterator it = content.begin(); - it != content.end(); ++it) - { - joined += sep; - sep = ";"; - joined += *it; - } + std::string joined = cmJoin(content, ";"); tgt->AppendProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES", joined.c_str()); } diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index ce3b11e..31a47b7 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -44,15 +44,7 @@ void cmTargetSourcesCommand std::string cmTargetSourcesCommand ::Join(const std::vector &content) { - std::string srcs; - std::string sep; - for(std::vector::const_iterator it = content.begin(); - it != content.end(); ++it) - { - srcs += sep + *it; - sep = ";"; - } - return srcs; + return cmJoin(content, ";"); } //---------------------------------------------------------------------------- diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bbd3fe4..d155d64 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2320,14 +2320,7 @@ const char *cmake::GetProperty(const std::string& prop, { std::vector enLangs; this->GlobalGenerator->GetEnabledLanguages(enLangs); - const char* sep = ""; - for(std::vector::iterator i = enLangs.begin(); - i != enLangs.end(); ++i) - { - lang += sep; - sep = ";"; - lang += *i; - } + lang = cmJoin(enLangs, ";"); } this->SetProperty("ENABLED_LANGUAGES", lang.c_str()); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8dc8d756bc278cd02f329b31218c2459908dc0bb commit 8dc8d756bc278cd02f329b31218c2459908dc0bb Author: Stephen Kelly AuthorDate: Wed Jan 7 08:21:29 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:28:18 2015 +0100 cmStandardIncludes: Add a join algorithm for string containers. This requires the input range to supply BidirectionalIterators, which is not a problem for where it is currently useful to us. The alternative would be to not invoke --last;, and instead create an output iterator similar to std::ostream_iterator, but which puts the delimiter before the item to output. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index e4f5760..d7c6a65 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -358,6 +358,33 @@ static thisClass* SafeDownCast(cmObject *c) \ } \ class cmTypeMacro_UseTrailingSemicolon +template +std::string cmJoin(Range const& r, const char* delimiter) +{ + if (r.empty()) + { + return std::string(); + } + std::ostringstream os; + typedef typename Range::value_type ValueType; + typedef typename Range::const_iterator InputIt; + InputIt first = r.begin(); + InputIt last = r.end(); + --last; + std::copy(first, last, + std::ostream_iterator(os, delimiter)); + + os << *last; + + return os.str(); +} + +template +std::string cmJoin(Range const& r, std::string delimiter) +{ + return cmJoin(r, delimiter.c_str()); +}; + inline bool cmHasLiteralPrefixImpl(const std::string &str1, const char *str2, size_t N) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b5813ceeb5b5f78351dd9f9c6af904db2f4451c9 commit b5813ceeb5b5f78351dd9f9c6af904db2f4451c9 Author: Stephen Kelly AuthorDate: Tue Jan 6 01:15:47 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 22:25:18 2015 +0100 cmInstallCommand: Remove unused variable. diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index c3c9c55..12bb867 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -780,7 +780,6 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) std::vector dirs = includesArgs.GetIncludeDirs(); if(!dirs.empty()) { - std::string dirString; const char *sep = ""; for (std::vector::const_iterator it = dirs.begin(); it != dirs.end(); ++it) ----------------------------------------------------------------------- Summary of changes: Source/cmComputeLinkInformation.cxx | 26 ++------------- Source/cmGeneratorExpressionEvaluator.cxx | 11 +------ Source/cmInstallCommand.cxx | 15 ++------- Source/cmListCommand.cxx | 30 ++---------------- Source/cmMakefile.cxx | 12 +------ Source/cmQtAutoGenerators.cxx | 44 +++----------------------- Source/cmRST.cxx | 9 +----- Source/cmStandardIncludes.h | 27 ++++++++++++++++ Source/cmSystemTools.cxx | 18 ++++------- Source/cmTarget.cxx | 31 ++---------------- Source/cmTargetCompileFeaturesCommand.cxx | 10 +----- Source/cmTargetCompileOptionsCommand.cxx | 10 +----- Source/cmTargetIncludeDirectoriesCommand.cxx | 10 +----- Source/cmTargetSourcesCommand.cxx | 10 +----- Source/cmake.cxx | 9 +----- 15 files changed, 56 insertions(+), 216 deletions(-) hooks/post-receive -- CMake From ben.boeckel at kitware.com Thu Jan 8 16:55:39 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Thu, 8 Jan 2015 16:55:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1581-gfb08194 Message-ID: <20150108215539.050B6A97B5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fb08194fa34fa33379de6c01cf72278d1da4bf90 (commit) via 9ec446a86e5049ead95f35208f8844a5b1c817d5 (commit) via 95b3b096474932430f04433fc61a422239333b02 (commit) via bfc4b17aeb9fa6d2843f655052ac2c1a563bc25f (commit) via 5008f9da62218ba204dc0f1161d8ef39307fe061 (commit) from 7f218113baea90ff726b2f72be85242d038a60ba (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fb08194fa34fa33379de6c01cf72278d1da4bf90 commit fb08194fa34fa33379de6c01cf72278d1da4bf90 Merge: 7f21811 9ec446a Author: Ben Boeckel AuthorDate: Thu Jan 8 16:55:37 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 16:55:37 2015 -0500 Merge topic 'fix-empty-target-property-queries' into next 9ec446a8 tests: add tests for querying properties 95b3b096 set_tests_properties: fix documentation bfc4b17a get_test_property: clarify the documentation 5008f9da cmGetTargetPropertyCommand: discern empty from undefined properties http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ec446a86e5049ead95f35208f8844a5b1c817d5 commit 9ec446a86e5049ead95f35208f8844a5b1c817d5 Author: Ben Boeckel AuthorDate: Thu Jan 8 15:27:46 2015 -0500 Commit: Ben Boeckel CommitDate: Thu Jan 8 16:33:31 2015 -0500 tests: add tests for querying properties diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index b5e41d9..05c51cc 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -173,3 +173,4 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) +add_RunCMake_test(get_property) diff --git a/Tests/RunCMake/get_property/CMakeLists.txt b/Tests/RunCMake/get_property/CMakeLists.txt new file mode 100644 index 0000000..12cd3c7 --- /dev/null +++ b/Tests/RunCMake/get_property/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/get_property/RunCMakeTest.cmake b/Tests/RunCMake/get_property/RunCMakeTest.cmake new file mode 100644 index 0000000..e5700a2 --- /dev/null +++ b/Tests/RunCMake/get_property/RunCMakeTest.cmake @@ -0,0 +1,9 @@ +include(RunCMake) + +#run_cmake(cache_properties) +run_cmake(directory_properties) +run_cmake(global_properties) +run_cmake(install_properties) +run_cmake(source_properties) +run_cmake(target_properties) +run_cmake(test_properties) diff --git a/Tests/RunCMake/get_property/cache_properties-stderr.txt b/Tests/RunCMake/get_property/cache_properties-stderr.txt new file mode 100644 index 0000000..b1a2987 --- /dev/null +++ b/Tests/RunCMake/get_property/cache_properties-stderr.txt @@ -0,0 +1,3 @@ +^get_property: --><-- +get_property: -->value<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/cache_properties.cmake b/Tests/RunCMake/get_property/cache_properties.cmake new file mode 100644 index 0000000..e41adfd --- /dev/null +++ b/Tests/RunCMake/get_property/cache_properties.cmake @@ -0,0 +1,14 @@ +function (check_cache_property var prop) + get_property(gp_val + CACHE "${var}" + PROPERTY "${prop}") + + message("get_property: -->${gp_val}<--") +endfunction () + +set(var val CACHE STRING "doc") +set_property(CACHE var PROPERTY empty "" custom value) + +check_cache_property(var empty) +check_cache_property(var custom) +check_cache_property(var noexist) diff --git a/Tests/RunCMake/get_property/directory_properties-stderr.txt b/Tests/RunCMake/get_property/directory_properties-stderr.txt new file mode 100644 index 0000000..80c9877 --- /dev/null +++ b/Tests/RunCMake/get_property/directory_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_directory_property: --><-- +get_property: --><-- +get_directory_property: -->value<-- +get_property: -->value<-- +get_directory_property: --><-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/directory_properties.cmake b/Tests/RunCMake/get_property/directory_properties.cmake new file mode 100644 index 0000000..b0a9b1b --- /dev/null +++ b/Tests/RunCMake/get_property/directory_properties.cmake @@ -0,0 +1,15 @@ +function (check_directory_property dir prop) + get_directory_property(gdp_val DIRECTORY "${dir}" "${prop}") + get_property(gp_val + DIRECTORY "${dir}" + PROPERTY "${prop}") + + message("get_directory_property: -->${gdp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +set_directory_properties(PROPERTIES empty "" custom value) + +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" empty) +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" custom) +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" noexist) diff --git a/Tests/RunCMake/get_property/global_properties-stderr.txt b/Tests/RunCMake/get_property/global_properties-stderr.txt new file mode 100644 index 0000000..b1a2987 --- /dev/null +++ b/Tests/RunCMake/get_property/global_properties-stderr.txt @@ -0,0 +1,3 @@ +^get_property: --><-- +get_property: -->value<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/global_properties.cmake b/Tests/RunCMake/get_property/global_properties.cmake new file mode 100644 index 0000000..5656a45 --- /dev/null +++ b/Tests/RunCMake/get_property/global_properties.cmake @@ -0,0 +1,14 @@ +function (check_global_property prop) + get_property(gp_val + GLOBAL + PROPERTY "${prop}") + + message("get_property: -->${gp_val}<--") +endfunction () + +set_property(GLOBAL PROPERTY empty "") +set_property(GLOBAL PROPERTY custom value) + +check_global_property(empty) +check_global_property(custom) +check_global_property(noexist) diff --git a/Tests/RunCMake/get_property/install_properties-stderr.txt b/Tests/RunCMake/get_property/install_properties-stderr.txt new file mode 100644 index 0000000..b1a2987 --- /dev/null +++ b/Tests/RunCMake/get_property/install_properties-stderr.txt @@ -0,0 +1,3 @@ +^get_property: --><-- +get_property: -->value<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/install_properties.cmake b/Tests/RunCMake/get_property/install_properties.cmake new file mode 100644 index 0000000..aa89225 --- /dev/null +++ b/Tests/RunCMake/get_property/install_properties.cmake @@ -0,0 +1,18 @@ +function (check_install_property file prop) + get_property(gp_val + INSTALL "${file}" + PROPERTY "${prop}") + + message("get_property: -->${gp_val}<--") +endfunction () + +install( + FILES "${CMAKE_CURRENT_LIST_FILE}" + DESTINATION "${CMAKE_CURRENT_LIST_DIR}" + RENAME "installed-file-dest") +set_property(INSTALL "${CMAKE_CURRENT_LIST_FILE}" PROPERTY empty "") +set_property(INSTALL "${CMAKE_CURRENT_LIST_FILE}" PROPERTY custom value) + +check_install_property("${CMAKE_CURRENT_LIST_FILE}" empty) +check_install_property("${CMAKE_CURRENT_LIST_FILE}" custom) +check_install_property("${CMAKE_CURRENT_LIST_FILE}" noexist) diff --git a/Tests/RunCMake/get_property/source_properties-stderr.txt b/Tests/RunCMake/get_property/source_properties-stderr.txt new file mode 100644 index 0000000..0a46f96 --- /dev/null +++ b/Tests/RunCMake/get_property/source_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_source_file_property: --><-- +get_property: --><-- +get_source_file_property: -->value<-- +get_property: -->value<-- +get_source_file_property: -->NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/source_properties.cmake b/Tests/RunCMake/get_property/source_properties.cmake new file mode 100644 index 0000000..263ffe1 --- /dev/null +++ b/Tests/RunCMake/get_property/source_properties.cmake @@ -0,0 +1,15 @@ +function (check_source_file_property file prop) + get_source_file_property(gsfp_val "${file}" "${prop}") + get_property(gp_val + SOURCE "${file}" + PROPERTY "${prop}") + + message("get_source_file_property: -->${gsfp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +set_source_files_properties(file.c PROPERTIES empty "" custom value) + +check_source_file_property(file.c empty) +check_source_file_property(file.c custom) +check_source_file_property(file.c noexist) diff --git a/Tests/RunCMake/get_property/target_properties-stderr.txt b/Tests/RunCMake/get_property/target_properties-stderr.txt new file mode 100644 index 0000000..d0981ac --- /dev/null +++ b/Tests/RunCMake/get_property/target_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_target_property: --><-- +get_property: --><-- +get_target_property: -->value<-- +get_property: -->value<-- +get_target_property: -->gtp_val-NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/target_properties.cmake b/Tests/RunCMake/get_property/target_properties.cmake new file mode 100644 index 0000000..c5a141d --- /dev/null +++ b/Tests/RunCMake/get_property/target_properties.cmake @@ -0,0 +1,16 @@ +function (check_target_property target prop) + get_target_property(gtp_val "${target}" "${prop}") + get_property(gp_val + TARGET "${target}" + PROPERTY "${prop}") + + message("get_target_property: -->${gtp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +add_custom_target(tgt) +set_target_properties(tgt PROPERTIES empty "" custom value) + +check_target_property(tgt empty) +check_target_property(tgt custom) +check_target_property(tgt noexist) diff --git a/Tests/RunCMake/get_property/test_properties-stderr.txt b/Tests/RunCMake/get_property/test_properties-stderr.txt new file mode 100644 index 0000000..a447280 --- /dev/null +++ b/Tests/RunCMake/get_property/test_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_test_property: --><-- +get_property: --><-- +get_test_property: -->value<-- +get_property: -->value<-- +get_test_property: -->NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/test_properties.cmake b/Tests/RunCMake/get_property/test_properties.cmake new file mode 100644 index 0000000..1d0295c --- /dev/null +++ b/Tests/RunCMake/get_property/test_properties.cmake @@ -0,0 +1,17 @@ +function (check_test_property test prop) + get_test_property("${test}" "${prop}" gtp_val) + get_property(gp_val + TEST "${test}" + PROPERTY "${prop}") + + message("get_test_property: -->${gtp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +include(CTest) +add_test(NAME test COMMAND "${CMAKE_COMMAND}" --help) +set_tests_properties(test PROPERTIES empty "" custom value) + +check_test_property(test empty) +check_test_property(test custom) +check_test_property(test noexist) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95b3b096474932430f04433fc61a422239333b02 commit 95b3b096474932430f04433fc61a422239333b02 Author: Ben Boeckel AuthorDate: Thu Jan 8 16:19:26 2015 -0500 Commit: Ben Boeckel CommitDate: Thu Jan 8 16:33:31 2015 -0500 set_tests_properties: fix documentation The error is raised if the *test* doesn't exist, not the property. diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst index e29d690..afac847 100644 --- a/Help/command/set_tests_properties.rst +++ b/Help/command/set_tests_properties.rst @@ -7,7 +7,7 @@ Set a property of the tests. set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2) -Set a property for the tests. If the property is not found, CMake +Set a property for the tests. If the test is not found, CMake will report an error. Generator expressions will be expanded the same as supported by the test's add_test call. The properties include: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bfc4b17aeb9fa6d2843f655052ac2c1a563bc25f commit bfc4b17aeb9fa6d2843f655052ac2c1a563bc25f Author: Ben Boeckel AuthorDate: Thu Jan 8 16:18:46 2015 -0500 Commit: Ben Boeckel CommitDate: Thu Jan 8 16:33:31 2015 -0500 get_test_property: clarify the documentation If either the test or the property doesn't exist, NOTFOUND will be used. No error is raised in either case. diff --git a/Help/command/get_test_property.rst b/Help/command/get_test_property.rst index 2623755..391a32e 100644 --- a/Help/command/get_test_property.rst +++ b/Help/command/get_test_property.rst @@ -7,9 +7,9 @@ Get a property of the test. get_test_property(test property VAR) -Get a property from the Test. The value of the property is stored in -the variable VAR. If the property is not found, VAR will be set to -"NOTFOUND". For a list of standard properties you can type cmake ---help-property-list +Get a property from the test. The value of the property is stored in +the variable VAR. If the test or property is not found, VAR will be +set to "NOTFOUND". For a list of standard properties you can type cmake +--help-property-list. See also the more general get_property() command. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5008f9da62218ba204dc0f1161d8ef39307fe061 commit 5008f9da62218ba204dc0f1161d8ef39307fe061 Author: Stephen Kelly AuthorDate: Thu Jan 8 15:20:38 2015 -0500 Commit: Ben Boeckel CommitDate: Thu Jan 8 15:20:38 2015 -0500 cmGetTargetPropertyCommand: discern empty from undefined properties diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index aa6f0c1..fb59df8 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -23,6 +23,7 @@ bool cmGetTargetPropertyCommand std::string var = args[0]; const std::string& targetName = args[1]; std::string prop; + bool prop_exists = false; if(args[2] == "ALIASED_TARGET") { @@ -32,6 +33,7 @@ bool cmGetTargetPropertyCommand this->Makefile->FindTargetToUse(targetName)) { prop = target->GetName(); + prop_exists = true; } } } @@ -42,6 +44,7 @@ bool cmGetTargetPropertyCommand if(prop_cstr) { prop = prop_cstr; + prop_exists = true; } } else @@ -74,7 +77,7 @@ bool cmGetTargetPropertyCommand } } } - if (!prop.empty()) + if (prop_exists) { this->Makefile->AddDefinition(var, prop.c_str()); return true; ----------------------------------------------------------------------- Summary of changes: Help/command/get_test_property.rst | 8 ++++---- Help/command/set_tests_properties.rst | 2 +- Source/cmGetTargetPropertyCommand.cxx | 5 ++++- Tests/RunCMake/CMakeLists.txt | 1 + .../{CMP0004 => get_property}/CMakeLists.txt | 0 Tests/RunCMake/get_property/RunCMakeTest.cmake | 9 +++++++++ .../get_property/cache_properties-stderr.txt | 3 +++ Tests/RunCMake/get_property/cache_properties.cmake | 14 ++++++++++++++ .../get_property/directory_properties-stderr.txt | 6 ++++++ .../RunCMake/get_property/directory_properties.cmake | 15 +++++++++++++++ .../get_property/global_properties-stderr.txt | 3 +++ Tests/RunCMake/get_property/global_properties.cmake | 14 ++++++++++++++ .../get_property/install_properties-stderr.txt | 3 +++ Tests/RunCMake/get_property/install_properties.cmake | 18 ++++++++++++++++++ .../get_property/source_properties-stderr.txt | 6 ++++++ Tests/RunCMake/get_property/source_properties.cmake | 15 +++++++++++++++ .../get_property/target_properties-stderr.txt | 6 ++++++ Tests/RunCMake/get_property/target_properties.cmake | 16 ++++++++++++++++ .../RunCMake/get_property/test_properties-stderr.txt | 6 ++++++ Tests/RunCMake/get_property/test_properties.cmake | 17 +++++++++++++++++ 20 files changed, 161 insertions(+), 6 deletions(-) copy Tests/RunCMake/{CMP0004 => get_property}/CMakeLists.txt (100%) create mode 100644 Tests/RunCMake/get_property/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/get_property/cache_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/cache_properties.cmake create mode 100644 Tests/RunCMake/get_property/directory_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/directory_properties.cmake create mode 100644 Tests/RunCMake/get_property/global_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/global_properties.cmake create mode 100644 Tests/RunCMake/get_property/install_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/install_properties.cmake create mode 100644 Tests/RunCMake/get_property/source_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/source_properties.cmake create mode 100644 Tests/RunCMake/get_property/target_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/target_properties.cmake create mode 100644 Tests/RunCMake/get_property/test_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/test_properties.cmake hooks/post-receive -- CMake From ben.boeckel at kitware.com Thu Jan 8 16:59:53 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Thu, 8 Jan 2015 16:59:53 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1584-g9ee6a71 Message-ID: <20150108215953.94AAFA9D9A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9ee6a717826db91829196a59e02bcf73d216bf87 (commit) via dd94f7c8233489388b5aea6418bfb8002ab855cc (commit) via b0a5d3932d2a6633d05eca3eb7fd632f433dca05 (commit) from fb08194fa34fa33379de6c01cf72278d1da4bf90 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ee6a717826db91829196a59e02bcf73d216bf87 commit 9ee6a717826db91829196a59e02bcf73d216bf87 Merge: fb08194 dd94f7c Author: Ben Boeckel AuthorDate: Thu Jan 8 16:59:52 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 16:59:52 2015 -0500 Merge topic 'add-xz-support' into next dd94f7c8 cmake -E tar: add support for .xz files with 'J' b0a5d393 cmake -E tar: clean up flag documentation http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd94f7c8233489388b5aea6418bfb8002ab855cc commit dd94f7c8233489388b5aea6418bfb8002ab855cc Author: Ben Boeckel AuthorDate: Thu Jan 8 16:56:33 2015 -0500 Commit: Ben Boeckel CommitDate: Thu Jan 8 16:59:36 2015 -0500 cmake -E tar: add support for .xz files with 'J' diff --git a/Help/release/dev/add-xz-support.rst b/Help/release/dev/add-xz-support.rst new file mode 100644 index 0000000..0dcea9c --- /dev/null +++ b/Help/release/dev/add-xz-support.rst @@ -0,0 +1,5 @@ +add-xz-support +-------------- + +The :manual:`cmake(1)` ``-E tar`` command now supports creating +``.xz``-compressed archives with the ``J`` flag. diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 80dbaf3..f02d78e 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1674,7 +1674,8 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file) std::vector files; files.push_back(file); - if(!cmSystemTools::CreateTar(tarFile.c_str(), files, true, false, false)) + if(!cmSystemTools::CreateTar(tarFile.c_str(), files, + true, false, false, false)) { cmCTestLog(this, ERROR_MESSAGE, "Error creating tar while " "encoding file: " << file << std::endl); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1c8c387..cd63347 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1482,7 +1482,8 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, - bool gzip, bool bzip2, bool verbose) + bool gzip, bool bzip2, bool xz, + bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); @@ -1498,7 +1499,8 @@ bool cmSystemTools::CreateTar(const char* outFileName, } cmArchiveWrite a(fout, (gzip? cmArchiveWrite::CompressGZip : (bzip2? cmArchiveWrite::CompressBZip2 : - cmArchiveWrite::CompressNone)), + (xz? cmArchiveWrite::CompressXZ : + cmArchiveWrite::CompressNone))), cmArchiveWrite::TypeTAR); a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index d49af74..47d2771 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -387,7 +387,7 @@ public: bool gzip, bool verbose); static bool CreateTar(const char* outFileName, const std::vector& files, bool gzip, - bool bzip2, bool verbose); + bool bzip2, bool xz, bool verbose); static bool ExtractTar(const char* inFileName, bool gzip, bool verbose); // This should be called first thing in main diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index f2f028a..6b3efb5 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -71,7 +71,7 @@ void CMakeCommandUsage(const char* program) << " remove_directory dir - remove a directory and its contents\n" << " rename oldname newname - rename a file or directory " "(on one volume)\n" - << " tar [cxt][vf][zj] file.tar [file/dir1 file/dir2 ...]\n" + << " tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]\n" << " - create or extract a tar or zip archive\n" << " sleep ... - sleep for given number of seconds\n" << " time command [args] ... - run command and return elapsed time\n" @@ -735,11 +735,16 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) } bool gzip = false; bool bzip2 = false; + bool xz = false; bool verbose = false; if ( flags.find_first_of('j') != flags.npos ) { bzip2 = true; } + if ( flags.find_first_of('J') != flags.npos ) + { + xz = true; + } if ( flags.find_first_of('z') != flags.npos ) { gzip = true; @@ -760,7 +765,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) else if ( flags.find_first_of('c') != flags.npos ) { if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, gzip, bzip2, verbose) ) + outFile.c_str(), files, gzip, bzip2, xz, verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0a5d3932d2a6633d05eca3eb7fd632f433dca05 commit b0a5d3932d2a6633d05eca3eb7fd632f433dca05 Author: Ben Boeckel AuthorDate: Thu Jan 8 16:56:17 2015 -0500 Commit: Ben Boeckel CommitDate: Thu Jan 8 16:56:17 2015 -0500 cmake -E tar: clean up flag documentation diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index a97444d..f2f028a 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -71,7 +71,7 @@ void CMakeCommandUsage(const char* program) << " remove_directory dir - remove a directory and its contents\n" << " rename oldname newname - rename a file or directory " "(on one volume)\n" - << " tar [cxt][vfz][cvfj] file.tar [file/dir1 file/dir2 ...]\n" + << " tar [cxt][vf][zj] file.tar [file/dir1 file/dir2 ...]\n" << " - create or extract a tar or zip archive\n" << " sleep ... - sleep for given number of seconds\n" << " time command [args] ... - run command and return elapsed time\n" ----------------------------------------------------------------------- Summary of changes: Help/release/dev/add-xz-support.rst | 5 +++++ Source/cmCTest.cxx | 3 ++- Source/cmSystemTools.cxx | 6 ++++-- Source/cmSystemTools.h | 2 +- Source/cmcmd.cxx | 9 +++++++-- 5 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 Help/release/dev/add-xz-support.rst hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 8 17:16:57 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 8 Jan 2015 17:16:57 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1586-gfc5b691 Message-ID: <20150108221657.EF8A7A9028@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fc5b6913b9abee1e56568f380976c0d89abc4691 (commit) via 51b3fa391ff71b6aa5e5f0ad714f59adfd1d13dc (commit) from 9ee6a717826db91829196a59e02bcf73d216bf87 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc5b6913b9abee1e56568f380976c0d89abc4691 commit fc5b6913b9abee1e56568f380976c0d89abc4691 Merge: 9ee6a71 51b3fa3 Author: Stephen Kelly AuthorDate: Thu Jan 8 17:16:57 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 17:16:57 2015 -0500 Merge topic 'drop-ancient-workarounds' into next 51b3fa39 Revert "Remove VS7 special case." http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51b3fa391ff71b6aa5e5f0ad714f59adfd1d13dc commit 51b3fa391ff71b6aa5e5f0ad714f59adfd1d13dc Author: Stephen Kelly AuthorDate: Thu Jan 8 23:16:33 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 23:16:33 2015 +0100 Revert "Remove VS7 special case." This reverts commit 73afe27ebd5bbd8ec0d316e0a951661d566ccc85. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 72a185f..96f4709 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -507,6 +507,11 @@ if(APPLE) target_link_libraries(CMakeLib "-framework CoreFoundation") endif() +# On some platforms we need the rpcrt4 library for the VS 7 generators. +if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) + target_link_libraries(CMakeLib rpcrt4) +endif() + # # CTestLib # ----------------------------------------------------------------------- Summary of changes: Source/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 8 17:17:56 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 8 Jan 2015 17:17:56 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1588-gb9c9643 Message-ID: <20150108221756.BF744A90FE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b9c9643a979378511a4f758afe66b3077ccc7c76 (commit) via f13b405afe0b591194bdd0c36cb96d4d8dc5bdfb (commit) from fc5b6913b9abee1e56568f380976c0d89abc4691 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9c9643a979378511a4f758afe66b3077ccc7c76 commit b9c9643a979378511a4f758afe66b3077ccc7c76 Merge: fc5b691 f13b405 Author: Stephen Kelly AuthorDate: Thu Jan 8 17:17:56 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 17:17:56 2015 -0500 Merge topic 'drop-ancient-workarounds' into next f13b405a Remove VS 6 special case. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f13b405afe0b591194bdd0c36cb96d4d8dc5bdfb commit f13b405afe0b591194bdd0c36cb96d4d8dc5bdfb Author: Stephen Kelly AuthorDate: Thu Jan 8 22:12:49 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 8 23:17:39 2015 +0100 Remove VS 6 special case. diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 153ba6a..93bfdf8 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -16,9 +16,6 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 7") set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) endif() -if(CMAKE_GENERATOR MATCHES "Visual Studio 6") - set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -endif() if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel") set(_INTEL_WINDOWS 1) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 8 18:07:05 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 8 Jan 2015 18:07:05 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1590-g28f8d0d Message-ID: <20150108230705.8D0B6A9D9A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 28f8d0dd27a6d2cb9bdd743d728d00af1a9830ff (commit) via 9c2cc86733790f2c8a8b585ea33ca9f594c81e27 (commit) from b9c9643a979378511a4f758afe66b3077ccc7c76 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28f8d0dd27a6d2cb9bdd743d728d00af1a9830ff commit 28f8d0dd27a6d2cb9bdd743d728d00af1a9830ff Merge: b9c9643 9c2cc86 Author: Stephen Kelly AuthorDate: Thu Jan 8 18:07:04 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 18:07:04 2015 -0500 Merge topic 'drop-ancient-workarounds' into next 9c2cc867 Fix build on Mac. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c2cc86733790f2c8a8b585ea33ca9f594c81e27 commit 9c2cc86733790f2c8a8b585ea33ca9f594c81e27 Author: Stephen Kelly AuthorDate: Fri Jan 9 00:06:20 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 9 00:06:20 2015 +0100 Fix build on Mac. diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h index 62218d4..1c84d49 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.h +++ b/Source/CPack/cmCPackDragNDropGenerator.h @@ -33,7 +33,7 @@ protected: bool SupportsComponentInstallation() const; - bool CopyFile(std::ostringstream& source, cmOStringStream& target); + bool CopyFile(std::ostringstream& source, std::ostringstream& target); bool RunCommand(std::ostringstream& command, std::string* output = 0); std::string ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackDragNDropGenerator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 8 18:08:10 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 8 Jan 2015 18:08:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1595-gdef4979 Message-ID: <20150108230814.223FEA9DD6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via def4979cf2be3342b9e46d44da13d2b51670f685 (commit) via c1f14639867b912787d16f431bb658b93e176a9c (commit) via dd14c5a9066f47297b48d5b204568362de1880ed (commit) via b63bca8e0d0e69aa2f936a54d5c7fa65684d2f1f (commit) via 074fc2292eb52f4df17c4b81448e17e4ad3528df (commit) from 28f8d0dd27a6d2cb9bdd743d728d00af1a9830ff (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=def4979cf2be3342b9e46d44da13d2b51670f685 commit def4979cf2be3342b9e46d44da13d2b51670f685 Merge: 28f8d0d c1f1463 Author: Stephen Kelly AuthorDate: Thu Jan 8 18:08:07 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 18:08:07 2015 -0500 Merge topic 'drop-ancient-workarounds' into next c1f14639 Remove VS 6 special case. dd14c5a9 Remove some obsolete stuff. b63bca8e cmStandardIncludes: Remove obsolete cmOStringStream. 074fc229 Port all cmOStringStream to std::ostringstream. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1f14639867b912787d16f431bb658b93e176a9c commit c1f14639867b912787d16f431bb658b93e176a9c Author: Stephen Kelly AuthorDate: Thu Jan 8 22:12:49 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 9 00:07:38 2015 +0100 Remove VS 6 special case. diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 153ba6a..93bfdf8 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -16,9 +16,6 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 7") set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) endif() -if(CMAKE_GENERATOR MATCHES "Visual Studio 6") - set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -endif() if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel") set(_INTEL_WINDOWS 1) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd14c5a9066f47297b48d5b204568362de1880ed commit dd14c5a9066f47297b48d5b204568362de1880ed Author: Stephen Kelly AuthorDate: Mon Jan 5 20:38:28 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 9 00:07:38 2015 +0100 Remove some obsolete stuff. We don't need to run compiler tests for ansi-for etc anymore. All supported compilers support the features tested here. diff --git a/CompileFlags.cmake b/CompileFlags.cmake index e7beb3f..153ba6a 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -83,5 +83,3 @@ endif () if (CMAKE_ANSI_CFLAGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") endif () - -include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index 79776f4..c0a1aa9 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -9,10 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#cmakedefine CMAKE_NO_STD_NAMESPACE -#cmakedefine CMAKE_NO_ANSI_STREAM_HEADERS -#cmakedefine CMAKE_NO_ANSI_STRING_STREAM -#cmakedefine CMAKE_NO_ANSI_FOR_SCOPE #cmakedefine HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE #cmakedefine HAVE_UNSETENV #cmakedefine CMAKE_USE_ELF_PARSER diff --git a/bootstrap b/bootstrap index d92b091..ac82f21 100755 --- a/bootstrap +++ b/bootstrap @@ -1461,35 +1461,6 @@ cmake_compiler_settings_comment="/* cmake_report cmConfigure.h${_tmp} "${cmake_compiler_settings_comment}" -if [ "x$KWSYS_STL_HAVE_STD" = "x1" ]; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_STD_NAMESPACE */" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_STD_NAMESPACE 1" -fi - -if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_STREAM_HEADERS */" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_STREAM_HEADERS 1" -fi - -if [ "x$KWSYS_IOS_USE_SSTREAM" = "x1" ]; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_STRING_STREAM */" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_STRING_STREAM 1" -fi - -# Test for ansi FOR scope -if cmake_try_run "${cmake_cxx_compiler}" \ - "${cmake_cxx_flags}" \ - "${cmake_source_dir}/Modules/TestForAnsiForScope.cxx" >> cmake_bootstrap.log 2>&1; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_FOR_SCOPE */" - echo "${cmake_cxx_compiler} has ANSI for scoping" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_FOR_SCOPE 1" - echo "${cmake_cxx_compiler} does not have ANSI for scoping" -fi - # When bootstrapping on MinGW with MSYS we must convert the source # directory to a windows path. if ${cmake_system_mingw}; then http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b63bca8e0d0e69aa2f936a54d5c7fa65684d2f1f commit b63bca8e0d0e69aa2f936a54d5c7fa65684d2f1f Author: Stephen Kelly AuthorDate: Mon Jan 5 20:33:18 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 9 00:07:38 2015 +0100 cmStandardIncludes: Remove obsolete cmOStringStream. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 97f57a3..96f4709 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -153,7 +153,6 @@ endif() # Sources for CMakeLib # set(SRCS - cmStandardIncludes.cxx cmArchiveWrite.cxx cmBootstrapCommands1.cxx cmBootstrapCommands2.cxx diff --git a/Source/cmStandardIncludes.cxx b/Source/cmStandardIncludes.cxx deleted file mode 100644 index 23c570c..0000000 --- a/Source/cmStandardIncludes.cxx +++ /dev/null @@ -1,16 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2000-2010 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. -============================================================================*/ -#include "cmStandardIncludes.h" -#if !defined(CMAKE_NO_ANSI_STRING_STREAM) -std::ostringstream::cmOStringStream() {} -std::ostringstream::~cmOStringStream() {} -#endif diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index a7db271..f50771f 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -16,8 +16,6 @@ #ifndef cmStandardIncludes_h #define cmStandardIncludes_h -// include configure generated header to define CMAKE_NO_ANSI_STREAM_HEADERS, -// CMAKE_NO_STD_NAMESPACE, and other macros. #include #include @@ -49,23 +47,10 @@ # pragma warning (push,1) #endif -#ifndef CMAKE_NO_ANSI_STREAM_HEADERS -# include -# include -# include -#else -# include -# include -# include -#endif - -#if !defined(CMAKE_NO_ANSI_STRING_STREAM) -# include -#elif !defined(CMAKE_NO_ANSI_STREAM_HEADERS) -# include -#else -# include -#endif +#include +#include +#include +#include // we must have stl with the standard include style #include @@ -97,48 +82,6 @@ typedef unsigned short mode_t; #include //typedef cmsys::String std::string; -// Define cmOStringStream and cmIStringStream wrappers to hide -// differences between std::stringstream and the old strstream. -#if !defined(CMAKE_NO_ANSI_STRING_STREAM) -class cmOStringStream: public std::ostringstream -{ -public: - cmOStringStream(); - ~cmOStringStream(); -private: - cmOStringStream(const cmOStringStream&); - void operator=(const cmOStringStream&); -}; -#else -class cmOStrStreamCleanup -{ -public: - cmOStrStreamCleanup(std::ostrstream& ostr): OStrStream(ostr) {} - ~cmOStrStreamCleanup() { this->OStrStream.rdbuf()->freeze(0); } - static void IgnoreUnusedVariable(const cmOStrStreamCleanup&) {} -protected: - std::ostrstream& OStrStream; -}; - -class cmOStringStream: public std::ostrstream -{ -public: - typedef std::ostrstream Superclass; - cmOStringStream() {} - std::string str() - { - cmOStrStreamCleanup cleanup(*this); - cmOStrStreamCleanup::IgnoreUnusedVariable(cleanup); - int pcount = this->pcount(); - const char* ptr = this->Superclass::str(); - return std::string(ptr?ptr:"", pcount); - } -private: - cmOStringStream(const cmOStringStream&); - void operator=(const cmOStringStream&); -}; -#endif - /* Poison this operator to avoid common mistakes. */ extern void operator << (std::ostream&, const std::ostringstream&); diff --git a/bootstrap b/bootstrap index fe051e1..d92b091 100755 --- a/bootstrap +++ b/bootstrap @@ -240,7 +240,6 @@ CMAKE_UNUSED_SOURCES="\ " CMAKE_CXX_SOURCES="\ - cmStandardIncludes \ cmake \ cmakemain \ cmcmd \ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=074fc2292eb52f4df17c4b81448e17e4ad3528df commit 074fc2292eb52f4df17c4b81448e17e4ad3528df Author: Stephen Kelly AuthorDate: Mon Jan 5 20:31:31 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 9 00:07:37 2015 +0100 Port all cmOStringStream to std::ostringstream. All compilers hosting CMake support the std class. diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 0644ecb..c1fe404 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -24,7 +24,7 @@ #endif #define cmCPackLogger(logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ if(Generator) { \ Generator->Logger->Log(logType, __FILE__, __LINE__, \ diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 3c45639..86f8a52 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -25,7 +25,7 @@ #endif #define cmCPackLogger(logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ if(Generator) { \ Generator->Logger->Log(logType, __FILE__, __LINE__, \ diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index fbd1d21..e751568 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -112,24 +112,24 @@ int cmCPackBundleGenerator::ConstructBundle() // The staging directory contains everything that will end-up inside the // final disk image ... - cmOStringStream staging; + std::ostringstream staging; staging << toplevel; - cmOStringStream contents; + std::ostringstream contents; contents << staging.str() << "/" << cpack_bundle_name << ".app/" << "Contents"; - cmOStringStream application; + std::ostringstream application; application << contents.str() << "/" << "MacOS"; - cmOStringStream resources; + std::ostringstream resources; resources << contents.str() << "/" << "Resources"; // Install a required, user-provided bundle metadata file ... - cmOStringStream plist_source; + std::ostringstream plist_source; plist_source << cpack_bundle_plist; - cmOStringStream plist_target; + std::ostringstream plist_target; plist_target << contents.str() << "/" << "Info.plist"; if(!this->CopyFile(plist_source, plist_target)) @@ -142,10 +142,10 @@ int cmCPackBundleGenerator::ConstructBundle() } // Install a user-provided bundle icon ... - cmOStringStream icon_source; + std::ostringstream icon_source; icon_source << cpack_bundle_icon; - cmOStringStream icon_target; + std::ostringstream icon_target; icon_target << resources.str() << "/" << cpack_bundle_name << ".icns"; if(!this->CopyFile(icon_source, icon_target)) @@ -161,10 +161,10 @@ int cmCPackBundleGenerator::ConstructBundle() // executable or a script) ... if(!cpack_bundle_startup_command.empty()) { - cmOStringStream command_source; + std::ostringstream command_source; command_source << cpack_bundle_startup_command; - cmOStringStream command_target; + std::ostringstream command_target; command_target << application.str() << "/" << cpack_bundle_name; if(!this->CopyFile(command_source, command_target)) @@ -231,7 +231,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) for(std::vector::iterator it = relFiles.begin(); it != relFiles.end(); ++it) { - cmOStringStream temp_sign_file_cmd; + std::ostringstream temp_sign_file_cmd; temp_sign_file_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_sign_file_cmd << " --deep -f -s \"" << cpack_apple_cert_app; temp_sign_file_cmd << "\" -i "; @@ -251,7 +251,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) } // sign main binary - cmOStringStream temp_sign_binary_cmd; + std::ostringstream temp_sign_binary_cmd; temp_sign_binary_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_sign_binary_cmd << " --deep -f -s \"" << cpack_apple_cert_app; temp_sign_binary_cmd << "\" \"" << bundle_path << "\""; @@ -266,7 +266,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) } // sign app bundle - cmOStringStream temp_codesign_cmd; + std::ostringstream temp_codesign_cmd; temp_codesign_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_codesign_cmd << " --deep -f -s \"" << cpack_apple_cert_app << "\""; if(this->GetOption("CPACK_BUNDLE_APPLE_ENTITLEMENTS")) diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 9f0a77e..5da9234 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -169,8 +169,8 @@ int cmCPackDragNDropGenerator::PackageFiles() } //---------------------------------------------------------------------- -bool cmCPackDragNDropGenerator::CopyFile(cmOStringStream& source, - cmOStringStream& target) +bool cmCPackDragNDropGenerator::CopyFile(std::ostringstream& source, + std::ostringstream& target) { if(!cmSystemTools::CopyFileIfDifferent( source.str().c_str(), @@ -190,7 +190,7 @@ bool cmCPackDragNDropGenerator::CopyFile(cmOStringStream& source, } //---------------------------------------------------------------------- -bool cmCPackDragNDropGenerator::RunCommand(cmOStringStream& command, +bool cmCPackDragNDropGenerator::RunCommand(std::ostringstream& command, std::string* output) { int exit_code = 1; @@ -255,12 +255,12 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // The staging directory contains everything that will end-up inside the // final disk image ... - cmOStringStream staging; + std::ostringstream staging; staging << src_dir; // Add a symlink to /Applications so users can drag-and-drop the bundle // into it - cmOStringStream application_link; + std::ostringstream application_link; application_link << staging.str() << "/Applications"; cmSystemTools::CreateSymlink("/Applications", application_link.str().c_str()); @@ -268,10 +268,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Optionally add a custom volume icon ... if(!cpack_package_icon.empty()) { - cmOStringStream package_icon_source; + std::ostringstream package_icon_source; package_icon_source << cpack_package_icon; - cmOStringStream package_icon_destination; + std::ostringstream package_icon_destination; package_icon_destination << staging.str() << "/.VolumeIcon.icns"; if(!this->CopyFile(package_icon_source, package_icon_destination)) @@ -289,10 +289,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // (e.g. for setting background/layout) ... if(!cpack_dmg_ds_store.empty()) { - cmOStringStream package_settings_source; + std::ostringstream package_settings_source; package_settings_source << cpack_dmg_ds_store; - cmOStringStream package_settings_destination; + std::ostringstream package_settings_destination; package_settings_destination << staging.str() << "/.DS_Store"; if(!this->CopyFile(package_settings_source, package_settings_destination)) @@ -309,10 +309,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Optionally add a custom background image ... if(!cpack_dmg_background_image.empty()) { - cmOStringStream package_background_source; + std::ostringstream package_background_source; package_background_source << cpack_dmg_background_image; - cmOStringStream package_background_destination; + std::ostringstream package_background_destination; package_background_destination << staging.str() << "/background.png"; if(!this->CopyFile(package_background_source, @@ -326,7 +326,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, return 0; } - cmOStringStream temp_background_hiding_command; + std::ostringstream temp_background_hiding_command; temp_background_hiding_command << this->GetOption("CPACK_COMMAND_SETFILE"); temp_background_hiding_command << " -a V \""; temp_background_hiding_command << package_background_destination.str(); @@ -346,7 +346,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::string temp_image = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); temp_image += "/temp.dmg"; - cmOStringStream temp_image_command; + std::ostringstream temp_image_command; temp_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); temp_image_command << " create"; temp_image_command << " -ov"; @@ -368,9 +368,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Optionally set the custom icon flag for the image ... if(!cpack_package_icon.empty()) { - cmOStringStream temp_mount; + std::ostringstream temp_mount; - cmOStringStream attach_command; + std::ostringstream attach_command; attach_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); attach_command << " attach"; attach_command << " \"" << temp_image << "\""; @@ -389,7 +389,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, mountpoint_regex.find(attach_output.c_str()); temp_mount << mountpoint_regex.match(1); - cmOStringStream setfile_command; + std::ostringstream setfile_command; setfile_command << this->GetOption("CPACK_COMMAND_SETFILE"); setfile_command << " -a C"; setfile_command << " \"" << temp_mount.str() << "\""; @@ -403,7 +403,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, return 0; } - cmOStringStream detach_command; + std::ostringstream detach_command; detach_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); detach_command << " detach"; detach_command << " \"" << temp_mount.str() << "\""; @@ -471,7 +471,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::string temp_udco = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); temp_udco += "/temp-udco.dmg"; - cmOStringStream udco_image_command; + std::ostringstream udco_image_command; udco_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); udco_image_command << " convert \"" << temp_image << "\""; udco_image_command << " -format UDCO"; @@ -488,7 +488,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, } // unflatten dmg - cmOStringStream unflatten_command; + std::ostringstream unflatten_command; unflatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); unflatten_command << " unflatten "; unflatten_command << "\"" << temp_udco << "\""; @@ -503,7 +503,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, } // Rez the SLA - cmOStringStream embed_sla_command; + std::ostringstream embed_sla_command; embed_sla_command << this->GetOption("CPACK_COMMAND_REZ"); const char* sysroot = this->GetOption("CPACK_OSX_SYSROOT"); if(sysroot && sysroot[0] != '\0') @@ -524,7 +524,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, } // flatten dmg - cmOStringStream flatten_command; + std::ostringstream flatten_command; flatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); flatten_command << " flatten "; flatten_command << "\"" << temp_udco << "\""; @@ -543,7 +543,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Create the final compressed read-only disk image ... - cmOStringStream final_image_command; + std::ostringstream final_image_command; final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); final_image_command << " convert \"" << temp_image << "\""; final_image_command << " -format "; diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h index 808c618..1c84d49 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.h +++ b/Source/CPack/cmCPackDragNDropGenerator.h @@ -33,8 +33,8 @@ protected: bool SupportsComponentInstallation() const; - bool CopyFile(cmOStringStream& source, cmOStringStream& target); - bool RunCommand(cmOStringStream& command, std::string* output = 0); + bool CopyFile(std::ostringstream& source, std::ostringstream& target); + bool RunCommand(std::ostringstream& command, std::string* output = 0); std::string GetComponentInstallDirNameSuffix(const std::string& componentName); diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 2330278..9cd53ea 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -160,7 +160,7 @@ int cmCPackGenerator::PrepareNames() "Cannot open description file name: " << descFileName << std::endl); return 0; } - cmOStringStream ostr; + std::ostringstream ostr; std::string line; cmCPackLogger(cmCPackLog::LOG_VERBOSE, diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index ed89b53..907bb1e 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -29,7 +29,7 @@ #define cmCPackLogger(logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ this->Logger->Log(logType, __FILE__, __LINE__,\ cmCPackLog_msg.str().c_str());\ diff --git a/Source/CPack/cmCPackLog.h b/Source/CPack/cmCPackLog.h index 812f1de..7a7ff58 100644 --- a/Source/CPack/cmCPackLog.h +++ b/Source/CPack/cmCPackLog.h @@ -17,7 +17,7 @@ #define cmCPack_Log(ctSelf, logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ (ctSelf)->Log(logType, __FILE__, __LINE__, cmCPackLog_msg.str().c_str());\ } while ( 0 ) diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index b506b06..8f63ca2 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -71,7 +71,7 @@ int cmCPackNSISGenerator::PackageFiles() tmpFile += "/NSISOutput.log"; std::string nsisInstallOptions = nsisFileName + "/NSIS.InstallOptions.ini"; nsisFileName += "/project.nsi"; - cmOStringStream str; + std::ostringstream str; std::vector::const_iterator it; for ( it = files.begin(); it != files.end(); ++ it ) { @@ -91,7 +91,7 @@ int cmCPackNSISGenerator::PackageFiles() std::vector dirs; this->GetListOfSubdirectories(toplevel.c_str(), dirs); std::vector::const_iterator sit; - cmOStringStream dstr; + std::ostringstream dstr; for ( sit = dirs.begin(); sit != dirs.end(); ++ sit ) { std::string componentName; @@ -190,7 +190,7 @@ int cmCPackNSISGenerator::PackageFiles() std::string groupDescriptions; std::string installTypesCode; std::string defines; - cmOStringStream macrosOut; + std::ostringstream macrosOut; bool anyDownloadedComponents = false; // Create installation types. The order is significant, so we first fill @@ -503,8 +503,8 @@ int cmCPackNSISGenerator::InitializeInternal() << "not set" << std::endl); } - cmOStringStream str; - cmOStringStream deleteStr; + std::ostringstream str; + std::ostringstream deleteStr; if ( cpackPackageExecutables ) { @@ -565,8 +565,8 @@ int cmCPackNSISGenerator::InitializeInternal() } //---------------------------------------------------------------------- -void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str, - cmOStringStream& deleteStr) +void cmCPackNSISGenerator::CreateMenuLinks( std::ostringstream& str, + std::ostringstream& deleteStr) { const char* cpackMenuLinks = this->GetOption("CPACK_NSIS_MENU_LINKS"); @@ -694,7 +694,7 @@ bool cmCPackNSISGenerator::SupportsComponentInstallation() const std::string cmCPackNSISGenerator:: CreateComponentDescription(cmCPackComponent *component, - cmOStringStream& macrosOut) + std::ostringstream& macrosOut) { // Basic description of the component std::string componentCode = "Section "; @@ -714,7 +714,7 @@ CreateComponentDescription(cmCPackComponent *component, } else if (!component->InstallationTypes.empty()) { - cmOStringStream out; + std::ostringstream out; std::vector::iterator installTypeIter; for (installTypeIter = component->InstallationTypes.begin(); installTypeIter != component->InstallationTypes.end(); @@ -734,7 +734,7 @@ CreateComponentDescription(cmCPackComponent *component, // Compute the name of the archive. std::string packagesDir = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); packagesDir += ".dummy"; - cmOStringStream out; + std::ostringstream out; out << cmSystemTools::GetFilenameWithoutLastExtension(packagesDir) << "-" << component->Name << ".zip"; component->ArchiveFile = out.str(); @@ -859,7 +859,7 @@ CreateComponentDescription(cmCPackComponent *component, { totalSizeInKbytes = 1; } - cmOStringStream out; + std::ostringstream out; out << " AddSize " << totalSizeInKbytes << "\n" << " Push \"" << component->ArchiveFile << "\"\n" << " Call DownloadFile\n" @@ -935,7 +935,7 @@ std::string cmCPackNSISGenerator::CreateSelectionDependenciesDescription } visited.insert(component); - cmOStringStream out; + std::ostringstream out; std::vector::iterator dependIt; for (dependIt = component->Dependencies.begin(); dependIt != component->Dependencies.end(); @@ -967,7 +967,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription } visited.insert(component); - cmOStringStream out; + std::ostringstream out; std::vector::iterator dependIt; for (dependIt = component->ReverseDependencies.begin(); dependIt != component->ReverseDependencies.end(); @@ -992,7 +992,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription std::string cmCPackNSISGenerator:: CreateComponentGroupDescription(cmCPackComponentGroup *group, - cmOStringStream& macrosOut) + std::ostringstream& macrosOut) { if (group->Components.empty() && group->Subgroups.empty()) { diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h index e46fbda..c7b2ce1 100644 --- a/Source/CPack/cmCPackNSISGenerator.h +++ b/Source/CPack/cmCPackNSISGenerator.h @@ -38,8 +38,8 @@ public: protected: virtual int InitializeInternal(); - void CreateMenuLinks( cmOStringStream& str, - cmOStringStream& deleteStr); + void CreateMenuLinks( std::ostringstream& str, + std::ostringstream& deleteStr); int PackageFiles(); virtual const char* GetOutputExtension() { return ".exe"; } virtual const char* GetOutputPostfix() { return "win32"; } @@ -56,7 +56,7 @@ protected: /// macrosOut. std::string CreateComponentDescription(cmCPackComponent *component, - cmOStringStream& macrosOut); + std::ostringstream& macrosOut); /// Produce NSIS code that selects all of the components that this component /// depends on, recursively. @@ -75,7 +75,7 @@ protected: /// added macros will be emitted via macrosOut. std::string CreateComponentGroupDescription(cmCPackComponentGroup *group, - cmOStringStream& macrosOut); + std::ostringstream& macrosOut); /// Translations any newlines found in the string into \\r\\n, so that the /// resulting string can be used within NSIS. diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 28c7f1d..313e08b 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -45,8 +45,8 @@ int cmCPackOSXX11Generator::PackageFiles() { cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: " << cpackPackageExecutables << "." << std::endl); - cmOStringStream str; - cmOStringStream deleteStr; + std::ostringstream str; + std::ostringstream deleteStr; std::vector cpackPackageExecutablesVector; cmSystemTools::ExpandListArgument(cpackPackageExecutables, cpackPackageExecutablesVector); @@ -165,7 +165,7 @@ int cmCPackOSXX11Generator::PackageFiles() std::string output; std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/hdiutilOutput.log"; - cmOStringStream dmgCmd; + std::ostringstream dmgCmd; dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") << "\" create -ov -format UDZO -srcfolder \"" << diskImageDirectory.c_str() diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index e799d06..2df8dd9 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -325,7 +325,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() if (this->Components.empty()) { // Use PackageMaker to build the package. - cmOStringStream pkgCmd; + std::ostringstream pkgCmd; pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM") << "\" -build -p \"" << packageDirFileName << "\""; if (this->Components.empty()) @@ -359,7 +359,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/hdiutilOutput.log"; - cmOStringStream dmgCmd; + std::ostringstream dmgCmd; dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") << "\" create -ov -format UDZO -srcfolder \"" << packageDirFileName << "\" \"" << packageFileNames[0] << "\""; @@ -687,7 +687,7 @@ cmCPackPackageMakerGenerator::GetPackageName(const cmCPackComponent& component) { std::string packagesDir = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); packagesDir += ".dummy"; - cmOStringStream out; + std::ostringstream out; out << cmSystemTools::GetFilenameWithoutLastExtension(packagesDir) << "-" << component.Name << ".pkg"; return out.str(); @@ -710,7 +710,7 @@ GenerateComponentPackage(const char *packageFile, packageFile << std::endl); // The command that will be used to run PackageMaker - cmOStringStream pkgCmd; + std::ostringstream pkgCmd; if (this->PackageCompatibilityVersion < 10.5 || this->PackageMakerVersion < 3.0) @@ -800,7 +800,7 @@ WriteDistributionFile(const char* metapackageFile) // Create the choice outline, which provides a tree-based view of // the components in their groups. - cmOStringStream choiceOut; + std::ostringstream choiceOut; choiceOut << "" << std::endl; // Emit the outline for the groups @@ -862,7 +862,7 @@ WriteDistributionFile(const char* metapackageFile) //---------------------------------------------------------------------- void cmCPackPackageMakerGenerator:: -CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out) +CreateChoiceOutline(const cmCPackComponentGroup& group, std::ostringstream& out) { out << "" << std::endl; std::vector::const_iterator groupIt; @@ -885,7 +885,7 @@ CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out) //---------------------------------------------------------------------- void cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group, - cmOStringStream& out) + std::ostringstream& out) { out << "GetOption("CPACK_PACKAGE_VENDOR"); @@ -989,7 +989,7 @@ void cmCPackPackageMakerGenerator:: AddDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out) + std::ostringstream& out) { if (visited.find(&component) != visited.end()) { @@ -1013,7 +1013,7 @@ void cmCPackPackageMakerGenerator:: AddReverseDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out) + std::ostringstream& out) { if (visited.find(&component) != visited.end()) { diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h index e350a60..1b468d7 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.h +++ b/Source/CPack/cmCPackPackageMakerGenerator.h @@ -84,30 +84,30 @@ protected: // dependency attributes for inter-component dependencies. void AddDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out); + std::ostringstream& out); // Subroutine of WriteDistributionFile that writes out the // reverse dependency attributes for inter-component dependencies. void AddReverseDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out); + std::ostringstream& out); // Generates XML that encodes the hierarchy of component groups and // their components in a form that can be used by distribution // metapackages. void CreateChoiceOutline(const cmCPackComponentGroup& group, - cmOStringStream& out); + std::ostringstream& out); /// Create the "choice" XML element to describe a component group /// for the installer GUI. void CreateChoice(const cmCPackComponentGroup& group, - cmOStringStream& out); + std::ostringstream& out); /// Create the "choice" XML element to describe a component for the /// installer GUI. void CreateChoice(const cmCPackComponent& component, - cmOStringStream& out); + std::ostringstream& out); // Escape the given string to make it usable as an XML attribute // value. diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 26bf607..b1b122d 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -426,7 +426,7 @@ int main (int argc, char const* const* argv) = mf->GetDefinition("CPACK_PACKAGE_VERSION_MINOR"); const char* projVersionPatch = mf->GetDefinition("CPACK_PACKAGE_VERSION_PATCH"); - cmOStringStream ostr; + std::ostringstream ostr; ostr << projVersionMajor << "." << projVersionMinor << "." << projVersionPatch; mf->AddDefinition("CPACK_PACKAGE_VERSION", diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index a101e39..b1fb02d 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -55,7 +55,7 @@ int cmCTestBuildAndTestHandler::ProcessHandler() //---------------------------------------------------------------------- int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, - cmOStringStream &out, std::string &cmakeOutString, std::string &cwd, + std::ostringstream &out, std::string &cmakeOutString, std::string &cwd, cmake *cm) { unsigned int k; @@ -209,7 +209,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) std::string cmakeOutString; cmCTestBuildAndTestCaptureRAII captureRAII(cm, cmakeOutString); static_cast(captureRAII); - cmOStringStream out; + std::ostringstream out; if ( this->CTest->GetConfigType().size() == 0 && this->ConfigSample.size()) diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h index 5a7b916..a75c631 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.h +++ b/Source/CTest/cmCTestBuildAndTestHandler.h @@ -50,7 +50,7 @@ public: protected: ///! Run CMake and build a test and then run it as a single test. int RunCMakeAndTest(std::string* output); - int RunCMake(std::string* outstring, cmOStringStream &out, + int RunCMake(std::string* outstring, std::ostringstream &out, std::string &cmakeOutString, std::string &cwd, cmake *cm); diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index a5a593a..c4df741 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -148,7 +148,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() } else { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "has no project to build. If this is a " "\"built with CMake\" project, verify that CTEST_CMAKE_GENERATOR " "and CTEST_PROJECT_NAME are set." @@ -181,7 +181,7 @@ bool cmCTestBuildCommand::InitialPass(std::vector const& args, bool ret = cmCTestHandlerCommand::InitialPass(args, status); if ( this->Values[ctb_NUMBER_ERRORS] && *this->Values[ctb_NUMBER_ERRORS]) { - cmOStringStream str; + std::ostringstream str; str << this->Handler->GetTotalErrors(); this->Makefile->AddDefinition( this->Values[ctb_NUMBER_ERRORS], str.str().c_str()); @@ -189,7 +189,7 @@ bool cmCTestBuildCommand::InitialPass(std::vector const& args, if ( this->Values[ctb_NUMBER_WARNINGS] && *this->Values[ctb_NUMBER_WARNINGS]) { - cmOStringStream str; + std::ostringstream str; str << this->Handler->GetTotalWarnings(); this->Makefile->AddDefinition( this->Values[ctb_NUMBER_WARNINGS], str.str().c_str()); diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index ef62fd3..0f13263 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -66,7 +66,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() const std::string cmakelists_file = source_dir + "/CMakeLists.txt"; if ( !cmSystemTools::FileExists(cmakelists_file.c_str()) ) { - cmOStringStream e; + std::ostringstream e; e << "CMakeLists.txt file does not exist [" << cmakelists_file << "]"; this->SetError(e.str()); diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index a1d770b..25bd96f 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -544,7 +544,7 @@ int cmCTestCoverageHandler::ProcessHandler() cmsys::ifstream ifs(fullFileName.c_str()); if ( !ifs) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Cannot open source file: " << fullFileName; errorsWhileAccumulating.push_back(ostr.str()); error ++; @@ -563,7 +563,7 @@ int cmCTestCoverageHandler::ProcessHandler() if ( !cmSystemTools::GetLineFromStream(ifs, line) && cc != fcov.size() -1 ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Problem reading source file: " << fullFileName << " line:" << cc << " out total: " << fcov.size()-1; errorsWhileAccumulating.push_back(ostr.str()); @@ -584,7 +584,7 @@ int cmCTestCoverageHandler::ProcessHandler() } if ( cmSystemTools::GetLineFromStream(ifs, line) ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Looks like there are more lines in the file: " << fullFileName; errorsWhileAccumulating.push_back(ostr.str()); } @@ -633,7 +633,7 @@ int cmCTestCoverageHandler::ProcessHandler() cmsys::ifstream ifs(fullPath.c_str()); if (!ifs) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Cannot open source file: " << fullPath; errorsWhileAccumulating.push_back(ostr.str()); error ++; diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx index 5ddef01..e175592 100644 --- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx +++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx @@ -24,7 +24,7 @@ bool cmCTestEmptyBinaryDirectoryCommand if ( !cmCTestScriptHandler::EmptyBinaryDirectory(args[0].c_str()) ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "problem removing the binary directory: " << args[0]; this->SetError(ostr.str()); return false; diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 2df2229..13c8ca5 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -103,7 +103,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part, << std::endl;); return false; } - cmOStringStream ostr; + std::ostringstream ostr; ostr << name; if ( this->SubmitIndex > 0 ) { @@ -142,7 +142,7 @@ bool cmCTestGenericHandler::StartLogFile(const char* name, "Cannot create log file without providing the name" << std::endl;); return false; } - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Last" << name; if ( this->SubmitIndex > 0 ) { diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 5b525dd..b886777 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -46,7 +46,7 @@ bool cmCTestHandlerCommand if(!this->CheckArgumentKeyword(args[i]) && !this->CheckArgumentValue(args[i])) { - cmOStringStream e; + std::ostringstream e; e << "called with unknown argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; @@ -141,7 +141,7 @@ bool cmCTestHandlerCommand int res = handler->ProcessHandler(); if ( this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE]) { - cmOStringStream str; + std::ostringstream str; str << res; this->Makefile->AddDefinition( this->Values[ct_RETURN_VALUE], str.str().c_str()); @@ -183,7 +183,7 @@ bool cmCTestHandlerCommand::CheckArgumentValue(std::string const& arg) unsigned int k = this->ArgumentIndex; if(this->Values[k]) { - cmOStringStream e; + std::ostringstream e; e << "Called with more than one value for " << this->Arguments[k]; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->ArgumentDoing = ArgumentDoingError; diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 09cf760..fd0388a 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -75,7 +75,7 @@ public: this->ParseError(atts); } // Create the log - cmOStringStream ostr; + std::ostringstream ostr; ostr << name << ":\n"; int i = 0; for(; atts[i] != 0; i+=2) @@ -198,7 +198,7 @@ void cmCTestMemCheckHandler::GenerateTestCommand( { std::vector::size_type pp; std::string index; - cmOStringStream stream; + std::ostringstream stream; std::string memcheckcommand = cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str()); stream << test; @@ -834,7 +834,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( int defects = 0; std::vector lines; cmSystemTools::Split(str.c_str(), lines); - cmOStringStream ostr; + std::ostringstream ostr; log = ""; for( std::vector::iterator i = lines.begin(); i != lines.end(); ++i) @@ -878,7 +878,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( { std::vector lines; cmSystemTools::Split(str.c_str(), lines); - cmOStringStream ostr; + std::ostringstream ostr; log = ""; cmsys::RegularExpression pfW("^\\[[WEI]\\] ([A-Z][A-Z][A-Z][A-Z]*): "); @@ -941,7 +941,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( std::string::size_type cc; - cmOStringStream ostr; + std::ostringstream ostr; log = ""; int defects = 0; @@ -1269,7 +1269,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(int test, files) { std::string index; - cmOStringStream stream; + std::ostringstream stream; stream << test; index = stream.str(); std::string ofile = this->MemoryTesterOutputFile; diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 4c89caa..a6bc844 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -668,7 +668,7 @@ void cmCTestMultiProcessHandler::PrintTestList() { cmCTestLog(this->CTest, HANDLER_OUTPUT, " Test"); } - cmOStringStream indexStr; + std::ostringstream indexStr; indexStr << " #" << p.Index << ":"; cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex())) diff --git a/Source/CTest/cmCTestRunScriptCommand.cxx b/Source/CTest/cmCTestRunScriptCommand.cxx index bdf9b9c..7afbe04 100644 --- a/Source/CTest/cmCTestRunScriptCommand.cxx +++ b/Source/CTest/cmCTestRunScriptCommand.cxx @@ -54,7 +54,7 @@ bool cmCTestRunScriptCommand int ret; cmCTestScriptHandler::RunScript(this->CTest, args[i].c_str(), !np, &ret); - cmOStringStream str; + std::ostringstream str; str << ret; this->Makefile->AddDefinition(returnVariable, str.str().c_str()); } diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index ff55528..2a39051 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -694,7 +694,7 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) cmCTestLog(this->CTest, HANDLER_OUTPUT, "Test"); } - cmOStringStream indexStr; + std::ostringstream indexStr; indexStr << " #" << this->Index << ":"; cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex())) diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index f958e7b..71edd5b 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -299,7 +299,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) cmsysProcess_Delete(cp); if(failed) { - cmOStringStream message; + std::ostringstream message; message << "Error running command: ["; message << result << "] "; for(std::vector::iterator i = argv.begin(); diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 1a39a8a..8ea6cef 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -126,7 +126,7 @@ bool cmCTestStartCommand } if(!cmSystemTools::FileIsDirectory(sourceDir)) { - cmOStringStream e; + std::ostringstream e; e << "given source path\n" << " " << sourceDir << "\n" << "which is not an existing directory. " diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 07a994d..97ec21e 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -212,7 +212,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "Part name \"" << arg << "\" is invalid."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->ArgumentDoing = ArgumentDoingError; @@ -229,7 +229,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "File \"" << filename << "\" does not exist. Cannot submit " << "a non-existent file."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 231f035..d209094 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -53,7 +53,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler() if ( this->Values[ctt_START] || this->Values[ctt_END] || this->Values[ctt_STRIDE] ) { - cmOStringStream testsToRunString; + std::ostringstream testsToRunString; if ( this->Values[ctt_START] ) { testsToRunString << this->Values[ctt_START]; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 38ce3dc..a398864 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1865,7 +1865,7 @@ std::string cmCTestTestHandler::GenerateRegressionImages( SPACE_REGEX "*(name|type|encoding|compression)=\"([^\"]*)\"" SPACE_REGEX "*>([^<]*)"); - cmOStringStream ostr; + std::ostringstream ostr; bool done = false; std::string cxml = xml; while ( ! done ) @@ -2098,7 +2098,7 @@ bool cmCTestTestHandler::CleanTestOutput(std::string& output, size_t length) output = output.substr(0, current - begin); // Append truncation message. - cmOStringStream msg; + std::ostringstream msg; msg << "...\n" "The rest of the test output was removed since it exceeds the threshold " "of " << length << " bytes.\n"; diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 7206914..772c9aa 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -413,7 +413,7 @@ bool cmCTestUpdateHandler::SelectVCS() } if (this->UpdateCommand.empty()) { - cmOStringStream e; + std::ostringstream e; e << "Cannot find UpdateCommand "; if (key) { diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx index f7de294..5613751 100644 --- a/Source/CTest/cmCTestUploadCommand.cxx +++ b/Source/CTest/cmCTestUploadCommand.cxx @@ -55,7 +55,7 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "File \"" << filename << "\" does not exist. Cannot submit " << "a non-existent file."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index 15f796f..6e93e95 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -105,7 +105,7 @@ bool cmCTestVC::RunChild(char const* const* cmd, OutputParser* out, //---------------------------------------------------------------------------- std::string cmCTestVC::ComputeCommandLine(char const* const* cmd) { - cmOStringStream line; + std::ostringstream line; const char* sep = ""; for(const char* const* arg = cmd; *arg; ++arg) { diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index 818b910..8fb49ca 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -305,7 +305,7 @@ bool cmAddCustomCommandCommand } // No command for this output exists. - cmOStringStream e; + std::ostringstream e; e << "given APPEND option with output \"" << output[0] << "\" which is not already a custom command output."; this->SetError(e.str()); @@ -354,7 +354,7 @@ bool cmAddCustomCommandCommand } if(!okay) { - cmOStringStream e; + std::ostringstream e; e << "could not locate source file with a custom command producing \"" << output[0] << "\" even though this command tried to create it!"; this->SetError(e.str()); @@ -375,7 +375,7 @@ bool cmAddCustomCommandCommand else { bool issueMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0050)) { @@ -436,7 +436,7 @@ cmAddCustomCommandCommand std::string::size_type pos = o->find_first_of("#<>"); if(pos != o->npos) { - cmOStringStream msg; + std::ostringstream msg; msg << "called with OUTPUT containing a \"" << (*o)[pos] << "\". This character is not allowed."; this->SetError(msg.str()); diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 09c8af5..a0e20c8 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -30,7 +30,7 @@ bool cmAddCustomTargetCommand // Check the target name. if(targetName.find_first_of("/\\") != targetName.npos) { - cmOStringStream e; + std::ostringstream e; e << "called with invalid target name \"" << targetName << "\". Target names may not contain a slash. " << "Use ADD_CUSTOM_COMMAND to generate files."; @@ -170,7 +170,7 @@ bool cmAddCustomTargetCommand std::string::size_type pos = targetName.find_first_of("#<>"); if(pos != targetName.npos) { - cmOStringStream msg; + std::ostringstream msg; msg << "called with target name containing a \"" << targetName[pos] << "\". This character is not allowed."; this->SetError(msg.str()); @@ -189,7 +189,7 @@ bool cmAddCustomTargetCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; - cmOStringStream e; + std::ostringstream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx index e897d81..b560452 100644 --- a/Source/cmAddDependenciesCommand.cxx +++ b/Source/cmAddDependenciesCommand.cxx @@ -26,7 +26,7 @@ bool cmAddDependenciesCommand std::string target_name = args[0]; if(this->Makefile->IsAlias(target_name)) { - cmOStringStream e; + std::ostringstream e; e << "Cannot add target-level dependencies to alias target \"" << target_name << "\".\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -35,7 +35,7 @@ bool cmAddDependenciesCommand { if (target->GetType() == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Cannot add target-level dependencies to INTERFACE library " "target \"" << target_name << "\".\n"; this->SetError(e.str()); @@ -51,7 +51,7 @@ bool cmAddDependenciesCommand } else { - cmOStringStream e; + std::ostringstream e; e << "Cannot add target-level dependencies to non-existent target \"" << target_name << "\".\n" << "The add_dependencies works for top-level logical targets created " diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx index c30e764..74dc8eb 100644 --- a/Source/cmAddExecutableCommand.cxx +++ b/Source/cmAddExecutableCommand.cxx @@ -79,7 +79,7 @@ bool cmAddExecutableCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; - cmOStringStream e; + std::ostringstream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { @@ -149,7 +149,7 @@ bool cmAddExecutableCommand } if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << "ALIAS requires exactly one target argument."; this->SetError(e.str()); return false; @@ -158,7 +158,7 @@ bool cmAddExecutableCommand const char *aliasedName = s->c_str(); if(this->Makefile->IsAlias(aliasedName)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" is itself an ALIAS."; this->SetError(e.str()); @@ -168,7 +168,7 @@ bool cmAddExecutableCommand this->Makefile->FindTargetToUse(aliasedName, true); if(!aliasedTarget) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" does not already " "exist."; @@ -178,7 +178,7 @@ bool cmAddExecutableCommand cmTarget::TargetType type = aliasedTarget->GetType(); if(type != cmTarget::EXECUTABLE) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" is not an " "executable."; @@ -187,7 +187,7 @@ bool cmAddExecutableCommand } if(aliasedTarget->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" is IMPORTED."; this->SetError(e.str()); @@ -203,7 +203,7 @@ bool cmAddExecutableCommand // Make sure the target does not already exist. if(this->Makefile->FindTargetToUse(exename)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create imported target \"" << exename << "\" because another target with the same name already exists."; this->SetError(e.str()); diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index bba4d41..db2f6fb 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -51,7 +51,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting STATIC type."; this->SetError(e.str()); return false; @@ -64,7 +64,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting SHARED type."; this->SetError(e.str()); return false; @@ -77,7 +77,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting MODULE type."; this->SetError(e.str()); return false; @@ -90,7 +90,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting OBJECT type."; this->SetError(e.str()); return false; @@ -103,7 +103,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting UNKNOWN type."; this->SetError(e.str()); return false; @@ -116,7 +116,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting ALIAS type."; this->SetError(e.str()); return false; @@ -128,21 +128,21 @@ bool cmAddLibraryCommand { if (haveSpecifiedType) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting/multiple types."; this->SetError(e.str()); return false; } if (isAlias) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting ALIAS type."; this->SetError(e.str()); return false; } if (excludeFromAll) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL."; this->SetError(e.str()); return false; @@ -155,7 +155,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL."; this->SetError(e.str()); return false; @@ -175,7 +175,7 @@ bool cmAddLibraryCommand } else if(type == cmTarget::INTERFACE_LIBRARY && *s == "GLOBAL") { - cmOStringStream e; + std::ostringstream e; e << "GLOBAL option may only be used with IMPORTED libraries."; this->SetError(e.str()); return false; @@ -190,14 +190,14 @@ bool cmAddLibraryCommand { if (s != args.end()) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library requires no source arguments."; this->SetError(e.str()); return false; } if (importGlobal && !importTarget) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified as GLOBAL, but not as IMPORTED."; this->SetError(e.str()); return false; @@ -214,7 +214,7 @@ bool cmAddLibraryCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; - cmOStringStream e; + std::ostringstream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { @@ -267,7 +267,7 @@ bool cmAddLibraryCommand } if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << "ALIAS requires exactly one target argument."; this->SetError(e.str()); return false; @@ -276,7 +276,7 @@ bool cmAddLibraryCommand const char *aliasedName = s->c_str(); if(this->Makefile->IsAlias(aliasedName)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" is itself an ALIAS."; this->SetError(e.str()); @@ -286,7 +286,7 @@ bool cmAddLibraryCommand this->Makefile->FindTargetToUse(aliasedName, true); if(!aliasedTarget) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" does not already " "exist."; @@ -300,7 +300,7 @@ bool cmAddLibraryCommand && aliasedType != cmTarget::OBJECT_LIBRARY && aliasedType != cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" is not a library."; this->SetError(e.str()); @@ -308,7 +308,7 @@ bool cmAddLibraryCommand } if(aliasedTarget->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" is IMPORTED."; this->SetError(e.str()); @@ -333,7 +333,7 @@ bool cmAddLibraryCommand (this->Makefile->GetCMakeInstance()->GetPropertyAsBool( "TARGET_SUPPORTS_SHARED_LIBS") == false)) { - cmOStringStream w; + std::ostringstream w; w << "ADD_LIBRARY called with " << (type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE") << @@ -364,7 +364,7 @@ bool cmAddLibraryCommand { if (!cmGeneratorExpression::IsValidTargetName(libName)) { - cmOStringStream e; + std::ostringstream e; e << "Invalid name for IMPORTED INTERFACE library target: " << libName; this->SetError(e.str()); return false; @@ -374,7 +374,7 @@ bool cmAddLibraryCommand // Make sure the target does not already exist. if(this->Makefile->FindTargetToUse(libName)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create imported target \"" << libName << "\" because another target with the same name already exists."; this->SetError(e.str()); @@ -413,7 +413,7 @@ bool cmAddLibraryCommand if (!cmGeneratorExpression::IsValidTargetName(libName) || libName.find("::") != std::string::npos) { - cmOStringStream e; + std::ostringstream e; e << "Invalid name for INTERFACE library target: " << libName; this->SetError(e.str()); return false; diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 477a3d9..8db5078 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -81,7 +81,7 @@ bool cmAddSubDirectoryCommand::InitialPass if(!cmSystemTools::IsSubDirectory(srcPath, this->Makefile->GetCurrentDirectory())) { - cmOStringStream e; + std::ostringstream e; e << "not given a binary directory but the given source directory " << "\"" << srcPath << "\" is not a subdirectory of \"" << this->Makefile->GetCurrentDirectory() << "\". " diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx index 2531a1a..65d295b 100644 --- a/Source/cmAddTestCommand.cxx +++ b/Source/cmAddTestCommand.cxx @@ -51,7 +51,7 @@ bool cmAddTestCommand // allow it to be duplicated. if(!test->GetOldStyle()) { - cmOStringStream e; + std::ostringstream e; e << " given test name \"" << args[0] << "\" which already exists in this directory."; this->SetError(e.str()); @@ -135,7 +135,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << " given unknown argument:\n " << args[i] << "\n"; this->SetError(e.str()); return false; @@ -159,7 +159,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector const& args) // Require a unique test name within the directory. if(this->Makefile->GetTest(name)) { - cmOStringStream e; + std::ostringstream e; e << " given test NAME \"" << name << "\" which already exists in this directory."; this->SetError(e.str()); diff --git a/Source/cmBreakCommand.cxx b/Source/cmBreakCommand.cxx index ff527db..34245b3 100644 --- a/Source/cmBreakCommand.cxx +++ b/Source/cmBreakCommand.cxx @@ -18,7 +18,7 @@ bool cmBreakCommand::InitialPass(std::vector const &args, if(!this->Makefile->IsLoopBlock()) { bool issueMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) { @@ -53,7 +53,7 @@ bool cmBreakCommand::InitialPass(std::vector const &args, if(!args.empty()) { bool issueMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) { diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 93f7801..5d32437 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -78,7 +78,7 @@ bool cmBuildCommand } else { - cmOStringStream e; + std::ostringstream e; e << "unknown argument \"" << args[i] << "\""; this->SetError(e.str()); return false; diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index 384e0a7..8591ed6 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/Source/cmCMakeMinimumRequired.cxx @@ -78,7 +78,7 @@ bool cmCMakeMinimumRequired &required_major, &required_minor, &required_patch, &required_tweak) < 2) { - cmOStringStream e; + std::ostringstream e; e << "could not parse VERSION \"" << version_string << "\"."; this->SetError(e.str()); return false; @@ -97,7 +97,7 @@ bool cmCMakeMinimumRequired current_tweak < required_tweak)) { // The current version is too low. - cmOStringStream e; + std::ostringstream e; e << "CMake " << version_string << " or higher is required. You are running version " << cmVersion::GetCMakeVersion(); @@ -132,7 +132,7 @@ bool cmCMakeMinimumRequired::EnforceUnknownArguments() { if(!this->UnknownArguments.empty()) { - cmOStringStream e; + std::ostringstream e; e << "called with unknown argument \"" << this->UnknownArguments[0] << "\"."; this->SetError(e.str()); diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx index ddd5d6a..9662fbf 100644 --- a/Source/cmCMakePolicyCommand.cxx +++ b/Source/cmCMakePolicyCommand.cxx @@ -56,7 +56,7 @@ bool cmCMakePolicyCommand return this->HandleVersionMode(args); } - cmOStringStream e; + std::ostringstream e; e << "given unknown first argument \"" << args[0] << "\""; this->SetError(e.str()); return false; @@ -82,7 +82,7 @@ bool cmCMakePolicyCommand::HandleSetMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "SET given unrecognized policy status \"" << args[2] << "\""; this->SetError(e.str()); return false; @@ -113,7 +113,7 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector const& args) cmPolicies::PolicyID pid; if(!this->Makefile->GetPolicies()->GetPolicyID(id.c_str(), pid)) { - cmOStringStream e; + std::ostringstream e; e << "GET given policy \"" << id << "\" which is not known to this " << "version of CMake."; this->SetError(e.str()); @@ -140,7 +140,7 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector const& args) case cmPolicies::REQUIRED_ALWAYS: // The policy is required to be set before anything needs it. { - cmOStringStream e; + std::ostringstream e; e << this->Makefile->GetPolicies()->GetRequiredPolicyError(pid) << "\n" << "The call to cmake_policy(GET " << id << " ...) at which this " diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index b304f28..d0dc30a 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -769,7 +769,7 @@ void CCONV cmSourceFileSetName(void *arg, const char* name, const char* dir, } } - cmOStringStream e; + std::ostringstream e; e << "Cannot find source file \"" << pathname << "\""; e << "\n\nTried extensions"; for( std::vector::const_iterator ext = sourceExts.begin(); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 2f1cf10..0c4d76c 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -240,7 +240,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method, //---------------------------------------------------------------------- std::string cmCTest::MakeURLSafe(const std::string& str) { - cmOStringStream ost; + std::ostringstream ost; char buffer[10]; for ( std::string::size_type pos = 0; pos < str.size(); pos ++ ) { @@ -1302,7 +1302,7 @@ int cmCTest::RunTest(std::vector argv, inst.TimeOut = timeout; // Capture output of the child ctest. - cmOStringStream oss; + std::ostringstream oss; inst.SetStreams(&oss, &oss); std::vector args; @@ -1316,7 +1316,7 @@ int cmCTest::RunTest(std::vector argv, if (strcmp(argv[i],"--build-generator") == 0 && timeout > 0) { args.push_back("--test-timeout"); - cmOStringStream msg; + std::ostringstream msg; msg << timeout; args.push_back(msg.str()); } diff --git a/Source/cmCTest.h b/Source/cmCTest.h index e19d32c..deb8896 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -27,7 +27,7 @@ class cmCTestStartCommand; #define cmCTestLog(ctSelf, logType, msg) \ do { \ - cmOStringStream cmCTestLog_msg; \ + std::ostringstream cmCTestLog_msg; \ cmCTestLog_msg << msg; \ (ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__,\ cmCTestLog_msg.str().c_str());\ diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 64b67c9..747b7e4 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -103,7 +103,7 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } return this->EmptyVariable; } - cmOStringStream e; + std::ostringstream e; e << "Syntax $" << key << "{} is not supported. " << "Only ${}, $ENV{}, and $CACHE{} are allowed."; this->SetError(e.str()); @@ -118,7 +118,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) } if(this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << this->FileLine; return this->AddString(ostr.str()); } @@ -136,7 +136,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) cmSystemTools::IsSubDirectory(this->FileName, this->Makefile->GetHomeOutputDirectory())) { - cmOStringStream msg; + std::ostringstream msg; cmListFileBacktrace bt(this->Makefile->GetLocalGenerator()); cmListFileContext lfc; lfc.FilePath = this->FileName; @@ -253,7 +253,7 @@ bool cmCommandArgumentParserHelper::HandleEscapeSymbol break; default: { - cmOStringStream e; + std::ostringstream e; e << "Invalid escape sequence \\" << symbol; this->SetError(e.str()); } @@ -335,7 +335,7 @@ int cmCommandArgumentParserHelper::LexInput(char* buf, int maxlen) void cmCommandArgumentParserHelper::Error(const char* str) { unsigned long pos = static_cast(this->InputBufferPos); - cmOStringStream ostr; + std::ostringstream ostr; ostr << str << " (" << pos << ")"; this->SetError(ostr.str()); } diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index a636d23..20c71fb 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -710,7 +710,7 @@ void cmComputeLinkDepends::CleanConstraintGraph() void cmComputeLinkDepends::DisplayConstraintGraph() { // Display the graph nodes and their edges. - cmOStringStream e; + std::ostringstream e; for(unsigned int i=0; i < this->EntryConstraintGraph.size(); ++i) { EdgeList const& nl = this->EntryConstraintGraph[i]; diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index f4fa5c6..8d24bd0 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1342,7 +1342,7 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item) // Try to separate the framework name and path. if(!this->SplitFramework.find(item.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "Could not parse framework path \"" << item << "\" " << "linked by target " << this->Target->GetName() << "."; cmSystemTools::Error(e.str().c_str()); @@ -1389,7 +1389,7 @@ void cmComputeLinkInformation::DropDirectoryItem(std::string const& item) { // A full path to a directory was found as a link item. Warn the // user. - cmOStringStream e; + std::ostringstream e; e << "WARNING: Target \"" << this->Target->GetName() << "\" requests linking to directory \"" << item << "\". " << "Targets may link only to libraries. " @@ -1505,7 +1505,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item, if(!this->CMakeInstance->GetPropertyAsBool(wid)) { this->CMakeInstance->SetProperty(wid, "1"); - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0008)) << "\n" << "Target \"" << this->Target->GetName() << "\" links to item\n" @@ -1524,7 +1524,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item, case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile->GetPolicies()-> GetRequiredPolicyError(cmPolicies::CMP0008)) << "\n" << "Target \"" << this->Target->GetName() << "\" links to item\n" @@ -1554,7 +1554,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories() if(!this->CMakeInstance->GetPropertyAsBool("CMP0003-WARNING-GIVEN")) { this->CMakeInstance->SetProperty("CMP0003-WARNING-GIVEN", "1"); - cmOStringStream w; + std::ostringstream w; this->PrintLinkPolicyDiagnosis(w); this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), this->Target->GetBacktrace()); @@ -1569,7 +1569,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories() case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile->GetPolicies()-> GetRequiredPolicyError(cmPolicies::CMP0003)) << "\n"; this->PrintLinkPolicyDiagnosis(e); diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 75d3967..cf2b88e 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -361,7 +361,7 @@ void cmComputeTargetDepends::AddTargetDepend( cmMakefile *makefile = depender->GetMakefile(); cmake::MessageType messageType = cmake::AUTHOR_WARNING; bool issueMessage = false; - cmOStringStream e; + std::ostringstream e; switch(depender->GetPolicyStatusCMP0046()) { case cmPolicies::WARN: @@ -539,7 +539,7 @@ cmComputeTargetDepends bool strong) { // Construct the error message. - cmOStringStream e; + std::ostringstream e; e << "The inter-target dependency graph contains the following " << "strongly connected component (cycle):\n"; std::vector const& components = ccg.GetComponents(); diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index aba26de..73b4ba2 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -119,7 +119,7 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted( if(!hasBeenReported) { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile.GetPolicies()->GetPolicyWarning( cmPolicies::CMP0054)) << "\n"; e << "Quoted variables like \"" << argument.GetValue() << @@ -169,7 +169,7 @@ bool cmConditionEvaluator::IsKeyword(std::string const& keyword, if(!hasBeenReported) { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile.GetPolicies()->GetPolicyWarning( cmPolicies::CMP0054)) << "\n"; e << "Quoted keywords like \"" << argument.GetValue() << @@ -559,7 +559,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList &newArgs, cmsys::RegularExpression regEntry; if ( !regEntry.compile(rex) ) { - cmOStringStream error; + std::ostringstream error; error << "Regular expression \"" << rex << "\" cannot compile"; errorString = error.str(); status = cmake::FATAL_ERROR; diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index cc6cf5f..fa7f486 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -34,7 +34,7 @@ bool cmConfigureFileCommand // If the input location is a directory, error out. if(cmSystemTools::FileIsDirectory(this->InputFile)) { - cmOStringStream e; + std::ostringstream e; e << "input location\n" << " " << this->InputFile << "\n" << "is a directory but a file was expected."; diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 0030b84..002e75a 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -150,7 +150,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) } else { - cmOStringStream m; + std::ostringstream m; m << "try_compile given unknown argument \"" << argv[i] << "\"."; this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str()); } @@ -220,7 +220,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) // do not allow recursive try Compiles if (this->BinaryDirectory == this->Makefile->GetHomeOutputDirectory()) { - cmOStringStream e; + std::ostringstream e; e << "Attempt at a recursive or nested TRY_COMPILE in directory\n" << " " << this->BinaryDirectory << "\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -256,7 +256,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) } else { - cmOStringStream err; + std::ostringstream err; err << "Unknown extension \"" << ext << "\" for file\n" << " " << *si << "\n" << "try_compile() works only for enabled languages. " @@ -282,7 +282,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) FILE *fout = cmsys::SystemTools::Fopen(outFileName,"w"); if (!fout) { - cmOStringStream e; + std::ostringstream e; e << "Failed to open\n" << " " << outFileName << "\n" << cmSystemTools::GetLastSystemError(); @@ -337,7 +337,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) if(this->Makefile->PolicyOptionalWarningEnabled( "CMAKE_POLICY_WARNING_CMP0056")) { - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetCMakeInstance()->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0056)) << "\n" "For compatibility with older versions of CMake, try_compile " @@ -553,7 +553,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) !cmSystemTools::CopyFileAlways(this->OutputFile, copyFile)) { - cmOStringStream emsg; + std::ostringstream emsg; emsg << "Cannot copy output executable\n" << " '" << this->OutputFile << "'\n" << "to destination specified by COPY_FILE:\n" @@ -691,7 +691,7 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName) } } - cmOStringStream emsg; + std::ostringstream emsg; emsg << "Unable to find the executable at any of:\n"; for (unsigned int i = 0; i < searchDirs.size(); ++i) { diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx index 6b729de..5ff0186 100644 --- a/Source/cmDefinePropertyCommand.cxx +++ b/Source/cmDefinePropertyCommand.cxx @@ -53,7 +53,7 @@ bool cmDefinePropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid scope " << args[0] << ". " << "Valid scopes are " << "GLOBAL, DIRECTORY, TARGET, SOURCE, " @@ -100,7 +100,7 @@ bool cmDefinePropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index 947db82..d419011 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -123,7 +123,7 @@ void cmDepends::Clear(const char *file) // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Clearing dependencies in \"" << file << "\"." << std::endl; cmSystemTools::Stdout(msg.str().c_str()); } @@ -213,7 +213,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dependee << "\" does not exist for depender \"" << depender << "\"." << std::endl; @@ -235,7 +235,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dependee << "\" is newer than depender \"" << depender << "\"." << std::endl; @@ -257,7 +257,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dependee << "\" is newer than depends file \"" << internalDependsFileName << "\"." << std::endl; diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index cab23b7..d062987 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -532,7 +532,7 @@ cmELFInternalImpl break; } #endif - cmOStringStream e; + std::ostringstream e; e << "Unknown ELF file type " << eti; this->SetErrorMessage(e.str().c_str()); return; diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 11f8ae5..0707906 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -189,7 +189,7 @@ bool cmExecuteProcessCommand } else { - cmOStringStream e; + std::ostringstream e; e << " given unknown argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 134ee98..a28ec48 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -45,7 +45,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) } else { - cmOStringStream e; + std::ostringstream e; e << "given target \"" << te->GetName() << "\" more than once."; this->Makefile->GetCMakeInstance() ->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace); @@ -70,7 +70,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) cmTarget* te = *tei; if (te->GetProperty("INTERFACE_SOURCES")) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << te->GetName() << "\" has a populated INTERFACE_SOURCES property. This is not " @@ -313,7 +313,7 @@ cmExportBuildFileGenerator return; } - cmOStringStream e; + std::ostringstream e; e << "export called with target \"" << depender->GetName() << "\" which requires target \"" << dependee->GetName() << "\" "; if (occurrences == 0) diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index db21c49..76283d4 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -89,7 +89,7 @@ bool cmExportCommand if(cmSystemTools::GetFilenameLastExtension(this->Filename.GetCString()) != ".cmake") { - cmOStringStream e; + std::ostringstream e; e << "FILE option given filename \"" << this->Filename.GetString() << "\" which does not have an extension of \".cmake\".\n"; this->SetError(e.str()); @@ -103,7 +103,7 @@ bool cmExportCommand { if(!this->Makefile->CanIWriteThisFile(fname.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "FILE option given filename \"" << fname << "\" which is in the source tree.\n"; this->SetError(e.str()); @@ -126,7 +126,7 @@ bool cmExportCommand { if (this->Append.IsEnabled()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT signature does not recognise the APPEND option."; this->SetError(e.str()); return false; @@ -134,7 +134,7 @@ bool cmExportCommand if (this->ExportOld.IsEnabled()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT signature does not recognise the " "EXPORT_LINK_INTERFACE_LIBRARIES option."; this->SetError(e.str()); @@ -145,7 +145,7 @@ bool cmExportCommand std::string setName = this->ExportSetName.GetString(); if (setMap.find(setName) == setMap.end()) { - cmOStringStream e; + std::ostringstream e; e << "Export set \"" << setName << "\" not found."; this->SetError(e.str()); return false; @@ -161,7 +161,7 @@ bool cmExportCommand { if (this->Makefile->IsAlias(*currentTarget)) { - cmOStringStream e; + std::ostringstream e; e << "given ALIAS target \"" << *currentTarget << "\" which may not be exported."; this->SetError(e.str()); @@ -172,7 +172,7 @@ bool cmExportCommand { if(target->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "given OBJECT library \"" << *currentTarget << "\" which may not be exported."; this->SetError(e.str()); @@ -181,7 +181,7 @@ bool cmExportCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given target \"" << *currentTarget << "\" which is not built by this project."; this->SetError(e.str()); @@ -261,7 +261,7 @@ bool cmExportCommand::HandlePackage(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "PACKAGE given unknown argument: " << args[i]; this->SetError(e.str()); return false; @@ -278,7 +278,7 @@ bool cmExportCommand::HandlePackage(std::vector const& args) cmsys::RegularExpression packageRegex(packageExpr); if(!packageRegex.find(package.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "PACKAGE given invalid package name \"" << package << "\". " << "Package names must match \"" << packageExpr << "\"."; this->SetError(e.str()); @@ -314,7 +314,7 @@ void cmExportCommand::ReportRegistryError(std::string const& msg, std::string const& key, long err) { - cmOStringStream e; + std::ostringstream e; e << msg << "\n" << " HKEY_CURRENT_USER\\" << key << "\n"; wchar_t winmsg[1024]; @@ -355,7 +355,7 @@ void cmExportCommand::StorePackageRegistryWin(std::string const& package, RegCloseKey(hKey); if(err != ERROR_SUCCESS) { - cmOStringStream msg; + std::ostringstream msg; msg << "Cannot set registry value \"" << hash << "\" under key"; this->ReportRegistryError(msg.str(), key, err); return; @@ -400,7 +400,7 @@ void cmExportCommand::StorePackageRegistryDir(std::string const& package, } else { - cmOStringStream e; + std::ostringstream e; e << "Cannot create package registry file:\n" << " " << fname << "\n" << cmSystemTools::GetLastSystemError() << "\n"; diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 1f39d7a..0254cb4 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -81,7 +81,7 @@ bool cmExportFileGenerator::GenerateImportFile() if(!foutPtr.get() || !*foutPtr) { std::string se = cmSystemTools::GetLastSystemError(); - cmOStringStream e; + std::ostringstream e; e << "cannot write to file \"" << this->MainImportFile << "\": " << se; cmSystemTools::Error(e.str().c_str()); @@ -247,7 +247,7 @@ static bool checkInterfaceDirs(const std::string &prepro, continue; } cmake::MessageType messageType = cmake::FATAL_ERROR; - cmOStringStream e; + std::ostringstream e; if (genexPos != std::string::npos) { switch (target->GetPolicyStatusCMP0041()) @@ -295,7 +295,7 @@ static bool checkInterfaceDirs(const std::string &prepro, { case cmPolicies::WARN: { - cmOStringStream s; + std::ostringstream s; s << target->GetMakefile()->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0052) << "\n"; s << "Directory:\n \"" << *li << "\"\nin " @@ -391,7 +391,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( if (cge->GetHadContextSensitiveCondition()) { cmMakefile* mf = target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target->GetName() << "\" is installed with " "INCLUDES DESTINATION set to a context sensitive path. Paths which " "depend on the configuration, policy values or the link interface are " @@ -473,7 +473,7 @@ void getCompatibleInterfaceProperties(cmTarget *target, if (!info) { cmMakefile* mf = target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "Exporting the target \"" << target->GetName() << "\" is not " "allowed since its linker language cannot be determined"; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -773,7 +773,7 @@ cmExportFileGenerator if(newCMP0022Behavior && !this->ExportOld) { cmMakefile *mf = target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, " "but also has old-style LINK_INTERFACE_LIBRARIES properties " "populated, but it was exported without the " @@ -857,7 +857,7 @@ cmExportFileGenerator { std::string prop = "IMPORTED_LINK_INTERFACE_MULTIPLICITY"; prop += suffix; - cmOStringStream m; + std::ostringstream m; m << iface->Multiplicity; properties[prop] = m.str(); } diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 3f5866a..98ed818 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -56,7 +56,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) } else { - cmOStringStream e; + std::ostringstream e; e << "install(EXPORT \"" << this->IEGen->GetExportSet()->GetName() << "\" ...) " << "includes target \"" << te->Target->GetName() @@ -133,7 +133,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) if (te->GetProperty("INTERFACE_SOURCES")) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << te->GetName() << "\" has a populated INTERFACE_SOURCES property. This is not " @@ -290,7 +290,7 @@ cmExportInstallFileGenerator::GenerateImportFileConfig( if(!exportFileStream) { std::string se = cmSystemTools::GetLastSystemError(); - cmOStringStream e; + std::ostringstream e; e << "cannot write to file \"" << fileName << "\": " << se; cmSystemTools::Error(e.str().c_str()); @@ -516,7 +516,7 @@ cmExportInstallFileGenerator cmTarget* dependee, int occurrences) { - cmOStringStream e; + std::ostringstream e; e << "install(EXPORT \"" << this->IEGen->GetExportSet()->GetName() << "\" ...) " diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx index cc35f84..6016c4c 100644 --- a/Source/cmExprParserHelper.cxx +++ b/Source/cmExprParserHelper.cxx @@ -99,7 +99,7 @@ int cmExprParserHelper::LexInput(char* buf, int maxlen) void cmExprParserHelper::Error(const char* str) { unsigned long pos = static_cast(this->InputBufferPos); - cmOStringStream ostr; + std::ostringstream ostr; ostr << str << " (" << pos << ")"; this->ErrorString = ostr.str(); } diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index cc42bca..eb50a7d 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -454,7 +454,7 @@ cmExtraCodeLiteGenerator::GetBuildCommand(const cmMakefile* mf) const else if ( generator == "MinGW Makefiles" || generator == "Unix Makefiles" ) { - cmOStringStream ss; + std::ostringstream ss; ss << make << " -j " << this->CpuCount; buildCommand = ss.str(); } @@ -482,7 +482,7 @@ cmExtraCodeLiteGenerator::GetSingleFileBuildCommand std::string generator = mf->GetSafeDefinition("CMAKE_GENERATOR"); if ( generator == "Unix Makefiles" || generator == "MinGW Makefiles" ) { - cmOStringStream ss; + std::ostringstream ss; ss << make << " -f$(ProjectPath)/Makefile $(CurrentFileName).cpp.o"; buildCommand = ss.str(); } diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 3c2dfa5..0306f18 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -404,7 +404,7 @@ bool cmFileCommand::HandleHashCommand(std::vector const& args) #if defined(CMAKE_BUILD_WITH_CMAKE) if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " requires a file name and output variable"; this->SetError(e.str()); return false; @@ -419,14 +419,14 @@ bool cmFileCommand::HandleHashCommand(std::vector const& args) this->Makefile->AddDefinition(args[2], out.c_str()); return true; } - cmOStringStream e; + std::ostringstream e; e << args[0] << " failed to read file \"" << args[1] << "\": " << cmSystemTools::GetLastSystemError(); this->SetError(e.str()); } return false; #else - cmOStringStream e; + std::ostringstream e; e << args[0] << " not available during bootstrap"; this->SetError(e.str().c_str()); return false; @@ -519,7 +519,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) if(sscanf(args[i].c_str(), "%d", &limit_input) != 1 || limit_input < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LIMIT_INPUT value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -532,7 +532,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) if(sscanf(args[i].c_str(), "%d", &limit_output) != 1 || limit_output < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LIMIT_OUTPUT value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -545,7 +545,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) int count; if(sscanf(args[i].c_str(), "%d", &count) != 1 || count < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LIMIT_COUNT value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -559,7 +559,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) int len; if(sscanf(args[i].c_str(), "%d", &len) != 1 || len < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LENGTH_MINIMUM value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -573,7 +573,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) int len; if(sscanf(args[i].c_str(), "%d", &len) != 1 || len < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LENGTH_MAXIMUM value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -586,7 +586,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) { if(!regex.compile(args[i].c_str())) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option REGEX value \"" << args[i] << "\" could not be compiled."; this->SetError(e.str()); @@ -603,7 +603,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option ENCODING \"" << args[i] << "\" not recognized."; this->SetError(e.str()); @@ -613,7 +613,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "STRINGS given unknown argument \"" << args[i] << "\""; this->SetError(e.str()); @@ -641,7 +641,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) #endif if(!fin) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS file \"" << fileName << "\" cannot be read."; this->SetError(e.str()); return false; @@ -1037,7 +1037,7 @@ cmFileCommand::HandleDifferentCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "DIFFERENT given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -1152,7 +1152,7 @@ protected: { if(permissions && !cmSystemTools::SetPermissions(toFile, permissions)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot set permissions on \"" << toFile << "\""; this->FileCommand->SetError(e.str()); return false; @@ -1176,7 +1176,7 @@ protected: else if(arg == "SETGID") { permissions |= mode_setgid; } else { - cmOStringStream e; + std::ostringstream e; e << this->Name << " given invalid permission \"" << arg << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -1203,7 +1203,7 @@ protected: virtual bool ReportMissing(const char* fromFile) { // The input file does not exist and installation is not optional. - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot find \"" << fromFile << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -1236,14 +1236,14 @@ protected: void NotBeforeMatch(std::string const& arg) { - cmOStringStream e; + std::ostringstream e; e << "option " << arg << " may not appear before PATTERN or REGEX."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; } void NotAfterMatch(std::string const& arg) { - cmOStringStream e; + std::ostringstream e; e << "option " << arg << " may not appear after PATTERN or REGEX."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; @@ -1281,7 +1281,7 @@ bool cmFileCopier::Parse(std::vector const& args) if(!this->CheckKeyword(args[i]) && !this->CheckValue(args[i])) { - cmOStringStream e; + std::ostringstream e; e << "called with unknown argument \"" << args[i] << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -1297,7 +1297,7 @@ bool cmFileCopier::Parse(std::vector const& args) // Require a destination. if(this->Destination.empty()) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " given no DESTINATION"; this->FileCommand->SetError(e.str()); return false; @@ -1477,7 +1477,7 @@ bool cmFileCopier::CheckValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "could not compile PATTERN \"" << arg << "\"."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; @@ -1493,7 +1493,7 @@ bool cmFileCopier::CheckValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "could not compile REGEX \"" << arg << "\"."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; @@ -1573,7 +1573,7 @@ bool cmFileCopier::Install(const char* fromFile, const char* toFile) { if(!*fromFile) { - cmOStringStream e; + std::ostringstream e; e << "INSTALL encountered an empty string input file name."; this->FileCommand->SetError(e.str()); return false; @@ -1614,7 +1614,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile) std::string symlinkTarget; if(!cmSystemTools::ReadSymlink(fromFile, symlinkTarget)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot read symlink \"" << fromFile << "\" to duplicate at \"" << toFile << "\"."; this->FileCommand->SetError(e.str()); @@ -1647,7 +1647,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile) // Create the symlink. if(!cmSystemTools::CreateSymlink(symlinkTarget, toFile)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot duplicate symlink \"" << fromFile << "\" at \"" << toFile << "\"."; this->FileCommand->SetError(e.str()); @@ -1679,7 +1679,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile, // Copy the file. if(copy && !cmSystemTools::CopyAFile(fromFile, toFile, true)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot copy file \"" << fromFile << "\" to \"" << toFile << "\"."; this->FileCommand->SetError(e.str()); @@ -1698,7 +1698,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile, } if (!cmSystemTools::CopyFileTime(fromFile, toFile)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot set modification time on \"" << toFile << "\""; this->FileCommand->SetError(e.str()); @@ -1730,7 +1730,7 @@ bool cmFileCopier::InstallDirectory(const char* source, // Make sure the destination directory exists. if(!cmSystemTools::MakeDirectory(destination)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot make directory \"" << destination << "\": " << cmSystemTools::GetLastSystemError(); this->FileCommand->SetError(e.str()); @@ -2075,7 +2075,7 @@ bool cmFileInstaller::CheckKeyword(std::string const& arg) else if(arg == "COMPONENTS" || arg == "CONFIGURATIONS" || arg == "PROPERTIES") { - cmOStringStream e; + std::ostringstream e; e << "INSTALL called with old-style " << arg << " argument. " << "This script was generated with an older version of CMake. " << "Re-run this cmake version on your build tree."; @@ -2143,7 +2143,7 @@ bool cmFileInstaller } else { - cmOStringStream e; + std::ostringstream e; e << "Option TYPE given unknown value \"" << stype << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -2288,7 +2288,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHANGE given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -2311,7 +2311,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector const& args) } if(!cmSystemTools::FileExists(file, true)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHANGE given FILE \"" << file << "\" that does not exist."; this->SetError(e.str()); return false; @@ -2323,7 +2323,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector const& args) bool changed; if(!cmSystemTools::ChangeRPath(file, oldRPath, newRPath, &emsg, &changed)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHANGE could not write new RPATH:\n" << " " << newRPath << "\n" << "to the file:\n" @@ -2373,7 +2373,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "RPATH_REMOVE given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -2386,7 +2386,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector const& args) } if(!cmSystemTools::FileExists(file, true)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_REMOVE given FILE \"" << file << "\" that does not exist."; this->SetError(e.str()); return false; @@ -2398,7 +2398,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector const& args) bool removed; if(!cmSystemTools::RemoveRPath(file, &emsg, &removed)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_REMOVE could not remove RPATH from file:\n" << " " << file << "\n" << emsg; @@ -2454,7 +2454,7 @@ cmFileCommand::HandleRPathCheckCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHECK given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -2555,7 +2555,7 @@ bool cmFileCommand::HandleRename(std::vector const& args) if(!cmSystemTools::RenameFile(oldname.c_str(), newname.c_str())) { std::string err = cmSystemTools::GetLastSystemError(); - cmOStringStream e; + std::ostringstream e; e << "RENAME failed to rename\n" << " " << oldname << "\n" << "to\n" @@ -2722,7 +2722,7 @@ namespace { if (updated) { - cmOStringStream oss; + std::ostringstream oss; oss << "[" << this->Text << " " << this->CurrentPercentage << "% complete]"; status = oss.str(); @@ -2994,7 +2994,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) msg += "\""; if(statusVar.size()) { - cmOStringStream result; + std::ostringstream result; result << (int)0 << ";\"" << msg; this->Makefile->AddDefinition(statusVar, result.str().c_str()); @@ -3133,7 +3133,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) if(statusVar.size()) { - cmOStringStream result; + std::ostringstream result; result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\""; this->Makefile->AddDefinition(statusVar, result.str().c_str()); @@ -3159,7 +3159,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) if (expectedHash != actualHash) { - cmOStringStream oss; + std::ostringstream oss; oss << "DOWNLOAD HASH mismatch" << std::endl << " for file: [" << file << "]" << std::endl << " expected hash: [" << expectedHash << "]" << std::endl @@ -3392,7 +3392,7 @@ cmFileCommand::HandleUploadCommand(std::vector const& args) if(statusVar.size()) { - cmOStringStream result; + std::ostringstream result; result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\""; this->Makefile->AddDefinition(statusVar, result.str().c_str()); @@ -3568,7 +3568,7 @@ bool cmFileCommand::HandleLockCommand( } else { - cmOStringStream e; + std::ostringstream e; e << merr << ", but got:\n \"" << args[i] << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -3601,7 +3601,7 @@ bool cmFileCommand::HandleLockCommand( if(!cmSystemTools::StringToLong(args[i].c_str(), &scanned) || scanned < 0) { - cmOStringStream e; + std::ostringstream e; e << "TIMEOUT value \"" << args[i] << "\" is not an unsigned integer."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -3610,7 +3610,7 @@ bool cmFileCommand::HandleLockCommand( } else { - cmOStringStream e; + std::ostringstream e; e << "expected DIRECTORY, RELEASE, GUARD, RESULT_VARIABLE or TIMEOUT\n"; e << "but got: \"" << args[i] << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -3635,7 +3635,7 @@ bool cmFileCommand::HandleLockCommand( std::string parentDir = cmSystemTools::GetParentDirectory(path); if (!cmSystemTools::MakeDirectory(parentDir)) { - cmOStringStream e; + std::ostringstream e; e << "directory\n \"" << parentDir << "\"\ncreation failed "; e << "(check permissions)."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -3645,7 +3645,7 @@ bool cmFileCommand::HandleLockCommand( FILE *file = cmsys::SystemTools::Fopen(path, "w"); if (!file) { - cmOStringStream e; + std::ostringstream e; e << "file\n \"" << path << "\"\ncreation failed (check permissions)."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); cmSystemTools::SetFatalErrorOccured(); @@ -3685,7 +3685,7 @@ bool cmFileCommand::HandleLockCommand( if (resultVariable.empty() && !fileLockResult.IsOk()) { - cmOStringStream e; + std::ostringstream e; e << "error locking file\n \"" << path << "\"\n" << result << "."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); cmSystemTools::SetFatalErrorOccured(); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 8410cda..9386e42 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -301,7 +301,7 @@ bool cmFindPackageCommand if(args[i].find_first_of(":/\\") != args[i].npos || cmSystemTools::GetFilenameLastExtension(args[i]) != ".cmake") { - cmOStringStream e; + std::ostringstream e; e << "given CONFIGS option followed by invalid file name \"" << args[i] << "\". The names given must be file names without " << "a path and with a \".cmake\" extension."; @@ -317,7 +317,7 @@ bool cmFindPackageCommand } else { - cmOStringStream e; + std::ostringstream e; e << "called with invalid argument \"" << args[i] << "\""; this->SetError(e.str()); return false; @@ -330,7 +330,7 @@ bool cmFindPackageCommand std::back_inserter(doubledComponents)); if(!doubledComponents.empty()) { - cmOStringStream e; + std::ostringstream e; e << "called with components that are both required and optional:\n"; for(unsigned int i=0; iUseConfigFiles = moduleArgs.empty(); if(!this->UseFindModules && !this->UseConfigFiles) { - cmOStringStream e; + std::ostringstream e; e << "given options exclusive to Module mode:\n"; for(std::set::const_iterator si = moduleArgs.begin(); si != moduleArgs.end(); ++si) @@ -427,7 +427,7 @@ bool cmFindPackageCommand { if (this->Required) { - cmOStringStream e; + std::ostringstream e; e << "for module " << this->Name << " called with REQUIRED, but " << disableFindPackageVar << " is enabled. A REQUIRED package cannot be disabled."; @@ -460,7 +460,7 @@ bool cmFindPackageCommand if(this->UseFindModules && this->UseConfigFiles && this->Makefile->IsOn("CMAKE_FIND_PACKAGE_WARN_NO_MODULE")) { - cmOStringStream aw; + std::ostringstream aw; if(this->RequiredCMakeVersion >= CMake_VERSION_ENCODE(2,8,8)) { aw << "find_package called without either MODULE or CONFIG option and " @@ -751,8 +751,8 @@ bool cmFindPackageCommand::HandlePackageMode() if (result && !found && (!this->Quiet || this->Required)) { // The variable is not set. - cmOStringStream e; - cmOStringStream aw; + std::ostringstream e; + std::ostringstream aw; if (configFileSetFOUNDFalse) { e << "Found package configuration file:\n" @@ -1470,7 +1470,7 @@ void cmFindPackageCommand::FillPrefixesBuilds() // It is likely that CMake will have recently built the project. for(int i=0; i <= 10; ++i) { - cmOStringStream r; + std::ostringstream r; r << "[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\" "Settings\\StartPath;WhereBuild" << i << "]"; diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 03d6590..8e3510d 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -170,7 +170,7 @@ bool cmForEachCommand step == 0 ) { - cmOStringStream str; + std::ostringstream str; str << "called with incorrect range specification: start "; str << start << ", stop " << stop << ", step " << step; this->SetError(str.str()); @@ -243,7 +243,7 @@ bool cmForEachCommand::HandleInMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "Unknown argument:\n" << " " << args[i] << "\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return true; diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 3580374..556ef19 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -103,7 +103,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies); // set the value of argc - cmOStringStream strStream; + std::ostringstream strStream; strStream << expandedArgs.size(); this->Makefile->AddDefinition("ARGC",strStream.str().c_str()); this->Makefile->MarkVariableAsUsed("ARGC"); @@ -111,7 +111,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass // set the values for ARGV0 ARGV1 ... for (unsigned int t = 0; t < expandedArgs.size(); ++t) { - cmOStringStream tmpStream; + std::ostringstream tmpStream; tmpStream << "ARGV" << t; this->Makefile->AddDefinition(tmpStream.str(), expandedArgs[t].c_str()); diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index 75a84cb..bfbe918 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -106,7 +106,7 @@ void cmGeneratorExpressionDAGChecker::ReportError( if (parent && !parent->Parent) { - cmOStringStream e; + std::ostringstream e; e << "Error evaluating generator expression:\n" << " " << expr << "\n" << "Self reference on target \"" @@ -118,7 +118,7 @@ void cmGeneratorExpressionDAGChecker::ReportError( } { - cmOStringStream e; + std::ostringstream e; e << "Error evaluating generator expression:\n" << " " << expr << "\n" << "Dependency loop found."; @@ -130,7 +130,7 @@ void cmGeneratorExpressionDAGChecker::ReportError( int loopStep = 1; while (parent) { - cmOStringStream e; + std::ostringstream e; e << "Loop step " << loopStep << "\n" << " " << (parent->Content ? parent->Content->GetOriginalExpression() : expr) diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index 03d0bc6..4e2a868 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -51,7 +51,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config, } if (condResult != "1") { - cmOStringStream e; + std::ostringstream e; e << "Evaluation file condition \"" << rawCondition << "\" did " "not evaluate to valid content. Got \"" << condResult << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -73,7 +73,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config, { return; } - cmOStringStream e; + std::ostringstream e; e << "Evaluation file to be written multiple times for different " "configurations with different content:\n " << outputFileName; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -123,7 +123,7 @@ void cmGeneratorExpressionEvaluationFile::Generate() cmsys::ifstream fin(this->Input.c_str()); if(!fin) { - cmOStringStream e; + std::ostringstream e; e << "Evaluation file \"" << this->Input << "\" cannot be read."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 7ddf4d0..2975c43 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -36,7 +36,7 @@ void reportError(cmGeneratorExpressionContext *context, return; } - cmOStringStream e; + std::ostringstream e; e << "Error evaluating generator expression:\n" << " " << expr << "\n" << result; @@ -456,7 +456,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << context->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0044); context->Makefile->GetCMakeInstance() @@ -953,7 +953,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode if (!target) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << targetName << "\" not found."; @@ -1253,7 +1253,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode { if (!context->EvaluateForBuildsystem) { - cmOStringStream e; + std::ostringstream e; e << "The evaluation of the TARGET_OBJECTS generator expression " "is only suitable for consumption by CMake. It is not suitable " "for writing out elsewhere."; @@ -1266,7 +1266,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode context->Makefile->FindGeneratorTargetToUse(tgtName); if (!gt) { - cmOStringStream e; + std::ostringstream e; e << "Objects of target \"" << tgtName << "\" referenced but no such target exists."; reportError(context, content->GetOriginalExpression(), e.str()); @@ -1274,7 +1274,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode } if (gt->GetType() != cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Objects of target \"" << tgtName << "\" referenced but is not an OBJECT library."; reportError(context, content->GetOriginalExpression(), e.str()); @@ -2028,7 +2028,7 @@ std::string GeneratorExpressionContent::EvaluateParameters( } else { - cmOStringStream e; + std::ostringstream e; e << "$<" + identifier + "> expression requires " << numExpected << " comma separated parameters, but got " diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 2b531e2..cca06bb 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -31,7 +31,7 @@ void reportBadObjLib(std::vector const& badObjLib, { if(!badObjLib.empty()) { - cmOStringStream e; + std::ostringstream e; e << "OBJECT library \"" << target->GetName() << "\" contains:\n"; for(std::vector::const_iterator i = badObjLib.begin(); i != badObjLib.end(); ++i) @@ -630,7 +630,7 @@ cmTargetTraceDependencies this->GlobalGenerator->GetFilenameTargetDepends(sf); if (tgts.find(this->Target) != tgts.end()) { - cmOStringStream e; + std::ostringstream e; e << "Evaluation output file\n \"" << sf->GetFullPath() << "\"\ndepends on the sources of a target it is used in. This " "is a dependency loop and is not allowed."; diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 3c59c25..f0b2686 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -73,7 +73,7 @@ bool cmGetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid scope " << args[1] << ". " << "Valid scopes are " << "GLOBAL, DIRECTORY, TARGET, SOURCE, TEST, VARIABLE, CACHE, INSTALL."; @@ -122,7 +122,7 @@ bool cmGetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; @@ -312,7 +312,7 @@ bool cmGetPropertyCommand::HandleTargetMode() } else { - cmOStringStream e; + std::ostringstream e; e << "could not find TARGET " << this->Name << ". Perhaps it has not yet been created."; this->SetError(e.str()); @@ -338,7 +338,7 @@ bool cmGetPropertyCommand::HandleSourceMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given SOURCE name that could not be found or created: " << this->Name; this->SetError(e.str()); @@ -362,7 +362,7 @@ bool cmGetPropertyCommand::HandleTestMode() } // If not found it is an error. - cmOStringStream e; + std::ostringstream e; e << "given TEST name that does not exist: " << this->Name; this->SetError(e.str()); return false; @@ -423,7 +423,7 @@ bool cmGetPropertyCommand::HandleInstallMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given INSTALL name that could not be found or created: " << this->Name; this->SetError(e.str()); diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index aa6f0c1..d8f7679 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -47,7 +47,7 @@ bool cmGetTargetPropertyCommand else { bool issueMessage = false; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0045)) { diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index dd7fbc8..aee96dd 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -88,7 +88,7 @@ bool cmGlobalGenerator::SetGeneratorPlatform(std::string const& p, } else { - cmOStringStream e; + std::ostringstream e; e << "Generator\n" " " << this->GetName() << "\n" @@ -109,7 +109,7 @@ bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts, } else { - cmOStringStream e; + std::ostringstream e; e << "Generator\n" " " << this->GetName() << "\n" @@ -284,7 +284,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM") || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) { - cmOStringStream err; + std::ostringstream err; err << "CMake was unable to find a build program corresponding to \"" << this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You " << "probably need to select a different build tool."; @@ -405,7 +405,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, const char* lang = li->c_str(); if(this->LanguagesReady.find(lang) == this->LanguagesReady.end()) { - cmOStringStream e; + std::ostringstream e; e << "The test project needs language " << lang << " which is not enabled."; this->TryCompileOuterMakefile @@ -467,7 +467,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (pop) #endif - cmOStringStream windowsVersionString; + std::ostringstream windowsVersionString; windowsVersionString << osvi.dwMajorVersion << "." << osvi.dwMinorVersion; windowsVersionString.str(); mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", @@ -660,7 +660,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, std::string compilerEnv = "CMAKE_"; compilerEnv += lang; compilerEnv += "_COMPILER_ENV_VAR"; - cmOStringStream noCompiler; + std::ostringstream noCompiler; const char* compilerFile = mf->GetDefinition(compilerName); if(!compilerFile || !*compilerFile || cmSystemTools::IsNOTFOUND(compilerFile)) @@ -852,7 +852,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf, if(!this->CMakeInstance->GetIsInTryCompile() && mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0025")) { - cmOStringStream w; + std::ostringstream w; w << policies->GetPolicyWarning(cmPolicies::CMP0025) << "\n" "Converting " << lang << " compiler id \"AppleClang\" to \"Clang\" for compatibility." @@ -884,7 +884,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf, if(!this->CMakeInstance->GetIsInTryCompile() && mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0047")) { - cmOStringStream w; + std::ostringstream w; w << policies->GetPolicyWarning(cmPolicies::CMP0047) << "\n" "Converting " << lang << " compiler id \"QCC\" to \"GNU\" for compatibility." @@ -1147,7 +1147,7 @@ void cmGlobalGenerator::Configure() if ( this->CMakeInstance->GetWorkingMode() == cmake::NORMAL_MODE) { - cmOStringStream msg; + std::ostringstream msg; if(cmSystemTools::GetErrorOccuredFlag()) { msg << "Configuring incomplete, errors occurred!"; @@ -1196,7 +1196,7 @@ bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const } // This generator does not support duplicate custom targets. - cmOStringStream e; + std::ostringstream e; e << "This project has enabled the ALLOW_DUPLICATE_CUSTOM_TARGETS " << "global property. " << "The \"" << this->GetName() << "\" generator does not support " @@ -1346,7 +1346,7 @@ void cmGlobalGenerator::Generate() if(!this->CMP0042WarnTargets.empty()) { - cmOStringStream w; + std::ostringstream w; w << (this->GetCMakeInstance()->GetPolicies()-> GetPolicyWarning(cmPolicies::CMP0042)) << "\n"; @@ -2331,7 +2331,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end()); depends.erase(depends.begin(), depends.end()); - cmOStringStream ostr; + std::ostringstream ostr; if ( componentsSet->size() > 0 ) { ostr << "Available install components are:"; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 6f0586b..b93fbb3 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -71,7 +71,7 @@ std::string cmGlobalNinjaGenerator::EncodeIdent(const std::string &ident, if (std::find_if(ident.begin(), ident.end(), std::not1(std::ptr_fun(IsIdentChar))) != ident.end()) { static unsigned VarNum = 0; - cmOStringStream names; + std::ostringstream names; names << "ident" << VarNum++; vars << names.str() << " = " << ident << "\n"; return "$" + names.str(); @@ -191,7 +191,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, build += " " + rule; // Write the variables bound to this build statement. - cmOStringStream variable_assignments; + std::ostringstream variable_assignments; for(cmNinjaVars::const_iterator i = variables.begin(); i != variables.end(); ++i) cmGlobalNinjaGenerator::WriteVariable(variable_assignments, @@ -295,7 +295,7 @@ cmGlobalNinjaGenerator::AddMacOSXContentRule() cmLocalGenerator *lg = this->LocalGenerators[0]; cmMakefile* mfRoot = lg->GetMakefile(); - cmOStringStream cmd; + std::ostringstream cmd; cmd << lg->ConvertToOutputFormat( mfRoot->GetRequiredDefinition("CMAKE_COMMAND"), cmLocalGenerator::SHELL) @@ -1103,7 +1103,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) cmLocalGenerator *lg = this->LocalGenerators[0]; cmMakefile* mfRoot = lg->GetMakefile(); - cmOStringStream cmd; + std::ostringstream cmd; cmd << lg->ConvertToOutputFormat( mfRoot->GetRequiredDefinition("CMAKE_COMMAND"), cmLocalGenerator::SHELL) diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 3478534..1f08629 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -783,7 +783,7 @@ cmGlobalUnixMakefileGenerator3 lg->GetMakefile()->GetHomeOutputDirectory(); progressDir += cmake::GetCMakeFilesDirectory(); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; // all target counts progCmd << lg->Convert(progressDir, @@ -824,7 +824,7 @@ cmGlobalUnixMakefileGenerator3 { // TODO: Convert the total progress count to a make variable. - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # in target progCmd << lg->Convert(progressDir, @@ -841,7 +841,7 @@ cmGlobalUnixMakefileGenerator3 commands.push_back(lg->GetRecursiveMakeCall (tmp.c_str(),localName)); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 progCmd << lg->Convert(progressDir, cmLocalGenerator::FULL, diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 499ac56..531a714 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -156,7 +156,7 @@ cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts, if (this->SystemIsWindowsCE && ts.empty() && this->DefaultPlatformToolset.empty()) { - cmOStringStream e; + std::ostringstream e; e << this->GetName() << " Windows CE version '" << this->SystemVersion << "' requires CMAKE_GENERATOR_TOOLSET to be set."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -202,7 +202,7 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf) { if(this->DefaultPlatformName != "Win32") { - cmOStringStream e; + std::ostringstream e; e << "CMAKE_SYSTEM_NAME is 'Android' but CMAKE_GENERATOR " << "specifies a platform too: '" << this->GetName() << "'"; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -231,7 +231,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf) { if (this->DefaultPlatformName != "Win32") { - cmOStringStream e; + std::ostringstream e; e << "CMAKE_SYSTEM_NAME is 'WindowsCE' but CMAKE_GENERATOR " << "specifies a platform too: '" << this->GetName() << "'"; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -246,7 +246,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf) //---------------------------------------------------------------------------- bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf) { - cmOStringStream e; + std::ostringstream e; e << this->GetName() << " does not support Windows Phone."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -255,7 +255,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf) //---------------------------------------------------------------------------- bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf) { - cmOStringStream e; + std::ostringstream e; e << this->GetName() << " does not support Windows Store."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -320,7 +320,7 @@ void cmGlobalVisualStudio10Generator::Generate() if(this->LongestSource.Length > 0) { cmMakefile* mf = this->LongestSource.Target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "The binary and/or source directory paths may be too long to generate " "Visual Studio 10 files for this project. " @@ -574,7 +574,7 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf) "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\" "Windows\\v7.1;InstallationFolder", winSDK_7_1)) { - cmOStringStream m; + std::ostringstream m; m << "Found Windows SDK v7.1: " << winSDK_7_1; mf->DisplayStatus(m.str().c_str(), -1); this->DefaultPlatformToolset = "Windows7.1SDK"; @@ -582,7 +582,7 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf) } else { - cmOStringStream e; + std::ostringstream e; e << "Cannot enable 64-bit tools with Visual Studio 2010 Express.\n" << "Install the Microsoft Windows SDK v7.1 to get 64-bit tools:\n" << " http://msdn.microsoft.com/en-us/windows/bb980924.aspx"; diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 2b69222..3013200 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -133,7 +133,7 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf) { if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Phone '8.0', but not '" @@ -156,7 +156,7 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf) { if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Store '8.0', but not '" diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index 047f2ad..2bc9379 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -113,7 +113,7 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf) { if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Phone '8.0' and '8.1', but " @@ -136,7 +136,7 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf) { if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Store '8.0' and '8.1', but " diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 6a480a9..8831a8b 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1170,7 +1170,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, this->CreateString("2147483647")); copyFilesBuildPhase->AddAttribute("dstSubfolderSpec", this->CreateString("6")); - cmOStringStream ostr; + std::ostringstream ostr; if (cmtarget.IsFrameworkOnApple()) { // dstPath in frameworks is relative to Versions/ @@ -1581,7 +1581,7 @@ void cmGlobalXCodeGenerator } else { - cmOStringStream str; + std::ostringstream str; str << "_buildpart_" << count++ ; tname[&ccg.GetCC()] = std::string(target.GetName()) + str.str(); makefileStream << "\\\n\t" << tname[&ccg.GetCC()]; @@ -2299,7 +2299,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, // VERSION -> current_version target.GetTargetVersion(false, major, minor, patch); - cmOStringStream v; + std::ostringstream v; // Xcode always wants at least 1.0.0 or nothing if(!(major == 0 && minor == 0 && patch == 0)) @@ -2311,7 +2311,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, // SOVERSION -> compatibility_version target.GetTargetVersion(true, major, minor, patch); - cmOStringStream vso; + std::ostringstream vso; // Xcode always wants at least 1.0.0 or nothing if(!(major == 0 && minor == 0 && patch == 0)) diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 601993f..11a5466 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -497,7 +497,7 @@ int cmGraphVizWriter::CollectAllTargets() continue; } //std::cout << "Found target: " << tit->first.c_str() << std::endl; - cmOStringStream ostr; + std::ostringstream ostr; ostr << this->GraphNodePrefix << cnt++; this->TargetNamesNodes[realTargetName] = ostr.str(); this->TargetPtrs[realTargetName] = &tit->second; @@ -544,7 +544,7 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt) this->TargetPtrs.find(libName); if ( tarIt == this->TargetPtrs.end() ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << this->GraphNodePrefix << cnt++; this->TargetNamesNodes[libName] = ostr.str(); this->TargetPtrs[libName] = NULL; diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 0a1d280..9d44db1 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -98,7 +98,7 @@ bool cmIncludeCommand if (gg->IsExportedTargetsFile(fname_abs)) { const char *modal = 0; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0024)) diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index c3c9c55..c30cf85 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -273,7 +273,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) if(!unknownArgs.empty()) { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << "TARGETS given unknown argument \"" << unknownArgs[0] << "\"."; this->SetError(e.str()); return false; @@ -373,7 +373,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) if (this->Makefile->IsAlias(*targetIt)) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given target \"" << (*targetIt) << "\" which is an alias."; this->SetError(e.str()); @@ -390,7 +390,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) target->GetType() != cmTarget::OBJECT_LIBRARY && target->GetType() != cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given target \"" << (*targetIt) << "\" which is not an executable, library, or module."; this->SetError(e.str()); @@ -398,7 +398,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else if(target->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given OBJECT library \"" << (*targetIt) << "\" which may not be installed."; this->SetError(e.str()); @@ -410,7 +410,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) else { // Did not find the target. - cmOStringStream e; + std::ostringstream e; e << "TARGETS given target \"" << (*targetIt) << "\" which does not exist in this directory."; this->SetError(e.str()); @@ -502,7 +502,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no FRAMEWORK DESTINATION for shared library " "FRAMEWORK target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -522,7 +522,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no LIBRARY DESTINATION for shared library " "target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -542,7 +542,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no ARCHIVE DESTINATION for static library " "target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -563,7 +563,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no LIBRARY DESTINATION for module target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -598,7 +598,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } if(!bundleGenerator) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE " "executable target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -615,7 +615,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no RUNTIME DESTINATION for executable " "target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -681,7 +681,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "INSTALL TARGETS - target " << target.GetName() << " has " << "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION."; cmSystemTools::Message(e.str().c_str(), "Warning"); @@ -708,7 +708,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "INSTALL TARGETS - target " << target.GetName() << " has " << "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION."; cmSystemTools::Message(e.str().c_str(), "Warning"); @@ -734,7 +734,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "INSTALL TARGETS - target " << target.GetName() << " has " << "RESOURCE files but no RESOURCE DESTINATION."; cmSystemTools::Message(e.str().c_str(), "Warning"); @@ -855,7 +855,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) if(!unknownArgs.empty()) { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given unknown argument \"" << unknownArgs[0] << "\"."; this->SetError(e.str()); return false; @@ -870,7 +870,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) if(!ica.GetRename().empty() && files.GetVector().size() > 1) { // The rename option works only with one file. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given RENAME option with more than one file."; this->SetError(e.str()); return false; @@ -890,7 +890,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) if(ica.GetDestination().empty()) { // A destination is required. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given no DESTINATION!"; this->SetError(e.str()); return false; @@ -931,7 +931,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -945,7 +945,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -960,7 +960,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -988,7 +988,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Add this property to the current match rule. if(!in_match_mode || doing == DoingPattern || doing == DoingRegex) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" before a PATTERN or REGEX is given."; this->SetError(e.str()); @@ -1001,7 +1001,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(!in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" before a PATTERN or REGEX is given."; this->SetError(e.str()); @@ -1016,7 +1016,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1030,7 +1030,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1044,7 +1044,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1059,7 +1059,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1074,7 +1074,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1088,7 +1088,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1113,7 +1113,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) if(cmSystemTools::FileExists(dir.c_str()) && !cmSystemTools::FileIsDirectory(dir)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given non-directory \"" << args[i] << "\" to install."; this->SetError(e.str()); @@ -1169,7 +1169,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Check the requested permission. if(!cmInstallCommandArguments::CheckPermissions(args[i],permissions_file)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid file permission \"" << args[i] << "\"."; this->SetError(e.str()); @@ -1181,7 +1181,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Check the requested permission. if(!cmInstallCommandArguments::CheckPermissions(args[i],permissions_dir)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid directory permission \"" << args[i] << "\"."; this->SetError(e.str()); @@ -1193,7 +1193,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Check the requested permission. if(!cmInstallCommandArguments::CheckPermissions(args[i], literal_args)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid permission \"" << args[i] << "\"."; this->SetError(e.str()); @@ -1203,7 +1203,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) else { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given unknown argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; @@ -1224,7 +1224,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) if(!destination) { // A destination is required. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given no DESTINATION!"; this->SetError(e.str()); return false; @@ -1271,7 +1271,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if (!unknownArgs.empty()) { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given unknown argument \"" << unknownArgs[0] << "\"."; this->SetError(e.str()); return false; @@ -1286,7 +1286,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(ica.GetDestination().empty()) { // A destination is required. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given no DESTINATION!"; this->SetError(e.str()); return false; @@ -1296,7 +1296,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) std::string fname = filename.GetString(); if(fname.find_first_of(":/\\") != fname.npos) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid export file name \"" << fname << "\". " << "The FILE argument may not contain a path. " << "Specify the path in the DESTINATION argument."; @@ -1308,7 +1308,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(!fname.empty() && cmSystemTools::GetFilenameLastExtension(fname) != ".cmake") { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid export file name \"" << fname << "\". " << "The FILE argument must specify a name ending in \".cmake\"."; this->SetError(e.str()); @@ -1323,7 +1323,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(fname.find_first_of(":/\\") != fname.npos) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given export name \"" << exp.GetString() << "\". " << "This name cannot be safely converted to a file name. " << "Specify a different export name or use the FILE option to set " @@ -1348,7 +1348,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(!newCMP0022Behavior) { - cmOStringStream e; + std::ostringstream e; e << "INSTALL(EXPORT) given keyword \"" << "EXPORT_LINK_INTERFACE_LIBRARIES" << "\", but target \"" << te->Target->GetName() @@ -1395,7 +1395,7 @@ bool cmInstallCommand::MakeFilesFullPath(const char* modeName, // Make sure the file is not a directory. if(gpos == file.npos && cmSystemTools::FileIsDirectory(file)) { - cmOStringStream e; + std::ostringstream e; e << modeName << " given directory \"" << (*fileIt) << "\" to install."; this->SetError(e.str()); return false; diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index ddfd6c5..4480cc6 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -121,7 +121,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os) // Skip empty sets. if(ExportSet->GetTargetExports()->empty()) { - cmOStringStream e; + std::ostringstream e; e << "INSTALL(EXPORT) given unknown export \"" << ExportSet->GetName() << "\""; cmSystemTools::Error(e.str().c_str()); diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index bb346fb..8701b73 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -47,7 +47,7 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os) // Warn if installing an exclude-from-all target. if(this->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) { - cmOStringStream msg; + std::ostringstream msg; msg << "WARNING: Target \"" << this->Target->GetName() << "\" has EXCLUDE_FROM_ALL set and will not be built by default " << "but an install rule has been provided for it. CMake does " @@ -424,7 +424,7 @@ cmInstallTargetGenerator ::AddTweak(std::ostream& os, Indent const& indent, const std::string& config, std::string const& file, TweakMethod tweak) { - cmOStringStream tw; + std::ostringstream tw; (this->*tweak)(tw, indent.Next(), config, file); std::string tws = tw.str(); if(!tws.empty()) @@ -450,7 +450,7 @@ cmInstallTargetGenerator else { // Generate a foreach loop to tweak multiple files. - cmOStringStream tw; + std::ostringstream tw; this->AddTweak(tw, indent.Next(), config, "${file}", tweak); std::string tws = tw.str(); if(!tws.empty()) @@ -699,7 +699,7 @@ cmInstallTargetGenerator (!oldRuntimeDirs.empty() || !newRuntimeDirs.empty()) ) { - cmOStringStream msg; + std::ostringstream msg; msg << "WARNING: Target \"" << this->Target->GetName() << "\" has runtime paths which cannot be changed during install. " << "To change runtime paths, OS X version 10.6 or newer is required. " diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx index 3644d93..ade1feb 100644 --- a/Source/cmLinkDirectoriesCommand.cxx +++ b/Source/cmLinkDirectoriesCommand.cxx @@ -36,7 +36,7 @@ void cmLinkDirectoriesCommand::AddLinkDir(std::string const& dir) if(!cmSystemTools::FileIsFullPath(unixPath.c_str())) { bool convertToAbsolute = false; - cmOStringStream e; + std::ostringstream e; e << "This command specifies the relative path\n" << " " << unixPath << "\n" << "as a link directory.\n"; diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index f1ea088..47b8be5 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -225,7 +225,7 @@ bool cmListCommand::HandleGetCommand(std::vector const& args) } if ( item < 0 || nitem <= (size_t)item ) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << varArgsExpanded.size()-1 << ")"; @@ -322,7 +322,7 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) if((!this->GetList(varArgsExpanded, listName) || varArgsExpanded.empty()) && item != 0) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (0, 0)"; this->SetError(str.str()); return false; @@ -337,7 +337,7 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) } if ( item < 0 || nitem <= (size_t)item ) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << (varArgsExpanded.size() == 0?0:(varArgsExpanded.size()-1)) << ")"; @@ -570,7 +570,7 @@ bool cmListCommand::HandleRemoveAtCommand( } if ( item < 0 || nitem <= (size_t)item ) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << varArgsExpanded.size()-1 << ")"; diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 1c39563..3e26349 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -68,7 +68,7 @@ bool cmListFileParser::ParseFile() bom != cmListFileLexer_BOM_UTF8) { cmListFileLexer_SetFileName(this->Lexer, 0, 0); - cmOStringStream m; + std::ostringstream m; m << "File\n " << this->FileName << "\n" << "starts with a Byte-Order-Mark that is not UTF-8."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, m.str()); @@ -108,7 +108,7 @@ bool cmListFileParser::ParseFile() } else { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << token->line << ":\n" << "Parse error. Expected a newline, got " @@ -120,7 +120,7 @@ bool cmListFileParser::ParseFile() } else { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << token->line << ":\n" << "Parse error. Expected a command name, got " @@ -268,7 +268,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) token->type == cmListFileLexer_Token_Space) {} if(!token) { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << "Parse error. Function missing opening \"(\"."; @@ -277,7 +277,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) } if(token->type != cmListFileLexer_Token_ParenLeft) { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << "Parse error. Expected \"(\", got " @@ -355,7 +355,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) else { // Error. - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << "Parse error. Function missing ending \")\". " @@ -367,7 +367,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) } } - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << lastLine << ":\n" << "Parse error. Function missing ending \")\". " @@ -389,7 +389,7 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token, } bool isError = (this->Separation == SeparationError || delim == cmListFileArgument::Bracket); - cmOStringStream m; + std::ostringstream m; m << "Syntax " << (isError? "Error":"Warning") << " in cmake code at\n" << " " << this->FileName << ":" << token->line << ":" << token->column << "\n" diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index a4063a6..cdfd00c 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -226,7 +226,7 @@ bool cmLoadCommandCommand std::string fullPath = cmSystemTools::FindFile(moduleName.c_str(), path); if (fullPath == "") { - cmOStringStream e; + std::ostringstream e; e << "Attempt to load command failed from file \"" << moduleName << "\""; this->SetError(e.str()); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2de6c93..52d312e 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -153,7 +153,7 @@ void cmLocalGenerator::ComputeObjectMaxPath() } else { - cmOStringStream w; + std::ostringstream w; w << "CMAKE_OBJECT_PATH_MAX is set to " << pmax << ", which is less than the minimum of 128. " << "The value will be ignored."; @@ -162,7 +162,7 @@ void cmLocalGenerator::ComputeObjectMaxPath() } else { - cmOStringStream w; + std::ostringstream w; w << "CMAKE_OBJECT_PATH_MAX is set to \"" << plen << "\", which fails to parse as a positive integer. " << "The value will be ignored."; @@ -191,7 +191,7 @@ void cmLocalGenerator::ReadInputFile() // The file is missing. Check policy CMP0014. cmMakefile* mf = this->Parent->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "The source directory\n" << " " << this->Makefile->GetStartDirectory() << "\n" << "does not contain a CMakeLists.txt file."; @@ -1245,7 +1245,7 @@ void cmLocalGenerator::InsertRuleLauncher(std::string& s, cmTarget* target, { if(const char* val = this->GetRuleLauncher(target, prop)) { - cmOStringStream wrapped; + std::ostringstream wrapped; wrapped << val << " " << s; s = wrapped.str(); } @@ -1326,7 +1326,7 @@ std::string cmLocalGenerator::GetIncludeFlags( } OutputFormat shellFormat = forResponseFile? RESPONSE : SHELL; - cmOStringStream includeFlags; + std::ostringstream includeFlags; std::string flagVar = "CMAKE_INCLUDE_FLAG_"; flagVar += lang; @@ -1521,7 +1521,7 @@ void cmLocalGenerator::AddCompileOptions( } if (this->Makefile->IsLaterStandard(it->first, standard, it->second)) { - cmOStringStream e; + std::ostringstream e; e << "The COMPILE_FEATURES property of target \"" << target->GetName() << "\" was evaluated when computing the link " "implementation, and the \"" << it->first << "_STANDARD\" was \"" @@ -1880,7 +1880,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries, OutputFormat shellFormat = (forResponseFile) ? RESPONSE : ((useWatcomQuote) ? WATCOMQUOTE : SHELL); bool escapeAllowMakeVars = !forResponseFile; - cmOStringStream fout; + std::ostringstream fout; std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); cmComputeLinkInformation* pcli = tgt.Target->GetLinkInformation(config); if(!pcli) @@ -2242,7 +2242,7 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, const char *opt = target->GetMakefile()->GetDefinition(option_flag); if (!opt) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target->GetName() << "\" requires the language " "dialect \"" << lang << standardProp << "\" " << (ext ? "(with compiler extensions)" : "") << ", but CMake " @@ -2327,7 +2327,7 @@ static void AddVisibilityCompileOption(std::string &flags, cmTarget* target, && strcmp(prop, "protected") != 0 && strcmp(prop, "internal") != 0 ) { - cmOStringStream e; + std::ostringstream e; e << "Target " << target->GetName() << " uses unsupported value \"" << prop << "\" for " << flagDefine << "."; cmSystemTools::Error(e.str().c_str()); @@ -2442,7 +2442,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared, { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << "Variable " << flagsVar << " has been modified. CMake " "will ignore the POSITION_INDEPENDENT_CODE target property for " "shared libraries and will use the " << flagsVar << " variable " @@ -3251,7 +3251,7 @@ cmLocalGenerator // Warn if this is the first time the path has been seen. if(this->ObjectMaxPathViolations.insert(dir_max).second) { - cmOStringStream m; + std::ostringstream m; m << "The object file directory\n" << " " << dir_max << "\n" << "has " << dir_max.size() << " characters. " @@ -3649,7 +3649,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const } if(function_style) { - cmOStringStream e; + std::ostringstream e; e << "WARNING: Function-style preprocessor definitions may not be " << "passed on the compiler command line because many compilers " << "do not support it.\n" @@ -3662,7 +3662,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const // Many compilers do not support # in the value so we disable it. if(define.find_first_of("#") != define.npos) { - cmOStringStream e; + std::ostringstream e; e << "WARNING: Preprocessor definitions containing '#' may not be " << "passed on the compiler command line because many compilers " << "do not support it.\n" @@ -3704,7 +3704,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmTarget* target, } if(!cmSystemTools::FileExists(inFile.c_str(), true)) { - cmOStringStream e; + std::ostringstream e; e << "Target " << target->GetName() << " Info.plist template \"" << inFile << "\" could not be found."; cmSystemTools::Error(e.str().c_str()); @@ -3748,7 +3748,7 @@ void cmLocalGenerator::GenerateFrameworkInfoPList(cmTarget* target, } if(!cmSystemTools::FileExists(inFile.c_str(), true)) { - cmOStringStream e; + std::ostringstream e; e << "Target " << target->GetName() << " Info.plist template \"" << inFile << "\" could not be found."; cmSystemTools::Error(e.str().c_str()); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 0b0d971..413dc0f 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -369,7 +369,7 @@ std::string cmLocalNinjaGenerator::BuildCommandLine( return ":"; #endif - cmOStringStream cmd; + std::ostringstream cmd; for (std::vector::const_iterator li = cmdLines.begin(); li != cmdLines.end(); ++li) #ifdef _WIN32 @@ -409,7 +409,7 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines( if (wd.empty()) wd = this->GetMakefile()->GetStartOutputDirectory(); - cmOStringStream cdCmd; + std::ostringstream cdCmd; #ifdef _WIN32 std::string cdStr = "cd /D "; #else diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 812ded3..75231b7 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1554,7 +1554,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo, { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << tgtInfo << "\" is newer than depender \"" << internalDependFile << "\"." << std::endl; @@ -1577,7 +1577,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo, { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dirInfoFile << "\" is newer than depender \"" << internalDependFile << "\"." << std::endl; @@ -1788,7 +1788,7 @@ void cmLocalUnixMakefileGenerator3::CheckMultipleOutputs(bool verbose) { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Deleting primary custom command output \"" << dependee << "\" because another output \"" << depender << "\" does not exist." << std::endl; @@ -1918,7 +1918,7 @@ void cmLocalUnixMakefileGenerator3 std::string progressDir = this->Makefile->GetHomeOutputDirectory(); progressDir += cmake::GetCMakeFilesDirectory(); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; progCmd << this->Convert(progressDir, @@ -1942,7 +1942,7 @@ void cmLocalUnixMakefileGenerator3 this->Makefile->GetHomeOutputDirectory(), cmLocalGenerator::START_OUTPUT); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 progCmd << this->Convert(progressDir, cmLocalGenerator::FULL, diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index b9a5074..1d62093 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -1321,7 +1321,7 @@ void cmLocalVisualStudio6Generator int major; int minor; target.GetTargetVersion(major, minor); - cmOStringStream targetVersionStream; + std::ostringstream targetVersionStream; targetVersionStream << "/version:" << major << "." << minor; targetVersionFlag = targetVersionStream.str(); } @@ -1998,7 +1998,7 @@ cmLocalVisualStudio6Generator if(define.find_first_of(" ") != define.npos && define.find_first_of("\"$;") != define.npos) { - cmOStringStream e; + std::ostringstream e; e << "WARNING: The VS6 IDE does not support preprocessor definition " << "values with spaces and '\"', '$', or ';'.\n" << "CMake is dropping a preprocessor definition: " << define << "\n" diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 0e66764..914df5f 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1115,7 +1115,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, if(this->GetVersion() < VS8 || this->FortranProject) { - cmOStringStream libdeps; + std::ostringstream libdeps; this->Internal->OutputObjects(libdeps, &target); if(!libdeps.str().empty()) { @@ -1713,7 +1713,7 @@ bool cmLocalVisualStudio7Generator // Write the children to temporary output. bool hasChildrenWithSources = false; - cmOStringStream tmpOut; + std::ostringstream tmpOut; for(unsigned int i=0;iWriteGroup(&children[i], target, tmpOut, libName, configs)) diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index ae81c58..8c2489a 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -107,7 +107,7 @@ bool cmMacroHelperCommand::InvokeInitialPass cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies); // set the value of argc - cmOStringStream argcDefStream; + std::ostringstream argcDefStream; argcDefStream << expandedArgs.size(); std::string argcDef = argcDefStream.str(); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 20dae5a..1438f7e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -363,7 +363,7 @@ cmListFileBacktrace cmMakefile::GetBacktrace() const //---------------------------------------------------------------------------- void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const { - cmOStringStream msg; + std::ostringstream msg; msg << lff.FilePath << "(" << lff.Line << "): "; msg << lff.Name << "("; for(std::vector::const_iterator i = @@ -556,7 +556,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011() case cmPolicies::WARN: // Warn because the user did not set this policy. { - cmOStringStream w; + std::ostringstream w; w << policies->GetPolicyWarning(cmPolicies::CMP0011) << "\n" << "The included script\n " << this->File << "\n" << "affects policy settings. " @@ -568,7 +568,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011() case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << policies->GetRequiredPolicyError(cmPolicies::CMP0011) << "\n" << "The included script\n " << this->File << "\n" << "affects policy settings, so it requires this policy to be set."; @@ -741,7 +741,7 @@ void cmMakefile::EnforceDirectoryLevelRules() const // Diagnose a violation of CMP0000 if necessary. if(this->CheckCMP0000) { - cmOStringStream msg; + std::ostringstream msg; msg << "No cmake_minimum_required command is present. " << "A line of code such as\n" << " cmake_minimum_required(VERSION " @@ -897,7 +897,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target, { cmake::MessageType messageType = cmake::AUTHOR_WARNING; bool issueMessage = false; - cmOStringStream e; + std::ostringstream e; switch(this->GetPolicyStatus(cmPolicies::CMP0040)) { case cmPolicies::WARN: @@ -924,7 +924,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target, if(ti->second.GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target << "\" is an OBJECT library " "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -932,7 +932,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target, } if(ti->second.GetType() == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target << "\" is an INTERFACE library " "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -997,7 +997,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector& outputs, cmCustomCommandLine const& cl = *i; if(!cl.empty() && !cl[0].empty() && cl[0][0] == '"') { - cmOStringStream e; + std::ostringstream e; e << "COMMAND may not contain literal quotes:\n " << cl[0] << "\n"; this->IssueMessage(cmake::FATAL_ERROR, e.str()); return 0; @@ -1555,7 +1555,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target, (tgt->GetType() == cmTarget::INTERFACE_LIBRARY) || tgt->IsExecutableWithExports())) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << lib << "\" of type " << cmTarget::GetTargetTypeName(tgt->GetType()) << " may not be linked into another target. " @@ -1568,7 +1568,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target, } else { - cmOStringStream e; + std::ostringstream e; e << "Attempt to add link library \"" << lib << "\" to target \"" << target << "\" which is not built in this directory."; @@ -1584,7 +1584,7 @@ void cmMakefile::AddLinkDirectoryForTarget(const std::string& target, { if(this->IsAlias(target)) { - cmOStringStream e; + std::ostringstream e; e << "ALIAS target \"" << target << "\" " << "may not be linked into another target."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -2006,7 +2006,7 @@ void cmMakefile::CheckForUnused(const char* reason, !cmSystemTools::IsSubDirectory(path, cmake::GetCMakeFilesDirectory()))) { - cmOStringStream msg; + std::ostringstream msg; msg << "unused variable (" << reason << ") \'" << name << "\'"; this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, msg.str(), @@ -2311,7 +2311,7 @@ void cmMakefile::ExpandVariablesCMP0019() { return; } - cmOStringStream w; + std::ostringstream w; const char *includeDirs = this->GetProperty("INCLUDE_DIRECTORIES"); if(mightExpandVariablesCMP0019(includeDirs)) @@ -2389,7 +2389,7 @@ void cmMakefile::ExpandVariablesCMP0019() if(!w.str().empty()) { - cmOStringStream m; + std::ostringstream m; m << this->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0019) << "\n" << "The following variable evaluations were encountered:\n" @@ -2782,7 +2782,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld( else { // Construct the main error message. - cmOStringStream error; + std::ostringstream error; error << "Syntax error in cmake code "; if(filename && line > 0) { @@ -2890,7 +2890,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( case NORMAL: if(filename && lookup == lineVar) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << line; varresult = ostr.str(); } @@ -2932,7 +2932,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( cmSystemTools::IsSubDirectory(filename, this->GetHomeOutputDirectory())) { - cmOStringStream msg; + std::ostringstream msg; cmListFileBacktrace bt(this->GetLocalGenerator()); cmListFileContext lfc; lfc.FilePath = filename; @@ -3126,7 +3126,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( if(error) { - cmOStringStream emsg; + std::ostringstream emsg; emsg << "Syntax error in cmake code "; if(filename) { @@ -3341,7 +3341,7 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError) { // Report the context in which the unclosed block was opened. cmListFileContext const& lfc = fb->GetStartingContext(); - cmOStringStream e; + std::ostringstream e; e << "A logical block opening on the line\n" << " " << lfc << "\n" << "is not closed."; @@ -3499,7 +3499,7 @@ cmMakefile::RemoveFunctionBlocker(cmFunctionBlocker* fb, if(!(*pos)->ShouldRemove(lff, *this)) { cmListFileContext const& lfc = fb->GetStartingContext(); - cmOStringStream e; + std::ostringstream e; e << "A logical block opening on the line\n" << " " << lfc << "\n" << "closes on the line\n" @@ -3559,14 +3559,14 @@ void cmMakefile::SetScriptModeFile(const char* scriptfile) void cmMakefile::SetArgcArgv(const std::vector& args) { - cmOStringStream strStream; + std::ostringstream strStream; strStream << args.size(); this->AddDefinition("CMAKE_ARGC", strStream.str().c_str()); //this->MarkVariableAsUsed("CMAKE_ARGC"); for (unsigned int t = 0; t < args.size(); ++t) { - cmOStringStream tmpStream; + std::ostringstream tmpStream; tmpStream << "CMAKE_ARGV" << t; this->AddDefinition(tmpStream.str(), args[t].c_str()); //this->MarkVariableAsUsed(tmpStream.str().c_str()); @@ -3918,7 +3918,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << "File " << currentFile << " includes " << moduleInCMakeModulePath << " (found via CMAKE_MODULE_PATH) which shadows " @@ -4098,7 +4098,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile, if(bom != cmsys::FStream::BOM_None && bom != cmsys::FStream::BOM_UTF8) { - cmOStringStream e; + std::ostringstream e; e << "File starts with a Byte-Order-Mark that is not UTF-8:\n " << sinfile; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -4310,7 +4310,7 @@ const char *cmMakefile::GetProperty(const std::string& prop, } else if (prop == "LINK_DIRECTORIES") { - cmOStringStream str; + std::ostringstream str; for (std::vector::const_iterator it = this->GetLinkDirectories().begin(); it != this->GetLinkDirectories().end(); @@ -4488,7 +4488,7 @@ void cmMakefile::AddCMakeDependFilesFromUser() std::string cmMakefile::GetListFileStack() const { - cmOStringStream tmp; + std::ostringstream tmp; size_t depth = this->ListFileStack.size(); if (depth > 0) { @@ -4606,7 +4606,7 @@ void cmMakefile::RaiseScope(const std::string& var, const char *varDef) } else { - cmOStringStream m; + std::ostringstream m; m << "Cannot set \"" << var << "\": current scope has no parent."; this->IssueMessage(cmake::AUTHOR_WARNING, m.str()); } @@ -4701,7 +4701,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, { if(this->IsAlias(name)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create target \"" << name << "\" because an alias with the same name already exists."; msg = e.str(); @@ -4715,7 +4715,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, { // Imported targets were not supported in previous versions. // This is new code, so we can make it an error. - cmOStringStream e; + std::ostringstream e; e << "cannot create target \"" << name << "\" because an imported target with the same name already exists."; msg = e.str(); @@ -4754,7 +4754,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, // Produce an error that tells the user how to work around the // problem. - cmOStringStream e; + std::ostringstream e; e << "cannot create target \"" << name << "\" because another target with the same name already exists. " << "The existing target is "; @@ -4800,7 +4800,7 @@ bool cmMakefile::EnforceUniqueDir(const std::string& srcPath, { return true; } - cmOStringStream e; + std::ostringstream e; switch (this->GetPolicyStatus(cmPolicies::CMP0013)) { case cmPolicies::WARN: @@ -4985,7 +4985,7 @@ bool cmMakefile::SetPolicy(const char *id, cmPolicies::PolicyID pid; if (!this->GetPolicies()->GetPolicyID(id, /* out */ pid)) { - cmOStringStream e; + std::ostringstream e; e << "Policy \"" << id << "\" is not known to this version of CMake."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -5200,7 +5200,7 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature, availableFeatures.end(), feature) == availableFeatures.end()) { - cmOStringStream e; + std::ostringstream e; e << "The compiler feature \"" << feature << "\" is not known to " << lang << " compiler\n\"" << this->GetDefinition("CMAKE_" + lang + "_COMPILER_ID") @@ -5240,7 +5240,7 @@ CompileFeatureKnown(cmTarget const* target, const std::string& feature, lang = "CXX"; return true; } - cmOStringStream e; + std::ostringstream e; if (error) { e << "specified"; @@ -5271,7 +5271,7 @@ CompileFeaturesAvailable(const std::string& lang, std::string *error) const if (!featuresKnown || !*featuresKnown) { - cmOStringStream e; + std::ostringstream e; if (error) { e << "no"; @@ -5326,7 +5326,7 @@ HaveCFeatureAvailable(cmTarget const* target, const std::string& feature) const if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The C_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -5403,7 +5403,7 @@ bool cmMakefile::HaveCxxFeatureAvailable(cmTarget const* target, if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), cmStrCmp(existingCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The CXX_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCxxStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -5478,7 +5478,7 @@ AddRequiredTargetCxxFeature(cmTarget *target, if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), cmStrCmp(existingCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The CXX_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCxxStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -5577,7 +5577,7 @@ AddRequiredTargetCFeature(cmTarget *target, const std::string& feature) const if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The C_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index fc52ccc..d4036d2 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -371,8 +371,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) std::string targetVersionMajor; std::string targetVersionMinor; { - cmOStringStream majorStream; - cmOStringStream minorStream; + std::ostringstream majorStream; + std::ostringstream minorStream; int major; int minor; this->Target->GetTargetVersion(major, minor); diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 305d81d..cdda36c 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -566,8 +566,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules std::string targetVersionMajor; std::string targetVersionMinor; { - cmOStringStream majorStream; - cmOStringStream minorStream; + std::ostringstream majorStream; + std::ostringstream minorStream; int major; int minor; this->Target->GetTargetVersion(major, minor); @@ -805,7 +805,7 @@ cmMakefileLibraryTargetGenerator if(major > 0 || minor > 0 || patch > 0) { // Append the flag since a non-zero version is specified. - cmOStringStream vflag; + std::ostringstream vflag; vflag << flag << major << "." << minor << "." << patch; this->LocalGenerator->AppendFlags(flags, vflag.str()); } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index cbf8573..ef08c21 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -451,7 +451,7 @@ void cmMakefileTargetGenerator } else { - cmOStringStream err; + std::ostringstream err; err << "Warning: Source file \"" << source.GetFullPath() << "\" is listed multiple times for target \"" @@ -1101,7 +1101,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() // Add a command to call CMake to scan dependencies. CMake will // touch the corresponding depends file after scanning dependencies. - cmOStringStream depCmd; + std::ostringstream depCmd; // TODO: Account for source file properties and directory-level // definitions when scanning for dependencies. #if !defined(_WIN32) || defined(__CYGWIN__) @@ -1217,7 +1217,7 @@ void cmMakefileTargetGenerator } // Now append the actual user-specified commands. - cmOStringStream content; + std::ostringstream content; this->LocalGenerator->AppendCustomCommand(commands, ccg, this->Target, false, cmLocalGenerator::HOME_OUTPUT, &content); @@ -1279,7 +1279,7 @@ cmMakefileTargetGenerator::AppendProgress(std::vector& commands) } std::string progressDir = this->Makefile->GetHomeOutputDirectory(); progressDir += cmake::GetCMakeFilesDirectory(); - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; progCmd << this->LocalGenerator->Convert(progressDir, cmLocalGenerator::FULL, diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 53b7a8e..32a5ccf 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -218,8 +218,8 @@ cmNinjaNormalTargetGenerator std::string targetVersionMajor; std::string targetVersionMinor; { - cmOStringStream majorStream; - cmOStringStream minorStream; + std::ostringstream majorStream; + std::ostringstream minorStream; int major; int minor; this->GetTarget()->GetTargetVersion(major, minor); @@ -255,10 +255,10 @@ cmNinjaNormalTargetGenerator this->GetLocalGenerator()->BuildCommandLine(linkCmds); // Write the linker rule with response file if needed. - cmOStringStream comment; + std::ostringstream comment; comment << "Rule for linking " << this->TargetLinkLanguage << " " << this->GetVisibleTypeName() << "."; - cmOStringStream description; + std::ostringstream description; description << "Linking " << this->TargetLinkLanguage << " " << this->GetVisibleTypeName() << " $TARGET_FILE"; this->GetGlobalGenerator()->AddRule(ruleName, @@ -435,7 +435,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() cmNinjaVars vars; // Compute the comment. - cmOStringStream comment; + std::ostringstream comment; comment << "Link the " << this->GetVisibleTypeName() << " " << targetOutputReal; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index b36ff93..c019ceb 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -468,9 +468,9 @@ cmNinjaTargetGenerator // Write the rule for compiling file of the given language. - cmOStringStream comment; + std::ostringstream comment; comment << "Rule for compiling " << lang << " files."; - cmOStringStream description; + std::ostringstream description; description << "Building " << lang << " object $out"; this->GetGlobalGenerator()->AddRule(this->LanguageCompilerRule(lang), cmdLine, diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 3cdd2f6..116d42f 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -86,7 +86,7 @@ public: } } - void FindImplicitConflicts(cmOStringStream& w) + void FindImplicitConflicts(std::ostringstream& w) { bool first = true; for(unsigned int i=0; i < this->OD->OriginalDirectories.size(); ++i) @@ -541,7 +541,7 @@ void cmOrderDirectories::FindImplicitConflicts() { // Check for items in implicit link directories that have conflicts // in the explicit directories. - cmOStringStream conflicts; + std::ostringstream conflicts; for(unsigned int i=0; i < this->ImplicitDirEntries.size(); ++i) { this->ImplicitDirEntries[i]->FindImplicitConflicts(conflicts); @@ -555,7 +555,7 @@ void cmOrderDirectories::FindImplicitConflicts() } // Warn about the conflicts. - cmOStringStream w; + std::ostringstream w; w << "Cannot generate a safe " << this->Purpose << " for target " << this->Target->GetName() << " because files in some directories may conflict with " @@ -624,7 +624,7 @@ void cmOrderDirectories::DiagnoseCycle() this->CycleDiagnosed = true; // Construct the message. - cmOStringStream e; + std::ostringstream e; e << "Cannot generate a safe " << this->Purpose << " for target " << this->Target->GetName() << " because there is a cycle in the constraint graph:\n"; diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 1a27a25..da64617 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -41,7 +41,7 @@ public: std::string GetVersionString() { - cmOStringStream v; + std::ostringstream v; v << this->MajorVersionIntroduced << "." << this->MinorVersionIntroduced; if(this->PatchVersionIntroduced > 0) { @@ -432,7 +432,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, if(sscanf(ver.c_str(), "%u.%u.%u.%u", &majorVer, &minorVer, &patchVer, &tweakVer) < 2) { - cmOStringStream e; + std::ostringstream e; e << "Invalid policy version value \"" << ver << "\". " << "A numeric major.minor[.patch[.tweak]] must be given."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -462,7 +462,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, patchVer == cmVersion::GetPatchVersion() && tweakVer > cmVersion::GetTweakVersion())) { - cmOStringStream e; + std::ostringstream e; e << "An attempt was made to set the policy version of CMake to \"" << version << "\" which is greater than this version of CMake. " << "This is not allowed because the greater version may have new " @@ -534,7 +534,7 @@ bool cmPolicies::GetPolicyDefault(cmMakefile* mf, std::string const& policy, } else { - cmOStringStream e; + std::ostringstream e; e << defaultVar << " has value \"" << defaultValue << "\" but must be \"OLD\", \"NEW\", or \"\" (empty)."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -584,7 +584,7 @@ std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id) return "Request for warning text for undefined policy!"; } - cmOStringStream msg; + std::ostringstream msg; msg << "Policy " << pos->second->IDString << " is not set: " "" << pos->second->ShortDescription << " " @@ -608,7 +608,7 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id) return "Request for error text for undefined policy!"; } - cmOStringStream error; + std::ostringstream error; error << "Policy " << pos->second->IDString << " is not set to NEW: " "" << pos->second->ShortDescription << " " @@ -645,7 +645,7 @@ std::string cmPolicies::GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id) { std::string pid = this->GetPolicyIDString(id); - cmOStringStream e; + std::ostringstream e; e << "Policy " << pid << " may not be set to OLD behavior because this " << "version of CMake no longer supports it. " << "The policy was introduced in " @@ -667,7 +667,7 @@ cmPolicies::DiagnoseAncientPolicies(std::vector const& ancient, unsigned int patchVer, cmMakefile* mf) { - cmOStringStream e; + std::ostringstream e; e << "The project requests behavior compatible with CMake version \"" << majorVer << "." << minorVer << "." << patchVer << "\", which requires the OLD behavior for some policies:\n"; diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 12318c8..61c0133 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -215,7 +215,7 @@ bool cmProjectCommand } if(!vw.empty()) { - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0048)) << "\nThe following variable(s) would be set to empty:" << vw; diff --git a/Source/cmSeparateArgumentsCommand.cxx b/Source/cmSeparateArgumentsCommand.cxx index 1ee3f29..8e6c311 100644 --- a/Source/cmSeparateArgumentsCommand.cxx +++ b/Source/cmSeparateArgumentsCommand.cxx @@ -51,7 +51,7 @@ bool cmSeparateArgumentsCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given unknown argument " << args[i]; this->SetError(e.str()); return false; diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 653d764..1150bc7 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -67,7 +67,7 @@ bool cmSetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid scope " << *arg << ". " << "Valid scopes are GLOBAL, DIRECTORY, " "TARGET, SOURCE, TEST, CACHE, INSTALL."; @@ -117,7 +117,7 @@ bool cmSetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid argument \"" << *arg << "\"."; this->SetError(e.str()); return false; @@ -265,7 +265,7 @@ bool cmSetPropertyCommand::HandleTargetMode() } else { - cmOStringStream e; + std::ostringstream e; e << "could not find TARGET " << *ni << ". Perhaps it has not yet been created."; this->SetError(e.str()); @@ -316,7 +316,7 @@ bool cmSetPropertyCommand::HandleSourceMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given SOURCE name that could not be found or created: " << *ni; this->SetError(e.str()); return false; @@ -373,7 +373,7 @@ bool cmSetPropertyCommand::HandleTestMode() // Names that are still left were not found. if(!this->Names.empty()) { - cmOStringStream e; + std::ostringstream e; e << "given TEST names that do not exist:\n"; for(std::set::const_iterator ni = this->Names.begin(); ni != this->Names.end(); ++ni) @@ -417,7 +417,7 @@ bool cmSetPropertyCommand::HandleCacheMode() !cmSystemTools::IsOn(this->PropertyValue.c_str()) && !cmSystemTools::IsOff(this->PropertyValue.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "given non-boolean value \"" << this->PropertyValue << "\" for CACHE property \"ADVANCED\". "; this->SetError(e.str()); @@ -428,7 +428,7 @@ bool cmSetPropertyCommand::HandleCacheMode() { if(!cmCacheManager::IsType(this->PropertyValue.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "given invalid CACHE entry TYPE \"" << this->PropertyValue << "\""; this->SetError(e.str()); return false; @@ -438,7 +438,7 @@ bool cmSetPropertyCommand::HandleCacheMode() this->PropertyName != "STRINGS" && this->PropertyName != "VALUE") { - cmOStringStream e; + std::ostringstream e; e << "given invalid CACHE property " << this->PropertyName << ". " << "Settable CACHE properties are: " << "ADVANCED, HELPSTRING, STRINGS, TYPE, and VALUE."; @@ -463,7 +463,7 @@ bool cmSetPropertyCommand::HandleCacheMode() } else { - cmOStringStream e; + std::ostringstream e; e << "could not find CACHE variable " << *ni << ". Perhaps it has not yet been created."; this->SetError(e.str()); @@ -513,7 +513,7 @@ bool cmSetPropertyCommand::HandleInstallMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given INSTALL name that could not be found or created: " << *i; this->SetError(e.str()); return false; diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 6fe5c62..27fda40 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -202,7 +202,7 @@ bool cmSourceFile::FindFullPath(std::string* error) } } - cmOStringStream e; + std::ostringstream e; std::string missing = this->Location.GetDirectory(); if(!missing.empty()) { diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index edba5ba..1741e05 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -90,7 +90,7 @@ bool cmSourceGroupCommand } else { - cmOStringStream err; + std::ostringstream err; err << "Unknown argument \"" << args[i] << "\". " << "Perhaps the FILES keyword is missing.\n"; this->SetError(err.str()); diff --git a/Source/cmStandardIncludes.cxx b/Source/cmStandardIncludes.cxx index a4bdb2e..23c570c 100644 --- a/Source/cmStandardIncludes.cxx +++ b/Source/cmStandardIncludes.cxx @@ -11,6 +11,6 @@ ============================================================================*/ #include "cmStandardIncludes.h" #if !defined(CMAKE_NO_ANSI_STRING_STREAM) -cmOStringStream::cmOStringStream() {} -cmOStringStream::~cmOStringStream() {} +std::ostringstream::cmOStringStream() {} +std::ostringstream::~cmOStringStream() {} #endif diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index df031b9..a7db271 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -140,7 +140,7 @@ private: #endif /* Poison this operator to avoid common mistakes. */ -extern void operator << (std::ostream&, const cmOStringStream&); +extern void operator << (std::ostream&, const std::ostringstream&); /** Standard documentation entry for cmDocumentation's formatting. */ struct cmDocumentationEntry diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 8341027..fe962ba 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -122,7 +122,7 @@ bool cmStringCommand::HandleHashCommand(std::vector const& args) #if defined(CMAKE_BUILD_WITH_CMAKE) if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " requires an output variable and an input string"; this->SetError(e.str()); return false; @@ -137,7 +137,7 @@ bool cmStringCommand::HandleHashCommand(std::vector const& args) } return false; #else - cmOStringStream e; + std::ostringstream e; e << args[0] << " not available during bootstrap"; this->SetError(e.str().c_str()); return false; @@ -233,7 +233,7 @@ bool cmStringCommand::HandleConfigureCommand( } else { - cmOStringStream err; + std::ostringstream err; err << "Unrecognized argument \"" << args[i] << "\""; this->SetError(err.str()); return false; @@ -591,7 +591,7 @@ bool cmStringCommand::HandleFindCommand(std::vector const& } if(std::string::npos != pos) { - cmOStringStream s; + std::ostringstream s; s << pos; this->Makefile->AddDefinition(outvar, s.str().c_str()); return true; @@ -705,7 +705,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector const& int intStringLength = static_cast(stringLength); if ( begin < 0 || begin > intStringLength ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "begin index: " << begin << " is out of range 0 - " << stringLength; this->SetError(ostr.str()); @@ -713,7 +713,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector const& } if ( end < -1 ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "end index: " << end << " should be -1 or greater"; this->SetError(ostr.str()); return false; @@ -1089,7 +1089,7 @@ bool cmStringCommand this->Makefile->AddDefinition(outputVariable, uuid.c_str()); return true; #else - cmOStringStream e; + std::ostringstream e; e << args[0] << " not available during bootstrap"; this->SetError(e.str().c_str()); return false; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1d36ff5..16e71cc 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2501,7 +2501,7 @@ bool cmSystemTools::ChangeRPath(std::string const& file, } if(emsg) { - cmOStringStream e; + std::ostringstream e; e << "The current " << se_name[i] << " is:\n" << " " << se[i]->Value << "\n" << "which does not contain:\n" diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 94a6de3..5d68d9d 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -686,7 +686,7 @@ static bool processSources(cmTarget const* tgt, if (!targetName.empty() && !cmSystemTools::FileIsFullPath(src.c_str())) { - cmOStringStream err; + std::ostringstream err; if (!targetName.empty()) { err << "Target \"" << targetName << "\" contains relative " @@ -863,7 +863,7 @@ cmTarget::GetConfigCommonSourceFiles(std::vector& files) const thisConfigFiles += (*fi)->GetFullPath(); sep = "\n "; } - cmOStringStream e; + std::ostringstream e; e << "Target \"" << this->Name << "\" has source files which vary by " "configuration. This is not supported by the \"" << this->Makefile->GetLocalGenerator() @@ -996,7 +996,7 @@ std::string cmTarget::ProcessSourceItemCMP0049(const std::string& s) this->Makefile->ExpandVariablesInString(src); if (src != s) { - cmOStringStream e; + std::ostringstream e; bool noMessage = false; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0049)) @@ -1279,7 +1279,7 @@ bool cmTarget::PushTLLCommandTrace(TLLSignature signature) } //---------------------------------------------------------------------------- -void cmTarget::GetTllSignatureTraces(cmOStringStream &s, +void cmTarget::GetTllSignatureTraces(std::ostringstream &s, TLLSignature sig) const { std::vector sigs; @@ -1307,7 +1307,7 @@ void cmTarget::GetTllSignatureTraces(cmOStringStream &s, if(i != it->end()) { cmListFileContext const& lfc = *i; - cmOStringStream line; + std::ostringstream line; line << " * " << (lfc.Line? "": " in ") << lfc << std::endl; if (emitted.insert(line.str()).second) { @@ -1749,7 +1749,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) if (this->GetType() == INTERFACE_LIBRARY && !whiteListedInterfaceProperty(prop)) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " "The property \"" << prop << "\" is not allowed."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1757,7 +1757,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) } else if (prop == "NAME") { - cmOStringStream e; + std::ostringstream e; e << "NAME property is read-only\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; @@ -1800,7 +1800,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) } else if(prop == "EXPORT_NAME" && this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT_NAME property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1816,7 +1816,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) { if(this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "SOURCES property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1844,7 +1844,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, if (this->GetType() == INTERFACE_LIBRARY && !whiteListedInterfaceProperty(prop)) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " "The property \"" << prop << "\" is not allowed."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1852,7 +1852,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } else if (prop == "NAME") { - cmOStringStream e; + std::ostringstream e; e << "NAME property is read-only\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; @@ -1887,7 +1887,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } else if(prop == "EXPORT_NAME" && this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT_NAME property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1902,7 +1902,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, { if(this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "SOURCES property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1931,7 +1931,7 @@ std::string cmTarget::GetExportName() const { if (!cmGeneratorExpression::IsValidTargetName(exportName)) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT_NAME property \"" << exportName << "\" for \"" << this->GetName() << "\": is not valid."; cmSystemTools::Error(e.str().c_str()); @@ -2043,7 +2043,7 @@ static void processIncludeDirectories(cmTarget const* tgt, if (fromImported && !cmSystemTools::FileExists(li->c_str())) { - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::FATAL_ERROR; if (checkCMP0027) { @@ -2076,7 +2076,7 @@ static void processIncludeDirectories(cmTarget const* tgt, if (!cmSystemTools::FileIsFullPath(li->c_str())) { - cmOStringStream e; + std::ostringstream e; bool noMessage = false; cmake::MessageType messageType = cmake::FATAL_ERROR; if (!targetName.empty()) @@ -2426,7 +2426,7 @@ void cmTarget::GetCompileDefinitions(std::vector &list, { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << this->Makefile->GetCMakeInstance()->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0043); this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, @@ -2559,7 +2559,7 @@ static void cmTargetCheckLINK_INTERFACE_LIBRARIES( "LINK_INTERFACE_LIBRARIES"); // Report an error. - cmOStringStream e; + std::ostringstream e; e << "Property " << prop << " may not contain link-type keyword \"" << keys.match(2) << "\". " << "The " << base << " property has a per-configuration " @@ -2596,7 +2596,7 @@ static void cmTargetCheckINTERFACE_LINK_LIBRARIES(const char* value, } // Report an error. - cmOStringStream e; + std::ostringstream e; e << "Property INTERFACE_LINK_LIBRARIES may not contain link-type " "keyword \"" << keys.match(2) << "\". The INTERFACE_LINK_LIBRARIES " @@ -2895,7 +2895,7 @@ bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const { return true; } - cmOStringStream e; + std::ostringstream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch (context->GetPolicyStatus(cmPolicies::CMP0026)) @@ -2954,7 +2954,7 @@ const char *cmTarget::GetProperty(const std::string& prop, if (this->GetType() == INTERFACE_LIBRARY && !whiteListedInterfaceProperty(prop)) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " "The property \"" << prop << "\" is not allowed."; context->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -3130,7 +3130,7 @@ const char *cmTarget::GetProperty(const std::string& prop, return 0; } - cmOStringStream ss; + std::ostringstream ss; const char* sep = ""; typedef cmTargetInternals::TargetPropertyEntry TargetPropertyEntry; @@ -3160,7 +3160,7 @@ const char *cmTarget::GetProperty(const std::string& prop, bool addContent = false; bool noMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(context->GetPolicyStatus(cmPolicies::CMP0051)) { @@ -3258,7 +3258,7 @@ public: { bool noMessage = false; cmake::MessageType messageType = cmake::FATAL_ERROR; - cmOStringStream e; + std::ostringstream e; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028)) { case cmPolicies::WARN: @@ -3379,7 +3379,7 @@ public: } else if(this->Preferred.size() > 1) { - cmOStringStream e; + std::ostringstream e; e << "Target " << this->Target->GetName() << " contains multiple languages with the highest linker preference" << " (" << this->Preference << "):\n"; @@ -3751,7 +3751,7 @@ bool cmTarget::HasMacOSXRpathInstallNameDir(const std::string& config) const if(!this->Makefile->IsSet("CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG")) { - cmOStringStream w; + std::ostringstream w; w << "Attempting to use"; if(macosx_rpath) { @@ -5049,7 +5049,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, report += compatibilityAgree(t, propContent != consistent.second); if (!consistent.first) { - cmOStringStream e; + std::ostringstream e; e << "Property " << p << " on target \"" << tgt->GetName() << "\" does\nnot match the " "INTERFACE_" << p << " property requirement\nof " @@ -5082,7 +5082,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, report += compatibilityAgree(t, propContent != consistent.second); if (!consistent.first) { - cmOStringStream e; + std::ostringstream e; e << "Property " << p << " on target \"" << tgt->GetName() << "\" is\nimplied to be " << defaultValue << " because it was used to determine the link libraries\n" @@ -5116,7 +5116,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, report += compatibilityAgree(t, propContent != consistent.second); if (!consistent.first) { - cmOStringStream e; + std::ostringstream e; e << "The INTERFACE_" << p << " property of \"" << theTarget->GetName() << "\" does\nnot agree with the value " "of " << p << " already determined\nfor \"" @@ -6024,7 +6024,7 @@ cmTargetInternals::ComputeLinkInterfaceLibraries( if (newExplicitLibraries && strcmp(newExplicitLibraries, explicitLibraries) != 0) { - cmOStringStream w; + std::ostringstream w; w << (thisTarget->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n" @@ -6111,7 +6111,7 @@ cmTargetInternals::ComputeLinkInterfaceLibraries( if(newLibraries.empty()) { newLibraries = "(empty)"; } - cmOStringStream w; + std::ostringstream w; w << (thisTarget->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n" @@ -6366,7 +6366,7 @@ cmTargetInternals::ComputeLinkImplementationLibraries( { bool noMessage = false; cmake::MessageType messageType = cmake::FATAL_ERROR; - cmOStringStream e; + std::ostringstream e; switch(thisTarget->GetPolicyStatusCMP0038()) { case cmPolicies::WARN: @@ -6472,7 +6472,7 @@ cmTarget const* cmTarget::FindTargetToLink(std::string const& name) const if(tgt && tgt->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << this->GetName() << "\" links to " "OBJECT library \"" << tgt->GetName() << "\" but this is not " "allowed. " @@ -6511,7 +6511,7 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const { case cmPolicies::WARN: { - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0004)) << "\n" << "Target \"" << this->GetName() << "\" links to item \"" @@ -6523,7 +6523,7 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const break; case cmPolicies::NEW: { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << this->GetName() << "\" links to item \"" << item << "\" which has leading or trailing whitespace. " << "This is now an error according to policy CMP0004."; @@ -6533,7 +6533,7 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile->GetPolicies() ->GetRequiredPolicyError(cmPolicies::CMP0004)) << "\n" << "Target \"" << this->GetName() << "\" links to item \"" @@ -6614,7 +6614,7 @@ void checkPropertyConsistency(cmTarget const* depender, std::string pfile = pdir + pname + ".rst"; if(cmSystemTools::FileExists(pfile.c_str(), true)) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << dependee->GetName() << "\" has property \"" << *pi << "\" listed in its " << propName << " property. " "This is not allowed. Only user-defined properties may appear " @@ -6776,7 +6776,7 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info, { propsString += " and the " + *props.begin(); } - cmOStringStream e; + std::ostringstream e; e << "Property \"" << prop << "\" appears in both the " << propsString << " property in the dependencies of target \"" << this->GetName() << diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a3ecca0..ddd9859 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -202,7 +202,7 @@ public: PlainTLLSignature }; bool PushTLLCommandTrace(TLLSignature signature); - void GetTllSignatureTraces(cmOStringStream &s, TLLSignature sig) const; + void GetTllSignatureTraces(std::ostringstream &s, TLLSignature sig) const; void MergeLinkLibraries( cmMakefile& mf, const std::string& selfname, const LinkLibraryVectorType& libs ); diff --git a/Source/cmTargetCompileDefinitionsCommand.cxx b/Source/cmTargetCompileDefinitionsCommand.cxx index 66d8ad3..dc19720 100644 --- a/Source/cmTargetCompileDefinitionsCommand.cxx +++ b/Source/cmTargetCompileDefinitionsCommand.cxx @@ -20,7 +20,7 @@ bool cmTargetCompileDefinitionsCommand void cmTargetCompileDefinitionsCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile definitions for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -29,7 +29,7 @@ void cmTargetCompileDefinitionsCommand void cmTargetCompileDefinitionsCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile definitions for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx index 10daad4..15a9a38 100644 --- a/Source/cmTargetCompileFeaturesCommand.cxx +++ b/Source/cmTargetCompileFeaturesCommand.cxx @@ -21,7 +21,7 @@ bool cmTargetCompileFeaturesCommand::InitialPass( void cmTargetCompileFeaturesCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile features for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -30,7 +30,7 @@ void cmTargetCompileFeaturesCommand void cmTargetCompileFeaturesCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile features for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx index 3fb76a6..e16468b 100644 --- a/Source/cmTargetCompileOptionsCommand.cxx +++ b/Source/cmTargetCompileOptionsCommand.cxx @@ -20,7 +20,7 @@ bool cmTargetCompileOptionsCommand void cmTargetCompileOptionsCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile options for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -29,7 +29,7 @@ void cmTargetCompileOptionsCommand void cmTargetCompileOptionsCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile options for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx index e9f0e04..6dc58b1 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.cxx +++ b/Source/cmTargetIncludeDirectoriesCommand.cxx @@ -25,7 +25,7 @@ bool cmTargetIncludeDirectoriesCommand void cmTargetIncludeDirectoriesCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify include directories for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -35,7 +35,7 @@ void cmTargetIncludeDirectoriesCommand void cmTargetIncludeDirectoriesCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify include directories for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 56e1338..75c94c5 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -43,7 +43,7 @@ bool cmTargetLinkLibrariesCommand if(!this->Target) { cmake::MessageType t = cmake::FATAL_ERROR; // fail by default - cmOStringStream e; + std::ostringstream e; e << "Cannot specify link libraries for target \"" << args[0] << "\" " << "which is not built by this project."; // The bad target is the only argument. Check how policy CMP0016 is set, @@ -92,7 +92,7 @@ bool cmTargetLinkLibrariesCommand if(this->Target->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Object library target \"" << args[0] << "\" " << "may not link to anything."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -102,7 +102,7 @@ bool cmTargetLinkLibrariesCommand if (this->Target->GetType() == cmTarget::UTILITY) { - cmOStringStream e; + std::ostringstream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0039)) @@ -311,7 +311,7 @@ bool cmTargetLinkLibrariesCommand // Make sure the last argument was not a library type specifier. if(haveLLT) { - cmOStringStream e; + std::ostringstream e; e << "The \"" << this->LinkLibraryTypeNames[llt] << "\" argument must be followed by a library."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -342,7 +342,7 @@ void cmTargetLinkLibrariesCommand ::LinkLibraryTypeSpecifierWarning(int left, int right) { - cmOStringStream w; + std::ostringstream w; w << "Link library type specifier \"" << this->LinkLibraryTypeNames[left] << "\" is followed by specifier \"" << this->LinkLibraryTypeNames[right] << "\" instead of a library name. " @@ -373,7 +373,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, ? cmTarget::KeywordTLLSignature : cmTarget::PlainTLLSignature; if (!this->Target->PushTLLCommandTrace(sig)) { - cmOStringStream e; + std::ostringstream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0023)) diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index ce3b11e..5153926 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -24,7 +24,7 @@ bool cmTargetSourcesCommand void cmTargetSourcesCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify sources for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -34,7 +34,7 @@ void cmTargetSourcesCommand void cmTargetSourcesCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify sources for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index debe243..9473008 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -70,7 +70,7 @@ static void cmVariableWatchCommandVariableAccessed( { arg.FilePath = "Unknown"; arg.Line = 0; - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << arg.FilePath << ":" << arg.Line << ":\n" << "A command failed during the invocation of callback \"" @@ -83,7 +83,7 @@ static void cmVariableWatchCommandVariableAccessed( } if ( !processed ) { - cmOStringStream msg; + std::ostringstream msg; msg << "Variable \"" << variable << "\" was accessed using " << accessString << " with value \"" << (newValue?newValue:"") << "\"."; makefile->IssueMessage(cmake::LOG, msg.str()); @@ -135,7 +135,7 @@ bool cmVariableWatchCommand } if ( variable == "CMAKE_CURRENT_LIST_FILE" ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "cannot be set on the variable: " << variable; this->SetError(ostr.str()); return false; diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx index 391b874..1d3e0e9 100644 --- a/Source/cmXMLParser.cxx +++ b/Source/cmXMLParser.cxx @@ -54,7 +54,7 @@ int cmXMLParser::ParseFile(const char* file) return 0; } - cmOStringStream str; + std::ostringstream str; str << ifs.rdbuf(); return this->Parse(str.str().c_str()); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bbd3fe4..5edb7dd 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1182,7 +1182,7 @@ int cmake::DoPreConfigureChecks() srcList += "/CMakeLists.txt"; if(!cmSystemTools::FileExists(srcList.c_str())) { - cmOStringStream err; + std::ostringstream err; if(cmSystemTools::FileIsDirectory(this->GetHomeDirectory())) { err << "The source directory \"" << this->GetHomeDirectory() @@ -1250,7 +1250,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) } cmCacheManager::CacheIterator ci = this->CacheManager->NewIterator(); std::vector saved; - cmOStringStream warning; + std::ostringstream warning; warning << "You have changed variables that require your cache to be deleted.\n" << "Configure will be re-run and you may have to reset some variables.\n" @@ -1971,7 +1971,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake no build system arguments\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -1983,7 +1983,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake missing file: " << this->CheckBuildSystemArgument << "\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2003,7 +2003,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake error reading : " << this->CheckBuildSystemArgument << "\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2045,7 +2045,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake, missing byproduct: " << *pi << "\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -2068,7 +2068,7 @@ int cmake::CheckBuildSystem() // Not enough information was provided to do the test. Just rerun. if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake no CMAKE_MAKEFILE_DEPENDS " "or CMAKE_MAKEFILE_OUTPUTS :\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2094,7 +2094,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake: build system dependency is missing\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -2120,7 +2120,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake: build system output is missing\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -2138,7 +2138,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake file: " << out_oldest << " older than: " << dep_newest << "\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2563,7 +2563,7 @@ static bool cmakeCheckStampFile(const char* stampName) // The build system is up to date. The stamp file has been removed // by the VS IDE due to a "rebuild" request. Restore it atomically. - cmOStringStream stampTempStream; + std::ostringstream stampTempStream; stampTempStream << stampName << ".tmp" << cmSystemTools::RandomSeed(); std::string stampTempString = stampTempStream.str(); const char* stampTemp = stampTempString.c_str(); @@ -2627,7 +2627,7 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, cmListFileBacktrace backtrace = bt; backtrace.MakeRelative(); - cmOStringStream msg; + std::ostringstream msg; bool isError = false; // Construct the message header. if(t == cmake::FATAL_ERROR) @@ -2835,7 +2835,7 @@ void cmake::RunCheckForUnusedVariables() { #ifdef CMAKE_BUILD_WITH_CMAKE bool haveUnused = false; - cmOStringStream msg; + std::ostringstream msg; msg << "Manually-specified variables were not used by the project:"; for(std::map::const_iterator it = this->UsedCliVariables.begin(); diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 37d2916..d3d85a5 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -36,7 +36,7 @@ void CMakeCommandUsage(const char* program) { - cmOStringStream errorStream; + std::ostringstream errorStream; #ifdef CMAKE_BUILD_WITH_CMAKE errorStream diff --git a/Tests/CMakeLib/testXMLSafe.cxx b/Tests/CMakeLib/testXMLSafe.cxx index 60442fa..9e4960c 100644 --- a/Tests/CMakeLib/testXMLSafe.cxx +++ b/Tests/CMakeLib/testXMLSafe.cxx @@ -34,7 +34,7 @@ int testXMLSafe(int, char*[]) for(test_pair const* p = pairs; p->in; ++p) { cmXMLSafe xs(p->in); - cmOStringStream oss; + std::ostringstream oss; oss << xs; std::string out = oss.str(); if(out != p->out) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From clinton at elemtech.com Thu Jan 8 22:47:54 2015 From: clinton at elemtech.com (Clinton Stimpson) Date: Thu, 8 Jan 2015 22:47:54 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1597-gcbda3a7 Message-ID: <20150109034754.B8A2DA8C85@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via cbda3a77ec426b6340d705eeb153f53346b53191 (commit) via 61cf781a6216c55a60fb73d4fb5fab76b1e7fc34 (commit) from def4979cf2be3342b9e46d44da13d2b51670f685 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cbda3a77ec426b6340d705eeb153f53346b53191 commit cbda3a77ec426b6340d705eeb153f53346b53191 Merge: def4979 61cf781 Author: Clinton Stimpson AuthorDate: Thu Jan 8 22:47:53 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 22:47:53 2015 -0500 Merge topic 'sln-bom' into next 61cf781a Encoding: Write Visual Studio solution file with BOM. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=61cf781a6216c55a60fb73d4fb5fab76b1e7fc34 commit 61cf781a6216c55a60fb73d4fb5fab76b1e7fc34 Author: Clinton Stimpson AuthorDate: Fri Dec 26 21:15:29 2014 -0700 Commit: Clinton Stimpson CommitDate: Fri Dec 26 21:15:29 2014 -0700 Encoding: Write Visual Studio solution file with BOM. When configured to use UTF-8 internally, add a UTF-8 BOM to generated .sln files for Visual Studio to correctly handle them. Otherwise, some versions of Visual Studio will read them as ANSI encoded files. diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index a67a649..64f9cee 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -93,6 +93,11 @@ void cmGlobalVisualStudio71Generator cmLocalGenerator* root, std::vector& generators) { +#ifdef CMAKE_ENCODING_UTF8 + // Add UTF-8 BOM for .sln file to indicate encoding + const unsigned char utf8_bom[3] = {0xEF,0xBB,0xBF}; + fout.write(reinterpret_cast(utf8_bom), 3); +#endif // Write out the header for a SLN file this->WriteSLNHeader(fout); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 401e475..0eb7d2c 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -558,6 +558,11 @@ void cmGlobalVisualStudio7Generator cmLocalGenerator* root, std::vector& generators) { +#ifdef CMAKE_ENCODING_UTF8 + // Add UTF-8 BOM for .sln file to indicate encoding + const unsigned char utf8_bom[3] = {0xEF,0xBB,0xBF}; + fout.write(reinterpret_cast(utf8_bom), 3); +#endif // Write out the header for a SLN file this->WriteSLNHeader(fout); ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalVisualStudio71Generator.cxx | 5 +++++ Source/cmGlobalVisualStudio7Generator.cxx | 5 +++++ 2 files changed, 10 insertions(+) hooks/post-receive -- CMake From clinton at elemtech.com Thu Jan 8 23:07:01 2015 From: clinton at elemtech.com (Clinton Stimpson) Date: Thu, 8 Jan 2015 23:07:01 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1599-g7b5da14 Message-ID: <20150109040701.E78D0A938E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7b5da14d074e365b812802b0b8c1be8aedf770fd (commit) via 9a8ab86645b0ea1fcbd1b069694d0cbb4fa2621a (commit) from cbda3a77ec426b6340d705eeb153f53346b53191 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b5da14d074e365b812802b0b8c1be8aedf770fd commit 7b5da14d074e365b812802b0b8c1be8aedf770fd Merge: cbda3a7 9a8ab86 Author: Clinton Stimpson AuthorDate: Thu Jan 8 23:07:00 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 8 23:07:00 2015 -0500 Merge topic 'tests-encoding' into next 9a8ab866 Encoding: Modify tests to work using non-ascii paths. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a8ab86645b0ea1fcbd1b069694d0cbb4fa2621a commit 9a8ab86645b0ea1fcbd1b069694d0cbb4fa2621a Author: Clinton Stimpson AuthorDate: Fri Dec 26 21:19:14 2014 -0700 Commit: Clinton Stimpson CommitDate: Thu Jan 8 20:56:51 2015 -0700 Encoding: Modify tests to work using non-ascii paths. For complex*, CustomCommand and OutDir tests, non-ascii paths are avoided in test code by using relative paths, and setting the working when running the test. This also avoids the need to internationalize the test code. For RunCMake.GeneratorExpression, use a UTF-8 encoding in file(STRINGS) to retrieve the compiled absolute path correctly. diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index bf23d4a..508221c 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -89,18 +89,22 @@ remove_definitions(-DCOMPLEX_DEFINED) # Test pre-build/pre-link/post-build rules for an executable. add_custom_command(TARGET complex PRE_BUILD COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Executable/prebuild.txt") + ARGS "Executable/prebuild.txt" + WORKING_DIRECTORY "${Complex_BINARY_DIR}") add_custom_command(TARGET complex PRE_LINK COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Executable/prelink.txt") + ARGS "Executable/prelink.txt" + WORKING_DIRECTORY "${Complex_BINARY_DIR}") add_custom_command(TARGET complex POST_BUILD COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Executable/postbuild.txt") + ARGS "Executable/postbuild.txt" + WORKING_DIRECTORY "${Complex_BINARY_DIR}") add_custom_command(TARGET complex POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy - "${Complex_BINARY_DIR}/Executable/postbuild.txt" - "${Complex_BINARY_DIR}/Executable/postbuild2.txt") + "Executable/postbuild.txt" + "Executable/postbuild2.txt" + WORKING_DIRECTORY "${Complex_BINARY_DIR}") set_source_files_properties(complex COMPILE_FLAGS diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 31442ba..ec222a5 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -716,14 +716,14 @@ int main() // the file was removed the last time 'complex' was run, and it is // only created during a build. - TestAndRemoveFile(BINARY_DIR "/Library/prebuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Library/prelink.txt"); - TestAndRemoveFile(BINARY_DIR "/Library/postbuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Library/postbuild2.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/prebuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/prelink.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/postbuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/postbuild2.txt"); + TestAndRemoveFile("Library/prebuild.txt"); + TestAndRemoveFile("Library/prelink.txt"); + TestAndRemoveFile("Library/postbuild.txt"); + TestAndRemoveFile("Library/postbuild2.txt"); + TestAndRemoveFile("Executable/prebuild.txt"); + TestAndRemoveFile("Executable/prelink.txt"); + TestAndRemoveFile("Executable/postbuild.txt"); + TestAndRemoveFile("Executable/postbuild2.txt"); // ---------------------------------------------------------------------- // A custom target has been created (see Library/). @@ -733,12 +733,12 @@ int main() // the file was removed the last time 'complex' was run, and it is // only created during a build. - TestAndRemoveFile(BINARY_DIR "/Library/custom_target1.txt"); + TestAndRemoveFile("Library/custom_target1.txt"); // ---------------------------------------------------------------------- // A directory has been created. - TestDir(BINARY_DIR "/make_dir"); + TestDir("make_dir"); // ---------------------------------------------------------------------- // Test OUTPUT_REQUIRED_FILES @@ -749,7 +749,7 @@ int main() // the file was removed the last time 'complex' was run, and it is // only created during a build. - TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt"); + TestAndRemoveFile("Executable/Temp/complex-required.txt"); // ---------------------------------------------------------------------- // Test FIND_LIBRARY diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index 01f1005..e910f20 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -89,18 +89,22 @@ remove_definitions(-DCOMPLEX_DEFINED) # Test pre-build/pre-link/post-build rules for an executable. add_custom_command(TARGET complex PRE_BUILD COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Executable/prebuild.txt") + ARGS "Executable/prebuild.txt" + WORKING_DIRECTORY "${Complex_BINARY_DIR}") add_custom_command(TARGET complex PRE_BUILD COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Executable/prelink.txt") + ARGS "Executable/prelink.txt" + WORKING_DIRECTORY "${Complex_BINARY_DIR}") add_custom_command(TARGET complex POST_BUILD COMMAND ${CREATE_FILE_EXE} - ARGS "${Complex_BINARY_DIR}/Executable/postbuild.txt") + ARGS "Executable/postbuild.txt" + WORKING_DIRECTORY "${Complex_BINARY_DIR}") add_custom_command(TARGET complex POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy - "${Complex_BINARY_DIR}/Executable/postbuild.txt" - "${Complex_BINARY_DIR}/Executable/postbuild2.txt") + "Executable/postbuild.txt" + "Executable/postbuild2.txt" + WORKING_DIRECTORY "${Complex_BINARY_DIR}") set_source_files_properties(complex COMPILE_FLAGS diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 31442ba..ec222a5 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -716,14 +716,14 @@ int main() // the file was removed the last time 'complex' was run, and it is // only created during a build. - TestAndRemoveFile(BINARY_DIR "/Library/prebuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Library/prelink.txt"); - TestAndRemoveFile(BINARY_DIR "/Library/postbuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Library/postbuild2.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/prebuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/prelink.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/postbuild.txt"); - TestAndRemoveFile(BINARY_DIR "/Executable/postbuild2.txt"); + TestAndRemoveFile("Library/prebuild.txt"); + TestAndRemoveFile("Library/prelink.txt"); + TestAndRemoveFile("Library/postbuild.txt"); + TestAndRemoveFile("Library/postbuild2.txt"); + TestAndRemoveFile("Executable/prebuild.txt"); + TestAndRemoveFile("Executable/prelink.txt"); + TestAndRemoveFile("Executable/postbuild.txt"); + TestAndRemoveFile("Executable/postbuild2.txt"); // ---------------------------------------------------------------------- // A custom target has been created (see Library/). @@ -733,12 +733,12 @@ int main() // the file was removed the last time 'complex' was run, and it is // only created during a build. - TestAndRemoveFile(BINARY_DIR "/Library/custom_target1.txt"); + TestAndRemoveFile("Library/custom_target1.txt"); // ---------------------------------------------------------------------- // A directory has been created. - TestDir(BINARY_DIR "/make_dir"); + TestDir("make_dir"); // ---------------------------------------------------------------------- // Test OUTPUT_REQUIRED_FILES @@ -749,7 +749,7 @@ int main() // the file was removed the last time 'complex' was run, and it is // only created during a build. - TestAndRemoveFile(BINARY_DIR "/Executable/Temp/complex-required.txt"); + TestAndRemoveFile("Executable/Temp/complex-required.txt"); // ---------------------------------------------------------------------- // Test FIND_LIBRARY diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 915da0a..57ffeec 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -164,13 +164,6 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/not_included.h ${PROJECT_BINARY_DIR}/not_included.h ) -# Tell the executable where to find not_included.h. -configure_file( - ${PROJECT_SOURCE_DIR}/config.h.in - ${PROJECT_BINARY_DIR}/config.h - @ONLY - ) - # add the executable add_executable(CustomCommand ${PROJECT_BINARY_DIR}/foo.h diff --git a/Tests/CustomCommand/config.h.in b/Tests/CustomCommand/config.h.in deleted file mode 100644 index 86c97bd..0000000 --- a/Tests/CustomCommand/config.h.in +++ /dev/null @@ -1 +0,0 @@ -#define PROJECT_BINARY_DIR "@PROJECT_BINARY_DIR@" diff --git a/Tests/CustomCommand/foo.in b/Tests/CustomCommand/foo.in index 0c5021c..e43aed1 100644 --- a/Tests/CustomCommand/foo.in +++ b/Tests/CustomCommand/foo.in @@ -1,6 +1,5 @@ #include "doc1.h" #include "foo.h" -#include "config.h" #include @@ -11,7 +10,7 @@ int main () { if (generated()*wrapped()*doc() == 3*5*7) { - FILE* fin = fopen(PROJECT_BINARY_DIR "/not_included.h", "r"); + FILE* fin = fopen("not_included.h", "r"); if(fin) { fclose(fin); diff --git a/Tests/OutDir/OutDir.cmake b/Tests/OutDir/OutDir.cmake index e1e6b7f..a1f13e7 100644 --- a/Tests/OutDir/OutDir.cmake +++ b/Tests/OutDir/OutDir.cmake @@ -16,13 +16,17 @@ find_program(CONLY_EXE PATHS ${top}/runtime NO_DEFAULT_PATH) +file(RELATIVE_PATH TESTC1_LIB_FILE "${top}" "${TESTC1_LIB}") +file(RELATIVE_PATH TESTC2_LIB_FILE "${top}" "${TESTC2_LIB}") +file(RELATIVE_PATH CONLY_EXE_FILE "${top}" "${CONLY_EXE}") + file(WRITE ${top}/OutDir.h "/* Generated by ${CMAKE_CURRENT_LIST_FILE} */ #ifndef OutDir_h #define OutDir_h -#define TESTC1_LIB \"${TESTC1_LIB}\" -#define TESTC2_LIB \"${TESTC2_LIB}\" -#define CONLY_EXE \"${CONLY_EXE}\" +#define TESTC1_LIB \"${TESTC1_LIB_FILE}\" +#define TESTC2_LIB \"${TESTC2_LIB_FILE}\" +#define CONLY_EXE \"${CONLY_EXE_FILE}\" #endif ") diff --git a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake index 748d14f..2a588bc 100644 --- a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake +++ b/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake @@ -1,4 +1,4 @@ -file(STRINGS ${RunCMake_TEST_BINARY_DIR}/test.txt TEST_TXT) +file(STRINGS ${RunCMake_TEST_BINARY_DIR}/test.txt TEST_TXT ENCODING UTF-8) list(GET TEST_TXT 0 PDB_PATH) list(GET TEST_TXT 1 PDB_NAME) ----------------------------------------------------------------------- Summary of changes: Tests/Complex/Executable/CMakeLists.txt | 14 ++++++++----- Tests/Complex/Executable/complex.cxx | 22 ++++++++++---------- Tests/ComplexOneConfig/Executable/CMakeLists.txt | 14 ++++++++----- Tests/ComplexOneConfig/Executable/complex.cxx | 22 ++++++++++---------- Tests/CustomCommand/CMakeLists.txt | 7 ------- Tests/CustomCommand/config.h.in | 1 - Tests/CustomCommand/foo.in | 3 +-- Tests/OutDir/OutDir.cmake | 10 ++++++--- .../ValidTarget-TARGET_PDB_FILE-check.cmake | 2 +- 9 files changed, 49 insertions(+), 46 deletions(-) delete mode 100644 Tests/CustomCommand/config.h.in hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jan 9 00:01:12 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 9 Jan 2015 00:01:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-631-g4aa9c64 Message-ID: <20150109050112.4C233A9302@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 4aa9c64511adb6e3aa1b686d07f8cbdf92dedbab (commit) from 7ecbade8877522d9d565bcb2216f71426873f564 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4aa9c64511adb6e3aa1b686d07f8cbdf92dedbab commit 4aa9c64511adb6e3aa1b686d07f8cbdf92dedbab Author: Kitware Robot AuthorDate: Fri Jan 9 00:01:10 2015 -0500 Commit: Kitware Robot CommitDate: Fri Jan 9 00:01:10 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 05b46c5..8024a7d 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 20150108) +set(CMake_VERSION_PATCH 20150109) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Fri Jan 9 04:00:20 2015 From: steveire at gmail.com (Stephen Kelly) Date: Fri, 9 Jan 2015 04:00:20 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1601-gcf0d9e8 Message-ID: <20150109090020.0EAE2A90FE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via cf0d9e84916ebbcd14fd3df5fd8b9b856c1edb5b (commit) via b1dfbc0de54b5721e073d8363aeb4d8f4fa09ed2 (commit) from 7b5da14d074e365b812802b0b8c1be8aedf770fd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cf0d9e84916ebbcd14fd3df5fd8b9b856c1edb5b commit cf0d9e84916ebbcd14fd3df5fd8b9b856c1edb5b Merge: 7b5da14 b1dfbc0 Author: Stephen Kelly AuthorDate: Fri Jan 9 04:00:18 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 9 04:00:18 2015 -0500 Merge topic 'drop-ancient-workarounds' into next b1dfbc0d Minor fixes. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b1dfbc0de54b5721e073d8363aeb4d8f4fa09ed2 commit b1dfbc0de54b5721e073d8363aeb4d8f4fa09ed2 Author: Stephen Kelly AuthorDate: Fri Jan 9 09:59:27 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 9 09:59:27 2015 +0100 Minor fixes. diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index c1fe404..4a99e50 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -24,7 +24,7 @@ #endif #define cmCPackLogger(logType, msg) \ do { \ - std::ostringstream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ if(Generator) { \ Generator->Logger->Log(logType, __FILE__, __LINE__, \ diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 86f8a52..38cef87 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -25,7 +25,7 @@ #endif #define cmCPackLogger(logType, msg) \ do { \ - std::ostringstream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ if(Generator) { \ Generator->Logger->Log(logType, __FILE__, __LINE__, \ diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 2df8dd9..8a22131 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -862,7 +862,8 @@ WriteDistributionFile(const char* metapackageFile) //---------------------------------------------------------------------- void cmCPackPackageMakerGenerator:: -CreateChoiceOutline(const cmCPackComponentGroup& group, std::ostringstream& out) +CreateChoiceOutline(const cmCPackComponentGroup& group, + std::ostringstream& out) { out << "" << std::endl; std::vector::const_iterator groupIt; ----------------------------------------------------------------------- Summary of changes: Source/CPack/IFW/cmCPackIFWInstaller.cxx | 2 +- Source/CPack/IFW/cmCPackIFWPackage.cxx | 2 +- Source/CPack/cmCPackPackageMakerGenerator.cxx | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 9 08:56:26 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 9 Jan 2015 08:56:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1605-ge51cf42 Message-ID: <20150109135626.DF8F1A8EFE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e51cf4204b190f9e85186b3552634bb7bc22f76d (commit) via 6c3e3c1fc60759f3818201c63b897babd9884ee7 (commit) via 60c5ab9ac8ae09d2eb65bcde93040b9bc0fc5a78 (commit) via 4aa9c64511adb6e3aa1b686d07f8cbdf92dedbab (commit) from cf0d9e84916ebbcd14fd3df5fd8b9b856c1edb5b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e51cf4204b190f9e85186b3552634bb7bc22f76d commit e51cf4204b190f9e85186b3552634bb7bc22f76d Merge: cf0d9e8 6c3e3c1 Author: Brad King AuthorDate: Fri Jan 9 08:56:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 9 08:56:25 2015 -0500 Merge topic 'update-kwsys' into next 6c3e3c1f Merge branch 'upstream-kwsys' into update-kwsys 60c5ab9a KWSys 2015-01-09 (d30c9b03) 4aa9c645 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c3e3c1fc60759f3818201c63b897babd9884ee7 commit 6c3e3c1fc60759f3818201c63b897babd9884ee7 Merge: 4aa9c64 60c5ab9 Author: Brad King AuthorDate: Fri Jan 9 08:55:40 2015 -0500 Commit: Brad King CommitDate: Fri Jan 9 08:55:40 2015 -0500 Merge branch 'upstream-kwsys' into update-kwsys http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=60c5ab9ac8ae09d2eb65bcde93040b9bc0fc5a78 commit 60c5ab9ac8ae09d2eb65bcde93040b9bc0fc5a78 Author: KWSys Robot AuthorDate: Fri Jan 9 08:54:18 2015 -0500 Commit: Brad King CommitDate: Fri Jan 9 08:55:35 2015 -0500 KWSys 2015-01-09 (d30c9b03) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ d30c9b03 | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 5a15cb3b..d30c9b03 Simon Gomizelj (1): 2f0165f1 Terminal: Add xterm-termite to VT100 color support whitelist Stephen Kelly (3): e4fe1d1a SystemTools: Refactor selection of Windows directory APIs af86ac7d SystemTools: Fix build with SunCC/stlport. d30c9b03 Workaround SolarisStudio bug with libstdc++. Change-Id: I0b0fd1c38f0a0fa246e5b862fc62bec6cfbf40c4 diff --git a/SystemTools.cxx b/SystemTools.cxx index e4c82d8..c2b6097 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -16,6 +16,14 @@ # define _XOPEN_SOURCE_EXTENDED #endif +#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__)) +# define KWSYS_WINDOWS_DIRS +#else +# if defined(__SUNPRO_CC) +# include +# endif +#endif + #include "kwsysPrivate.h" #include KWSYS_HEADER(RegularExpression.hxx) #include KWSYS_HEADER(SystemTools.hxx) @@ -205,8 +213,7 @@ static time_t windows_filetime_to_posix_time(const FILETIME& ft) } #endif -#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__)) - +#ifdef KWSYS_WINDOWS_DIRS #include inline int Mkdir(const kwsys_stl::string& dir) diff --git a/Terminal.c b/Terminal.c index e13003f..d13f79a 100644 --- a/Terminal.c +++ b/Terminal.c @@ -175,6 +175,7 @@ static const char* kwsysTerminalVT100Names[] = "xterm-88color", "xterm-color", "xterm-debian", + "xterm-termite", 0 }; diff --git a/kwsysPlatformTestsCXX.cxx b/kwsysPlatformTestsCXX.cxx index 3f947f3..82620da 100644 --- a/kwsysPlatformTestsCXX.cxx +++ b/kwsysPlatformTestsCXX.cxx @@ -548,6 +548,10 @@ int main() #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif +#if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 \ + && __linux && __SUNPRO_CC_COMPAT == 'G' +# include +#endif #include int main() { ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- Source/kwsys/Terminal.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From ben.boeckel at kitware.com Fri Jan 9 10:34:52 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Fri, 9 Jan 2015 10:34:52 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1609-g8b355d6 Message-ID: <20150109153452.5A681A9FC2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8b355d64de0d1d899a0c58a12285b7514f8d8e18 (commit) via 8833206e35bafa04a2264e3e60061651e4b41c2d (commit) via f98c15814512d7e111f8ac738cedd39d1bfbd9e2 (commit) via e0d8912dea950faf8d3ee875896d2ad2197b6e73 (commit) from e51cf4204b190f9e85186b3552634bb7bc22f76d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b355d64de0d1d899a0c58a12285b7514f8d8e18 commit 8b355d64de0d1d899a0c58a12285b7514f8d8e18 Merge: e51cf42 8833206 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:34:50 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 9 10:34:50 2015 -0500 Merge topic 'add-xz-support' into next 8833206e cmake -E tar: error out on multiple compression formats f98c1581 cmSystemTools: use an enumeration for compression formats e0d8912d fixup! cmake -E tar: add support for .xz files with 'J' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8833206e35bafa04a2264e3e60061651e4b41c2d commit 8833206e35bafa04a2264e3e60061651e4b41c2d Author: Ben Boeckel AuthorDate: Fri Jan 9 10:33:36 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 10:33:36 2015 -0500 cmake -E tar: error out on multiple compression formats diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index cf3b2de..1bfbb55 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -735,17 +735,27 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) } cmSystemTools::cmTarCompression compress = cmSystemTools::TarCompressNone; + int nCompress = 0; if ( flags.find_first_of('j') != flags.npos ) { compress = cmSystemTools::TarCompressBZip2; + ++nCompress; } if ( flags.find_first_of('J') != flags.npos ) { compress = cmSystemTools::TarCompressXZ; + ++nCompress; } if ( flags.find_first_of('z') != flags.npos ) { compress = cmSystemTools::TarCompressGZip; + ++nCompress; + } + if ( nCompress > 1 ) + { + cmSystemTools::Error("Can only compress a tar file one way; " + "at most one flag of z, j, or J may be used"); + return 1; } if ( flags.find_first_of('v') != flags.npos ) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f98c15814512d7e111f8ac738cedd39d1bfbd9e2 commit f98c15814512d7e111f8ac738cedd39d1bfbd9e2 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:33:00 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 10:33:00 2015 -0500 cmSystemTools: use an enumeration for compression formats Juggling 3 booleans was unwieldy. diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index f02d78e..e1391a7 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1675,7 +1675,7 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file) files.push_back(file); if(!cmSystemTools::CreateTar(tarFile.c_str(), files, - true, false, false, false)) + cmSystemTools::TarCompressGZip, false)) { cmCTestLog(this, ERROR_MESSAGE, "Error creating tar while " "encoding file: " << file << std::endl); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index cd63347..036e859 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1482,7 +1482,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, - bool gzip, bool bzip2, bool xz, + cmTarCompression compressType, bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) @@ -1497,11 +1497,24 @@ bool cmSystemTools::CreateTar(const char* outFileName, cmSystemTools::Error(e.c_str()); return false; } - cmArchiveWrite a(fout, (gzip? cmArchiveWrite::CompressGZip : - (bzip2? cmArchiveWrite::CompressBZip2 : - (xz? cmArchiveWrite::CompressXZ : - cmArchiveWrite::CompressNone))), - cmArchiveWrite::TypeTAR); + cmArchiveWrite::Compress compress = cmArchiveWrite::CompressNone; + switch (compressType) + { + case TarCompressGZip: + compress = cmArchiveWrite::CompressGZip; + break; + case TarCompressBZip2: + compress = cmArchiveWrite::CompressBZip2; + break; + case TarCompressXZ: + compress = cmArchiveWrite::CompressXZ; + break; + case TarCompressNone: + compress = cmArchiveWrite::CompressNone; + break; + } + cmArchiveWrite a(fout, compress, + cmArchiveWrite::TypeTAR); a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); i != files.end(); ++i) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 47d2771..ad269b1 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -383,11 +383,18 @@ public: static void EnableVSConsoleOutput(); /** Create tar */ + enum cmTarCompression + { + TarCompressGZip, + TarCompressBZip2, + TarCompressXZ, + TarCompressNone + }; static bool ListTar(const char* outFileName, bool gzip, bool verbose); static bool CreateTar(const char* outFileName, - const std::vector& files, bool gzip, - bool bzip2, bool xz, bool verbose); + const std::vector& files, + cmTarCompression compressType, bool verbose); static bool ExtractTar(const char* inFileName, bool gzip, bool verbose); // This should be called first thing in main diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 6b3efb5..cf3b2de 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -733,21 +733,19 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) { files.push_back(args[cc]); } - bool gzip = false; - bool bzip2 = false; - bool xz = false; - bool verbose = false; + cmSystemTools::cmTarCompression compress = + cmSystemTools::TarCompressNone; if ( flags.find_first_of('j') != flags.npos ) { - bzip2 = true; + compress = cmSystemTools::TarCompressBZip2; } if ( flags.find_first_of('J') != flags.npos ) { - xz = true; + compress = cmSystemTools::TarCompressXZ; } if ( flags.find_first_of('z') != flags.npos ) { - gzip = true; + compress = cmSystemTools::TarCompressGZip; } if ( flags.find_first_of('v') != flags.npos ) { @@ -765,7 +763,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) else if ( flags.find_first_of('c') != flags.npos ) { if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, gzip, bzip2, xz, verbose) ) + outFile.c_str(), files, compress, verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0d8912dea950faf8d3ee875896d2ad2197b6e73 commit e0d8912dea950faf8d3ee875896d2ad2197b6e73 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:24:45 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 10:24:45 2015 -0500 fixup! cmake -E tar: add support for .xz files with 'J' diff --git a/Help/release/dev/add-xz-support.rst b/Help/release/dev/add-xz-support.rst index 0dcea9c..9bdf528 100644 --- a/Help/release/dev/add-xz-support.rst +++ b/Help/release/dev/add-xz-support.rst @@ -1,5 +1,5 @@ add-xz-support -------------- -The :manual:`cmake(1)` ``-E tar`` command now supports creating -``.xz``-compressed archives with the ``J`` flag. +* The :manual:`cmake(1)` ``-E tar`` command now supports creating + ``.xz``-compressed archives with the ``J`` flag. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/add-xz-support.rst | 4 ++-- Source/cmCTest.cxx | 2 +- Source/cmSystemTools.cxx | 25 +++++++++++++++++++------ Source/cmSystemTools.h | 11 +++++++++-- Source/cmcmd.cxx | 24 ++++++++++++++++-------- 5 files changed, 47 insertions(+), 19 deletions(-) hooks/post-receive -- CMake From ben.boeckel at kitware.com Fri Jan 9 10:43:10 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Fri, 9 Jan 2015 10:43:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1612-g3a7edea Message-ID: <20150109154310.34B4BA81A1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3a7edeacb08fdb8f2ab82842b7de528e7f637d36 (commit) via 2319702021e7a5f34bdf2a5267d13c779ee75762 (commit) via 3777c2c7db091f6cfcaf0b6f2a2c212a4a2a4e36 (commit) from 8b355d64de0d1d899a0c58a12285b7514f8d8e18 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a7edeacb08fdb8f2ab82842b7de528e7f637d36 commit 3a7edeacb08fdb8f2ab82842b7de528e7f637d36 Merge: 8b355d6 2319702 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:43:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 9 10:43:09 2015 -0500 Merge topic 'fix-empty-target-property-queries' into next 23197020 fixup! tests: add tests for querying properties 3777c2c7 fixup! tests: add tests for querying properties http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2319702021e7a5f34bdf2a5267d13c779ee75762 commit 2319702021e7a5f34bdf2a5267d13c779ee75762 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:42:50 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 10:42:53 2015 -0500 fixup! tests: add tests for querying properties Adds testing of get_cmake_property. diff --git a/Tests/RunCMake/get_property/global_properties-stderr.txt b/Tests/RunCMake/get_property/global_properties-stderr.txt index b1a2987..4c08ad7 100644 --- a/Tests/RunCMake/get_property/global_properties-stderr.txt +++ b/Tests/RunCMake/get_property/global_properties-stderr.txt @@ -1,3 +1,6 @@ -^get_property: --><-- +^get_cmake_property: --><-- +get_property: --><-- +get_cmake_property: -->value<-- get_property: -->value<-- +get_cmake_property: -->NOTFOUND<-- get_property: --><--$ diff --git a/Tests/RunCMake/get_property/global_properties.cmake b/Tests/RunCMake/get_property/global_properties.cmake index 5656a45..2073136 100644 --- a/Tests/RunCMake/get_property/global_properties.cmake +++ b/Tests/RunCMake/get_property/global_properties.cmake @@ -1,8 +1,10 @@ function (check_global_property prop) + get_cmake_property(gcp_val "${prop}") get_property(gp_val GLOBAL PROPERTY "${prop}") + message("get_cmake_property: -->${gcp_val}<--") message("get_property: -->${gp_val}<--") endfunction () http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3777c2c7db091f6cfcaf0b6f2a2c212a4a2a4e36 commit 3777c2c7db091f6cfcaf0b6f2a2c212a4a2a4e36 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:42:27 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 10:42:31 2015 -0500 fixup! tests: add tests for querying properties Enables and fixes the cache property test. diff --git a/Tests/RunCMake/get_property/RunCMakeTest.cmake b/Tests/RunCMake/get_property/RunCMakeTest.cmake index e5700a2..1964824 100644 --- a/Tests/RunCMake/get_property/RunCMakeTest.cmake +++ b/Tests/RunCMake/get_property/RunCMakeTest.cmake @@ -1,6 +1,6 @@ include(RunCMake) -#run_cmake(cache_properties) +run_cmake(cache_properties) run_cmake(directory_properties) run_cmake(global_properties) run_cmake(install_properties) diff --git a/Tests/RunCMake/get_property/cache_properties-stderr.txt b/Tests/RunCMake/get_property/cache_properties-stderr.txt index b1a2987..ee019c6 100644 --- a/Tests/RunCMake/get_property/cache_properties-stderr.txt +++ b/Tests/RunCMake/get_property/cache_properties-stderr.txt @@ -1,3 +1,3 @@ ^get_property: --><-- -get_property: -->value<-- +get_property: -->TRUE<-- get_property: --><--$ diff --git a/Tests/RunCMake/get_property/cache_properties.cmake b/Tests/RunCMake/get_property/cache_properties.cmake index e41adfd..bf3e7ab 100644 --- a/Tests/RunCMake/get_property/cache_properties.cmake +++ b/Tests/RunCMake/get_property/cache_properties.cmake @@ -7,8 +7,9 @@ function (check_cache_property var prop) endfunction () set(var val CACHE STRING "doc") -set_property(CACHE var PROPERTY empty "" custom value) +set_property(CACHE var PROPERTY VALUE "") # empty +set_property(CACHE var PROPERTY ADVANCED TRUE) -check_cache_property(var empty) -check_cache_property(var custom) +check_cache_property(var VALUE) +check_cache_property(var ADVANCED) check_cache_property(var noexist) ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/get_property/RunCMakeTest.cmake | 2 +- Tests/RunCMake/get_property/cache_properties-stderr.txt | 2 +- Tests/RunCMake/get_property/cache_properties.cmake | 7 ++++--- Tests/RunCMake/get_property/global_properties-stderr.txt | 5 ++++- Tests/RunCMake/get_property/global_properties.cmake | 2 ++ 5 files changed, 12 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From ben.boeckel at kitware.com Fri Jan 9 10:43:56 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Fri, 9 Jan 2015 10:43:56 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1614-g2cfa421 Message-ID: <20150109154356.682EBA836F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2cfa421ac245f83e98783ecb677bbe69def1e1e0 (commit) via 55be5992cf539fd56bf86a0c588d7e98d6be5ac3 (commit) from 3a7edeacb08fdb8f2ab82842b7de528e7f637d36 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2cfa421ac245f83e98783ecb677bbe69def1e1e0 commit 2cfa421ac245f83e98783ecb677bbe69def1e1e0 Merge: 3a7edea 55be599 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:43:55 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 9 10:43:55 2015 -0500 Merge topic 'fix-empty-target-property-queries' into next 55be5992 tests: add tests for querying properties http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=55be5992cf539fd56bf86a0c588d7e98d6be5ac3 commit 55be5992cf539fd56bf86a0c588d7e98d6be5ac3 Author: Ben Boeckel AuthorDate: Thu Jan 8 15:27:46 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 10:43:42 2015 -0500 tests: add tests for querying properties diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index b5e41d9..05c51cc 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -173,3 +173,4 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) +add_RunCMake_test(get_property) diff --git a/Tests/RunCMake/get_property/CMakeLists.txt b/Tests/RunCMake/get_property/CMakeLists.txt new file mode 100644 index 0000000..12cd3c7 --- /dev/null +++ b/Tests/RunCMake/get_property/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/get_property/RunCMakeTest.cmake b/Tests/RunCMake/get_property/RunCMakeTest.cmake new file mode 100644 index 0000000..1964824 --- /dev/null +++ b/Tests/RunCMake/get_property/RunCMakeTest.cmake @@ -0,0 +1,9 @@ +include(RunCMake) + +run_cmake(cache_properties) +run_cmake(directory_properties) +run_cmake(global_properties) +run_cmake(install_properties) +run_cmake(source_properties) +run_cmake(target_properties) +run_cmake(test_properties) diff --git a/Tests/RunCMake/get_property/cache_properties-stderr.txt b/Tests/RunCMake/get_property/cache_properties-stderr.txt new file mode 100644 index 0000000..ee019c6 --- /dev/null +++ b/Tests/RunCMake/get_property/cache_properties-stderr.txt @@ -0,0 +1,3 @@ +^get_property: --><-- +get_property: -->TRUE<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/cache_properties.cmake b/Tests/RunCMake/get_property/cache_properties.cmake new file mode 100644 index 0000000..bf3e7ab --- /dev/null +++ b/Tests/RunCMake/get_property/cache_properties.cmake @@ -0,0 +1,15 @@ +function (check_cache_property var prop) + get_property(gp_val + CACHE "${var}" + PROPERTY "${prop}") + + message("get_property: -->${gp_val}<--") +endfunction () + +set(var val CACHE STRING "doc") +set_property(CACHE var PROPERTY VALUE "") # empty +set_property(CACHE var PROPERTY ADVANCED TRUE) + +check_cache_property(var VALUE) +check_cache_property(var ADVANCED) +check_cache_property(var noexist) diff --git a/Tests/RunCMake/get_property/directory_properties-stderr.txt b/Tests/RunCMake/get_property/directory_properties-stderr.txt new file mode 100644 index 0000000..80c9877 --- /dev/null +++ b/Tests/RunCMake/get_property/directory_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_directory_property: --><-- +get_property: --><-- +get_directory_property: -->value<-- +get_property: -->value<-- +get_directory_property: --><-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/directory_properties.cmake b/Tests/RunCMake/get_property/directory_properties.cmake new file mode 100644 index 0000000..b0a9b1b --- /dev/null +++ b/Tests/RunCMake/get_property/directory_properties.cmake @@ -0,0 +1,15 @@ +function (check_directory_property dir prop) + get_directory_property(gdp_val DIRECTORY "${dir}" "${prop}") + get_property(gp_val + DIRECTORY "${dir}" + PROPERTY "${prop}") + + message("get_directory_property: -->${gdp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +set_directory_properties(PROPERTIES empty "" custom value) + +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" empty) +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" custom) +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" noexist) diff --git a/Tests/RunCMake/get_property/global_properties-stderr.txt b/Tests/RunCMake/get_property/global_properties-stderr.txt new file mode 100644 index 0000000..4c08ad7 --- /dev/null +++ b/Tests/RunCMake/get_property/global_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_cmake_property: --><-- +get_property: --><-- +get_cmake_property: -->value<-- +get_property: -->value<-- +get_cmake_property: -->NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/global_properties.cmake b/Tests/RunCMake/get_property/global_properties.cmake new file mode 100644 index 0000000..2073136 --- /dev/null +++ b/Tests/RunCMake/get_property/global_properties.cmake @@ -0,0 +1,16 @@ +function (check_global_property prop) + get_cmake_property(gcp_val "${prop}") + get_property(gp_val + GLOBAL + PROPERTY "${prop}") + + message("get_cmake_property: -->${gcp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +set_property(GLOBAL PROPERTY empty "") +set_property(GLOBAL PROPERTY custom value) + +check_global_property(empty) +check_global_property(custom) +check_global_property(noexist) diff --git a/Tests/RunCMake/get_property/install_properties-stderr.txt b/Tests/RunCMake/get_property/install_properties-stderr.txt new file mode 100644 index 0000000..b1a2987 --- /dev/null +++ b/Tests/RunCMake/get_property/install_properties-stderr.txt @@ -0,0 +1,3 @@ +^get_property: --><-- +get_property: -->value<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/install_properties.cmake b/Tests/RunCMake/get_property/install_properties.cmake new file mode 100644 index 0000000..aa89225 --- /dev/null +++ b/Tests/RunCMake/get_property/install_properties.cmake @@ -0,0 +1,18 @@ +function (check_install_property file prop) + get_property(gp_val + INSTALL "${file}" + PROPERTY "${prop}") + + message("get_property: -->${gp_val}<--") +endfunction () + +install( + FILES "${CMAKE_CURRENT_LIST_FILE}" + DESTINATION "${CMAKE_CURRENT_LIST_DIR}" + RENAME "installed-file-dest") +set_property(INSTALL "${CMAKE_CURRENT_LIST_FILE}" PROPERTY empty "") +set_property(INSTALL "${CMAKE_CURRENT_LIST_FILE}" PROPERTY custom value) + +check_install_property("${CMAKE_CURRENT_LIST_FILE}" empty) +check_install_property("${CMAKE_CURRENT_LIST_FILE}" custom) +check_install_property("${CMAKE_CURRENT_LIST_FILE}" noexist) diff --git a/Tests/RunCMake/get_property/source_properties-stderr.txt b/Tests/RunCMake/get_property/source_properties-stderr.txt new file mode 100644 index 0000000..0a46f96 --- /dev/null +++ b/Tests/RunCMake/get_property/source_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_source_file_property: --><-- +get_property: --><-- +get_source_file_property: -->value<-- +get_property: -->value<-- +get_source_file_property: -->NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/source_properties.cmake b/Tests/RunCMake/get_property/source_properties.cmake new file mode 100644 index 0000000..263ffe1 --- /dev/null +++ b/Tests/RunCMake/get_property/source_properties.cmake @@ -0,0 +1,15 @@ +function (check_source_file_property file prop) + get_source_file_property(gsfp_val "${file}" "${prop}") + get_property(gp_val + SOURCE "${file}" + PROPERTY "${prop}") + + message("get_source_file_property: -->${gsfp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +set_source_files_properties(file.c PROPERTIES empty "" custom value) + +check_source_file_property(file.c empty) +check_source_file_property(file.c custom) +check_source_file_property(file.c noexist) diff --git a/Tests/RunCMake/get_property/target_properties-stderr.txt b/Tests/RunCMake/get_property/target_properties-stderr.txt new file mode 100644 index 0000000..d0981ac --- /dev/null +++ b/Tests/RunCMake/get_property/target_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_target_property: --><-- +get_property: --><-- +get_target_property: -->value<-- +get_property: -->value<-- +get_target_property: -->gtp_val-NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/target_properties.cmake b/Tests/RunCMake/get_property/target_properties.cmake new file mode 100644 index 0000000..c5a141d --- /dev/null +++ b/Tests/RunCMake/get_property/target_properties.cmake @@ -0,0 +1,16 @@ +function (check_target_property target prop) + get_target_property(gtp_val "${target}" "${prop}") + get_property(gp_val + TARGET "${target}" + PROPERTY "${prop}") + + message("get_target_property: -->${gtp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +add_custom_target(tgt) +set_target_properties(tgt PROPERTIES empty "" custom value) + +check_target_property(tgt empty) +check_target_property(tgt custom) +check_target_property(tgt noexist) diff --git a/Tests/RunCMake/get_property/test_properties-stderr.txt b/Tests/RunCMake/get_property/test_properties-stderr.txt new file mode 100644 index 0000000..a447280 --- /dev/null +++ b/Tests/RunCMake/get_property/test_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_test_property: --><-- +get_property: --><-- +get_test_property: -->value<-- +get_property: -->value<-- +get_test_property: -->NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/test_properties.cmake b/Tests/RunCMake/get_property/test_properties.cmake new file mode 100644 index 0000000..1d0295c --- /dev/null +++ b/Tests/RunCMake/get_property/test_properties.cmake @@ -0,0 +1,17 @@ +function (check_test_property test prop) + get_test_property("${test}" "${prop}" gtp_val) + get_property(gp_val + TEST "${test}" + PROPERTY "${prop}") + + message("get_test_property: -->${gtp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +include(CTest) +add_test(NAME test COMMAND "${CMAKE_COMMAND}" --help) +set_tests_properties(test PROPERTIES empty "" custom value) + +check_test_property(test empty) +check_test_property(test custom) +check_test_property(test noexist) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From ben.boeckel at kitware.com Fri Jan 9 10:44:00 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Fri, 9 Jan 2015 10:44:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1618-g76e41f6 Message-ID: <20150109154402.05B79A8380@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 76e41f6262ebabcc7e60ecd8112e09fa928e07db (commit) via 2072cb81f822d5ffc53f9daba83a03d8c4266207 (commit) via 37c5883963d6fc396a6a71081109ab1b47ead9a4 (commit) via df16dcfb4478bb05932a1abb0e42433e60f1a565 (commit) from 2cfa421ac245f83e98783ecb677bbe69def1e1e0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76e41f6262ebabcc7e60ecd8112e09fa928e07db commit 76e41f6262ebabcc7e60ecd8112e09fa928e07db Merge: 2cfa421 2072cb8 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:43:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 9 10:43:59 2015 -0500 Merge topic 'add-xz-support' into next 2072cb81 cmake -E tar: error out on multiple compression formats 37c58839 cmSystemTools: use an enumeration for compression formats df16dcfb cmake -E tar: add support for .xz files with 'J' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2072cb81f822d5ffc53f9daba83a03d8c4266207 commit 2072cb81f822d5ffc53f9daba83a03d8c4266207 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:33:36 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 10:35:01 2015 -0500 cmake -E tar: error out on multiple compression formats diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index cf3b2de..1bfbb55 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -735,17 +735,27 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) } cmSystemTools::cmTarCompression compress = cmSystemTools::TarCompressNone; + int nCompress = 0; if ( flags.find_first_of('j') != flags.npos ) { compress = cmSystemTools::TarCompressBZip2; + ++nCompress; } if ( flags.find_first_of('J') != flags.npos ) { compress = cmSystemTools::TarCompressXZ; + ++nCompress; } if ( flags.find_first_of('z') != flags.npos ) { compress = cmSystemTools::TarCompressGZip; + ++nCompress; + } + if ( nCompress > 1 ) + { + cmSystemTools::Error("Can only compress a tar file one way; " + "at most one flag of z, j, or J may be used"); + return 1; } if ( flags.find_first_of('v') != flags.npos ) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37c5883963d6fc396a6a71081109ab1b47ead9a4 commit 37c5883963d6fc396a6a71081109ab1b47ead9a4 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:33:00 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 10:35:01 2015 -0500 cmSystemTools: use an enumeration for compression formats Juggling 3 booleans was unwieldy. diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index f02d78e..e1391a7 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1675,7 +1675,7 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file) files.push_back(file); if(!cmSystemTools::CreateTar(tarFile.c_str(), files, - true, false, false, false)) + cmSystemTools::TarCompressGZip, false)) { cmCTestLog(this, ERROR_MESSAGE, "Error creating tar while " "encoding file: " << file << std::endl); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index cd63347..036e859 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1482,7 +1482,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, - bool gzip, bool bzip2, bool xz, + cmTarCompression compressType, bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) @@ -1497,11 +1497,24 @@ bool cmSystemTools::CreateTar(const char* outFileName, cmSystemTools::Error(e.c_str()); return false; } - cmArchiveWrite a(fout, (gzip? cmArchiveWrite::CompressGZip : - (bzip2? cmArchiveWrite::CompressBZip2 : - (xz? cmArchiveWrite::CompressXZ : - cmArchiveWrite::CompressNone))), - cmArchiveWrite::TypeTAR); + cmArchiveWrite::Compress compress = cmArchiveWrite::CompressNone; + switch (compressType) + { + case TarCompressGZip: + compress = cmArchiveWrite::CompressGZip; + break; + case TarCompressBZip2: + compress = cmArchiveWrite::CompressBZip2; + break; + case TarCompressXZ: + compress = cmArchiveWrite::CompressXZ; + break; + case TarCompressNone: + compress = cmArchiveWrite::CompressNone; + break; + } + cmArchiveWrite a(fout, compress, + cmArchiveWrite::TypeTAR); a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); i != files.end(); ++i) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 47d2771..ad269b1 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -383,11 +383,18 @@ public: static void EnableVSConsoleOutput(); /** Create tar */ + enum cmTarCompression + { + TarCompressGZip, + TarCompressBZip2, + TarCompressXZ, + TarCompressNone + }; static bool ListTar(const char* outFileName, bool gzip, bool verbose); static bool CreateTar(const char* outFileName, - const std::vector& files, bool gzip, - bool bzip2, bool xz, bool verbose); + const std::vector& files, + cmTarCompression compressType, bool verbose); static bool ExtractTar(const char* inFileName, bool gzip, bool verbose); // This should be called first thing in main diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 6b3efb5..cf3b2de 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -733,21 +733,19 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) { files.push_back(args[cc]); } - bool gzip = false; - bool bzip2 = false; - bool xz = false; - bool verbose = false; + cmSystemTools::cmTarCompression compress = + cmSystemTools::TarCompressNone; if ( flags.find_first_of('j') != flags.npos ) { - bzip2 = true; + compress = cmSystemTools::TarCompressBZip2; } if ( flags.find_first_of('J') != flags.npos ) { - xz = true; + compress = cmSystemTools::TarCompressXZ; } if ( flags.find_first_of('z') != flags.npos ) { - gzip = true; + compress = cmSystemTools::TarCompressGZip; } if ( flags.find_first_of('v') != flags.npos ) { @@ -765,7 +763,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) else if ( flags.find_first_of('c') != flags.npos ) { if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, gzip, bzip2, xz, verbose) ) + outFile.c_str(), files, compress, verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df16dcfb4478bb05932a1abb0e42433e60f1a565 commit df16dcfb4478bb05932a1abb0e42433e60f1a565 Author: Ben Boeckel AuthorDate: Thu Jan 8 16:56:33 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 10:35:01 2015 -0500 cmake -E tar: add support for .xz files with 'J' diff --git a/Help/release/dev/add-xz-support.rst b/Help/release/dev/add-xz-support.rst new file mode 100644 index 0000000..9bdf528 --- /dev/null +++ b/Help/release/dev/add-xz-support.rst @@ -0,0 +1,5 @@ +add-xz-support +-------------- + +* The :manual:`cmake(1)` ``-E tar`` command now supports creating + ``.xz``-compressed archives with the ``J`` flag. diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 80dbaf3..f02d78e 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1674,7 +1674,8 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file) std::vector files; files.push_back(file); - if(!cmSystemTools::CreateTar(tarFile.c_str(), files, true, false, false)) + if(!cmSystemTools::CreateTar(tarFile.c_str(), files, + true, false, false, false)) { cmCTestLog(this, ERROR_MESSAGE, "Error creating tar while " "encoding file: " << file << std::endl); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1c8c387..cd63347 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1482,7 +1482,8 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, - bool gzip, bool bzip2, bool verbose) + bool gzip, bool bzip2, bool xz, + bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); @@ -1498,7 +1499,8 @@ bool cmSystemTools::CreateTar(const char* outFileName, } cmArchiveWrite a(fout, (gzip? cmArchiveWrite::CompressGZip : (bzip2? cmArchiveWrite::CompressBZip2 : - cmArchiveWrite::CompressNone)), + (xz? cmArchiveWrite::CompressXZ : + cmArchiveWrite::CompressNone))), cmArchiveWrite::TypeTAR); a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index d49af74..47d2771 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -387,7 +387,7 @@ public: bool gzip, bool verbose); static bool CreateTar(const char* outFileName, const std::vector& files, bool gzip, - bool bzip2, bool verbose); + bool bzip2, bool xz, bool verbose); static bool ExtractTar(const char* inFileName, bool gzip, bool verbose); // This should be called first thing in main diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index f2f028a..6b3efb5 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -71,7 +71,7 @@ void CMakeCommandUsage(const char* program) << " remove_directory dir - remove a directory and its contents\n" << " rename oldname newname - rename a file or directory " "(on one volume)\n" - << " tar [cxt][vf][zj] file.tar [file/dir1 file/dir2 ...]\n" + << " tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]\n" << " - create or extract a tar or zip archive\n" << " sleep ... - sleep for given number of seconds\n" << " time command [args] ... - run command and return elapsed time\n" @@ -735,11 +735,16 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) } bool gzip = false; bool bzip2 = false; + bool xz = false; bool verbose = false; if ( flags.find_first_of('j') != flags.npos ) { bzip2 = true; } + if ( flags.find_first_of('J') != flags.npos ) + { + xz = true; + } if ( flags.find_first_of('z') != flags.npos ) { gzip = true; @@ -760,7 +765,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) else if ( flags.find_first_of('c') != flags.npos ) { if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, gzip, bzip2, verbose) ) + outFile.c_str(), files, gzip, bzip2, xz, verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From zack.galbreath at kitware.com Fri Jan 9 11:54:53 2015 From: zack.galbreath at kitware.com (Zack Galbreath) Date: Fri, 9 Jan 2015 11:54:53 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1620-ga9adf6a Message-ID: <20150109165453.9367FA8F80@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a9adf6ad4b1300a805dca29fe8e09d4db3c9fd73 (commit) via 96e332c4324bd7a129ce762062dcb468762e385d (commit) from 76e41f6262ebabcc7e60ecd8112e09fa928e07db (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a9adf6ad4b1300a805dca29fe8e09d4db3c9fd73 commit a9adf6ad4b1300a805dca29fe8e09d4db3c9fd73 Merge: 76e41f6 96e332c Author: Zack Galbreath AuthorDate: Fri Jan 9 11:54:51 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 9 11:54:51 2015 -0500 Merge topic 'improve_cobertura' into next 96e332c4 Fix parsing of absolute paths http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96e332c4324bd7a129ce762062dcb468762e385d commit 96e332c4324bd7a129ce762062dcb468762e385d Author: Zack Galbreath AuthorDate: Fri Dec 19 10:12:25 2014 -0500 Commit: Zack Galbreath CommitDate: Fri Jan 9 11:31:28 2015 -0500 Fix parsing of absolute paths This commit fixes a segmentation fault I encountered when my Coverage.xml referenced a system file, eg /usr/lib/python/foo.py. Similar to other CMake coverage parsers, this one now ignores any files it finds that are not located within this project's source or binary directories. diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx index 0742be1..e19b199 100644 --- a/Source/CTest/cmParseCoberturaCoverage.cxx +++ b/Source/CTest/cmParseCoberturaCoverage.cxx @@ -12,9 +12,11 @@ public: XMLParser(cmCTest* ctest, cmCTestCoverageHandlerContainer& cont) : CTest(ctest), Coverage(cont) { - this->InSources = false; - this->InSource = false; + this->InSources = false; + this->InSource = false; + this->SkipThisClass = false; this->FilePaths.push_back(this->Coverage.SourceDir); + this->FilePaths.push_back(this->Coverage.BinaryDir); this->CurFileName = ""; } @@ -35,6 +37,10 @@ protected: { this->InSources=false; } + else if(name == "class") + { + this->SkipThisClass = false; + } } virtual void CharacterDataHandler(const char* data, int length) @@ -72,15 +78,33 @@ protected: << atts[tagCount+1]<< std::endl); std::string filename = atts[tagCount+1]; this->CurFileName = ""; + + // Check if this is an absolute path that falls within our + // source or binary directories. for(size_t i=0;i < FilePaths.size();i++) { - finalpath = FilePaths[i] + "/" + filename; - if(cmSystemTools::FileExists(finalpath.c_str())) + if (filename.find(FilePaths[i]) == 0) { - this->CurFileName = finalpath; + this->CurFileName = filename; break; } } + + if (this->CurFileName == "") + { + // Check if this is a path that is relative to our source or + // binary directories. + for(size_t i=0;i < FilePaths.size();i++) + { + finalpath = FilePaths[i] + "/" + filename; + if(cmSystemTools::FileExists(finalpath.c_str())) + { + this->CurFileName = finalpath; + break; + } + } + } + cmsys::ifstream fin(this->CurFileName.c_str()); if(this->CurFileName == "" || !fin ) { @@ -89,10 +113,11 @@ protected: fin.open(this->CurFileName.c_str()); if (!fin) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - "Python Coverage: Error opening " << this->CurFileName - << std::endl); - this->Coverage.Error++; + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Skipping system file " << filename << + std::endl); + + this->SkipThisClass = true; break; } } @@ -117,6 +142,10 @@ protected: int curHits = -1; while(true) { + if(this->SkipThisClass) + { + break; + } if(strcmp(atts[tagCount], "hits") == 0) { curHits = atoi(atts[tagCount+1]); @@ -144,6 +173,7 @@ private: bool InSources; bool InSource; + bool SkipThisClass; std::vector FilePaths; typedef cmCTestCoverageHandlerContainer::SingleFileCoverageVector FileLinesType; ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmParseCoberturaCoverage.cxx | 48 +++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 9 deletions(-) hooks/post-receive -- CMake From ben.boeckel at kitware.com Fri Jan 9 12:05:27 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Fri, 9 Jan 2015 12:05:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1623-g5f33228 Message-ID: <20150109170527.290C2A9E65@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5f3322884cc5903d3198f760191e2990c361330d (commit) via f6de0b5eb61b389758505ccdeb2005b35cfc0a7e (commit) via 0d3deaa1147303b30fc4e5339ecab36f2df62264 (commit) from a9adf6ad4b1300a805dca29fe8e09d4db3c9fd73 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f3322884cc5903d3198f760191e2990c361330d commit 5f3322884cc5903d3198f760191e2990c361330d Merge: a9adf6a f6de0b5 Author: Ben Boeckel AuthorDate: Fri Jan 9 12:05:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 9 12:05:26 2015 -0500 Merge topic 'add-xz-support' into next f6de0b5e fixup! cmSystemTools: use an enumeration for compression formats 0d3deaa1 cmSystemTools: remove unused gzip argument diff --cc Source/cmcmd.cxx index a3f0099,27dd08b..70d98d2 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@@ -764,9 -765,9 +765,9 @@@ int cmcmd::ExecuteCMakeCommand(std::vec if ( flags.find_first_of('t') != flags.npos ) { - if ( !cmSystemTools::ListTar(outFile.c_str(), gzip, verbose) ) + if ( !cmSystemTools::ListTar(outFile.c_str(), verbose) ) { - cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); + cmSystemTools::Error("Problem listing tar: ", outFile.c_str()); return 1; } } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f6de0b5eb61b389758505ccdeb2005b35cfc0a7e commit f6de0b5eb61b389758505ccdeb2005b35cfc0a7e Author: Ben Boeckel AuthorDate: Fri Jan 9 12:05:19 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 12:05:19 2015 -0500 fixup! cmSystemTools: use an enumeration for compression formats diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 5fc4823..27dd08b 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -735,6 +735,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) } cmSystemTools::cmTarCompression compress = cmSystemTools::TarCompressNone; + bool verbose = false; int nCompress = 0; if ( flags.find_first_of('j') != flags.npos ) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d3deaa1147303b30fc4e5339ecab36f2df62264 commit 0d3deaa1147303b30fc4e5339ecab36f2df62264 Author: Ben Boeckel AuthorDate: Fri Jan 9 12:04:56 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 12:04:56 2015 -0500 cmSystemTools: remove unused gzip argument diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 036e859..0271665 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1800,7 +1800,7 @@ bool extract_tar(const char* outFileName, bool verbose, #endif bool cmSystemTools::ExtractTar(const char* outFileName, - bool , bool verbose) + bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) return extract_tar(outFileName, verbose, true); @@ -1812,7 +1812,6 @@ bool cmSystemTools::ExtractTar(const char* outFileName, } bool cmSystemTools::ListTar(const char* outFileName, - bool , bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index ad269b1..09ceea6 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -391,11 +391,11 @@ public: TarCompressNone }; static bool ListTar(const char* outFileName, - bool gzip, bool verbose); + bool verbose); static bool CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, bool verbose); - static bool ExtractTar(const char* inFileName, bool gzip, + static bool ExtractTar(const char* inFileName, bool verbose); // This should be called first thing in main // it will keep child processes from inheriting the diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 1bfbb55..5fc4823 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -764,7 +764,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) if ( flags.find_first_of('t') != flags.npos ) { - if ( !cmSystemTools::ListTar(outFile.c_str(), gzip, verbose) ) + if ( !cmSystemTools::ListTar(outFile.c_str(), verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; @@ -782,7 +782,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) else if ( flags.find_first_of('x') != flags.npos ) { if ( !cmSystemTools::ExtractTar( - outFile.c_str(), gzip, verbose) ) + outFile.c_str(), verbose) ) { cmSystemTools::Error("Problem extracting tar: ", outFile.c_str()); return 1; ----------------------------------------------------------------------- Summary of changes: Source/cmSystemTools.cxx | 3 +-- Source/cmSystemTools.h | 4 ++-- Source/cmcmd.cxx | 5 +++-- 3 files changed, 6 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From ben.boeckel at kitware.com Fri Jan 9 12:06:00 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Fri, 9 Jan 2015 12:06:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1627-gb5061d4 Message-ID: <20150109170600.754FDA9EB5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b5061d40e11d93a449736ffa0b363a36bea97898 (commit) via 7cd1b9bf75fcac42b937e5aae4d3f5a6a61fcb4e (commit) via 312ac7257eacbe909f0544a8e9bce3f11f404a26 (commit) via 54df2294ed54b2b6746d94534ff6584371e9d082 (commit) from 5f3322884cc5903d3198f760191e2990c361330d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b5061d40e11d93a449736ffa0b363a36bea97898 commit b5061d40e11d93a449736ffa0b363a36bea97898 Merge: 5f33228 7cd1b9b Author: Ben Boeckel AuthorDate: Fri Jan 9 12:05:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 9 12:05:59 2015 -0500 Merge topic 'add-xz-support' into next 7cd1b9bf cmSystemTools: remove unused gzip argument 312ac725 cmake -E tar: error out on multiple compression formats 54df2294 cmSystemTools: use an enumeration for compression formats http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7cd1b9bf75fcac42b937e5aae4d3f5a6a61fcb4e commit 7cd1b9bf75fcac42b937e5aae4d3f5a6a61fcb4e Author: Ben Boeckel AuthorDate: Fri Jan 9 12:04:56 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 12:05:48 2015 -0500 cmSystemTools: remove unused gzip argument diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 036e859..0271665 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1800,7 +1800,7 @@ bool extract_tar(const char* outFileName, bool verbose, #endif bool cmSystemTools::ExtractTar(const char* outFileName, - bool , bool verbose) + bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) return extract_tar(outFileName, verbose, true); @@ -1812,7 +1812,6 @@ bool cmSystemTools::ExtractTar(const char* outFileName, } bool cmSystemTools::ListTar(const char* outFileName, - bool , bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index ad269b1..09ceea6 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -391,11 +391,11 @@ public: TarCompressNone }; static bool ListTar(const char* outFileName, - bool gzip, bool verbose); + bool verbose); static bool CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, bool verbose); - static bool ExtractTar(const char* inFileName, bool gzip, + static bool ExtractTar(const char* inFileName, bool verbose); // This should be called first thing in main // it will keep child processes from inheriting the diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index b30c8a6..27dd08b 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -765,7 +765,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) if ( flags.find_first_of('t') != flags.npos ) { - if ( !cmSystemTools::ListTar(outFile.c_str(), gzip, verbose) ) + if ( !cmSystemTools::ListTar(outFile.c_str(), verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; @@ -783,7 +783,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) else if ( flags.find_first_of('x') != flags.npos ) { if ( !cmSystemTools::ExtractTar( - outFile.c_str(), gzip, verbose) ) + outFile.c_str(), verbose) ) { cmSystemTools::Error("Problem extracting tar: ", outFile.c_str()); return 1; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=312ac7257eacbe909f0544a8e9bce3f11f404a26 commit 312ac7257eacbe909f0544a8e9bce3f11f404a26 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:33:36 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 12:05:47 2015 -0500 cmake -E tar: error out on multiple compression formats diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index f7bb20e..b30c8a6 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -736,17 +736,27 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) cmSystemTools::cmTarCompression compress = cmSystemTools::TarCompressNone; bool verbose = false; + int nCompress = 0; if ( flags.find_first_of('j') != flags.npos ) { compress = cmSystemTools::TarCompressBZip2; + ++nCompress; } if ( flags.find_first_of('J') != flags.npos ) { compress = cmSystemTools::TarCompressXZ; + ++nCompress; } if ( flags.find_first_of('z') != flags.npos ) { compress = cmSystemTools::TarCompressGZip; + ++nCompress; + } + if ( nCompress > 1 ) + { + cmSystemTools::Error("Can only compress a tar file one way; " + "at most one flag of z, j, or J may be used"); + return 1; } if ( flags.find_first_of('v') != flags.npos ) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54df2294ed54b2b6746d94534ff6584371e9d082 commit 54df2294ed54b2b6746d94534ff6584371e9d082 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:33:00 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 9 12:05:39 2015 -0500 cmSystemTools: use an enumeration for compression formats Juggling 3 booleans was unwieldy. diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index f02d78e..e1391a7 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1675,7 +1675,7 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file) files.push_back(file); if(!cmSystemTools::CreateTar(tarFile.c_str(), files, - true, false, false, false)) + cmSystemTools::TarCompressGZip, false)) { cmCTestLog(this, ERROR_MESSAGE, "Error creating tar while " "encoding file: " << file << std::endl); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index cd63347..036e859 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1482,7 +1482,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, - bool gzip, bool bzip2, bool xz, + cmTarCompression compressType, bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) @@ -1497,11 +1497,24 @@ bool cmSystemTools::CreateTar(const char* outFileName, cmSystemTools::Error(e.c_str()); return false; } - cmArchiveWrite a(fout, (gzip? cmArchiveWrite::CompressGZip : - (bzip2? cmArchiveWrite::CompressBZip2 : - (xz? cmArchiveWrite::CompressXZ : - cmArchiveWrite::CompressNone))), - cmArchiveWrite::TypeTAR); + cmArchiveWrite::Compress compress = cmArchiveWrite::CompressNone; + switch (compressType) + { + case TarCompressGZip: + compress = cmArchiveWrite::CompressGZip; + break; + case TarCompressBZip2: + compress = cmArchiveWrite::CompressBZip2; + break; + case TarCompressXZ: + compress = cmArchiveWrite::CompressXZ; + break; + case TarCompressNone: + compress = cmArchiveWrite::CompressNone; + break; + } + cmArchiveWrite a(fout, compress, + cmArchiveWrite::TypeTAR); a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); i != files.end(); ++i) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 47d2771..ad269b1 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -383,11 +383,18 @@ public: static void EnableVSConsoleOutput(); /** Create tar */ + enum cmTarCompression + { + TarCompressGZip, + TarCompressBZip2, + TarCompressXZ, + TarCompressNone + }; static bool ListTar(const char* outFileName, bool gzip, bool verbose); static bool CreateTar(const char* outFileName, - const std::vector& files, bool gzip, - bool bzip2, bool xz, bool verbose); + const std::vector& files, + cmTarCompression compressType, bool verbose); static bool ExtractTar(const char* inFileName, bool gzip, bool verbose); // This should be called first thing in main diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 6b3efb5..f7bb20e 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -733,21 +733,20 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) { files.push_back(args[cc]); } - bool gzip = false; - bool bzip2 = false; - bool xz = false; + cmSystemTools::cmTarCompression compress = + cmSystemTools::TarCompressNone; bool verbose = false; if ( flags.find_first_of('j') != flags.npos ) { - bzip2 = true; + compress = cmSystemTools::TarCompressBZip2; } if ( flags.find_first_of('J') != flags.npos ) { - xz = true; + compress = cmSystemTools::TarCompressXZ; } if ( flags.find_first_of('z') != flags.npos ) { - gzip = true; + compress = cmSystemTools::TarCompressGZip; } if ( flags.find_first_of('v') != flags.npos ) { @@ -765,7 +764,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) else if ( flags.find_first_of('c') != flags.npos ) { if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, gzip, bzip2, xz, verbose) ) + outFile.c_str(), files, compress, verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jan 10 00:01:19 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 10 Jan 2015 00:01:19 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-632-gccd0046 Message-ID: <20150110050119.E3A09A8EFD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via ccd004666750248ba0fc5193ebefd45f93c12693 (commit) from 4aa9c64511adb6e3aa1b686d07f8cbdf92dedbab (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ccd004666750248ba0fc5193ebefd45f93c12693 commit ccd004666750248ba0fc5193ebefd45f93c12693 Author: Kitware Robot AuthorDate: Sat Jan 10 00:01:15 2015 -0500 Commit: Kitware Robot CommitDate: Sat Jan 10 00:01:15 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 8024a7d..bfd2569 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 20150109) +set(CMake_VERSION_PATCH 20150110) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Sat Jan 10 12:05:09 2015 From: brad.king at kitware.com (Brad King) Date: Sat, 10 Jan 2015 12:05:09 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1629-g761bc9f Message-ID: <20150110170509.BAAA0A9F4E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 761bc9f27850eb9425d8d222a3312007cdc24908 (commit) via 4729547a5b2596d6997e9b9131751995dbc4695d (commit) from b5061d40e11d93a449736ffa0b363a36bea97898 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=761bc9f27850eb9425d8d222a3312007cdc24908 commit 761bc9f27850eb9425d8d222a3312007cdc24908 Merge: b5061d4 4729547 Author: Brad King AuthorDate: Sat Jan 10 12:05:08 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 10 12:05:08 2015 -0500 Merge topic 'linux-XL-fortran' into next 4729547a XL: Fix link flags for executables on Linux with XL compilers http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4729547a5b2596d6997e9b9131751995dbc4695d commit 4729547a5b2596d6997e9b9131751995dbc4695d Author: Brad King AuthorDate: Sat Jan 10 12:00:56 2015 -0500 Commit: Brad King CommitDate: Sat Jan 10 12:03:19 2015 -0500 XL: Fix link flags for executables on Linux with XL compilers Use "-Wl,-export-dynamic" with XL to match the "-rdynamic" flag used with GNU-like compilers. diff --git a/Modules/Platform/Linux-XL-C.cmake b/Modules/Platform/Linux-XL-C.cmake index f1c584c..d595e44 100644 --- a/Modules/Platform/Linux-XL-C.cmake +++ b/Modules/Platform/Linux-XL-C.cmake @@ -1 +1,2 @@ set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj") +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-export-dynamic") diff --git a/Modules/Platform/Linux-XL-CXX.cmake b/Modules/Platform/Linux-XL-CXX.cmake index abd3fa4..5ceb255 100644 --- a/Modules/Platform/Linux-XL-CXX.cmake +++ b/Modules/Platform/Linux-XL-CXX.cmake @@ -1 +1,2 @@ set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj") +set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-export-dynamic") diff --git a/Modules/Platform/Linux-XL-Fortran.cmake b/Modules/Platform/Linux-XL-Fortran.cmake index cdd1f70..a878991 100644 --- a/Modules/Platform/Linux-XL-Fortran.cmake +++ b/Modules/Platform/Linux-XL-Fortran.cmake @@ -1 +1,2 @@ set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-qmkshrobj") +set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-export-dynamic") ----------------------------------------------------------------------- Summary of changes: Modules/Platform/Linux-XL-C.cmake | 1 + Modules/Platform/Linux-XL-CXX.cmake | 1 + Modules/Platform/Linux-XL-Fortran.cmake | 1 + 3 files changed, 3 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Sat Jan 10 12:07:17 2015 From: brad.king at kitware.com (Brad King) Date: Sat, 10 Jan 2015 12:07:17 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1631-g8504583 Message-ID: <20150110170717.20E2FA9F84@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 85045836c29eaa58efdb4c01aeb62d3b44290cac (commit) via d11a8f8c13225e05ec0bcbca4f174f795fe35a44 (commit) from 761bc9f27850eb9425d8d222a3312007cdc24908 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85045836c29eaa58efdb4c01aeb62d3b44290cac commit 85045836c29eaa58efdb4c01aeb62d3b44290cac Merge: 761bc9f d11a8f8 Author: Brad King AuthorDate: Sat Jan 10 12:07:16 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 10 12:07:16 2015 -0500 Merge topic 'add-xz-support' into next d11a8f8c cmSystsemTools: Remove unused gzip arg during bootstrap http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d11a8f8c13225e05ec0bcbca4f174f795fe35a44 commit d11a8f8c13225e05ec0bcbca4f174f795fe35a44 Author: Brad King AuthorDate: Sat Jan 10 12:07:05 2015 -0500 Commit: Brad King CommitDate: Sat Jan 10 12:07:05 2015 -0500 cmSystsemTools: Remove unused gzip arg during bootstrap diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 0271665..963ca77 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1539,7 +1539,6 @@ bool cmSystemTools::CreateTar(const char* outFileName, #else (void)outFileName; (void)files; - (void)gzip; (void)verbose; return false; #endif ----------------------------------------------------------------------- Summary of changes: Source/cmSystemTools.cxx | 1 - 1 file changed, 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Sat Jan 10 12:08:19 2015 From: brad.king at kitware.com (Brad King) Date: Sat, 10 Jan 2015 12:08:19 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1634-gd388bda Message-ID: <20150110170819.EC386A9FE7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d388bda78fb01e6a8cebad0464cd7b9eefd91eef (commit) via 97f178f061a21fdc060d85982c68b8be5a088858 (commit) via 56616160de37c1a2cc5fbcf4c9714db3ca1e5422 (commit) from 85045836c29eaa58efdb4c01aeb62d3b44290cac (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d388bda78fb01e6a8cebad0464cd7b9eefd91eef commit d388bda78fb01e6a8cebad0464cd7b9eefd91eef Merge: 8504583 97f178f Author: Brad King AuthorDate: Sat Jan 10 12:08:19 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 10 12:08:19 2015 -0500 Merge topic 'update-kwsys' into next 97f178f0 Merge branch 'upstream-kwsys' into update-kwsys 56616160 KWSys 2015-01-09 (425fa73e) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97f178f061a21fdc060d85982c68b8be5a088858 commit 97f178f061a21fdc060d85982c68b8be5a088858 Merge: 6c3e3c1 5661616 Author: Brad King AuthorDate: Sat Jan 10 12:07:56 2015 -0500 Commit: Brad King CommitDate: Sat Jan 10 12:07:56 2015 -0500 Merge branch 'upstream-kwsys' into update-kwsys http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56616160de37c1a2cc5fbcf4c9714db3ca1e5422 commit 56616160de37c1a2cc5fbcf4c9714db3ca1e5422 Author: KWSys Robot AuthorDate: Fri Jan 9 15:37:34 2015 -0500 Commit: Brad King CommitDate: Sat Jan 10 12:07:51 2015 -0500 KWSys 2015-01-09 (425fa73e) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ 425fa73e | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' d30c9b03..425fa73e Ben Boeckel (1): 425fa73e Add missing malloc return value casts Change-Id: I3295bc4241b746364c728445114b3a627095838c diff --git a/EncodingC.c b/EncodingC.c index cda78e2..ba2cec2 100644 --- a/EncodingC.c +++ b/EncodingC.c @@ -44,7 +44,7 @@ wchar_t* kwsysEncoding_DupToWide(const char* str) size_t length = kwsysEncoding_mbstowcs(NULL, str, 0) + 1; if(length > 0) { - ret = malloc((length)*sizeof(wchar_t)); + ret = (wchar_t*)malloc((length)*sizeof(wchar_t)); ret[0] = 0; kwsysEncoding_mbstowcs(ret, str, length); } @@ -71,7 +71,7 @@ char* kwsysEncoding_DupToNarrow(const wchar_t* str) size_t length = kwsysEncoding_wcstombs(0, str, 0) + 1; if(length > 0) { - ret = malloc(length); + ret = (char*)malloc(length); ret[0] = 0; kwsysEncoding_wcstombs(ret, str, length); } diff --git a/ProcessUNIX.c b/ProcessUNIX.c index ca9d424..1be6d02 100644 --- a/ProcessUNIX.c +++ b/ProcessUNIX.c @@ -547,7 +547,7 @@ int kwsysProcess_SetPipeFile(kwsysProcess* cp, int prPipe, const char* file) } if(file) { - *pfile = malloc(strlen(file)+1); + *pfile = (char*)malloc(strlen(file)+1); if(!*pfile) { return 0; @@ -1468,7 +1468,7 @@ static int kwsysProcessInitialize(kwsysProcess* cp) cp->RealWorkingDirectoryLength = 4096; #endif cp->RealWorkingDirectory = - malloc((size_t)(cp->RealWorkingDirectoryLength)); + (char*)malloc((size_t)(cp->RealWorkingDirectoryLength)); if(!cp->RealWorkingDirectory) { return 0; ----------------------------------------------------------------------- Summary of changes: Source/kwsys/EncodingC.c | 4 ++-- Source/kwsys/ProcessUNIX.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Sat Jan 10 12:09:27 2015 From: brad.king at kitware.com (Brad King) Date: Sat, 10 Jan 2015 12:09:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1637-g7276bd8 Message-ID: <20150110170927.EF4BD2197@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7276bd8fc3bf055c27e34751c3df052a3ba42a8e (commit) via e5b914209742a70c72c6cf8a8e6e1e005d8830f2 (commit) via 54d83caecfc1e0b8f047037ea6aaa7d54b64d8b3 (commit) from d388bda78fb01e6a8cebad0464cd7b9eefd91eef (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7276bd8fc3bf055c27e34751c3df052a3ba42a8e commit 7276bd8fc3bf055c27e34751c3df052a3ba42a8e Merge: d388bda e5b9142 Author: Brad King AuthorDate: Sat Jan 10 12:09:27 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 10 12:09:27 2015 -0500 Merge topic 'update-kwsys' into next e5b91420 Merge branch 'upstream-kwsys' into update-kwsys 54d83cae KWSys 2015-01-09 (425fa73e) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e5b914209742a70c72c6cf8a8e6e1e005d8830f2 commit e5b914209742a70c72c6cf8a8e6e1e005d8830f2 Merge: 4aa9c64 54d83ca Author: Brad King AuthorDate: Sat Jan 10 12:09:04 2015 -0500 Commit: Brad King CommitDate: Sat Jan 10 12:09:04 2015 -0500 Merge branch 'upstream-kwsys' into update-kwsys http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54d83caecfc1e0b8f047037ea6aaa7d54b64d8b3 commit 54d83caecfc1e0b8f047037ea6aaa7d54b64d8b3 Author: KWSys Robot AuthorDate: Fri Jan 9 15:37:34 2015 -0500 Commit: Brad King CommitDate: Sat Jan 10 12:09:01 2015 -0500 KWSys 2015-01-09 (425fa73e) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ 425fa73e | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 5a15cb3b..425fa73e Ben Boeckel (1): 425fa73e Add missing malloc return value casts Simon Gomizelj (1): 2f0165f1 Terminal: Add xterm-termite to VT100 color support whitelist Stephen Kelly (3): e4fe1d1a SystemTools: Refactor selection of Windows directory APIs af86ac7d SystemTools: Fix build with SunCC/stlport. d30c9b03 Workaround SolarisStudio bug with libstdc++. Change-Id: Ib8fbe15d1ee072ac8d8506d92c8883056b224a89 diff --git a/EncodingC.c b/EncodingC.c index cda78e2..ba2cec2 100644 --- a/EncodingC.c +++ b/EncodingC.c @@ -44,7 +44,7 @@ wchar_t* kwsysEncoding_DupToWide(const char* str) size_t length = kwsysEncoding_mbstowcs(NULL, str, 0) + 1; if(length > 0) { - ret = malloc((length)*sizeof(wchar_t)); + ret = (wchar_t*)malloc((length)*sizeof(wchar_t)); ret[0] = 0; kwsysEncoding_mbstowcs(ret, str, length); } @@ -71,7 +71,7 @@ char* kwsysEncoding_DupToNarrow(const wchar_t* str) size_t length = kwsysEncoding_wcstombs(0, str, 0) + 1; if(length > 0) { - ret = malloc(length); + ret = (char*)malloc(length); ret[0] = 0; kwsysEncoding_wcstombs(ret, str, length); } diff --git a/ProcessUNIX.c b/ProcessUNIX.c index ca9d424..1be6d02 100644 --- a/ProcessUNIX.c +++ b/ProcessUNIX.c @@ -547,7 +547,7 @@ int kwsysProcess_SetPipeFile(kwsysProcess* cp, int prPipe, const char* file) } if(file) { - *pfile = malloc(strlen(file)+1); + *pfile = (char*)malloc(strlen(file)+1); if(!*pfile) { return 0; @@ -1468,7 +1468,7 @@ static int kwsysProcessInitialize(kwsysProcess* cp) cp->RealWorkingDirectoryLength = 4096; #endif cp->RealWorkingDirectory = - malloc((size_t)(cp->RealWorkingDirectoryLength)); + (char*)malloc((size_t)(cp->RealWorkingDirectoryLength)); if(!cp->RealWorkingDirectory) { return 0; diff --git a/SystemTools.cxx b/SystemTools.cxx index e4c82d8..c2b6097 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -16,6 +16,14 @@ # define _XOPEN_SOURCE_EXTENDED #endif +#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__)) +# define KWSYS_WINDOWS_DIRS +#else +# if defined(__SUNPRO_CC) +# include +# endif +#endif + #include "kwsysPrivate.h" #include KWSYS_HEADER(RegularExpression.hxx) #include KWSYS_HEADER(SystemTools.hxx) @@ -205,8 +213,7 @@ static time_t windows_filetime_to_posix_time(const FILETIME& ft) } #endif -#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__)) - +#ifdef KWSYS_WINDOWS_DIRS #include inline int Mkdir(const kwsys_stl::string& dir) diff --git a/Terminal.c b/Terminal.c index e13003f..d13f79a 100644 --- a/Terminal.c +++ b/Terminal.c @@ -175,6 +175,7 @@ static const char* kwsysTerminalVT100Names[] = "xterm-88color", "xterm-color", "xterm-debian", + "xterm-termite", 0 }; diff --git a/kwsysPlatformTestsCXX.cxx b/kwsysPlatformTestsCXX.cxx index 3f947f3..82620da 100644 --- a/kwsysPlatformTestsCXX.cxx +++ b/kwsysPlatformTestsCXX.cxx @@ -548,6 +548,10 @@ int main() #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif +#if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 \ + && __linux && __SUNPRO_CC_COMPAT == 'G' +# include +#endif #include int main() { ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Sat Jan 10 12:14:57 2015 From: brad.king at kitware.com (Brad King) Date: Sat, 10 Jan 2015 12:14:57 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-634-g427d932 Message-ID: <20150110171457.B5CB69AF88@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 427d9324983ddd02d5afff780c6b23ab5081c8df (commit) via 7a2c3f0c0ec5b542c89456826adeb56c3cbd7df0 (commit) from ccd004666750248ba0fc5193ebefd45f93c12693 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=427d9324983ddd02d5afff780c6b23ab5081c8df commit 427d9324983ddd02d5afff780c6b23ab5081c8df Merge: ccd0046 7a2c3f0 Author: Brad King AuthorDate: Sat Jan 10 12:14:56 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 10 12:14:56 2015 -0500 Merge topic 'doc-if-variable-not-defined' 7a2c3f0c Help: Clarify if() documentation (#15335) ----------------------------------------------------------------------- Summary of changes: Help/command/if.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Sat Jan 10 12:15:00 2015 From: brad.king at kitware.com (Brad King) Date: Sat, 10 Jan 2015 12:15:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-636-gbc04555 Message-ID: <20150110171500.35D469C170@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via bc045555b54734fa20a69d87d64ae9152639654d (commit) via 72a0d6df6dfa7c81a5a81c6f5b85b964815ffbc1 (commit) from 427d9324983ddd02d5afff780c6b23ab5081c8df (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bc045555b54734fa20a69d87d64ae9152639654d commit bc045555b54734fa20a69d87d64ae9152639654d Merge: 427d932 72a0d6d Author: Brad King AuthorDate: Sat Jan 10 12:14:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 10 12:14:59 2015 -0500 Merge topic 'doc-CXX_STANDARD-14' 72a0d6df Help: Document valid 14 value for CXX_STANDARD. (#15339) ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/CXX_STANDARD.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Sat Jan 10 12:15:23 2015 From: brad.king at kitware.com (Brad King) Date: Sat, 10 Jan 2015 12:15:23 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1641-g5b47c32 Message-ID: <20150110171523.A9C11A51DA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5b47c32a9d7a67fadd904a4f41c4838eb79a04c2 (commit) via bc045555b54734fa20a69d87d64ae9152639654d (commit) via 427d9324983ddd02d5afff780c6b23ab5081c8df (commit) via ccd004666750248ba0fc5193ebefd45f93c12693 (commit) from 7276bd8fc3bf055c27e34751c3df052a3ba42a8e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5b47c32a9d7a67fadd904a4f41c4838eb79a04c2 commit 5b47c32a9d7a67fadd904a4f41c4838eb79a04c2 Merge: 7276bd8 bc04555 Author: Brad King AuthorDate: Sat Jan 10 12:15:12 2015 -0500 Commit: Brad King CommitDate: Sat Jan 10 12:15:12 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 10 12:44:57 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 10 Jan 2015 12:44:57 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1643-gf1fa6eb Message-ID: <20150110174457.C6FF9A7EE3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f1fa6eb9c12d28f0d5e6afa23e012856238cfc6b (commit) via aedba1fa998a01fb483062fd393c10145219e7c4 (commit) from 5b47c32a9d7a67fadd904a4f41c4838eb79a04c2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f1fa6eb9c12d28f0d5e6afa23e012856238cfc6b commit f1fa6eb9c12d28f0d5e6afa23e012856238cfc6b Merge: 5b47c32 aedba1f Author: Stephen Kelly AuthorDate: Sat Jan 10 12:44:57 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 10 12:44:57 2015 -0500 Merge topic 'Apple-compiler-selection' into next aedba1fa Apple: Prefer the compiler reported by Xcode to that in path. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aedba1fa998a01fb483062fd393c10145219e7c4 commit aedba1fa998a01fb483062fd393c10145219e7c4 Author: Stephen Kelly AuthorDate: Sat Jan 3 17:36:34 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 10 18:44:35 2015 +0100 Apple: Prefer the compiler reported by Xcode to that in path. The compiler in the PATH on mac is a stub for a different delegate depending on the environment. Rather than requiring xcode-select to change the used Xcode globally, users should be able to choose the compiler per-session. That is possible with the DEVELOPER_DIR environment variable. However, the environment can change between running CMake and invoking the build. In such cases, CMake prefers to record the relevant paths from the environment and use them when invoking the build. That is not currently done for the compilers on APPLE, so the compiler used is not the one reported when running cmake: $ DEVELOPER_DIR=/Applications/Xcode2.app/Contents/Developer/ cc --version Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix $ DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ cc --version Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix Update that now by querying Xcode for the correct compiler path if it is found in /usr/bin. We can't simply query xcrun first and use the regular search as a fallback, because compilers in the PATH in /usr/local for example should be preferred if present. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index f509ef3..01e91f2 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -41,8 +41,39 @@ macro(_cmake_find_compiler lang) endif() endif() + # Look for directories containing compilers of reference languages. + set(_${lang}_COMPILER_HINTS) + foreach(l ${_languages}) + if(CMAKE_${l}_COMPILER AND IS_ABSOLUTE "${CMAKE_${l}_COMPILER}") + get_filename_component(_hint "${CMAKE_${l}_COMPILER}" PATH) + if(IS_DIRECTORY "${_hint}") + list(APPEND _${lang}_COMPILER_HINTS "${_hint}") + endif() + unset(_hint) + endif() + endforeach() + + # Find the compiler. + if(_${lang}_COMPILER_HINTS) + # Prefer directories containing compilers of reference languages. + list(REMOVE_DUPLICATES _${lang}_COMPILER_HINTS) + find_program(CMAKE_${lang}_COMPILER + NAMES ${CMAKE_${lang}_COMPILER_LIST} + PATHS ${_${lang}_COMPILER_HINTS} + NO_DEFAULT_PATH + DOC "${lang} compiler") + endif() + find_program(CMAKE_${lang}_COMPILER NAMES ${CMAKE_${lang}_COMPILER_LIST} DOC "${lang} compiler") + if(CMAKE_${lang}_COMPILER_INIT AND NOT CMAKE_${lang}_COMPILER) + set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${CMAKE_${lang}_COMPILER_INIT}") + endif() + unset(_${lang}_COMPILER_HINTS) + unset(_languages) + # Look for a make tool provided by Xcode - if(CMAKE_HOST_APPLE) + if(CMAKE_HOST_APPLE + AND (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" + OR CMAKE_${lang}_COMPILER MATCHES "^/usr/bin")) foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) execute_process(COMMAND xcrun --find ${comp} OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE @@ -53,37 +84,6 @@ macro(_cmake_find_compiler lang) endif() endforeach() endif() - - if(NOT CMAKE_${lang}_COMPILER) - # Look for directories containing compilers of reference languages. - set(_${lang}_COMPILER_HINTS) - foreach(l ${_languages}) - if(CMAKE_${l}_COMPILER AND IS_ABSOLUTE "${CMAKE_${l}_COMPILER}") - get_filename_component(_hint "${CMAKE_${l}_COMPILER}" PATH) - if(IS_DIRECTORY "${_hint}") - list(APPEND _${lang}_COMPILER_HINTS "${_hint}") - endif() - unset(_hint) - endif() - endforeach() - - # Find the compiler. - if(_${lang}_COMPILER_HINTS) - # Prefer directories containing compilers of reference languages. - list(REMOVE_DUPLICATES _${lang}_COMPILER_HINTS) - find_program(CMAKE_${lang}_COMPILER - NAMES ${CMAKE_${lang}_COMPILER_LIST} - PATHS ${_${lang}_COMPILER_HINTS} - NO_DEFAULT_PATH - DOC "${lang} compiler") - endif() - find_program(CMAKE_${lang}_COMPILER NAMES ${CMAKE_${lang}_COMPILER_LIST} DOC "${lang} compiler") - if(CMAKE_${lang}_COMPILER_INIT AND NOT CMAKE_${lang}_COMPILER) - set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${CMAKE_${lang}_COMPILER_INIT}") - endif() - unset(_${lang}_COMPILER_HINTS) - endif() - unset(_languages) endmacro() macro(_cmake_find_compiler_path lang) ----------------------------------------------------------------------- Summary of changes: Modules/CMakeDetermineCompiler.cmake | 64 +++++++++++++++++----------------- 1 file changed, 32 insertions(+), 32 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 10 12:45:59 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 10 Jan 2015 12:45:59 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1645-g0144470 Message-ID: <20150110174559.ED35AA88F1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0144470b71bd9c1d0ec138ebda9cb28d8b762009 (commit) via 6eabe4d0f9dd6622c7dafb5d6e8838c227f721d1 (commit) from f1fa6eb9c12d28f0d5e6afa23e012856238cfc6b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0144470b71bd9c1d0ec138ebda9cb28d8b762009 commit 0144470b71bd9c1d0ec138ebda9cb28d8b762009 Merge: f1fa6eb 6eabe4d Author: Stephen Kelly AuthorDate: Sat Jan 10 12:45:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 10 12:45:59 2015 -0500 Merge topic 'Apple-compiler-selection' into next 6eabe4d0 Apple: Resolve compiler in /usr/bin to that reported by Xcode http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6eabe4d0f9dd6622c7dafb5d6e8838c227f721d1 commit 6eabe4d0f9dd6622c7dafb5d6e8838c227f721d1 Author: Stephen Kelly AuthorDate: Sat Jan 3 17:36:34 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 10 18:45:03 2015 +0100 Apple: Resolve compiler in /usr/bin to that reported by Xcode The compiler in the PATH on mac is a stub for a different delegate depending on the environment. Rather than requiring xcode-select to change the used Xcode globally, users should be able to choose the compiler per-session. That is possible with the DEVELOPER_DIR environment variable. However, the environment can change between running CMake and invoking the build. In such cases, CMake prefers to record the relevant paths from the environment and use them when invoking the build. That is not currently done for the compilers on APPLE, so the compiler used is not the one reported when running cmake: $ DEVELOPER_DIR=/Applications/Xcode2.app/Contents/Developer/ cc --version Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix $ DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ cc --version Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix Update that now by querying Xcode for the correct compiler path before falling back to whatever is delegated to by the compilers in /usr/bin. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 0ab3af6..01e91f2 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -71,13 +71,15 @@ macro(_cmake_find_compiler lang) unset(_languages) # Look for a make tool provided by Xcode - if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE) + if(CMAKE_HOST_APPLE + AND (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" + OR CMAKE_${lang}_COMPILER MATCHES "^/usr/bin")) foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) execute_process(COMMAND xcrun --find ${comp} OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE _xcrun_err) if(_xcrun_out) - set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_out}") + set(CMAKE_${lang}_COMPILER "${_xcrun_out}" CACHE PATH "${lang} compiler") break() endif() endforeach() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 10 12:47:25 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 10 Jan 2015 12:47:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1647-g57e8b86 Message-ID: <20150110174725.7FC6FA9299@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 57e8b86866517c1fdc75b93fdc03b791247f95dd (commit) via 147278046f9f2200de276c84f61cde9ec0a5b2c4 (commit) from 0144470b71bd9c1d0ec138ebda9cb28d8b762009 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57e8b86866517c1fdc75b93fdc03b791247f95dd commit 57e8b86866517c1fdc75b93fdc03b791247f95dd Merge: 0144470 1472780 Author: Stephen Kelly AuthorDate: Sat Jan 10 12:47:24 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 10 12:47:24 2015 -0500 Merge topic 'Apple-GNU-compiler-features' into next 14727804 Record compile features for GNU on Apple. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=147278046f9f2200de276c84f61cde9ec0a5b2c4 commit 147278046f9f2200de276c84f61cde9ec0a5b2c4 Author: Stephen Kelly AuthorDate: Fri Jan 9 20:18:25 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 10 18:46:59 2015 +0100 Record compile features for GNU on Apple. Tested with GNU 4.8 binary (bottle) from homebrew, and assumed to work with the others. diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 9018450..db9089d 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -23,7 +23,7 @@ macro(cmake_record_c_compile_features) record_compiler_features(C "${std_version}" ${list}) endmacro() - if (UNIX AND NOT APPLE AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index a91c901..4a26963 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -39,10 +39,10 @@ macro(cmake_record_cxx_compile_features) endmacro() set(_result 0) - if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() - if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/GNU-C.cmake | 2 +- Modules/Compiler/GNU-CXX.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Sat Jan 10 12:57:42 2015 From: brad.king at kitware.com (Brad King) Date: Sat, 10 Jan 2015 12:57:42 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1649-gc7fb8d3 Message-ID: <20150110175742.9538CA9F0A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c7fb8d364b6915cd603573fdfb4670c88d728050 (commit) via c453fb77986632531d7835e4a4e7433edc004206 (commit) from 57e8b86866517c1fdc75b93fdc03b791247f95dd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c7fb8d364b6915cd603573fdfb4670c88d728050 commit c7fb8d364b6915cd603573fdfb4670c88d728050 Merge: 57e8b86 c453fb7 Author: Brad King AuthorDate: Sat Jan 10 12:57:41 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 10 12:57:41 2015 -0500 Merge topic 'feature_record_msvc' into next c453fb77 fixup! Features: Properly evaluate if the compiler supports cxx_final. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c453fb77986632531d7835e4a4e7433edc004206 commit c453fb77986632531d7835e4a4e7433edc004206 Author: Brad King AuthorDate: Sat Jan 10 12:53:52 2015 -0500 Commit: Brad King CommitDate: Sat Jan 10 12:54:49 2015 -0500 fixup! Features: Properly evaluate if the compiler supports cxx_final. Always reference the source file with a consistent name. diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake index b544b99..4de8e88 100644 --- a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake @@ -11,7 +11,7 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_res COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp" ) -add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp") +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_result}.cpp") if (HAVE_FINAL) target_compile_features(empty PRIVATE cxx_final) endif() ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jan 11 00:01:11 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 11 Jan 2015 00:01:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-637-g7e5e8a3 Message-ID: <20150111050111.1BDFFA9D96@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 7e5e8a37b56dd7c858d54c49e7fa6697cc72395b (commit) from bc045555b54734fa20a69d87d64ae9152639654d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e5e8a37b56dd7c858d54c49e7fa6697cc72395b commit 7e5e8a37b56dd7c858d54c49e7fa6697cc72395b Author: Kitware Robot AuthorDate: Sun Jan 11 00:01:09 2015 -0500 Commit: Kitware Robot CommitDate: Sun Jan 11 00:01:09 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index bfd2569..5de792a 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 20150110) +set(CMake_VERSION_PATCH 20150111) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 11 10:32:40 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 11 Jan 2015 10:32:40 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1658-g1e34d70 Message-ID: <20150111153240.9C53BAA044@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1e34d70d79927b9ed68111528bdde02cbfd1afa6 (commit) via 9a920b69d548faef12d7cf9a5d1bc2706e1e5e5c (commit) via 6c634a5cb389b9576da94d9e42ca9392651ec22b (commit) via 548c7be76d4c6590175c190ba3b1391bcd5e7861 (commit) via 1b7c74a2abca1d6f09abc7f84c63ad9eed311c54 (commit) via c7f575ec1d221aba0350fbe92b8bb1a10d1123e3 (commit) via f726493f91a61c28faa5eb526ab8c7f26dbedff2 (commit) via a1efdd8d0a65e98833cf3209da378250fa096c3e (commit) via 3452847e1ddb24d36048575d51bb5216af036ace (commit) from c7fb8d364b6915cd603573fdfb4670c88d728050 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e34d70d79927b9ed68111528bdde02cbfd1afa6 commit 1e34d70d79927b9ed68111528bdde02cbfd1afa6 Merge: c7fb8d3 9a920b6 Author: Stephen Kelly AuthorDate: Sun Jan 11 10:32:39 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 10:32:39 2015 -0500 Merge topic 'GNU-4.6-compile-features' into next 9a920b69 Features: Record for GNU 4.6. 6c634a5c Features: Test __GXX_EXPERIMENTAL_CXX0X__ macro for GNU 4.6 compatibility. 548c7be7 Features: Don't test __cplusplus value for CXX98 on GNU. 1b7c74a2 Features: Test an old value of __STDC_VERSION__ for GNU 4.6 compatibility. c7f575ec Features: Record C/CXX dialect flags for GNU 4.6. f726493f Features: Remove wrong content from else() condition. a1efdd8d Features: Make cxx_noexcept available from GNU 4.6. 3452847e Update the default_dialect test for old GNU-like compilers. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a920b69d548faef12d7cf9a5d1bc2706e1e5e5c commit 9a920b69d548faef12d7cf9a5d1bc2706e1e5e5c Author: Stephen Kelly AuthorDate: Sat Jan 10 20:05:54 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:29:14 2015 +0100 Features: Record for GNU 4.6. diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake index ddac0e8..7e840aa 100644 --- a/Modules/Compiler/GNU-C-FeatureTests.cmake +++ b/Modules/Compiler/GNU-C-FeatureTests.cmake @@ -1,12 +1,12 @@ -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") # GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it # to 201000L. As the former is strictly greater than the latter, test only # for the latter. If in the future CMake learns about a C feature which was # introduced with GNU 4.7, that should test for the correct version, similar # to the distinction between __cplusplus and __GXX_EXPERIMENTAL_CXX0X__ tests. -set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") +set(GNU46_C11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") set(_cmake_feature_test_c_static_assert "${GNU46_C11}") # Since 4.4 at least: set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 2720fbc..07200f4 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -28,7 +28,7 @@ macro(cmake_record_c_compile_features) record_compiler_features(C "${std_version}" ${list}) endmacro() - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 41f1803..e5af099 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -2,7 +2,7 @@ # Reference: http://gcc.gnu.org/projects/cxx0x.html # http://gcc.gnu.org/projects/cxx1y.html -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L") set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}") @@ -60,7 +60,7 @@ set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") # defined in the future. set(GNU_CXX0X_DEFINED "(__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))") # TODO: Should be supported by GNU 4.6 -set(GNU46_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU46_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index e746267..18bcf15 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -45,7 +45,7 @@ macro(cmake_record_cxx_compile_features) if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() - if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c634a5cb389b9576da94d9e42ca9392651ec22b commit 6c634a5cb389b9576da94d9e42ca9392651ec22b Author: Stephen Kelly AuthorDate: Sun Jan 11 16:22:24 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:27:33 2015 +0100 Features: Test __GXX_EXPERIMENTAL_CXX0X__ macro for GNU 4.6 compatibility. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 27cff40..41f1803 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -54,8 +54,13 @@ set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") # support -std=c++11. Prior to that, support for C++11 features is technically # experiemental and possibly incomplete (see for example the note below about # cxx_variadic_template_template_parameters) +# GNU does not define __cplusplus correctly before version 4.7. +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773 +# __GXX_EXPERIMENTAL_CXX0X__ is defined in prior versions, but may not be +# defined in the future. +set(GNU_CXX0X_DEFINED "(__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))") # TODO: Should be supported by GNU 4.6 -set(GNU46_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU46_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}") @@ -64,13 +69,13 @@ set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}") set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}") # TODO: Should be supported by GNU 4.5 -set(GNU45_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU45_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}") set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}") set(_cmake_feature_test_cxx_local_type_template_args "${GNU45_CXX11}") set(_cmake_feature_test_cxx_raw_string_literals "${GNU45_CXX11}") # TODO: Should be supported by GNU 4.4 -set(GNU44_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU44_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}") set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}") set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}") @@ -90,7 +95,7 @@ set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}") # templates capability in CMake. See # http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf # TODO: Should be supported by GNU 4.3 -set(GNU43_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU43_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}") set(_cmake_feature_test_cxx_default_function_template_args "${GNU43_CXX11}") set(_cmake_feature_test_cxx_long_long_type "${GNU43_CXX11}") @@ -98,8 +103,8 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}") set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}") set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}") # TODO: Should be supported since GNU 3.4? -set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") # TODO: Should be supported forever? -set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && __cplusplus >= 201103L") -set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported}") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=548c7be76d4c6590175c190ba3b1391bcd5e7861 commit 548c7be76d4c6590175c190ba3b1391bcd5e7861 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:23:34 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:23:34 2015 +0100 Features: Don't test __cplusplus value for CXX98 on GNU. The macro is defined to 1 for GNU 4.6, and such a test is only useful for features in language dialects newer than the default (CXX98 for GNU currently). diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 03b53e1..27cff40 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -102,4 +102,4 @@ set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && __cpl # TODO: Should be supported forever? set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && __cplusplus >= 201103L") -set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported} && __cplusplus >= 199711L") +set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported}") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b7c74a2abca1d6f09abc7f84c63ad9eed311c54 commit 1b7c74a2abca1d6f09abc7f84c63ad9eed311c54 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:20:03 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:20:03 2015 +0100 Features: Test an old value of __STDC_VERSION__ for GNU 4.6 compatibility. diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake index dfaeebf..ddac0e8 100644 --- a/Modules/Compiler/GNU-C-FeatureTests.cmake +++ b/Modules/Compiler/GNU-C-FeatureTests.cmake @@ -1,7 +1,12 @@ set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") -set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L") +# GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it +# to 201000L. As the former is strictly greater than the latter, test only +# for the latter. If in the future CMake learns about a C feature which was +# introduced with GNU 4.7, that should test for the correct version, similar +# to the distinction between __cplusplus and __GXX_EXPERIMENTAL_CXX0X__ tests. +set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") set(_cmake_feature_test_c_static_assert "${GNU46_C11}") # Since 4.4 at least: set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c7f575ec1d221aba0350fbe92b8bb1a10d1123e3 commit c7f575ec1d221aba0350fbe92b8bb1a10d1123e3 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:09:50 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:17:57 2015 +0100 Features: Record C/CXX dialect flags for GNU 4.6. This release was prior to standardization of C11/CXX11. diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 031eb81..2720fbc 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -1,15 +1,20 @@ include(Compiler/GNU) __compiler_gnu(C) -if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99") set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99") +endif() +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") +elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) + set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x") + set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x") endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index 4a26963..e746267 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -11,7 +11,7 @@ else() endif() endif() -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) # Supported since 4.3 set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98") @@ -20,7 +20,10 @@ endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") +elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) # 4.3 supports 0x variants + set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x") + set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x") endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f726493f91a61c28faa5eb526ab8c7f26dbedff2 commit f726493f91a61c28faa5eb526ab8c7f26dbedff2 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:14:26 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:16:01 2015 +0100 Features: Remove wrong content from else() condition. As this is not elseif(), the content has no effect. Rather than changing it to an elseif(), remove the conditional content. All versions of GNU prior to 5.0 default to C90/89. Clang-C.cmake has a similar code block which correctly uses elseif() for setting the default C dialect to C99. That may have been updated from a C90 default at some point, so leave the version condition there in place for now. diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index db9089d..031eb81 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -14,7 +14,7 @@ endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set(CMAKE_C_STANDARD_DEFAULT 11) -else(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) +else() set(CMAKE_C_STANDARD_DEFAULT 90) endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a1efdd8d0a65e98833cf3209da378250fa096c3e commit a1efdd8d0a65e98833cf3209da378250fa096c3e Author: Stephen Kelly AuthorDate: Sun Jan 11 15:55:09 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 15:55:59 2015 +0100 Features: Make cxx_noexcept available from GNU 4.6. As listed in the reference document. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 6de06dd..03b53e1 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -46,7 +46,6 @@ set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}") set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}") set(_cmake_feature_test_cxx_extended_friend_declarations "${GNU47_CXX11}") set(_cmake_feature_test_cxx_final "${GNU47_CXX11}") -set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}") set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}") set(_cmake_feature_test_cxx_override "${GNU47_CXX11}") set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") @@ -60,6 +59,7 @@ set(GNU46_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}") +set(_cmake_feature_test_cxx_noexcept "${GNU46_CXX11}") set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}") set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3452847e1ddb24d36048575d51bb5216af036ace commit 3452847e1ddb24d36048575d51bb5216af036ace Author: Stephen Kelly AuthorDate: Fri Jan 9 20:18:24 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 14:28:56 2015 +0100 Update the default_dialect test for old GNU-like compilers. Prior to GNU 4.7, GNU defined __cplusplus incorrectly, and defined __GXX_EXPERIMENTAL_CXX0X__ in C++11 mode. diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp index 8d97926..a2ca268 100644 --- a/Tests/CompileFeatures/default_dialect.cpp +++ b/Tests/CompileFeatures/default_dialect.cpp @@ -14,7 +14,7 @@ Outputter<__cplusplus> o; # if !DEFAULT_CXX98 # error Buildsystem error # endif -# if __cplusplus != 199711L +# if __cplusplus != 199711L && __cplusplus != 1 && !defined(__GXX_EXPERIMENTAL_CXX0X__) Outputter<__cplusplus> o; # endif #endif ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/GNU-C-FeatureTests.cmake | 9 +++++++-- Modules/Compiler/GNU-C.cmake | 11 ++++++++--- Modules/Compiler/GNU-CXX-FeatureTests.cmake | 25 +++++++++++++++---------- Modules/Compiler/GNU-CXX.cmake | 7 +++++-- Tests/CompileFeatures/default_dialect.cpp | 2 +- 5 files changed, 36 insertions(+), 18 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 11 10:50:44 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 11 Jan 2015 10:50:44 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1665-gb71ecfb Message-ID: <20150111155044.0FC9DA8CE1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b71ecfb867f90c0f29f3ad9e0636b51726419bde (commit) via 3d809d5909d79fb78afb61317e8c2df0ada99d81 (commit) via 18adaaf5f93dbea14c98a77305c876806c6eb326 (commit) via 64c30bdc48d0a3e1da48fdbfeb200740fa5dac43 (commit) via 225c0ef88bf21c39694b51798390b87328a163de (commit) via a15675efc3d96906d4e803def2e83fd3bd1cf812 (commit) via 07d1f6fca1d6ea21dea64b32639c44d5eecf98a6 (commit) from 1e34d70d79927b9ed68111528bdde02cbfd1afa6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b71ecfb867f90c0f29f3ad9e0636b51726419bde commit b71ecfb867f90c0f29f3ad9e0636b51726419bde Merge: 1e34d70 3d809d5 Author: Stephen Kelly AuthorDate: Sun Jan 11 10:50:43 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 10:50:43 2015 -0500 Merge topic 'feature_record_msvc' into next 3d809d59 Only disable cxx_contextual_conversions on MSVC 2012 and older. 18adaaf5 Features: Enable writing of MSVC compiler feature header. 64c30bdc Features: Record for MSVC C++ 2015 and MSVC C 2010-2015. 225c0ef8 Features: Record for MSVC 2010-2013. a15675ef Features: Quote all compiler names when comparing with COMPILER_ID 07d1f6fc Features: Properly evaluate if the compiler supports cxx_final. diff --cc Tests/CompileFeatures/CMakeLists.txt index a77b399,9fb8d1b..b34640d --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -63,14 -63,6 +63,25 @@@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU cxx_return_type_deduction ) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM CXX_non_features + # Micrsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because ++ # older compiler pass the test but might not actually conform ++ cxx_contextual_conversions ++ ) ++endif() ++ ++set(MSVC_) ++if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND ++ MSVC_VERSION LESS 1800) ++ list(REMOVE_ITEM CXX_non_features ++ # Microsoft only officially supports this feature in VS2013 and above, due ++ # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() set(MSVC_) if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d809d5909d79fb78afb61317e8c2df0ada99d81 commit 3d809d5909d79fb78afb61317e8c2df0ada99d81 Author: Robert Maynard AuthorDate: Mon Jan 5 14:55:42 2015 -0500 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:47:58 2015 +0100 Only disable cxx_contextual_conversions on MSVC 2012 and older. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 0bcae32..9fb8d1b 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -63,9 +63,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" cxx_return_type_deduction ) endif() -if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + +set(MSVC_) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + MSVC_VERSION LESS 1800) list(REMOVE_ITEM CXX_non_features - # Micrsoft only officially supports this feature in VS2013 and above, due + # Microsoft only officially supports this feature in VS2013 and above, due # to new wording of the proposal. We don't test for this with MSVC because # older compiler pass the test but might not actually conform cxx_contextual_conversions http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18adaaf5f93dbea14c98a77305c876806c6eb326 commit 18adaaf5f93dbea14c98a77305c876806c6eb326 Author: Robert Maynard AuthorDate: Tue Jan 6 13:19:44 2015 -0500 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:47:58 2015 +0100 Features: Enable writing of MSVC compiler feature header. Notes: VS2015 and above are the only MSVC versions to support cxx_final, so remove usages from the tests, and instead only test for cxx_override. VS2012 and above to conform to cxx_decltype_incomplete_return_types proposal, but without support for auto return types the dcl.type.simple example in the proposal doesn't compile. VS2013 and above to conform to the updated cxx_contextual_conversions proposal, but VS2010 and above pass the test. Compilers such as MSVC have no explicit flags to enable C++11 mode, it just is always on. So only run the link tests with compilers that require a flag to specify the language version. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 36b9706..bcaaafa 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -316,6 +316,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC ) set(_hex_compilers ADSP Borland Embarcadero SunPro) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index b164f06..0bcae32 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -26,7 +26,18 @@ get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) foreach(feature ${c_features}) run_test(${feature} C) endforeach() + get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) + +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM cxx_features + # This test requires auto return type deduction to work properly, but + # that is not supported by all versions of MSVC that support decltype + # incomplete return types. + cxx_decltype_incomplete_return_types + ) +endif() + foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() @@ -52,6 +63,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" cxx_return_type_deduction ) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM CXX_non_features + # Micrsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() set(C_ext c) set(C_standard_flag 11) @@ -126,6 +145,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) + target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index f667cc4..4412569 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -10,7 +10,7 @@ struct A virtual int getA() { return 7; } }; -struct B final : A +struct B : A { int getA() override { return 42; } }; diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 401de95..cfaa78c 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 MSVC VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -64,6 +64,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -81,7 +93,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 MSVC VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..3b37091 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,8 +27,13 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) - run_cmake(LinkImplementationFeatureCycleSolved) + # compilers such as MSVC have no explicit flags to enable c++11 mode. + # Instead they come with all c++11 features implicitly enabled. + # So for those types of compilers this tests is not applicable. + if(CMAKE_CXX11_STANDARD_COMPILE_OPTION) + run_cmake(LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycleSolved) + endif() if (";${CXX_FEATURES};" MATCHES ";cxx_final;") set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=64c30bdc48d0a3e1da48fdbfeb200740fa5dac43 commit 64c30bdc48d0a3e1da48fdbfeb200740fa5dac43 Author: Robert Maynard AuthorDate: Mon Dec 22 10:25:18 2014 -0500 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:47:58 2015 +0100 Features: Record for MSVC C++ 2015 and MSVC C 2010-2015. Initializer lists are only properly supported in 2015 and above. Previous Visual Studio releases said they supported initializer lists but silently produced bad code. diff --git a/Modules/Compiler/MSVC-C-FeatureTests.cmake b/Modules/Compiler/MSVC-C-FeatureTests.cmake new file mode 100644 index 0000000..e449358 --- /dev/null +++ b/Modules/Compiler/MSVC-C-FeatureTests.cmake @@ -0,0 +1,23 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + +set(_cmake_oldestSupported "_MSC_VER >= 1300") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_c_static_assert "${MSVC_2010}") +set(_cmake_feature_test_c_variadic_macros "${MSVC_2010}") + +set(MSVC_2003 "_MSC_VER >= 1300") +set(_cmake_feature_test_c_function_prototypes "${MSVC_2003}") + +# Currently unsupported: +# restrict requires the __restrict syntax in msvc +# set(_cmake_feature_test_c_restrict) + +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2010) +set(MSVC_2003) \ No newline at end of file diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake index 18dea24..b238fde 100644 --- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -1,8 +1,35 @@ # Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx # http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx -set(_oldestSupported "_MSC_VER >= 1600") + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") set(MSVC_2013 "_MSC_VER >= 1800") set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") @@ -11,14 +38,16 @@ set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") -# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221 -set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}") set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") # Possibly broken: # http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") +# Microsoft now states they support contextual conversions +# see footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}") set(MSVC_2012 "_MSC_VER >= 1700") set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") @@ -42,24 +71,27 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") # Currently unsupported: # http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ -# set(_cmake_feature_test_cxx_reference_qualified_functions ) -# set(_cmake_feature_test_cxx_inheriting_constructors ) -# set(_cmake_feature_test_cxx_alignas ) -# set(_cmake_feature_test_cxx_alignof ) -# set(_cmake_feature_test_cxx_thread_local ) -# set(_cmake_feature_test_cxx_func_identifier ) -# set(_cmake_feature_test_cxx_sizeof_member ) +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -# set(_cmake_feature_test_cxx_user_literals ) -# set(_cmake_feature_test_cxx_unrestricted_unions ) -# set(_cmake_feature_test_cxx_unicode_literals ) -# set(_cmake_feature_test_cxx_inline_namespaces ) +# set(_cmake_feature_test_cxx_reference_qualified_functions ) # set(_cmake_feature_test_cxx_constexpr ) -# set(_cmake_feature_test_cxx_noexcept ) # set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + -set(_oldestSupported) +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Platform/Windows-MSVC-C.cmake b/Modules/Platform/Windows-MSVC-C.cmake index cbe1586..c7792eb 100644 --- a/Modules/Platform/Windows-MSVC-C.cmake +++ b/Modules/Platform/Windows-MSVC-C.cmake @@ -3,3 +3,5 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_C " /FS") endif() __windows_compiler_msvc(C) + +set(CMAKE_C_STANDARD_DEFAULT 90) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 89885b8..ad56f68 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -5,6 +5,11 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) endif() __windows_compiler_msvc(CXX) +# No version of MSVC has full conformance to C++11. Therefore the +# __cplusplus macro always evaluates to 98 even if the compilers come with +# C++11/14/+ features enabled. +set(CMAKE_CXX_STANDARD_DEFAULT 98) + macro(cmake_record_cxx_compile_features) record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=225c0ef88bf21c39694b51798390b87328a163de commit 225c0ef88bf21c39694b51798390b87328a163de Author: Stephen Kelly AuthorDate: Sun Apr 6 15:55:37 2014 +0200 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:47:58 2015 +0100 Features: Record for MSVC 2010-2013. diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..18dea24 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,65 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx + +set(_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221 +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Possibly broken: +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_inheriting_constructors ) +# set(_cmake_feature_test_cxx_alignas ) +# set(_cmake_feature_test_cxx_alignof ) +# set(_cmake_feature_test_cxx_thread_local ) +# set(_cmake_feature_test_cxx_func_identifier ) +# set(_cmake_feature_test_cxx_sizeof_member ) + +# set(_cmake_feature_test_cxx_user_literals ) +# set(_cmake_feature_test_cxx_unrestricted_unions ) +# set(_cmake_feature_test_cxx_unicode_literals ) +# set(_cmake_feature_test_cxx_inline_namespaces ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_noexcept ) +# set(_cmake_feature_test_cxx_attributes ) + +set(_oldestSupported) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 0e85005..89885b8 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -4,3 +4,7 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_CXX " /FS") endif() __windows_compiler_msvc(CXX) + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a15675efc3d96906d4e803def2e83fd3bd1cf812 commit a15675efc3d96906d4e803def2e83fd3bd1cf812 Author: Robert Maynard AuthorDate: Tue Jan 6 13:31:30 2015 -0500 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:47:58 2015 +0100 Features: Quote all compiler names when comparing with COMPILER_ID In preparation of adding MSVC support we need to quote all compiler names, as MSVC is also a CMake variable. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 834ac7c..b164f06 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.1) project(CompileFeatures) @@ -31,7 +31,7 @@ foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) # The cxx_alignof feature happens to work (for *this* testcase) with # GNU 4.7, but it is first documented as available with GNU 4.8. @@ -39,7 +39,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU cxx_alignof ) endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) # GNU prior to 4.9 does not set any preprocessor define to distinguish # c++1y from c++11, so CMake does not support c++1y features before GNU 4.9. diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 5b2f1de..401de95 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0.0) +cmake_minimum_required(VERSION 3.1.0) project(WriteCompilerDetectionHeader) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -56,17 +56,17 @@ macro(set_defines target true_defs false_defs) ) endmacro() -if (CMAKE_CXX_COMPILER_ID STREQUAL GNU - OR CMAKE_CXX_COMPILER_ID STREQUAL Clang - OR CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" + OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") # False for C++98 mode. list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() -if (CMAKE_C_COMPILER_ID STREQUAL GNU - OR CMAKE_C_COMPILER_ID STREQUAL Clang - OR CMAKE_C_COMPILER_ID STREQUAL AppleClang) +if (CMAKE_C_COMPILER_ID STREQUAL "GNU" + OR CMAKE_C_COMPILER_ID STREQUAL "Clang" + OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") add_executable(C_undefined c_undefined.c) set_property(TARGET C_undefined PROPERTY CXX_STANDARD 90) target_compile_options(C_undefined PRIVATE -Werror=undef) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=07d1f6fca1d6ea21dea64b32639c44d5eecf98a6 commit 07d1f6fca1d6ea21dea64b32639c44d5eecf98a6 Author: Robert Maynard AuthorDate: Wed Dec 31 10:25:33 2014 -0500 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:47:58 2015 +0100 Features: Properly evaluate if the compiler supports cxx_final. Previously we expanded HAVE_FINAL to determine what the copied_file number would be, but when we don't have cxx_final than HAVE_FINAL is not defined. What we really want is to use expected_result. diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake index c6707c1..4de8e88 100644 --- a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake @@ -7,11 +7,11 @@ else() set(expected_result 0) endif() -add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${HAVE_FINAL}.cpp" +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_result}.cpp" COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp" ) -add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp") +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_result}.cpp") if (HAVE_FINAL) target_compile_features(empty PRIVATE cxx_final) endif() ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 11 10:53:31 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 11 Jan 2015 10:53:31 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1668-g2a5d1c4 Message-ID: <20150111155331.EE307A8E4D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2a5d1c4b018df139dec3a99a4fc67ac0a70111a7 (commit) via 3ad893b5c23566184bc78eafb1446c05bd39a643 (commit) via 98965fb12d0d07deb6d953624529f8b8151dce13 (commit) from b71ecfb867f90c0f29f3ad9e0636b51726419bde (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2a5d1c4b018df139dec3a99a4fc67ac0a70111a7 commit 2a5d1c4b018df139dec3a99a4fc67ac0a70111a7 Merge: b71ecfb 3ad893b Author: Stephen Kelly AuthorDate: Sun Jan 11 10:53:31 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 10:53:31 2015 -0500 Merge topic 'Xcode-clang-compile-features' into next 3ad893b5 Features: Record for historical Xcode clang versions. 98965fb1 Features: Record dialect flags for AppleClang 4.0+. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3ad893b5c23566184bc78eafb1446c05bd39a643 commit 3ad893b5c23566184bc78eafb1446c05bd39a643 Author: Stephen Kelly AuthorDate: Fri Jan 9 20:18:26 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:52:27 2015 +0100 Features: Record for historical Xcode clang versions. diff --git a/Modules/Compiler/AppleClang-C-FeatureTests.cmake b/Modules/Compiler/AppleClang-C-FeatureTests.cmake index ec1d43f..6f3d6a7 100644 --- a/Modules/Compiler/AppleClang-C-FeatureTests.cmake +++ b/Modules/Compiler/AppleClang-C-FeatureTests.cmake @@ -1,5 +1,5 @@ -set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 501") +set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 400") set(AppleClang_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L") set(_cmake_feature_test_c_static_assert "${AppleClang_C11}") diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index b7c1aca..0665745 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -19,7 +19,7 @@ macro(cmake_record_c_compile_features) record_compiler_features(C "${std_version}" ${list}) endmacro() - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) _get_appleclang_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_appleclang_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake b/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake index 78bdb72..f67082c 100644 --- a/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake +++ b/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake @@ -3,7 +3,28 @@ # Generic reference: http://clang.llvm.org/cxx_status.html # http://clang.llvm.org/docs/LanguageExtensions.html -set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 501") +# Note: CXX compiler in Xcode 4.3 does not set __apple_build_version__ and so is +# not recognized as AppleClang. +# Xcode_43 - Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn) +# Xcode_44 - Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn) +# Xcode_45 - Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn) +# Xcode_46 - Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) +# Xcode_50 - Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) +# Xcode_51 - Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn) +# Xcode_60 - Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) +# Xcode_61 - Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) + +# There is some non-correspondance. __has_feature(cxx_user_literals) is +# false for AppleClang 4.0 and 4.1, although it is reported as +# supported in the reference link for Clang 3.1. The compiler does not pass +# the CompileFeatures/cxx_user_literals.cpp test. +# cxx_attributes is listed as not supported until Clang 3.3. It works without +# warning with AppleClang 5.0, but issues a gcc-compat warning for +# AppleClang 4.0-4.2. +# cxx_alignof and cxx_alignas tests work for early AppleClang versions, though +# they are listed as supported for Clang 3.3 and later. + +set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 400") include("${CMAKE_CURRENT_LIST_DIR}/Clang-CXX-TestableFeatures.cmake") @@ -16,16 +37,16 @@ set(_cmake_feature_test_cxx_digit_separators "${AppleClang51_CXX14}") # http://llvm.org/bugs/show_bug.cgi?id=19674 set(_cmake_feature_test_cxx_generic_lambdas "${AppleClang51_CXX14}") -set(AppleClang51_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") -set(_cmake_feature_test_cxx_enum_forward_declarations "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_sizeof_member "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_extended_friend_declarations "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_extern_templates "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_func_identifier "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_inline_namespaces "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_long_long_type "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_right_angle_brackets "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_variadic_macros "${AppleClang51_CXX11}") +set(AppleClang40_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_enum_forward_declarations "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_sizeof_member "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_extern_templates "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_func_identifier "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_inline_namespaces "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_long_long_type "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_right_angle_brackets "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_variadic_macros "${AppleClang40_CXX11}") set(AppleClang_CXX98 "${_cmake_oldestSupported} && __cplusplus >= 199711L") set(_cmake_feature_test_cxx_template_template_parameters "${AppleClang_CXX98}") diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index e56f55b..a508623 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -26,8 +26,11 @@ macro(cmake_record_cxx_compile_features) record_compiler_features(CXX "${std_version}" ${list}) endmacro() - if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) - _get_appleclang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) + set(_result 0) + if(CMAKE_CXX14_STANDARD_COMPILE_OPTION) + _get_appleclang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) + endif() if (_result EQUAL 0) _get_appleclang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index b164f06..4308508 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -31,6 +31,26 @@ foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() +if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) + # AppleClang prior to 5.1 does not set any preprocessor define to distinguish + # c++1y from c++11, so CMake does not support c++1y features before AppleClang 5.1. + list(REMOVE_ITEM CXX_non_features + cxx_attribute_deprecated + cxx_binary_literals + ) +endif() + +if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2) + # AppleClang prior to 4.1 reports false for __has_feature(cxx_local_type_template_args) + # and __has_feature(cxx_unrestricted_unions) but it happens to pass these tests. + list(REMOVE_ITEM CXX_non_features + cxx_local_type_template_args + cxx_unrestricted_unions + ) +endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) # The cxx_alignof feature happens to work (for *this* testcase) with http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98965fb12d0d07deb6d953624529f8b8151dce13 commit 98965fb12d0d07deb6d953624529f8b8151dce13 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:38:10 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 16:52:05 2015 +0100 Features: Record dialect flags for AppleClang 4.0+. diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index 10edc74..b7c1aca 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -1,7 +1,7 @@ include(Compiler/Clang) __compiler_clang(C) -if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1) +if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index eb97f88..e56f55b 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -5,13 +5,16 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") endif() -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98") set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") +endif() +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) + # AppleClang 5.0 knows this flag, but does not set a __cplusplus macro greater than 201103L set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y") set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y") endif() ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/AppleClang-C-FeatureTests.cmake | 2 +- Modules/Compiler/AppleClang-C.cmake | 4 +- Modules/Compiler/AppleClang-CXX-FeatureTests.cmake | 43 +++++++++++++++----- Modules/Compiler/AppleClang-CXX.cmake | 12 ++++-- Tests/CompileFeatures/CMakeLists.txt | 20 +++++++++ 5 files changed, 64 insertions(+), 17 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 11 11:03:38 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 11 Jan 2015 11:03:38 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1677-ga7fe9e7 Message-ID: <20150111160338.E88D2A9A60@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a7fe9e746dbf363a692ab285cf15e0aad74c44dd (commit) via 3660d063bc005aa13e7ee4836aef842a91cc87f1 (commit) via 5c28495fba56ea488a5a1df323f3c89ff7d28a7e (commit) via ac3d38292035a470affdd0ca9df88992916bfeee (commit) via 36b8de563cab1933fb332c42bca68125dd13f35a (commit) via 6162c9194bfb416ac43f52f281db442a4d484aff (commit) via 238dd2fbab1bd4fb53a25dcd07c1ee41da46d451 (commit) via 2f7ef7e38d7aad93f5d25efb4fd7f61468cf06a2 (commit) via 4c69ec6f121f303113d2f8a158d2e53b7d93d6b4 (commit) from 2a5d1c4b018df139dec3a99a4fc67ac0a70111a7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a7fe9e746dbf363a692ab285cf15e0aad74c44dd commit a7fe9e746dbf363a692ab285cf15e0aad74c44dd Merge: 2a5d1c4 3660d06 Author: Stephen Kelly AuthorDate: Sun Jan 11 11:03:37 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 11:03:37 2015 -0500 Merge topic 'sun-better-stdlib' into next 3660d063 cmTarget: Use insert instead of std::copy. 5c28495f Help: Remove documented restriction on template use. ac3d3829 Help: Remove documented restriction on find in conditions. 36b8de56 Help: Remove documented restriction on insert APIs. 6162c919 Use two-iterator std::set::insert where appropriate. 238dd2fb Use insert instead of a loop in some cases. 2f7ef7e3 Revert "Misc. fixes for the Oracle / Sun compiler." 4c69ec6f SolarisStudio: Use alternative standard library to build CMake. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3660d063bc005aa13e7ee4836aef842a91cc87f1 commit 3660d063bc005aa13e7ee4836aef842a91cc87f1 Author: Stephen Kelly AuthorDate: Thu Jan 1 13:35:18 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:00:56 2015 +0100 cmTarget: Use insert instead of std::copy. insert can reserve() memory in the container, and this is more-consistent with the rest of CMake now. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index c8fbf61..d454e89 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -6058,8 +6058,8 @@ cmTargetInternals::ComputeLinkInterfaceLibraries( // The link implementation is the default link interface. cmTarget::LinkImplementationLibraries const* impl = thisTarget->GetLinkImplementationLibrariesInternal(config, headTarget); - std::copy(impl->Libraries.begin(), impl->Libraries.end(), - std::back_inserter(iface.Libraries)); + iface.Libraries.insert(iface.Libraries.end(), + impl->Libraries.begin(), impl->Libraries.end()); if(thisTarget->PolicyStatusCMP0022 == cmPolicies::WARN && !this->PolicyWarnedCMP0022 && !usage_requirements_only) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c28495fba56ea488a5a1df323f3c89ff7d28a7e commit 5c28495fba56ea488a5a1df323f3c89ff7d28a7e Author: Stephen Kelly AuthorDate: Wed Dec 31 14:38:43 2014 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:00:56 2015 +0100 Help: Remove documented restriction on template use. diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index a7abb4e..65b3a72 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -64,12 +64,6 @@ assigning the result of ``.size()`` on a container for example, the result should be assigned to ``size_t`` not to ``std::size_t``, ``unsigned int`` or similar types. -Templates ---------- - -Some template code is permitted, but with some limitations. Member templates -may not be used, and template friends may not be used. - Adding Compile Features ======================= http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac3d38292035a470affdd0ca9df88992916bfeee commit ac3d38292035a470affdd0ca9df88992916bfeee Author: Stephen Kelly AuthorDate: Wed Dec 31 14:37:44 2014 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:00:56 2015 +0100 Help: Remove documented restriction on find in conditions. The necessary conversion is supported by all CMake host compilers. diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index 2f98b02..a7abb4e 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -21,32 +21,6 @@ CMake is required to build with ancient C++ compilers and standard library implementations. Some common C++ constructs may not be used in CMake in order to build with such toolchains. -std::set const iterators ------------------------- - -The ``find()`` member function of a ``const`` ``std::set`` instance may not be -used in a comparison with the iterator returned by ``end()``: - -.. code-block:: c++ - - const std::set& someSet = getSet(); - if (someSet.find("needle") == someSet.end()) // Wrong - { - // ... - } - -The return value of ``find()`` must be assigned to an intermediate -``const_iterator`` for comparison: - -.. code-block:: c++ - - const std::set& someSet; - const std::set::const_iterator i = someSet.find("needle"); - if (i != propSet.end()) // Ok - { - // ... - } - std::auto_ptr ------------- diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index 75a84cb..a660bd4 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -66,9 +66,7 @@ cmGeneratorExpressionDAGChecker::Initialize() if (it != top->Seen.end()) { const std::set &propSet = it->second; - const std::set::const_iterator i - = propSet.find(this->Property); - if (i != propSet.end()) + if (propSet.find(this->Property) != propSet.end()) { this->CheckResult = ALREADY_SEEN; return; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=36b8de563cab1933fb332c42bca68125dd13f35a commit 36b8de563cab1933fb332c42bca68125dd13f35a Author: Stephen Kelly AuthorDate: Tue Nov 25 16:33:00 2014 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:00:55 2015 +0100 Help: Remove documented restriction on insert APIs. diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index 682ce47..2f98b02 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -54,53 +54,6 @@ Some implementations have a ``std::auto_ptr`` which can not be used as a return value from a function. ``std::auto_ptr`` may not be used. Use ``cmsys::auto_ptr`` instead. -std::vector::insert and std::set --------------------------------- - -Use of ``std::vector::insert`` with an iterator whose ``element_type`` requires -conversion is not allowed: - -.. code-block:: c++ - - std::set theSet; - std::vector theVector; - theVector.insert(theVector.end(), theSet.begin(), theSet.end()); // Wrong - -A loop must be used instead: - -.. code-block:: c++ - - std::set theSet; - std::vector theVector; - for(std::set::iterator li = theSet.begin(); - li != theSet.end(); ++li) - { - theVector.push_back(*li); - } - -std::set::insert ----------------- - -Use of ``std::set::insert`` is not allowed with any source container: - -.. code-block:: c++ - - std::set theSet; - theSet.insert(targets.begin(), targets.end()); // Wrong - -A loop must be used instead: - -.. code-block:: c++ - - ConstIterator it = targets.begin(); - const ConstIterator end = targets.end(); - for ( ; it != end; ++it) - { - theSet.insert(*it); - } - -.. SunCC 5.9 - Template Parameter Defaults --------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6162c9194bfb416ac43f52f281db442a4d484aff commit 6162c9194bfb416ac43f52f281db442a4d484aff Author: Stephen Kelly AuthorDate: Tue Nov 25 16:33:00 2014 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:00:55 2015 +0100 Use two-iterator std::set::insert where appropriate. diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 7e00027..59c38e9 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -1150,12 +1150,7 @@ void cmCPackWIXGenerator::CollectExtensions( std::vector list; cmSystemTools::ExpandListArgument(variableContent, list); - - for(std::vector::const_iterator i = list.begin(); - i != list.end(); ++i) - { - extensions.insert(*i); - } + extensions.insert(list.begin(), list.end()); } void cmCPackWIXGenerator::AddCustomFlags( diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index a1d770b..fb3e367 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -2498,11 +2498,7 @@ void cmCTestCoverageHandler::LoadLabels(const char* dir) // Label the source with the target labels. LabelSet& labelSet = this->SourceLabels[source]; - for(std::vector::const_iterator li = targetLabels.begin(); - li != targetLabels.end(); ++li) - { - labelSet.insert(*li); - } + labelSet.insert(targetLabels.begin(), targetLabels.end()); } } } diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 97637ed..b83ebe0 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -162,12 +162,9 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test) //--------------------------------------------------------- void cmCTestMultiProcessHandler::LockResources(int index) { - for(std::set::iterator i = - this->Properties[index]->LockedResources.begin(); - i != this->Properties[index]->LockedResources.end(); ++i) - { - this->LockedResources.insert(*i); - } + this->LockedResources.insert( + this->Properties[index]->LockedResources.begin(), + this->Properties[index]->LockedResources.end()); } //--------------------------------------------------------- @@ -499,11 +496,7 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList() i != previousSet.end(); ++i) { TestSet const& dependencies = this->Tests[*i]; - for(TestSet::const_iterator j = dependencies.begin(); - j != dependencies.end(); ++j) - { - currentSet.insert(*j); - } + currentSet.insert(dependencies.begin(), dependencies.end()); } for(TestSet::const_iterator i = currentSet.begin(); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 6aa1c2b..fea94ba 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1160,11 +1160,7 @@ int cmCTestSubmitHandler::ProcessHandler() { // Submit the explicitly selected files: // - cmCTest::SetOfStrings::const_iterator it; - for (it = this->Files.begin(); it != this->Files.end(); ++it) - { - files.insert(*it); - } + files.insert(this->Files.begin(), this->Files.end()); } // Add to the list of files to submit from any selected, existing parts: @@ -1219,11 +1215,7 @@ int cmCTestSubmitHandler::ProcessHandler() // Submit files from this part. std::vector const& pfiles = this->CTest->GetSubmitFiles(p); - for(std::vector::const_iterator pi = pfiles.begin(); - pi != pfiles.end(); ++pi) - { - files.insert(*pi); - } + files.insert(pfiles.begin(), pfiles.end()); } if ( ofs ) @@ -1503,9 +1495,5 @@ void cmCTestSubmitHandler::SelectParts(std::set const& parts) //---------------------------------------------------------------------------- void cmCTestSubmitHandler::SelectFiles(cmCTest::SetOfStrings const& files) { - cmCTest::SetOfStrings::const_iterator it; - for (it = files.begin(); it != files.end(); ++it) - { - this->Files.insert(*it); - } + this->Files.insert(files.begin(), files.end()); } diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 38ce3dc..0d8d46e 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2163,11 +2163,7 @@ bool cmCTestTestHandler::SetTestsProperties( std::vector lval; cmSystemTools::ExpandListArgument(val, lval); - for(std::vector::iterator f = lval.begin(); - f != lval.end(); ++f) - { - rtit->LockedResources.insert(*f); - } + rtit->LockedResources.insert(lval.begin(), lval.end()); } if ( key == "TIMEOUT" ) { diff --git a/Source/cmCommandArgumentsHelper.cxx b/Source/cmCommandArgumentsHelper.cxx index 1d5fc07..1a2efc6 100644 --- a/Source/cmCommandArgumentsHelper.cxx +++ b/Source/cmCommandArgumentsHelper.cxx @@ -50,13 +50,8 @@ void cmCommandArgument::FollowsGroup(const cmCommandArgumentGroup* group) if (group!=0) { this->ArgumentsBeforeEmpty = false; - for(std::vector::const_iterator - argIt= group->ContainedArguments.begin(); - argIt != group->ContainedArguments.end(); - ++argIt) - { - this->ArgumentsBefore.insert(*argIt); - } + this->ArgumentsBefore.insert(group->ContainedArguments.begin(), + group->ContainedArguments.end()); } } diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index f4fa5c6..7171d6b 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -408,11 +408,7 @@ cmComputeLinkInformation // Construct a mask to not bother with this behavior for link // directories already specified by the user. std::vector const& dirs = this->Target->GetLinkDirectories(); - for(std::vector::const_iterator di = dirs.begin(); - di != dirs.end(); ++di) - { - this->OldLinkDirMask.insert(*di); - } + this->OldLinkDirMask.insert(dirs.begin(), dirs.end()); } } @@ -1420,11 +1416,8 @@ void cmComputeLinkInformation::ComputeFrameworkInfo() cmSystemTools::ExpandListArgument(implicitDirs, implicitDirVec); } - for(std::vector::const_iterator i = implicitDirVec.begin(); - i != implicitDirVec.end(); ++i) - { - this->FrameworkPathsEmmitted.insert(*i); - } + this->FrameworkPathsEmmitted.insert(implicitDirVec.begin(), + implicitDirVec.end()); // Regular expression to extract a framework path and name. this->SplitFramework.compile("(.*)/(.*)\\.framework$"); @@ -1694,11 +1687,7 @@ void cmComputeLinkInformation::LoadImplicitLinkInfo() } // Store implicit link directories. - for(std::vector::const_iterator i = implicitDirVec.begin(); - i != implicitDirVec.end(); ++i) - { - this->ImplicitLinkDirs.insert(*i); - } + this->ImplicitLinkDirs.insert(implicitDirVec.begin(), implicitDirVec.end()); // Get language-specific implicit libraries. std::vector implicitLibVec; diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index a1fc268..a8711eb 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -125,11 +125,7 @@ bool cmDependsC::WriteDependencies(const std::set& sources, this->ValidDeps->find(obj); if (tmpIt!= this->ValidDeps->end()) { - for(DependencyVector::const_iterator i=tmpIt->second.begin(); - i != tmpIt->second.end(); ++i) - { - dependencies.insert(*i); - } + dependencies.insert(tmpIt->second.begin(), tmpIt->second.end()); haveDeps = true; } } diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 4082d24..d9818ce 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -319,17 +319,13 @@ void cmDependsFortran::LocateModules() infoI != objInfo.end(); ++infoI) { cmDependsFortranSourceInfo const& info = infoI->second; - for(std::set::const_iterator i = info.Provides.begin(); - i != info.Provides.end(); ++i) - { - // Include this module in the set provided by this target. - this->Internal->TargetProvides.insert(*i); - } + // Include this module in the set provided by this target. + this->Internal->TargetProvides.insert(info.Provides.begin(), + info.Provides.end()); for(std::set::const_iterator i = info.Requires.begin(); i != info.Requires.end(); ++i) { - // Include this module in the set required by this target. this->Internal->TargetRequires[*i] = ""; } } diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 1f39d7a..2b81d60 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -456,11 +456,7 @@ void getPropertyContents(cmTarget const* tgt, const std::string& prop, } std::vector content; cmSystemTools::ExpandListArgument(p, content); - for (std::vector::const_iterator ci = content.begin(); - ci != content.end(); ++ci) - { - ifaceProperties.insert(*ci); - } + ifaceProperties.insert(content.begin(), content.end()); } //---------------------------------------------------------------------------- diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 79d7bca..69857ef 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -615,12 +615,8 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, std::vector includes; target->GetMakefile()->GetLocalGenerator()-> GetIncludeDirectories(includes, gtgt, "C", buildType); - for(std::vector::const_iterator dirIt=includes.begin(); - dirIt != includes.end(); - ++dirIt) - { - uniqIncludeDirs.insert(*dirIt); - } + + uniqIncludeDirs.insert(includes.begin(), includes.end()); std::string systemIncludeDirs = makefile->GetSafeDefinition( "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS"); @@ -628,12 +624,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, { std::vector dirs; cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs); - for(std::vector::const_iterator dirIt=dirs.begin(); - dirIt != dirs.end(); - ++dirIt) - { - uniqIncludeDirs.insert(*dirIt); - } + uniqIncludeDirs.insert(dirs.begin(), dirs.end()); } systemIncludeDirs = makefile->GetSafeDefinition( @@ -642,12 +633,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, { std::vector dirs; cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs); - for(std::vector::const_iterator dirIt=dirs.begin(); - dirIt != dirs.end(); - ++dirIt) - { - uniqIncludeDirs.insert(*dirIt); - } + uniqIncludeDirs.insert(dirs.begin(), dirs.end()); } for(std::set::const_iterator dirIt=uniqIncludeDirs.begin(); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 435452c..56213e9 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -818,11 +818,7 @@ cmTargetTraceDependencies = ge.Parse(*cli); cge->Evaluate(this->Makefile, "", true); std::set geTargets = cge->GetTargets(); - for(std::set::const_iterator it = geTargets.begin(); - it != geTargets.end(); ++it) - { - targets.insert(*it); - } + targets.insert(geTargets.begin(), geTargets.end()); } } diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 6f0586b..07ea942 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1021,12 +1021,9 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os) } //insert outputs from all WirteBuild commands - for(std::set::iterator i = this->CombinedBuildOutputs.begin(); - i != this->CombinedBuildOutputs.end(); ++i) - { - //these paths have already be encoded when added to CombinedBuildOutputs - knownDependencies.insert(*i); - } + //these paths have already be encoded when added to CombinedBuildOutputs + knownDependencies.insert(this->CombinedBuildOutputs.begin(), + this->CombinedBuildOutputs.end()); //after we have combined the data into knownDependencies we have no need //to keep this data around diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 2dab23c..320a1f4 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -845,22 +845,14 @@ cmGlobalVisualStudioGenerator::TargetCompare cmGlobalVisualStudioGenerator::OrderedTargetDependSet ::OrderedTargetDependSet(TargetDependSet const& targets) { - for(TargetDependSet::const_iterator ti = - targets.begin(); ti != targets.end(); ++ti) - { - this->insert(*ti); - } + this->insert(targets.begin(), targets.end()); } //---------------------------------------------------------------------------- cmGlobalVisualStudioGenerator::OrderedTargetDependSet ::OrderedTargetDependSet(TargetSet const& targets) { - for(TargetSet::const_iterator ti = targets.begin(); - ti != targets.end(); ++ti) - { - this->insert(*ti); - } + this->insert(targets.begin(), targets.end()); } std::string cmGlobalVisualStudioGenerator::ExpandCFGIntDir( diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index df5508e..f37d8bc 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -71,11 +71,7 @@ bool cmIncludeDirectoryCommand } if (system) { - for (std::vector::const_iterator li = includes.begin(); - li != includes.end(); ++li) - { - systemIncludes.insert(*li); - } + systemIncludes.insert(includes.begin(), includes.end()); } } std::reverse(beforeIncludes.begin(), beforeIncludes.end()); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 25d5881..25d23f7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1822,11 +1822,7 @@ void cmMakefile::AddIncludeDirectories(const std::vector &incs, void cmMakefile::AddSystemIncludeDirectories(const std::set &incs) { - for(std::set::const_iterator li = incs.begin(); - li != incs.end(); ++li) - { - this->SystemIncludeDirectories.insert(*li); - } + this->SystemIncludeDirectories.insert(incs.begin(), incs.end()); for (cmTargets::iterator l = this->Targets.begin(); l != this->Targets.end(); ++l) @@ -4556,16 +4552,8 @@ void cmMakefile::PopScope() this->Internal->VarInitStack.pop(); this->Internal->VarUsageStack.pop(); // Push initialization and usage up to the parent scope. - it = init.begin(); - for (; it != init.end(); ++it) - { - this->Internal->VarInitStack.top().insert(*it); - } - it = usage.begin(); - for (; it != usage.end(); ++it) - { - this->Internal->VarUsageStack.top().insert(*it); - } + this->Internal->VarInitStack.top().insert(init.begin(), init.end()); + this->Internal->VarUsageStack.top().insert(usage.begin(), usage.end()); } void cmMakefile::RaiseScope(const std::string& var, const char *varDef) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 443162a..ded85c3 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -899,12 +899,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target, std::set skipped; std::vector skipVec; cmSystemTools::ExpandListArgument(this->SkipUic, skipVec); - - for (std::vector::const_iterator li = skipVec.begin(); - li != skipVec.end(); ++li) - { - skipped.insert(*li); - } + skipped.insert(skipVec.begin(), skipVec.end()); makefile->AddDefinition("_skip_uic", cmLocalGenerator::EscapeForCMake(this->SkipUic).c_str()); @@ -1622,12 +1617,7 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) std::vector headerFilesVec; cmSystemTools::ExpandListArgument(this->Headers, headerFilesVec); - for (std::vector::const_iterator it = headerFilesVec.begin(); - it != headerFilesVec.end(); - ++it) - { - headerFiles.insert(*it); - } + headerFiles.insert(headerFilesVec.begin(), headerFilesVec.end()); // key = moc source filepath, value = moc output filename std::map notIncludedMocs; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 1b39804..c8fbf61 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -424,12 +424,8 @@ void cmTarget::SetMakefile(cmMakefile* mf) const std::set parentSystemIncludes = this->Makefile->GetSystemIncludeDirectories(); - for (std::set::const_iterator it - = parentSystemIncludes.begin(); - it != parentSystemIncludes.end(); ++it) - { - this->SystemIncludeDirectories.insert(*it); - } + this->SystemIncludeDirectories.insert(parentSystemIncludes.begin(), + parentSystemIncludes.end()); const std::vector parentOptions = this->Makefile->GetCompileOptionsEntries(); @@ -1397,22 +1393,14 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, void cmTarget::AddSystemIncludeDirectories(const std::set &incs) { - for(std::set::const_iterator li = incs.begin(); - li != incs.end(); ++li) - { - this->SystemIncludeDirectories.insert(*li); - } + this->SystemIncludeDirectories.insert(incs.begin(), incs.end()); } //---------------------------------------------------------------------------- void cmTarget::AddSystemIncludeDirectories(const std::vector &incs) { - for(std::vector::const_iterator li = incs.begin(); - li != incs.end(); ++li) - { - this->SystemIncludeDirectories.insert(*li); - } + this->SystemIncludeDirectories.insert(incs.begin(), incs.end()); } #if defined(_WIN32) && !defined(__CYGWIN__) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=238dd2fbab1bd4fb53a25dcd07c1ee41da46d451 commit 238dd2fbab1bd4fb53a25dcd07c1ee41da46d451 Author: Stephen Kelly AuthorDate: Sat Nov 22 11:00:45 2014 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:00:55 2015 +0100 Use insert instead of a loop in some cases. Limit this change to inserting into a vector from a vector. A follow up change can use insert for inserting into a set. diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index d226a6c..5e7d764 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -1094,11 +1094,8 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length, { // Create a contiguous array for the line this->CurrentProcessingLine.clear(); - t_BuildProcessingQueueType::iterator cit; - for ( cit = queue->begin(); cit != it; ++cit ) - { - this->CurrentProcessingLine.push_back(*cit); - } + this->CurrentProcessingLine.insert(this->CurrentProcessingLine.end(), + queue->begin(), queue->end()); this->CurrentProcessingLine.push_back(0); const char* line = &*this->CurrentProcessingLine.begin(); diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 4c89caa..97637ed 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -526,11 +526,8 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList() TestList sortedCopy; - for(TestSet::const_iterator j = currentSet.begin(); - j != currentSet.end(); ++j) - { - sortedCopy.push_back(*j); - } + sortedCopy.insert(sortedCopy.end(), + currentSet.begin(), currentSet.end()); std::stable_sort(sortedCopy.begin(), sortedCopy.end(), comp); diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index 0bb1a99..52b98d7 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -349,11 +349,7 @@ void cmCTestP4::SetP4Options(std::vector &CommandOptions) std::vector args = cmSystemTools::ParseArguments(opts.c_str()); - for(std::vector::const_iterator ai = args.begin(); - ai != args.end(); ++ai) - { - P4Options.push_back(*ai); - } + P4Options.insert(P4Options.end(), args.begin(), args.end()); } CommandOptions.clear(); diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 07a994d..4aa8d04 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -74,13 +74,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() std::vector notesFiles; cmCTest::VectorOfStrings newNotesFiles; cmSystemTools::ExpandListArgument(notesFilesVariable,notesFiles); - std::vector::iterator it; - for ( it = notesFiles.begin(); - it != notesFiles.end(); - ++ it ) - { - newNotesFiles.push_back(*it); - } + newNotesFiles.insert(newNotesFiles.end(), + notesFiles.begin(), notesFiles.end()); this->CTest->GenerateNotesFile(newNotesFiles); } @@ -91,13 +86,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() std::vector extraFiles; cmCTest::VectorOfStrings newExtraFiles; cmSystemTools::ExpandListArgument(extraFilesVariable,extraFiles); - std::vector::iterator it; - for ( it = extraFiles.begin(); - it != extraFiles.end(); - ++ it ) - { - newExtraFiles.push_back(*it); - } + newExtraFiles.insert(newExtraFiles.end(), + extraFiles.begin(), extraFiles.end()); if ( !this->CTest->SubmitExtraFiles(newExtraFiles)) { this->SetError("problem submitting extra files."); diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx index 2531a1a..dc3b4c2 100644 --- a/Source/cmAddTestCommand.cxx +++ b/Source/cmAddTestCommand.cxx @@ -36,11 +36,7 @@ bool cmAddTestCommand // Collect the command with arguments. std::vector command; - for(std::vector::const_iterator it = args.begin() + 1; - it != args.end(); ++it) - { - command.push_back(*it); - } + command.insert(command.end(), args.begin() + 1, args.end()); // Create the test but add a generator only the first time it is // seen. This preserves behavior from before test generators. diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index aba26de..7a601e2 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -53,10 +53,7 @@ bool cmConditionEvaluator::IsTrue( cmArgumentList newArgs; // copy to the list structure - for(unsigned int i = 0; i < args.size(); ++i) - { - newArgs.push_back(args[i]); - } + newArgs.insert(newArgs.end(), args.begin(), args.end()); // now loop through the arguments and see if we can reduce any of them // we do this multiple times. Once for each level of precedence @@ -411,10 +408,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList &newArgs, // copy to the list structure cmArgumentList::iterator argP1 = arg; argP1++; - for(; argP1 != argClose; argP1++) - { - newArgs2.push_back(*argP1); - } + newArgs2.insert(newArgs2.end(), argP1, argClose); newArgs2.pop_back(); // now recursively invoke IsTrue to handle the values inside the // parenthetical expression diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx index 2afb029..015825d 100644 --- a/Source/cmCustomCommand.cxx +++ b/Source/cmCustomCommand.cxx @@ -131,21 +131,14 @@ const char* cmCustomCommand::GetComment() const //---------------------------------------------------------------------------- void cmCustomCommand::AppendCommands(const cmCustomCommandLines& commandLines) { - for(cmCustomCommandLines::const_iterator i=commandLines.begin(); - i != commandLines.end(); ++i) - { - this->CommandLines.push_back(*i); - } + this->CommandLines.insert(this->CommandLines.end(), + commandLines.begin(), commandLines.end()); } //---------------------------------------------------------------------------- void cmCustomCommand::AppendDepends(const std::vector& depends) { - for(std::vector::const_iterator i=depends.begin(); - i != depends.end(); ++i) - { - this->Depends.push_back(*i); - } + this->Depends.insert(this->Depends.end(), depends.begin(), depends.end()); } //---------------------------------------------------------------------------- diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index beb6dde..013724e 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -184,10 +184,8 @@ bool cmFindBase::ParseArguments(std::vector const& argsIn) std::vector shortArgs = this->Names; this->Names.clear(); // clear out any values in Names this->Names.push_back(shortArgs[0]); - for(unsigned int j = 1; j < shortArgs.size(); ++j) - { - this->UserGuessArgs.push_back(shortArgs[j]); - } + this->UserGuessArgs.insert(this->UserGuessArgs.end(), + shortArgs.begin() + 1, shortArgs.end()); } this->ExpandPaths(); diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 3580374..488538f 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -271,11 +271,7 @@ bool cmFunctionCommand // create a function blocker cmFunctionFunctionBlocker *f = new cmFunctionFunctionBlocker(); - for(std::vector::const_iterator j = args.begin(); - j != args.end(); ++j) - { - f->Args.push_back(*j); - } + f->Args.insert(f->Args.end(), args.begin(), args.end()); this->Makefile->AddFunctionBlocker(f); return true; } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 2b531e2..435452c 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -489,11 +489,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, unique.insert(*li); } result.clear(); - for(std::set::iterator li = unique.begin(); - li != unique.end(); ++li) - { - result.push_back(*li); - } + result.insert(result.end(), unique.begin(), unique.end()); IncludeCacheType::value_type entry(config_upper, result); iter = this->SystemIncludesCache.insert(entry).first; diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index f106e1a..a007693 100644 --- a/Source/cmInstallFilesCommand.cxx +++ b/Source/cmInstallFilesCommand.cxx @@ -47,11 +47,8 @@ bool cmInstallFilesCommand else { this->IsFilesForm = false; - std::vector::const_iterator s = args.begin(); - for (++s;s != args.end(); ++s) - { - this->FinalArgs.push_back(*s); - } + this->FinalArgs.insert(this->FinalArgs.end(), + args.begin() + 1, args.end()); } this->Makefile->GetLocalGenerator()->GetGlobalGenerator() diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index 0405769..cc223ab 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx @@ -27,11 +27,7 @@ bool cmInstallProgramsCommand this->Destination = args[0]; - std::vector::const_iterator s = args.begin(); - for (++s;s != args.end(); ++s) - { - this->FinalArgs.push_back(*s); - } + this->FinalArgs.insert(this->FinalArgs.end(), args.begin() + 1, args.end()); this->Makefile->GetLocalGenerator()->GetGlobalGenerator() ->AddInstallComponent(this->Makefile->GetSafeDefinition( diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2de6c93..a4185ad 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -634,11 +634,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname, // Parse the string to get the custom command line. cmCustomCommandLine commandLine; std::vector cmd = cmSystemTools::ParseArguments(i->c_str()); - for(std::vector::iterator a = cmd.begin(); - a != cmd.end(); ++a) - { - commandLine.push_back(*a); - } + commandLine.insert(commandLine.end(), cmd.begin(), cmd.end()); // Store this command line. commandLines.push_back(commandLine); @@ -745,11 +741,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang, // Parse the string to get the custom command line. cmCustomCommandLine commandLine; std::vector cmd = cmSystemTools::ParseArguments(i->c_str()); - for(std::vector::iterator a = cmd.begin(); - a != cmd.end(); ++a) - { - commandLine.push_back(*a); - } + commandLine.insert(commandLine.end(), cmd.begin(), cmd.end()); // Store this command line. commandLines.push_back(commandLine); diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 812ded3..96beb1c 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1856,13 +1856,8 @@ void cmLocalUnixMakefileGenerator3 { text = "Running external command ..."; } - std::set::const_iterator dit; - for ( dit = glIt->second.GetUtilities().begin(); - dit != glIt->second.GetUtilities().end(); - ++ dit ) - { - depends.push_back(*dit); - } + depends.insert(depends.end(), glIt->second.GetUtilities().begin(), + glIt->second.GetUtilities().end()); this->AppendEcho(commands, text, cmLocalUnixMakefileGenerator3::EchoGlobal); diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index ae81c58..d399313 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -328,11 +328,7 @@ bool cmMacroCommand::InitialPass(std::vector const& args, // create a function blocker cmMacroFunctionBlocker *f = new cmMacroFunctionBlocker(); - for(std::vector::const_iterator j = args.begin(); - j != args.end(); ++j) - { - f->Args.push_back(*j); - } + f->Args.insert(f->Args.end(), args.begin(), args.end()); this->Makefile->AddFunctionBlocker(f); return true; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 20dae5a..25d5881 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2567,12 +2567,7 @@ std::vector cmMakefile } std::vector res; - - std::set::iterator fit; - for ( fit = definitions.begin(); fit != definitions.end(); fit ++ ) - { - res.push_back(*fit); - } + res.insert(res.end(), definitions.begin(), definitions.end()); return res; } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index cbf8573..040a7d6 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -759,13 +759,10 @@ cmMakefileTargetGenerator if(const char* extra_outputs_str = source.GetProperty("OBJECT_OUTPUTS")) { + // Register these as extra files to clean. cmSystemTools::ExpandListArgument(extra_outputs_str, outputs); - for(std::vector::const_iterator eoi = outputs.begin()+1; - eoi != outputs.end(); ++eoi) - { - // Register this as an extra file to clean. - this->CleanFiles.push_back(*eoi); - } + this->CleanFiles.insert(this->CleanFiles.end(), + outputs.begin() + 1, outputs.end()); } // Write the rule. @@ -1174,11 +1171,7 @@ cmMakefileTargetGenerator { cmCustomCommandGenerator ccg(*cc, this->ConfigName, this->Makefile); const std::vector& outputs = ccg.GetOutputs(); - for(std::vector::const_iterator o = outputs.begin(); - o != outputs.end(); ++o) - { - depends.push_back(*o); - } + depends.insert(depends.end(), outputs.begin(), outputs.end()); } } } @@ -1462,11 +1455,8 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule( } // Make sure the extra files are built. - for(std::set::const_iterator i = this->ExtraFiles.begin(); - i != this->ExtraFiles.end(); ++i) - { - depends.push_back(*i); - } + depends.insert(depends.end(), + this->ExtraFiles.begin(), this->ExtraFiles.end()); } // Write the driver rule. @@ -1553,11 +1543,7 @@ void cmMakefileTargetGenerator if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg)) { std::vector const& libDeps = cli->GetDepends(); - for(std::vector::const_iterator j = libDeps.begin(); - j != libDeps.end(); ++j) - { - depends.push_back(*j); - } + depends.insert(depends.end(), libDeps.begin(), libDeps.end()); } } @@ -1577,12 +1563,8 @@ void cmMakefileTargetGenerator } // Add dependencies on the external object files. - for(std::vector::const_iterator obj - = this->ExternalObjects.begin(); - obj != this->ExternalObjects.end(); ++obj) - { - depends.push_back(*obj); - } + depends.insert(depends.end(), + this->ExternalObjects.begin(), this->ExternalObjects.end()); // Add a dependency on the rule file itself. this->LocalGenerator->AppendRuleDepend(depends, diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index a01a384..443162a 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -2188,24 +2188,12 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile, std::vector command; command.push_back(this->MocExecutable); - for (std::list::const_iterator it = this->MocIncludes.begin(); - it != this->MocIncludes.end(); - ++it) - { - command.push_back(*it); - } - for(std::list::const_iterator it=this->MocDefinitions.begin(); - it != this->MocDefinitions.end(); - ++it) - { - command.push_back(*it); - } - for(std::vector::const_iterator it=this->MocOptions.begin(); - it != this->MocOptions.end(); - ++it) - { - command.push_back(*it); - } + command.insert(command.end(), + this->MocIncludes.begin(), this->MocIncludes.end()); + command.insert(command.end(), + this->MocDefinitions.begin(), this->MocDefinitions.end()); + command.insert(command.end(), + this->MocOptions.begin(), this->MocOptions.end()); #ifdef _WIN32 command.push_back("-DWIN32"); #endif @@ -2277,12 +2265,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName, cmSystemTools::ExpandListArgument(optionIt->second, fileOpts); this->MergeUicOptions(opts, fileOpts, this->QtMajorVersion == "5"); } - for(std::vector::const_iterator optIt = opts.begin(); - optIt != opts.end(); - ++optIt) - { - command.push_back(*optIt); - } + command.insert(command.end(), opts.begin(), opts.end()); command.push_back("-o"); command.push_back(this->Builddir + ui_output_file); diff --git a/Source/cmRemoveCommand.cxx b/Source/cmRemoveCommand.cxx index bcb8564..d8aa1cb 100644 --- a/Source/cmRemoveCommand.cxx +++ b/Source/cmRemoveCommand.cxx @@ -39,10 +39,7 @@ bool cmRemoveCommand // check for REMOVE(VAR v1 v2 ... vn) std::vector argsExpanded; std::vector temp; - for(unsigned int j = 1; j < args.size(); ++j) - { - temp.push_back(args[j]); - } + temp.insert(temp.end(), args.begin() + 1, args.end()); cmSystemTools::ExpandList(temp, argsExpanded); // now create the new value diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1c8c387..54dafd2 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1273,11 +1273,7 @@ bool cmSystemTools::Split(const char* s, std::vector& l) { std::vector temp; bool res = Superclass::Split(s, temp); - for(std::vector::const_iterator i = temp.begin(); - i != temp.end(); ++i) - { - l.push_back(*i); - } + l.insert(l.end(), temp.begin(), temp.end()); return res; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 94a6de3..1b39804 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -6449,11 +6449,8 @@ cmTargetInternals::ComputeLinkImplementationLanguages( // Get languages used in our source files. thisTarget->GetLanguages(languages, config); // Copy the set of langauges to the link implementation. - for(std::set::iterator li = languages.begin(); - li != languages.end(); ++li) - { - impl.Languages.push_back(*li); - } + impl.Languages.insert(impl.Languages.begin(), + languages.begin(), languages.end()); } //---------------------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2f7ef7e38d7aad93f5d25efb4fd7f61468cf06a2 commit 2f7ef7e38d7aad93f5d25efb4fd7f61468cf06a2 Author: Stephen Kelly AuthorDate: Wed Dec 31 14:55:42 2014 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:00:55 2015 +0100 Revert "Misc. fixes for the Oracle / Sun compiler." This reverts commit 97b65f8156734db2adc367b27c822a5fe332d740. diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index a636d23..1fb8f30 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -266,10 +266,9 @@ cmComputeLinkDepends::Compute() // Iterate in reverse order so we can keep only the last occurrence // of a shared library. std::set emmitted; - const std::vector& cFLO = this->FinalLinkOrder; for(std::vector::const_reverse_iterator - li = cFLO.rbegin(), - le = cFLO.rend(); + li = this->FinalLinkOrder.rbegin(), + le = this->FinalLinkOrder.rend(); li != le; ++li) { int i = *li; diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 8410cda..0130006 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -80,15 +80,12 @@ void cmFindPackageCommand::AppendSearchPathGroups() PathLabel::SystemRegistry); // Create the new path objects - this->LabeledPaths.insert( - std::pair( - PathLabel::UserRegistry, cmSearchPath(this))); - this->LabeledPaths.insert( - std::pair( - PathLabel::Builds, cmSearchPath(this))); - this->LabeledPaths.insert( - std::pair( - PathLabel::SystemRegistry, cmSearchPath(this))); + this->LabeledPaths.insert(std::make_pair(PathLabel::UserRegistry, + cmSearchPath(this))); + this->LabeledPaths.insert(std::make_pair(PathLabel::Builds, + cmSearchPath(this))); + this->LabeledPaths.insert(std::make_pair(PathLabel::SystemRegistry, + cmSearchPath(this))); } //---------------------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c69ec6f121f303113d2f8a158d2e53b7d93d6b4 commit 4c69ec6f121f303113d2f8a158d2e53b7d93d6b4 Author: Stephen Kelly AuthorDate: Wed Dec 31 12:23:50 2014 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:00:55 2015 +0100 SolarisStudio: Use alternative standard library to build CMake. SolarisStudio ships a very old RogueWave standard library implementation (libCstd) and uses it by default for backward compatibility. The macros defined when building the system libCstd need to be the same as the macros defined when using it for binary compatibility reasons etc. The SolarisStudio compiler driver adds macros such as _RWSTD_NO_MEMBER_TEMPLATES and _RWSTD_NO_CLASS_PARTIAL_SPEC etc. These macros disable certain APIs in the standard library headers. Although the compiler supports the features 'member templates' and 'partial template specialization', the standard library does not provide APIs which rely on those features. This means that std::vector::insert in libCStd does not accept a pair of iterators from a different type of container, because that requires member templates, and reverse_iterator can not be constructed from a reverse_iterator because that requires partial specialization (or at least the _RWSTD_NO_CLASS_PARTIAL_SPEC define) and member templates. This causes many problems while building CMake using SolarisStudio, which have not been well understood until now. The problems are usually attributed to compiler limitations, while actually the problem is in the standard library, as in commit v3.0.0-rc1~99^2~1 (Help: Document non-use of std::set::insert., 2014-01-24) and commit 107dcac3 (Fix compilation with the Oracle / Sun compiler (#15318), 2014-12-12). SolarisStudio 12.3 and earlier also ships a version of stlport which may be used instead of libCstd by specifying -library=stlport4 https://docs.oracle.com/cd/E18659_01/html/821-1383/bkakg.html SolarisStudio 12.4 ships a version of libstdc++ from GCC 4.8.2 which may be used by specifying -std=c++03 or -std=c++11 etc http://docs.oracle.com/cd/E37069_01/html/E37075/bkamw.html#OSSCPgnaof Use these more-capable standard library implementations when building cmake. This will allow more use of 'normal' C++ (such as std::vector::insert), and cause fewer surprises resulting from dashboards using SolarisStudio. Because cmake is not a library linked against by 3rd parties and does not have external dependencies, issues related to mixing code using libCStd and libstdc++ do not apply. diff --git a/CompileFlags.cmake b/CompileFlags.cmake index e7beb3f..b6cc783 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -75,6 +75,14 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc") endif() endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4") + endif() +endif() + # use the ansi CXX compile flag for building cmake if (CMAKE_ANSI_CXXFLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") diff --git a/bootstrap b/bootstrap index fe051e1..3574973 100755 --- a/bootstrap +++ b/bootstrap @@ -1154,6 +1154,35 @@ if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then cmake_test_flags= fi + +if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then + # Are we SolarisStudio? + + TMPFILE=`cmake_tmp_file` + echo ' + #if defined(__SUNPRO_CC) + #include + int main() { std::cout << "This is SolarisStudio" << std::endl; return 0;} + #endif + ' > ${TMPFILE}.cxx + cmake_cxx_compiler_is_solarisstudio=0 + if cmake_try_run "${cmake_cxx_compiler}" \ + "${cmake_cxx_flags} " "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then + cmake_cxx_compiler_is_solarisstudio=1 + fi + if [ "x${cmake_cxx_compiler_is_solarisstudio}" = "x1" ]; then + echo "${cmake_cxx_compiler} is SolarisStudio compiler" + else + echo "${cmake_cxx_compiler} is not SolarisStudio compiler" + fi + rm -f "${TMPFILE}.cxx" + + if [ "x${cmake_cxx_compiler_is_solarisstudio}" = "x1" ]; then + cmake_cxx_flags="${cmake_cxx_flags} -library=stlport4" + fi +fi + + # Test for kwsys features KWSYS_NAME_IS_KWSYS=0 KWSYS_BUILD_SHARED=0 ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 11 11:06:42 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 11 Jan 2015 11:06:42 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1682-g06ba9bf Message-ID: <20150111160642.C48EDA9DEC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 06ba9bf3f9e191daae83735f55c20f269334af6c (commit) via 0f7bdd61da51ea8609246fe6fd05a13235fe75db (commit) via 5e92c82655e7430bef6604c90b3389f6609c2bdf (commit) via 15e42bb27c75e90da8163b89ad8fdc0a8fd70d7a (commit) via 931e055d8c2e113b9cabb9282d9742ae78c4d802 (commit) from a7fe9e746dbf363a692ab285cf15e0aad74c44dd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06ba9bf3f9e191daae83735f55c20f269334af6c commit 06ba9bf3f9e191daae83735f55c20f269334af6c Merge: a7fe9e7 0f7bdd6 Author: Stephen Kelly AuthorDate: Sun Jan 11 11:06:39 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 11:06:39 2015 -0500 Merge topic 'drop-ancient-workarounds' into next 0f7bdd61 Remove VS 6 special case. 5e92c826 Remove some obsolete stuff. 15e42bb2 cmStandardIncludes: Remove obsolete cmOStringStream. 931e055d Port all cmOStringStream to std::ostringstream. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0f7bdd61da51ea8609246fe6fd05a13235fe75db commit 0f7bdd61da51ea8609246fe6fd05a13235fe75db Author: Stephen Kelly AuthorDate: Thu Jan 8 22:12:49 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:06:04 2015 +0100 Remove VS 6 special case. diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 153ba6a..93bfdf8 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -16,9 +16,6 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 7") set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) endif() -if(CMAKE_GENERATOR MATCHES "Visual Studio 6") - set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) -endif() if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel") set(_INTEL_WINDOWS 1) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5e92c82655e7430bef6604c90b3389f6609c2bdf commit 5e92c82655e7430bef6604c90b3389f6609c2bdf Author: Stephen Kelly AuthorDate: Mon Jan 5 20:38:28 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:06:04 2015 +0100 Remove some obsolete stuff. We don't need to run compiler tests for ansi-for etc anymore. All supported compilers support the features tested here. diff --git a/CompileFlags.cmake b/CompileFlags.cmake index e7beb3f..153ba6a 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -83,5 +83,3 @@ endif () if (CMAKE_ANSI_CFLAGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") endif () - -include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index 79776f4..c0a1aa9 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -9,10 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#cmakedefine CMAKE_NO_STD_NAMESPACE -#cmakedefine CMAKE_NO_ANSI_STREAM_HEADERS -#cmakedefine CMAKE_NO_ANSI_STRING_STREAM -#cmakedefine CMAKE_NO_ANSI_FOR_SCOPE #cmakedefine HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE #cmakedefine HAVE_UNSETENV #cmakedefine CMAKE_USE_ELF_PARSER diff --git a/bootstrap b/bootstrap index d92b091..ac82f21 100755 --- a/bootstrap +++ b/bootstrap @@ -1461,35 +1461,6 @@ cmake_compiler_settings_comment="/* cmake_report cmConfigure.h${_tmp} "${cmake_compiler_settings_comment}" -if [ "x$KWSYS_STL_HAVE_STD" = "x1" ]; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_STD_NAMESPACE */" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_STD_NAMESPACE 1" -fi - -if [ "x$KWSYS_IOS_USE_ANSI" = "x1" ]; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_STREAM_HEADERS */" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_STREAM_HEADERS 1" -fi - -if [ "x$KWSYS_IOS_USE_SSTREAM" = "x1" ]; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_STRING_STREAM */" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_STRING_STREAM 1" -fi - -# Test for ansi FOR scope -if cmake_try_run "${cmake_cxx_compiler}" \ - "${cmake_cxx_flags}" \ - "${cmake_source_dir}/Modules/TestForAnsiForScope.cxx" >> cmake_bootstrap.log 2>&1; then - cmake_report cmConfigure.h${_tmp} "/* #undef CMAKE_NO_ANSI_FOR_SCOPE */" - echo "${cmake_cxx_compiler} has ANSI for scoping" -else - cmake_report cmConfigure.h${_tmp} "#define CMAKE_NO_ANSI_FOR_SCOPE 1" - echo "${cmake_cxx_compiler} does not have ANSI for scoping" -fi - # When bootstrapping on MinGW with MSYS we must convert the source # directory to a windows path. if ${cmake_system_mingw}; then http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15e42bb27c75e90da8163b89ad8fdc0a8fd70d7a commit 15e42bb27c75e90da8163b89ad8fdc0a8fd70d7a Author: Stephen Kelly AuthorDate: Mon Jan 5 20:33:18 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:06:04 2015 +0100 cmStandardIncludes: Remove obsolete cmOStringStream. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 97f57a3..96f4709 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -153,7 +153,6 @@ endif() # Sources for CMakeLib # set(SRCS - cmStandardIncludes.cxx cmArchiveWrite.cxx cmBootstrapCommands1.cxx cmBootstrapCommands2.cxx diff --git a/Source/cmStandardIncludes.cxx b/Source/cmStandardIncludes.cxx deleted file mode 100644 index 23c570c..0000000 --- a/Source/cmStandardIncludes.cxx +++ /dev/null @@ -1,16 +0,0 @@ -/*============================================================================ - CMake - Cross Platform Makefile Generator - Copyright 2000-2010 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. -============================================================================*/ -#include "cmStandardIncludes.h" -#if !defined(CMAKE_NO_ANSI_STRING_STREAM) -std::ostringstream::cmOStringStream() {} -std::ostringstream::~cmOStringStream() {} -#endif diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index a7db271..f50771f 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -16,8 +16,6 @@ #ifndef cmStandardIncludes_h #define cmStandardIncludes_h -// include configure generated header to define CMAKE_NO_ANSI_STREAM_HEADERS, -// CMAKE_NO_STD_NAMESPACE, and other macros. #include #include @@ -49,23 +47,10 @@ # pragma warning (push,1) #endif -#ifndef CMAKE_NO_ANSI_STREAM_HEADERS -# include -# include -# include -#else -# include -# include -# include -#endif - -#if !defined(CMAKE_NO_ANSI_STRING_STREAM) -# include -#elif !defined(CMAKE_NO_ANSI_STREAM_HEADERS) -# include -#else -# include -#endif +#include +#include +#include +#include // we must have stl with the standard include style #include @@ -97,48 +82,6 @@ typedef unsigned short mode_t; #include //typedef cmsys::String std::string; -// Define cmOStringStream and cmIStringStream wrappers to hide -// differences between std::stringstream and the old strstream. -#if !defined(CMAKE_NO_ANSI_STRING_STREAM) -class cmOStringStream: public std::ostringstream -{ -public: - cmOStringStream(); - ~cmOStringStream(); -private: - cmOStringStream(const cmOStringStream&); - void operator=(const cmOStringStream&); -}; -#else -class cmOStrStreamCleanup -{ -public: - cmOStrStreamCleanup(std::ostrstream& ostr): OStrStream(ostr) {} - ~cmOStrStreamCleanup() { this->OStrStream.rdbuf()->freeze(0); } - static void IgnoreUnusedVariable(const cmOStrStreamCleanup&) {} -protected: - std::ostrstream& OStrStream; -}; - -class cmOStringStream: public std::ostrstream -{ -public: - typedef std::ostrstream Superclass; - cmOStringStream() {} - std::string str() - { - cmOStrStreamCleanup cleanup(*this); - cmOStrStreamCleanup::IgnoreUnusedVariable(cleanup); - int pcount = this->pcount(); - const char* ptr = this->Superclass::str(); - return std::string(ptr?ptr:"", pcount); - } -private: - cmOStringStream(const cmOStringStream&); - void operator=(const cmOStringStream&); -}; -#endif - /* Poison this operator to avoid common mistakes. */ extern void operator << (std::ostream&, const std::ostringstream&); diff --git a/bootstrap b/bootstrap index fe051e1..d92b091 100755 --- a/bootstrap +++ b/bootstrap @@ -240,7 +240,6 @@ CMAKE_UNUSED_SOURCES="\ " CMAKE_CXX_SOURCES="\ - cmStandardIncludes \ cmake \ cmakemain \ cmcmd \ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=931e055d8c2e113b9cabb9282d9742ae78c4d802 commit 931e055d8c2e113b9cabb9282d9742ae78c4d802 Author: Stephen Kelly AuthorDate: Mon Jan 5 20:31:31 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 17:06:03 2015 +0100 Port all cmOStringStream to std::ostringstream. All compilers hosting CMake support the std class. diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 0644ecb..4a99e50 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -24,7 +24,7 @@ #endif #define cmCPackLogger(logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ if(Generator) { \ Generator->Logger->Log(logType, __FILE__, __LINE__, \ diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 3c45639..38cef87 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -25,7 +25,7 @@ #endif #define cmCPackLogger(logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ if(Generator) { \ Generator->Logger->Log(logType, __FILE__, __LINE__, \ diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index fbd1d21..e751568 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -112,24 +112,24 @@ int cmCPackBundleGenerator::ConstructBundle() // The staging directory contains everything that will end-up inside the // final disk image ... - cmOStringStream staging; + std::ostringstream staging; staging << toplevel; - cmOStringStream contents; + std::ostringstream contents; contents << staging.str() << "/" << cpack_bundle_name << ".app/" << "Contents"; - cmOStringStream application; + std::ostringstream application; application << contents.str() << "/" << "MacOS"; - cmOStringStream resources; + std::ostringstream resources; resources << contents.str() << "/" << "Resources"; // Install a required, user-provided bundle metadata file ... - cmOStringStream plist_source; + std::ostringstream plist_source; plist_source << cpack_bundle_plist; - cmOStringStream plist_target; + std::ostringstream plist_target; plist_target << contents.str() << "/" << "Info.plist"; if(!this->CopyFile(plist_source, plist_target)) @@ -142,10 +142,10 @@ int cmCPackBundleGenerator::ConstructBundle() } // Install a user-provided bundle icon ... - cmOStringStream icon_source; + std::ostringstream icon_source; icon_source << cpack_bundle_icon; - cmOStringStream icon_target; + std::ostringstream icon_target; icon_target << resources.str() << "/" << cpack_bundle_name << ".icns"; if(!this->CopyFile(icon_source, icon_target)) @@ -161,10 +161,10 @@ int cmCPackBundleGenerator::ConstructBundle() // executable or a script) ... if(!cpack_bundle_startup_command.empty()) { - cmOStringStream command_source; + std::ostringstream command_source; command_source << cpack_bundle_startup_command; - cmOStringStream command_target; + std::ostringstream command_target; command_target << application.str() << "/" << cpack_bundle_name; if(!this->CopyFile(command_source, command_target)) @@ -231,7 +231,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) for(std::vector::iterator it = relFiles.begin(); it != relFiles.end(); ++it) { - cmOStringStream temp_sign_file_cmd; + std::ostringstream temp_sign_file_cmd; temp_sign_file_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_sign_file_cmd << " --deep -f -s \"" << cpack_apple_cert_app; temp_sign_file_cmd << "\" -i "; @@ -251,7 +251,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) } // sign main binary - cmOStringStream temp_sign_binary_cmd; + std::ostringstream temp_sign_binary_cmd; temp_sign_binary_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_sign_binary_cmd << " --deep -f -s \"" << cpack_apple_cert_app; temp_sign_binary_cmd << "\" \"" << bundle_path << "\""; @@ -266,7 +266,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) } // sign app bundle - cmOStringStream temp_codesign_cmd; + std::ostringstream temp_codesign_cmd; temp_codesign_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_codesign_cmd << " --deep -f -s \"" << cpack_apple_cert_app << "\""; if(this->GetOption("CPACK_BUNDLE_APPLE_ENTITLEMENTS")) diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 9f0a77e..5da9234 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -169,8 +169,8 @@ int cmCPackDragNDropGenerator::PackageFiles() } //---------------------------------------------------------------------- -bool cmCPackDragNDropGenerator::CopyFile(cmOStringStream& source, - cmOStringStream& target) +bool cmCPackDragNDropGenerator::CopyFile(std::ostringstream& source, + std::ostringstream& target) { if(!cmSystemTools::CopyFileIfDifferent( source.str().c_str(), @@ -190,7 +190,7 @@ bool cmCPackDragNDropGenerator::CopyFile(cmOStringStream& source, } //---------------------------------------------------------------------- -bool cmCPackDragNDropGenerator::RunCommand(cmOStringStream& command, +bool cmCPackDragNDropGenerator::RunCommand(std::ostringstream& command, std::string* output) { int exit_code = 1; @@ -255,12 +255,12 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // The staging directory contains everything that will end-up inside the // final disk image ... - cmOStringStream staging; + std::ostringstream staging; staging << src_dir; // Add a symlink to /Applications so users can drag-and-drop the bundle // into it - cmOStringStream application_link; + std::ostringstream application_link; application_link << staging.str() << "/Applications"; cmSystemTools::CreateSymlink("/Applications", application_link.str().c_str()); @@ -268,10 +268,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Optionally add a custom volume icon ... if(!cpack_package_icon.empty()) { - cmOStringStream package_icon_source; + std::ostringstream package_icon_source; package_icon_source << cpack_package_icon; - cmOStringStream package_icon_destination; + std::ostringstream package_icon_destination; package_icon_destination << staging.str() << "/.VolumeIcon.icns"; if(!this->CopyFile(package_icon_source, package_icon_destination)) @@ -289,10 +289,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // (e.g. for setting background/layout) ... if(!cpack_dmg_ds_store.empty()) { - cmOStringStream package_settings_source; + std::ostringstream package_settings_source; package_settings_source << cpack_dmg_ds_store; - cmOStringStream package_settings_destination; + std::ostringstream package_settings_destination; package_settings_destination << staging.str() << "/.DS_Store"; if(!this->CopyFile(package_settings_source, package_settings_destination)) @@ -309,10 +309,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Optionally add a custom background image ... if(!cpack_dmg_background_image.empty()) { - cmOStringStream package_background_source; + std::ostringstream package_background_source; package_background_source << cpack_dmg_background_image; - cmOStringStream package_background_destination; + std::ostringstream package_background_destination; package_background_destination << staging.str() << "/background.png"; if(!this->CopyFile(package_background_source, @@ -326,7 +326,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, return 0; } - cmOStringStream temp_background_hiding_command; + std::ostringstream temp_background_hiding_command; temp_background_hiding_command << this->GetOption("CPACK_COMMAND_SETFILE"); temp_background_hiding_command << " -a V \""; temp_background_hiding_command << package_background_destination.str(); @@ -346,7 +346,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::string temp_image = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); temp_image += "/temp.dmg"; - cmOStringStream temp_image_command; + std::ostringstream temp_image_command; temp_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); temp_image_command << " create"; temp_image_command << " -ov"; @@ -368,9 +368,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Optionally set the custom icon flag for the image ... if(!cpack_package_icon.empty()) { - cmOStringStream temp_mount; + std::ostringstream temp_mount; - cmOStringStream attach_command; + std::ostringstream attach_command; attach_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); attach_command << " attach"; attach_command << " \"" << temp_image << "\""; @@ -389,7 +389,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, mountpoint_regex.find(attach_output.c_str()); temp_mount << mountpoint_regex.match(1); - cmOStringStream setfile_command; + std::ostringstream setfile_command; setfile_command << this->GetOption("CPACK_COMMAND_SETFILE"); setfile_command << " -a C"; setfile_command << " \"" << temp_mount.str() << "\""; @@ -403,7 +403,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, return 0; } - cmOStringStream detach_command; + std::ostringstream detach_command; detach_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); detach_command << " detach"; detach_command << " \"" << temp_mount.str() << "\""; @@ -471,7 +471,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, std::string temp_udco = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); temp_udco += "/temp-udco.dmg"; - cmOStringStream udco_image_command; + std::ostringstream udco_image_command; udco_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); udco_image_command << " convert \"" << temp_image << "\""; udco_image_command << " -format UDCO"; @@ -488,7 +488,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, } // unflatten dmg - cmOStringStream unflatten_command; + std::ostringstream unflatten_command; unflatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); unflatten_command << " unflatten "; unflatten_command << "\"" << temp_udco << "\""; @@ -503,7 +503,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, } // Rez the SLA - cmOStringStream embed_sla_command; + std::ostringstream embed_sla_command; embed_sla_command << this->GetOption("CPACK_COMMAND_REZ"); const char* sysroot = this->GetOption("CPACK_OSX_SYSROOT"); if(sysroot && sysroot[0] != '\0') @@ -524,7 +524,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, } // flatten dmg - cmOStringStream flatten_command; + std::ostringstream flatten_command; flatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); flatten_command << " flatten "; flatten_command << "\"" << temp_udco << "\""; @@ -543,7 +543,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, // Create the final compressed read-only disk image ... - cmOStringStream final_image_command; + std::ostringstream final_image_command; final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); final_image_command << " convert \"" << temp_image << "\""; final_image_command << " -format "; diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h index 808c618..1c84d49 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.h +++ b/Source/CPack/cmCPackDragNDropGenerator.h @@ -33,8 +33,8 @@ protected: bool SupportsComponentInstallation() const; - bool CopyFile(cmOStringStream& source, cmOStringStream& target); - bool RunCommand(cmOStringStream& command, std::string* output = 0); + bool CopyFile(std::ostringstream& source, std::ostringstream& target); + bool RunCommand(std::ostringstream& command, std::string* output = 0); std::string GetComponentInstallDirNameSuffix(const std::string& componentName); diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 2330278..9cd53ea 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -160,7 +160,7 @@ int cmCPackGenerator::PrepareNames() "Cannot open description file name: " << descFileName << std::endl); return 0; } - cmOStringStream ostr; + std::ostringstream ostr; std::string line; cmCPackLogger(cmCPackLog::LOG_VERBOSE, diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index ed89b53..907bb1e 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -29,7 +29,7 @@ #define cmCPackLogger(logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ this->Logger->Log(logType, __FILE__, __LINE__,\ cmCPackLog_msg.str().c_str());\ diff --git a/Source/CPack/cmCPackLog.h b/Source/CPack/cmCPackLog.h index 812f1de..7a7ff58 100644 --- a/Source/CPack/cmCPackLog.h +++ b/Source/CPack/cmCPackLog.h @@ -17,7 +17,7 @@ #define cmCPack_Log(ctSelf, logType, msg) \ do { \ - cmOStringStream cmCPackLog_msg; \ + std::ostringstream cmCPackLog_msg; \ cmCPackLog_msg << msg; \ (ctSelf)->Log(logType, __FILE__, __LINE__, cmCPackLog_msg.str().c_str());\ } while ( 0 ) diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index b506b06..8f63ca2 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -71,7 +71,7 @@ int cmCPackNSISGenerator::PackageFiles() tmpFile += "/NSISOutput.log"; std::string nsisInstallOptions = nsisFileName + "/NSIS.InstallOptions.ini"; nsisFileName += "/project.nsi"; - cmOStringStream str; + std::ostringstream str; std::vector::const_iterator it; for ( it = files.begin(); it != files.end(); ++ it ) { @@ -91,7 +91,7 @@ int cmCPackNSISGenerator::PackageFiles() std::vector dirs; this->GetListOfSubdirectories(toplevel.c_str(), dirs); std::vector::const_iterator sit; - cmOStringStream dstr; + std::ostringstream dstr; for ( sit = dirs.begin(); sit != dirs.end(); ++ sit ) { std::string componentName; @@ -190,7 +190,7 @@ int cmCPackNSISGenerator::PackageFiles() std::string groupDescriptions; std::string installTypesCode; std::string defines; - cmOStringStream macrosOut; + std::ostringstream macrosOut; bool anyDownloadedComponents = false; // Create installation types. The order is significant, so we first fill @@ -503,8 +503,8 @@ int cmCPackNSISGenerator::InitializeInternal() << "not set" << std::endl); } - cmOStringStream str; - cmOStringStream deleteStr; + std::ostringstream str; + std::ostringstream deleteStr; if ( cpackPackageExecutables ) { @@ -565,8 +565,8 @@ int cmCPackNSISGenerator::InitializeInternal() } //---------------------------------------------------------------------- -void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str, - cmOStringStream& deleteStr) +void cmCPackNSISGenerator::CreateMenuLinks( std::ostringstream& str, + std::ostringstream& deleteStr) { const char* cpackMenuLinks = this->GetOption("CPACK_NSIS_MENU_LINKS"); @@ -694,7 +694,7 @@ bool cmCPackNSISGenerator::SupportsComponentInstallation() const std::string cmCPackNSISGenerator:: CreateComponentDescription(cmCPackComponent *component, - cmOStringStream& macrosOut) + std::ostringstream& macrosOut) { // Basic description of the component std::string componentCode = "Section "; @@ -714,7 +714,7 @@ CreateComponentDescription(cmCPackComponent *component, } else if (!component->InstallationTypes.empty()) { - cmOStringStream out; + std::ostringstream out; std::vector::iterator installTypeIter; for (installTypeIter = component->InstallationTypes.begin(); installTypeIter != component->InstallationTypes.end(); @@ -734,7 +734,7 @@ CreateComponentDescription(cmCPackComponent *component, // Compute the name of the archive. std::string packagesDir = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); packagesDir += ".dummy"; - cmOStringStream out; + std::ostringstream out; out << cmSystemTools::GetFilenameWithoutLastExtension(packagesDir) << "-" << component->Name << ".zip"; component->ArchiveFile = out.str(); @@ -859,7 +859,7 @@ CreateComponentDescription(cmCPackComponent *component, { totalSizeInKbytes = 1; } - cmOStringStream out; + std::ostringstream out; out << " AddSize " << totalSizeInKbytes << "\n" << " Push \"" << component->ArchiveFile << "\"\n" << " Call DownloadFile\n" @@ -935,7 +935,7 @@ std::string cmCPackNSISGenerator::CreateSelectionDependenciesDescription } visited.insert(component); - cmOStringStream out; + std::ostringstream out; std::vector::iterator dependIt; for (dependIt = component->Dependencies.begin(); dependIt != component->Dependencies.end(); @@ -967,7 +967,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription } visited.insert(component); - cmOStringStream out; + std::ostringstream out; std::vector::iterator dependIt; for (dependIt = component->ReverseDependencies.begin(); dependIt != component->ReverseDependencies.end(); @@ -992,7 +992,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription std::string cmCPackNSISGenerator:: CreateComponentGroupDescription(cmCPackComponentGroup *group, - cmOStringStream& macrosOut) + std::ostringstream& macrosOut) { if (group->Components.empty() && group->Subgroups.empty()) { diff --git a/Source/CPack/cmCPackNSISGenerator.h b/Source/CPack/cmCPackNSISGenerator.h index e46fbda..c7b2ce1 100644 --- a/Source/CPack/cmCPackNSISGenerator.h +++ b/Source/CPack/cmCPackNSISGenerator.h @@ -38,8 +38,8 @@ public: protected: virtual int InitializeInternal(); - void CreateMenuLinks( cmOStringStream& str, - cmOStringStream& deleteStr); + void CreateMenuLinks( std::ostringstream& str, + std::ostringstream& deleteStr); int PackageFiles(); virtual const char* GetOutputExtension() { return ".exe"; } virtual const char* GetOutputPostfix() { return "win32"; } @@ -56,7 +56,7 @@ protected: /// macrosOut. std::string CreateComponentDescription(cmCPackComponent *component, - cmOStringStream& macrosOut); + std::ostringstream& macrosOut); /// Produce NSIS code that selects all of the components that this component /// depends on, recursively. @@ -75,7 +75,7 @@ protected: /// added macros will be emitted via macrosOut. std::string CreateComponentGroupDescription(cmCPackComponentGroup *group, - cmOStringStream& macrosOut); + std::ostringstream& macrosOut); /// Translations any newlines found in the string into \\r\\n, so that the /// resulting string can be used within NSIS. diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index 28c7f1d..313e08b 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -45,8 +45,8 @@ int cmCPackOSXX11Generator::PackageFiles() { cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: " << cpackPackageExecutables << "." << std::endl); - cmOStringStream str; - cmOStringStream deleteStr; + std::ostringstream str; + std::ostringstream deleteStr; std::vector cpackPackageExecutablesVector; cmSystemTools::ExpandListArgument(cpackPackageExecutables, cpackPackageExecutablesVector); @@ -165,7 +165,7 @@ int cmCPackOSXX11Generator::PackageFiles() std::string output; std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/hdiutilOutput.log"; - cmOStringStream dmgCmd; + std::ostringstream dmgCmd; dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") << "\" create -ov -format UDZO -srcfolder \"" << diskImageDirectory.c_str() diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index e799d06..8a22131 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -325,7 +325,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() if (this->Components.empty()) { // Use PackageMaker to build the package. - cmOStringStream pkgCmd; + std::ostringstream pkgCmd; pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM") << "\" -build -p \"" << packageDirFileName << "\""; if (this->Components.empty()) @@ -359,7 +359,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/hdiutilOutput.log"; - cmOStringStream dmgCmd; + std::ostringstream dmgCmd; dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") << "\" create -ov -format UDZO -srcfolder \"" << packageDirFileName << "\" \"" << packageFileNames[0] << "\""; @@ -687,7 +687,7 @@ cmCPackPackageMakerGenerator::GetPackageName(const cmCPackComponent& component) { std::string packagesDir = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); packagesDir += ".dummy"; - cmOStringStream out; + std::ostringstream out; out << cmSystemTools::GetFilenameWithoutLastExtension(packagesDir) << "-" << component.Name << ".pkg"; return out.str(); @@ -710,7 +710,7 @@ GenerateComponentPackage(const char *packageFile, packageFile << std::endl); // The command that will be used to run PackageMaker - cmOStringStream pkgCmd; + std::ostringstream pkgCmd; if (this->PackageCompatibilityVersion < 10.5 || this->PackageMakerVersion < 3.0) @@ -800,7 +800,7 @@ WriteDistributionFile(const char* metapackageFile) // Create the choice outline, which provides a tree-based view of // the components in their groups. - cmOStringStream choiceOut; + std::ostringstream choiceOut; choiceOut << "" << std::endl; // Emit the outline for the groups @@ -862,7 +862,8 @@ WriteDistributionFile(const char* metapackageFile) //---------------------------------------------------------------------- void cmCPackPackageMakerGenerator:: -CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out) +CreateChoiceOutline(const cmCPackComponentGroup& group, + std::ostringstream& out) { out << "" << std::endl; std::vector::const_iterator groupIt; @@ -885,7 +886,7 @@ CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out) //---------------------------------------------------------------------- void cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group, - cmOStringStream& out) + std::ostringstream& out) { out << "GetOption("CPACK_PACKAGE_VENDOR"); @@ -989,7 +990,7 @@ void cmCPackPackageMakerGenerator:: AddDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out) + std::ostringstream& out) { if (visited.find(&component) != visited.end()) { @@ -1013,7 +1014,7 @@ void cmCPackPackageMakerGenerator:: AddReverseDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out) + std::ostringstream& out) { if (visited.find(&component) != visited.end()) { diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h index e350a60..1b468d7 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.h +++ b/Source/CPack/cmCPackPackageMakerGenerator.h @@ -84,30 +84,30 @@ protected: // dependency attributes for inter-component dependencies. void AddDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out); + std::ostringstream& out); // Subroutine of WriteDistributionFile that writes out the // reverse dependency attributes for inter-component dependencies. void AddReverseDependencyAttributes(const cmCPackComponent& component, std::set& visited, - cmOStringStream& out); + std::ostringstream& out); // Generates XML that encodes the hierarchy of component groups and // their components in a form that can be used by distribution // metapackages. void CreateChoiceOutline(const cmCPackComponentGroup& group, - cmOStringStream& out); + std::ostringstream& out); /// Create the "choice" XML element to describe a component group /// for the installer GUI. void CreateChoice(const cmCPackComponentGroup& group, - cmOStringStream& out); + std::ostringstream& out); /// Create the "choice" XML element to describe a component for the /// installer GUI. void CreateChoice(const cmCPackComponent& component, - cmOStringStream& out); + std::ostringstream& out); // Escape the given string to make it usable as an XML attribute // value. diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 26bf607..b1b122d 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -426,7 +426,7 @@ int main (int argc, char const* const* argv) = mf->GetDefinition("CPACK_PACKAGE_VERSION_MINOR"); const char* projVersionPatch = mf->GetDefinition("CPACK_PACKAGE_VERSION_PATCH"); - cmOStringStream ostr; + std::ostringstream ostr; ostr << projVersionMajor << "." << projVersionMinor << "." << projVersionPatch; mf->AddDefinition("CPACK_PACKAGE_VERSION", diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index a101e39..b1fb02d 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -55,7 +55,7 @@ int cmCTestBuildAndTestHandler::ProcessHandler() //---------------------------------------------------------------------- int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, - cmOStringStream &out, std::string &cmakeOutString, std::string &cwd, + std::ostringstream &out, std::string &cmakeOutString, std::string &cwd, cmake *cm) { unsigned int k; @@ -209,7 +209,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) std::string cmakeOutString; cmCTestBuildAndTestCaptureRAII captureRAII(cm, cmakeOutString); static_cast(captureRAII); - cmOStringStream out; + std::ostringstream out; if ( this->CTest->GetConfigType().size() == 0 && this->ConfigSample.size()) diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h index 5a7b916..a75c631 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.h +++ b/Source/CTest/cmCTestBuildAndTestHandler.h @@ -50,7 +50,7 @@ public: protected: ///! Run CMake and build a test and then run it as a single test. int RunCMakeAndTest(std::string* output); - int RunCMake(std::string* outstring, cmOStringStream &out, + int RunCMake(std::string* outstring, std::ostringstream &out, std::string &cmakeOutString, std::string &cwd, cmake *cm); diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx index a5a593a..c4df741 100644 --- a/Source/CTest/cmCTestBuildCommand.cxx +++ b/Source/CTest/cmCTestBuildCommand.cxx @@ -148,7 +148,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler() } else { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "has no project to build. If this is a " "\"built with CMake\" project, verify that CTEST_CMAKE_GENERATOR " "and CTEST_PROJECT_NAME are set." @@ -181,7 +181,7 @@ bool cmCTestBuildCommand::InitialPass(std::vector const& args, bool ret = cmCTestHandlerCommand::InitialPass(args, status); if ( this->Values[ctb_NUMBER_ERRORS] && *this->Values[ctb_NUMBER_ERRORS]) { - cmOStringStream str; + std::ostringstream str; str << this->Handler->GetTotalErrors(); this->Makefile->AddDefinition( this->Values[ctb_NUMBER_ERRORS], str.str().c_str()); @@ -189,7 +189,7 @@ bool cmCTestBuildCommand::InitialPass(std::vector const& args, if ( this->Values[ctb_NUMBER_WARNINGS] && *this->Values[ctb_NUMBER_WARNINGS]) { - cmOStringStream str; + std::ostringstream str; str << this->Handler->GetTotalWarnings(); this->Makefile->AddDefinition( this->Values[ctb_NUMBER_WARNINGS], str.str().c_str()); diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx index ef62fd3..0f13263 100644 --- a/Source/CTest/cmCTestConfigureCommand.cxx +++ b/Source/CTest/cmCTestConfigureCommand.cxx @@ -66,7 +66,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler() const std::string cmakelists_file = source_dir + "/CMakeLists.txt"; if ( !cmSystemTools::FileExists(cmakelists_file.c_str()) ) { - cmOStringStream e; + std::ostringstream e; e << "CMakeLists.txt file does not exist [" << cmakelists_file << "]"; this->SetError(e.str()); diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index a1d770b..25bd96f 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -544,7 +544,7 @@ int cmCTestCoverageHandler::ProcessHandler() cmsys::ifstream ifs(fullFileName.c_str()); if ( !ifs) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Cannot open source file: " << fullFileName; errorsWhileAccumulating.push_back(ostr.str()); error ++; @@ -563,7 +563,7 @@ int cmCTestCoverageHandler::ProcessHandler() if ( !cmSystemTools::GetLineFromStream(ifs, line) && cc != fcov.size() -1 ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Problem reading source file: " << fullFileName << " line:" << cc << " out total: " << fcov.size()-1; errorsWhileAccumulating.push_back(ostr.str()); @@ -584,7 +584,7 @@ int cmCTestCoverageHandler::ProcessHandler() } if ( cmSystemTools::GetLineFromStream(ifs, line) ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Looks like there are more lines in the file: " << fullFileName; errorsWhileAccumulating.push_back(ostr.str()); } @@ -633,7 +633,7 @@ int cmCTestCoverageHandler::ProcessHandler() cmsys::ifstream ifs(fullPath.c_str()); if (!ifs) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Cannot open source file: " << fullPath; errorsWhileAccumulating.push_back(ostr.str()); error ++; diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx index 5ddef01..e175592 100644 --- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx +++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx @@ -24,7 +24,7 @@ bool cmCTestEmptyBinaryDirectoryCommand if ( !cmCTestScriptHandler::EmptyBinaryDirectory(args[0].c_str()) ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "problem removing the binary directory: " << args[0]; this->SetError(ostr.str()); return false; diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx index 2df2229..13c8ca5 100644 --- a/Source/CTest/cmCTestGenericHandler.cxx +++ b/Source/CTest/cmCTestGenericHandler.cxx @@ -103,7 +103,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part, << std::endl;); return false; } - cmOStringStream ostr; + std::ostringstream ostr; ostr << name; if ( this->SubmitIndex > 0 ) { @@ -142,7 +142,7 @@ bool cmCTestGenericHandler::StartLogFile(const char* name, "Cannot create log file without providing the name" << std::endl;); return false; } - cmOStringStream ostr; + std::ostringstream ostr; ostr << "Last" << name; if ( this->SubmitIndex > 0 ) { diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx index 5b525dd..b886777 100644 --- a/Source/CTest/cmCTestHandlerCommand.cxx +++ b/Source/CTest/cmCTestHandlerCommand.cxx @@ -46,7 +46,7 @@ bool cmCTestHandlerCommand if(!this->CheckArgumentKeyword(args[i]) && !this->CheckArgumentValue(args[i])) { - cmOStringStream e; + std::ostringstream e; e << "called with unknown argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; @@ -141,7 +141,7 @@ bool cmCTestHandlerCommand int res = handler->ProcessHandler(); if ( this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE]) { - cmOStringStream str; + std::ostringstream str; str << res; this->Makefile->AddDefinition( this->Values[ct_RETURN_VALUE], str.str().c_str()); @@ -183,7 +183,7 @@ bool cmCTestHandlerCommand::CheckArgumentValue(std::string const& arg) unsigned int k = this->ArgumentIndex; if(this->Values[k]) { - cmOStringStream e; + std::ostringstream e; e << "Called with more than one value for " << this->Arguments[k]; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->ArgumentDoing = ArgumentDoingError; diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 09cf760..fd0388a 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -75,7 +75,7 @@ public: this->ParseError(atts); } // Create the log - cmOStringStream ostr; + std::ostringstream ostr; ostr << name << ":\n"; int i = 0; for(; atts[i] != 0; i+=2) @@ -198,7 +198,7 @@ void cmCTestMemCheckHandler::GenerateTestCommand( { std::vector::size_type pp; std::string index; - cmOStringStream stream; + std::ostringstream stream; std::string memcheckcommand = cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str()); stream << test; @@ -834,7 +834,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( int defects = 0; std::vector lines; cmSystemTools::Split(str.c_str(), lines); - cmOStringStream ostr; + std::ostringstream ostr; log = ""; for( std::vector::iterator i = lines.begin(); i != lines.end(); ++i) @@ -878,7 +878,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( { std::vector lines; cmSystemTools::Split(str.c_str(), lines); - cmOStringStream ostr; + std::ostringstream ostr; log = ""; cmsys::RegularExpression pfW("^\\[[WEI]\\] ([A-Z][A-Z][A-Z][A-Z]*): "); @@ -941,7 +941,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( std::string::size_type cc; - cmOStringStream ostr; + std::ostringstream ostr; log = ""; int defects = 0; @@ -1269,7 +1269,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(int test, files) { std::string index; - cmOStringStream stream; + std::ostringstream stream; stream << test; index = stream.str(); std::string ofile = this->MemoryTesterOutputFile; diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 4c89caa..a6bc844 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -668,7 +668,7 @@ void cmCTestMultiProcessHandler::PrintTestList() { cmCTestLog(this->CTest, HANDLER_OUTPUT, " Test"); } - cmOStringStream indexStr; + std::ostringstream indexStr; indexStr << " #" << p.Index << ":"; cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex())) diff --git a/Source/CTest/cmCTestRunScriptCommand.cxx b/Source/CTest/cmCTestRunScriptCommand.cxx index bdf9b9c..7afbe04 100644 --- a/Source/CTest/cmCTestRunScriptCommand.cxx +++ b/Source/CTest/cmCTestRunScriptCommand.cxx @@ -54,7 +54,7 @@ bool cmCTestRunScriptCommand int ret; cmCTestScriptHandler::RunScript(this->CTest, args[i].c_str(), !np, &ret); - cmOStringStream str; + std::ostringstream str; str << ret; this->Makefile->AddDefinition(returnVariable, str.str().c_str()); } diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index ff55528..2a39051 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -694,7 +694,7 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) cmCTestLog(this->CTest, HANDLER_OUTPUT, "Test"); } - cmOStringStream indexStr; + std::ostringstream indexStr; indexStr << " #" << this->Index << ":"; cmCTestLog(this->CTest, HANDLER_OUTPUT, std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex())) diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index f958e7b..71edd5b 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -299,7 +299,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) cmsysProcess_Delete(cp); if(failed) { - cmOStringStream message; + std::ostringstream message; message << "Error running command: ["; message << result << "] "; for(std::vector::iterator i = argv.begin(); diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 1a39a8a..8ea6cef 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -126,7 +126,7 @@ bool cmCTestStartCommand } if(!cmSystemTools::FileIsDirectory(sourceDir)) { - cmOStringStream e; + std::ostringstream e; e << "given source path\n" << " " << sourceDir << "\n" << "which is not an existing directory. " diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 07a994d..97ec21e 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -212,7 +212,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "Part name \"" << arg << "\" is invalid."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->ArgumentDoing = ArgumentDoingError; @@ -229,7 +229,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "File \"" << filename << "\" does not exist. Cannot submit " << "a non-existent file."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx index 231f035..d209094 100644 --- a/Source/CTest/cmCTestTestCommand.cxx +++ b/Source/CTest/cmCTestTestCommand.cxx @@ -53,7 +53,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler() if ( this->Values[ctt_START] || this->Values[ctt_END] || this->Values[ctt_STRIDE] ) { - cmOStringStream testsToRunString; + std::ostringstream testsToRunString; if ( this->Values[ctt_START] ) { testsToRunString << this->Values[ctt_START]; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 38ce3dc..a398864 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1865,7 +1865,7 @@ std::string cmCTestTestHandler::GenerateRegressionImages( SPACE_REGEX "*(name|type|encoding|compression)=\"([^\"]*)\"" SPACE_REGEX "*>([^<]*)"); - cmOStringStream ostr; + std::ostringstream ostr; bool done = false; std::string cxml = xml; while ( ! done ) @@ -2098,7 +2098,7 @@ bool cmCTestTestHandler::CleanTestOutput(std::string& output, size_t length) output = output.substr(0, current - begin); // Append truncation message. - cmOStringStream msg; + std::ostringstream msg; msg << "...\n" "The rest of the test output was removed since it exceeds the threshold " "of " << length << " bytes.\n"; diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 7206914..772c9aa 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -413,7 +413,7 @@ bool cmCTestUpdateHandler::SelectVCS() } if (this->UpdateCommand.empty()) { - cmOStringStream e; + std::ostringstream e; e << "Cannot find UpdateCommand "; if (key) { diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx index f7de294..5613751 100644 --- a/Source/CTest/cmCTestUploadCommand.cxx +++ b/Source/CTest/cmCTestUploadCommand.cxx @@ -55,7 +55,7 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "File \"" << filename << "\" does not exist. Cannot submit " << "a non-existent file."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx index 15f796f..6e93e95 100644 --- a/Source/CTest/cmCTestVC.cxx +++ b/Source/CTest/cmCTestVC.cxx @@ -105,7 +105,7 @@ bool cmCTestVC::RunChild(char const* const* cmd, OutputParser* out, //---------------------------------------------------------------------------- std::string cmCTestVC::ComputeCommandLine(char const* const* cmd) { - cmOStringStream line; + std::ostringstream line; const char* sep = ""; for(const char* const* arg = cmd; *arg; ++arg) { diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index 818b910..8fb49ca 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -305,7 +305,7 @@ bool cmAddCustomCommandCommand } // No command for this output exists. - cmOStringStream e; + std::ostringstream e; e << "given APPEND option with output \"" << output[0] << "\" which is not already a custom command output."; this->SetError(e.str()); @@ -354,7 +354,7 @@ bool cmAddCustomCommandCommand } if(!okay) { - cmOStringStream e; + std::ostringstream e; e << "could not locate source file with a custom command producing \"" << output[0] << "\" even though this command tried to create it!"; this->SetError(e.str()); @@ -375,7 +375,7 @@ bool cmAddCustomCommandCommand else { bool issueMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0050)) { @@ -436,7 +436,7 @@ cmAddCustomCommandCommand std::string::size_type pos = o->find_first_of("#<>"); if(pos != o->npos) { - cmOStringStream msg; + std::ostringstream msg; msg << "called with OUTPUT containing a \"" << (*o)[pos] << "\". This character is not allowed."; this->SetError(msg.str()); diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 09c8af5..a0e20c8 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -30,7 +30,7 @@ bool cmAddCustomTargetCommand // Check the target name. if(targetName.find_first_of("/\\") != targetName.npos) { - cmOStringStream e; + std::ostringstream e; e << "called with invalid target name \"" << targetName << "\". Target names may not contain a slash. " << "Use ADD_CUSTOM_COMMAND to generate files."; @@ -170,7 +170,7 @@ bool cmAddCustomTargetCommand std::string::size_type pos = targetName.find_first_of("#<>"); if(pos != targetName.npos) { - cmOStringStream msg; + std::ostringstream msg; msg << "called with target name containing a \"" << targetName[pos] << "\". This character is not allowed."; this->SetError(msg.str()); @@ -189,7 +189,7 @@ bool cmAddCustomTargetCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; - cmOStringStream e; + std::ostringstream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx index e897d81..b560452 100644 --- a/Source/cmAddDependenciesCommand.cxx +++ b/Source/cmAddDependenciesCommand.cxx @@ -26,7 +26,7 @@ bool cmAddDependenciesCommand std::string target_name = args[0]; if(this->Makefile->IsAlias(target_name)) { - cmOStringStream e; + std::ostringstream e; e << "Cannot add target-level dependencies to alias target \"" << target_name << "\".\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -35,7 +35,7 @@ bool cmAddDependenciesCommand { if (target->GetType() == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Cannot add target-level dependencies to INTERFACE library " "target \"" << target_name << "\".\n"; this->SetError(e.str()); @@ -51,7 +51,7 @@ bool cmAddDependenciesCommand } else { - cmOStringStream e; + std::ostringstream e; e << "Cannot add target-level dependencies to non-existent target \"" << target_name << "\".\n" << "The add_dependencies works for top-level logical targets created " diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx index c30e764..74dc8eb 100644 --- a/Source/cmAddExecutableCommand.cxx +++ b/Source/cmAddExecutableCommand.cxx @@ -79,7 +79,7 @@ bool cmAddExecutableCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; - cmOStringStream e; + std::ostringstream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { @@ -149,7 +149,7 @@ bool cmAddExecutableCommand } if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << "ALIAS requires exactly one target argument."; this->SetError(e.str()); return false; @@ -158,7 +158,7 @@ bool cmAddExecutableCommand const char *aliasedName = s->c_str(); if(this->Makefile->IsAlias(aliasedName)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" is itself an ALIAS."; this->SetError(e.str()); @@ -168,7 +168,7 @@ bool cmAddExecutableCommand this->Makefile->FindTargetToUse(aliasedName, true); if(!aliasedTarget) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" does not already " "exist."; @@ -178,7 +178,7 @@ bool cmAddExecutableCommand cmTarget::TargetType type = aliasedTarget->GetType(); if(type != cmTarget::EXECUTABLE) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" is not an " "executable."; @@ -187,7 +187,7 @@ bool cmAddExecutableCommand } if(aliasedTarget->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << exename << "\" because target \"" << aliasedName << "\" is IMPORTED."; this->SetError(e.str()); @@ -203,7 +203,7 @@ bool cmAddExecutableCommand // Make sure the target does not already exist. if(this->Makefile->FindTargetToUse(exename)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create imported target \"" << exename << "\" because another target with the same name already exists."; this->SetError(e.str()); diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index bba4d41..db2f6fb 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -51,7 +51,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting STATIC type."; this->SetError(e.str()); return false; @@ -64,7 +64,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting SHARED type."; this->SetError(e.str()); return false; @@ -77,7 +77,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting MODULE type."; this->SetError(e.str()); return false; @@ -90,7 +90,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting OBJECT type."; this->SetError(e.str()); return false; @@ -103,7 +103,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting UNKNOWN type."; this->SetError(e.str()); return false; @@ -116,7 +116,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting ALIAS type."; this->SetError(e.str()); return false; @@ -128,21 +128,21 @@ bool cmAddLibraryCommand { if (haveSpecifiedType) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting/multiple types."; this->SetError(e.str()); return false; } if (isAlias) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified with conflicting ALIAS type."; this->SetError(e.str()); return false; } if (excludeFromAll) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL."; this->SetError(e.str()); return false; @@ -155,7 +155,7 @@ bool cmAddLibraryCommand { if (type == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL."; this->SetError(e.str()); return false; @@ -175,7 +175,7 @@ bool cmAddLibraryCommand } else if(type == cmTarget::INTERFACE_LIBRARY && *s == "GLOBAL") { - cmOStringStream e; + std::ostringstream e; e << "GLOBAL option may only be used with IMPORTED libraries."; this->SetError(e.str()); return false; @@ -190,14 +190,14 @@ bool cmAddLibraryCommand { if (s != args.end()) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library requires no source arguments."; this->SetError(e.str()); return false; } if (importGlobal && !importTarget) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE library specified as GLOBAL, but not as IMPORTED."; this->SetError(e.str()); return false; @@ -214,7 +214,7 @@ bool cmAddLibraryCommand if (!nameOk) { cmake::MessageType messageType = cmake::AUTHOR_WARNING; - cmOStringStream e; + std::ostringstream e; bool issueMessage = false; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) { @@ -267,7 +267,7 @@ bool cmAddLibraryCommand } if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << "ALIAS requires exactly one target argument."; this->SetError(e.str()); return false; @@ -276,7 +276,7 @@ bool cmAddLibraryCommand const char *aliasedName = s->c_str(); if(this->Makefile->IsAlias(aliasedName)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" is itself an ALIAS."; this->SetError(e.str()); @@ -286,7 +286,7 @@ bool cmAddLibraryCommand this->Makefile->FindTargetToUse(aliasedName, true); if(!aliasedTarget) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" does not already " "exist."; @@ -300,7 +300,7 @@ bool cmAddLibraryCommand && aliasedType != cmTarget::OBJECT_LIBRARY && aliasedType != cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" is not a library."; this->SetError(e.str()); @@ -308,7 +308,7 @@ bool cmAddLibraryCommand } if(aliasedTarget->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "cannot create ALIAS target \"" << libName << "\" because target \"" << aliasedName << "\" is IMPORTED."; this->SetError(e.str()); @@ -333,7 +333,7 @@ bool cmAddLibraryCommand (this->Makefile->GetCMakeInstance()->GetPropertyAsBool( "TARGET_SUPPORTS_SHARED_LIBS") == false)) { - cmOStringStream w; + std::ostringstream w; w << "ADD_LIBRARY called with " << (type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE") << @@ -364,7 +364,7 @@ bool cmAddLibraryCommand { if (!cmGeneratorExpression::IsValidTargetName(libName)) { - cmOStringStream e; + std::ostringstream e; e << "Invalid name for IMPORTED INTERFACE library target: " << libName; this->SetError(e.str()); return false; @@ -374,7 +374,7 @@ bool cmAddLibraryCommand // Make sure the target does not already exist. if(this->Makefile->FindTargetToUse(libName)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create imported target \"" << libName << "\" because another target with the same name already exists."; this->SetError(e.str()); @@ -413,7 +413,7 @@ bool cmAddLibraryCommand if (!cmGeneratorExpression::IsValidTargetName(libName) || libName.find("::") != std::string::npos) { - cmOStringStream e; + std::ostringstream e; e << "Invalid name for INTERFACE library target: " << libName; this->SetError(e.str()); return false; diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 477a3d9..8db5078 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -81,7 +81,7 @@ bool cmAddSubDirectoryCommand::InitialPass if(!cmSystemTools::IsSubDirectory(srcPath, this->Makefile->GetCurrentDirectory())) { - cmOStringStream e; + std::ostringstream e; e << "not given a binary directory but the given source directory " << "\"" << srcPath << "\" is not a subdirectory of \"" << this->Makefile->GetCurrentDirectory() << "\". " diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx index 2531a1a..65d295b 100644 --- a/Source/cmAddTestCommand.cxx +++ b/Source/cmAddTestCommand.cxx @@ -51,7 +51,7 @@ bool cmAddTestCommand // allow it to be duplicated. if(!test->GetOldStyle()) { - cmOStringStream e; + std::ostringstream e; e << " given test name \"" << args[0] << "\" which already exists in this directory."; this->SetError(e.str()); @@ -135,7 +135,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << " given unknown argument:\n " << args[i] << "\n"; this->SetError(e.str()); return false; @@ -159,7 +159,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector const& args) // Require a unique test name within the directory. if(this->Makefile->GetTest(name)) { - cmOStringStream e; + std::ostringstream e; e << " given test NAME \"" << name << "\" which already exists in this directory."; this->SetError(e.str()); diff --git a/Source/cmBreakCommand.cxx b/Source/cmBreakCommand.cxx index ff527db..34245b3 100644 --- a/Source/cmBreakCommand.cxx +++ b/Source/cmBreakCommand.cxx @@ -18,7 +18,7 @@ bool cmBreakCommand::InitialPass(std::vector const &args, if(!this->Makefile->IsLoopBlock()) { bool issueMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) { @@ -53,7 +53,7 @@ bool cmBreakCommand::InitialPass(std::vector const &args, if(!args.empty()) { bool issueMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) { diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx index 93f7801..5d32437 100644 --- a/Source/cmBuildCommand.cxx +++ b/Source/cmBuildCommand.cxx @@ -78,7 +78,7 @@ bool cmBuildCommand } else { - cmOStringStream e; + std::ostringstream e; e << "unknown argument \"" << args[i] << "\""; this->SetError(e.str()); return false; diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx index 384e0a7..8591ed6 100644 --- a/Source/cmCMakeMinimumRequired.cxx +++ b/Source/cmCMakeMinimumRequired.cxx @@ -78,7 +78,7 @@ bool cmCMakeMinimumRequired &required_major, &required_minor, &required_patch, &required_tweak) < 2) { - cmOStringStream e; + std::ostringstream e; e << "could not parse VERSION \"" << version_string << "\"."; this->SetError(e.str()); return false; @@ -97,7 +97,7 @@ bool cmCMakeMinimumRequired current_tweak < required_tweak)) { // The current version is too low. - cmOStringStream e; + std::ostringstream e; e << "CMake " << version_string << " or higher is required. You are running version " << cmVersion::GetCMakeVersion(); @@ -132,7 +132,7 @@ bool cmCMakeMinimumRequired::EnforceUnknownArguments() { if(!this->UnknownArguments.empty()) { - cmOStringStream e; + std::ostringstream e; e << "called with unknown argument \"" << this->UnknownArguments[0] << "\"."; this->SetError(e.str()); diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx index ddd5d6a..9662fbf 100644 --- a/Source/cmCMakePolicyCommand.cxx +++ b/Source/cmCMakePolicyCommand.cxx @@ -56,7 +56,7 @@ bool cmCMakePolicyCommand return this->HandleVersionMode(args); } - cmOStringStream e; + std::ostringstream e; e << "given unknown first argument \"" << args[0] << "\""; this->SetError(e.str()); return false; @@ -82,7 +82,7 @@ bool cmCMakePolicyCommand::HandleSetMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "SET given unrecognized policy status \"" << args[2] << "\""; this->SetError(e.str()); return false; @@ -113,7 +113,7 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector const& args) cmPolicies::PolicyID pid; if(!this->Makefile->GetPolicies()->GetPolicyID(id.c_str(), pid)) { - cmOStringStream e; + std::ostringstream e; e << "GET given policy \"" << id << "\" which is not known to this " << "version of CMake."; this->SetError(e.str()); @@ -140,7 +140,7 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector const& args) case cmPolicies::REQUIRED_ALWAYS: // The policy is required to be set before anything needs it. { - cmOStringStream e; + std::ostringstream e; e << this->Makefile->GetPolicies()->GetRequiredPolicyError(pid) << "\n" << "The call to cmake_policy(GET " << id << " ...) at which this " diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index b304f28..d0dc30a 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -769,7 +769,7 @@ void CCONV cmSourceFileSetName(void *arg, const char* name, const char* dir, } } - cmOStringStream e; + std::ostringstream e; e << "Cannot find source file \"" << pathname << "\""; e << "\n\nTried extensions"; for( std::vector::const_iterator ext = sourceExts.begin(); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 2f1cf10..0c4d76c 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -240,7 +240,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method, //---------------------------------------------------------------------- std::string cmCTest::MakeURLSafe(const std::string& str) { - cmOStringStream ost; + std::ostringstream ost; char buffer[10]; for ( std::string::size_type pos = 0; pos < str.size(); pos ++ ) { @@ -1302,7 +1302,7 @@ int cmCTest::RunTest(std::vector argv, inst.TimeOut = timeout; // Capture output of the child ctest. - cmOStringStream oss; + std::ostringstream oss; inst.SetStreams(&oss, &oss); std::vector args; @@ -1316,7 +1316,7 @@ int cmCTest::RunTest(std::vector argv, if (strcmp(argv[i],"--build-generator") == 0 && timeout > 0) { args.push_back("--test-timeout"); - cmOStringStream msg; + std::ostringstream msg; msg << timeout; args.push_back(msg.str()); } diff --git a/Source/cmCTest.h b/Source/cmCTest.h index e19d32c..deb8896 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -27,7 +27,7 @@ class cmCTestStartCommand; #define cmCTestLog(ctSelf, logType, msg) \ do { \ - cmOStringStream cmCTestLog_msg; \ + std::ostringstream cmCTestLog_msg; \ cmCTestLog_msg << msg; \ (ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__,\ cmCTestLog_msg.str().c_str());\ diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index 64b67c9..747b7e4 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -103,7 +103,7 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key, } return this->EmptyVariable; } - cmOStringStream e; + std::ostringstream e; e << "Syntax $" << key << "{} is not supported. " << "Only ${}, $ENV{}, and $CACHE{} are allowed."; this->SetError(e.str()); @@ -118,7 +118,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) } if(this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << this->FileLine; return this->AddString(ostr.str()); } @@ -136,7 +136,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) cmSystemTools::IsSubDirectory(this->FileName, this->Makefile->GetHomeOutputDirectory())) { - cmOStringStream msg; + std::ostringstream msg; cmListFileBacktrace bt(this->Makefile->GetLocalGenerator()); cmListFileContext lfc; lfc.FilePath = this->FileName; @@ -253,7 +253,7 @@ bool cmCommandArgumentParserHelper::HandleEscapeSymbol break; default: { - cmOStringStream e; + std::ostringstream e; e << "Invalid escape sequence \\" << symbol; this->SetError(e.str()); } @@ -335,7 +335,7 @@ int cmCommandArgumentParserHelper::LexInput(char* buf, int maxlen) void cmCommandArgumentParserHelper::Error(const char* str) { unsigned long pos = static_cast(this->InputBufferPos); - cmOStringStream ostr; + std::ostringstream ostr; ostr << str << " (" << pos << ")"; this->SetError(ostr.str()); } diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index a636d23..20c71fb 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -710,7 +710,7 @@ void cmComputeLinkDepends::CleanConstraintGraph() void cmComputeLinkDepends::DisplayConstraintGraph() { // Display the graph nodes and their edges. - cmOStringStream e; + std::ostringstream e; for(unsigned int i=0; i < this->EntryConstraintGraph.size(); ++i) { EdgeList const& nl = this->EntryConstraintGraph[i]; diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index f4fa5c6..8d24bd0 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1342,7 +1342,7 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item) // Try to separate the framework name and path. if(!this->SplitFramework.find(item.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "Could not parse framework path \"" << item << "\" " << "linked by target " << this->Target->GetName() << "."; cmSystemTools::Error(e.str().c_str()); @@ -1389,7 +1389,7 @@ void cmComputeLinkInformation::DropDirectoryItem(std::string const& item) { // A full path to a directory was found as a link item. Warn the // user. - cmOStringStream e; + std::ostringstream e; e << "WARNING: Target \"" << this->Target->GetName() << "\" requests linking to directory \"" << item << "\". " << "Targets may link only to libraries. " @@ -1505,7 +1505,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item, if(!this->CMakeInstance->GetPropertyAsBool(wid)) { this->CMakeInstance->SetProperty(wid, "1"); - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0008)) << "\n" << "Target \"" << this->Target->GetName() << "\" links to item\n" @@ -1524,7 +1524,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item, case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile->GetPolicies()-> GetRequiredPolicyError(cmPolicies::CMP0008)) << "\n" << "Target \"" << this->Target->GetName() << "\" links to item\n" @@ -1554,7 +1554,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories() if(!this->CMakeInstance->GetPropertyAsBool("CMP0003-WARNING-GIVEN")) { this->CMakeInstance->SetProperty("CMP0003-WARNING-GIVEN", "1"); - cmOStringStream w; + std::ostringstream w; this->PrintLinkPolicyDiagnosis(w); this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), this->Target->GetBacktrace()); @@ -1569,7 +1569,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories() case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile->GetPolicies()-> GetRequiredPolicyError(cmPolicies::CMP0003)) << "\n"; this->PrintLinkPolicyDiagnosis(e); diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 75d3967..cf2b88e 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -361,7 +361,7 @@ void cmComputeTargetDepends::AddTargetDepend( cmMakefile *makefile = depender->GetMakefile(); cmake::MessageType messageType = cmake::AUTHOR_WARNING; bool issueMessage = false; - cmOStringStream e; + std::ostringstream e; switch(depender->GetPolicyStatusCMP0046()) { case cmPolicies::WARN: @@ -539,7 +539,7 @@ cmComputeTargetDepends bool strong) { // Construct the error message. - cmOStringStream e; + std::ostringstream e; e << "The inter-target dependency graph contains the following " << "strongly connected component (cycle):\n"; std::vector const& components = ccg.GetComponents(); diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index aba26de..73b4ba2 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -119,7 +119,7 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted( if(!hasBeenReported) { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile.GetPolicies()->GetPolicyWarning( cmPolicies::CMP0054)) << "\n"; e << "Quoted variables like \"" << argument.GetValue() << @@ -169,7 +169,7 @@ bool cmConditionEvaluator::IsKeyword(std::string const& keyword, if(!hasBeenReported) { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile.GetPolicies()->GetPolicyWarning( cmPolicies::CMP0054)) << "\n"; e << "Quoted keywords like \"" << argument.GetValue() << @@ -559,7 +559,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList &newArgs, cmsys::RegularExpression regEntry; if ( !regEntry.compile(rex) ) { - cmOStringStream error; + std::ostringstream error; error << "Regular expression \"" << rex << "\" cannot compile"; errorString = error.str(); status = cmake::FATAL_ERROR; diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index cc6cf5f..fa7f486 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -34,7 +34,7 @@ bool cmConfigureFileCommand // If the input location is a directory, error out. if(cmSystemTools::FileIsDirectory(this->InputFile)) { - cmOStringStream e; + std::ostringstream e; e << "input location\n" << " " << this->InputFile << "\n" << "is a directory but a file was expected."; diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 0030b84..002e75a 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -150,7 +150,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) } else { - cmOStringStream m; + std::ostringstream m; m << "try_compile given unknown argument \"" << argv[i] << "\"."; this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str()); } @@ -220,7 +220,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) // do not allow recursive try Compiles if (this->BinaryDirectory == this->Makefile->GetHomeOutputDirectory()) { - cmOStringStream e; + std::ostringstream e; e << "Attempt at a recursive or nested TRY_COMPILE in directory\n" << " " << this->BinaryDirectory << "\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -256,7 +256,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) } else { - cmOStringStream err; + std::ostringstream err; err << "Unknown extension \"" << ext << "\" for file\n" << " " << *si << "\n" << "try_compile() works only for enabled languages. " @@ -282,7 +282,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) FILE *fout = cmsys::SystemTools::Fopen(outFileName,"w"); if (!fout) { - cmOStringStream e; + std::ostringstream e; e << "Failed to open\n" << " " << outFileName << "\n" << cmSystemTools::GetLastSystemError(); @@ -337,7 +337,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) if(this->Makefile->PolicyOptionalWarningEnabled( "CMAKE_POLICY_WARNING_CMP0056")) { - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetCMakeInstance()->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0056)) << "\n" "For compatibility with older versions of CMake, try_compile " @@ -553,7 +553,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) !cmSystemTools::CopyFileAlways(this->OutputFile, copyFile)) { - cmOStringStream emsg; + std::ostringstream emsg; emsg << "Cannot copy output executable\n" << " '" << this->OutputFile << "'\n" << "to destination specified by COPY_FILE:\n" @@ -691,7 +691,7 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName) } } - cmOStringStream emsg; + std::ostringstream emsg; emsg << "Unable to find the executable at any of:\n"; for (unsigned int i = 0; i < searchDirs.size(); ++i) { diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx index 6b729de..5ff0186 100644 --- a/Source/cmDefinePropertyCommand.cxx +++ b/Source/cmDefinePropertyCommand.cxx @@ -53,7 +53,7 @@ bool cmDefinePropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid scope " << args[0] << ". " << "Valid scopes are " << "GLOBAL, DIRECTORY, TARGET, SOURCE, " @@ -100,7 +100,7 @@ bool cmDefinePropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx index 947db82..d419011 100644 --- a/Source/cmDepends.cxx +++ b/Source/cmDepends.cxx @@ -123,7 +123,7 @@ void cmDepends::Clear(const char *file) // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Clearing dependencies in \"" << file << "\"." << std::endl; cmSystemTools::Stdout(msg.str().c_str()); } @@ -213,7 +213,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dependee << "\" does not exist for depender \"" << depender << "\"." << std::endl; @@ -235,7 +235,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dependee << "\" is newer than depender \"" << depender << "\"." << std::endl; @@ -257,7 +257,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends, // Print verbose output. if(this->Verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dependee << "\" is newer than depends file \"" << internalDependsFileName << "\"." << std::endl; diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index cab23b7..d062987 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -532,7 +532,7 @@ cmELFInternalImpl break; } #endif - cmOStringStream e; + std::ostringstream e; e << "Unknown ELF file type " << eti; this->SetErrorMessage(e.str().c_str()); return; diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 11f8ae5..0707906 100644 --- a/Source/cmExecuteProcessCommand.cxx +++ b/Source/cmExecuteProcessCommand.cxx @@ -189,7 +189,7 @@ bool cmExecuteProcessCommand } else { - cmOStringStream e; + std::ostringstream e; e << " given unknown argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx index 134ee98..a28ec48 100644 --- a/Source/cmExportBuildFileGenerator.cxx +++ b/Source/cmExportBuildFileGenerator.cxx @@ -45,7 +45,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) } else { - cmOStringStream e; + std::ostringstream e; e << "given target \"" << te->GetName() << "\" more than once."; this->Makefile->GetCMakeInstance() ->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace); @@ -70,7 +70,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os) cmTarget* te = *tei; if (te->GetProperty("INTERFACE_SOURCES")) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << te->GetName() << "\" has a populated INTERFACE_SOURCES property. This is not " @@ -313,7 +313,7 @@ cmExportBuildFileGenerator return; } - cmOStringStream e; + std::ostringstream e; e << "export called with target \"" << depender->GetName() << "\" which requires target \"" << dependee->GetName() << "\" "; if (occurrences == 0) diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index db21c49..76283d4 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -89,7 +89,7 @@ bool cmExportCommand if(cmSystemTools::GetFilenameLastExtension(this->Filename.GetCString()) != ".cmake") { - cmOStringStream e; + std::ostringstream e; e << "FILE option given filename \"" << this->Filename.GetString() << "\" which does not have an extension of \".cmake\".\n"; this->SetError(e.str()); @@ -103,7 +103,7 @@ bool cmExportCommand { if(!this->Makefile->CanIWriteThisFile(fname.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "FILE option given filename \"" << fname << "\" which is in the source tree.\n"; this->SetError(e.str()); @@ -126,7 +126,7 @@ bool cmExportCommand { if (this->Append.IsEnabled()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT signature does not recognise the APPEND option."; this->SetError(e.str()); return false; @@ -134,7 +134,7 @@ bool cmExportCommand if (this->ExportOld.IsEnabled()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT signature does not recognise the " "EXPORT_LINK_INTERFACE_LIBRARIES option."; this->SetError(e.str()); @@ -145,7 +145,7 @@ bool cmExportCommand std::string setName = this->ExportSetName.GetString(); if (setMap.find(setName) == setMap.end()) { - cmOStringStream e; + std::ostringstream e; e << "Export set \"" << setName << "\" not found."; this->SetError(e.str()); return false; @@ -161,7 +161,7 @@ bool cmExportCommand { if (this->Makefile->IsAlias(*currentTarget)) { - cmOStringStream e; + std::ostringstream e; e << "given ALIAS target \"" << *currentTarget << "\" which may not be exported."; this->SetError(e.str()); @@ -172,7 +172,7 @@ bool cmExportCommand { if(target->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "given OBJECT library \"" << *currentTarget << "\" which may not be exported."; this->SetError(e.str()); @@ -181,7 +181,7 @@ bool cmExportCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given target \"" << *currentTarget << "\" which is not built by this project."; this->SetError(e.str()); @@ -261,7 +261,7 @@ bool cmExportCommand::HandlePackage(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "PACKAGE given unknown argument: " << args[i]; this->SetError(e.str()); return false; @@ -278,7 +278,7 @@ bool cmExportCommand::HandlePackage(std::vector const& args) cmsys::RegularExpression packageRegex(packageExpr); if(!packageRegex.find(package.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "PACKAGE given invalid package name \"" << package << "\". " << "Package names must match \"" << packageExpr << "\"."; this->SetError(e.str()); @@ -314,7 +314,7 @@ void cmExportCommand::ReportRegistryError(std::string const& msg, std::string const& key, long err) { - cmOStringStream e; + std::ostringstream e; e << msg << "\n" << " HKEY_CURRENT_USER\\" << key << "\n"; wchar_t winmsg[1024]; @@ -355,7 +355,7 @@ void cmExportCommand::StorePackageRegistryWin(std::string const& package, RegCloseKey(hKey); if(err != ERROR_SUCCESS) { - cmOStringStream msg; + std::ostringstream msg; msg << "Cannot set registry value \"" << hash << "\" under key"; this->ReportRegistryError(msg.str(), key, err); return; @@ -400,7 +400,7 @@ void cmExportCommand::StorePackageRegistryDir(std::string const& package, } else { - cmOStringStream e; + std::ostringstream e; e << "Cannot create package registry file:\n" << " " << fname << "\n" << cmSystemTools::GetLastSystemError() << "\n"; diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 1f39d7a..0254cb4 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -81,7 +81,7 @@ bool cmExportFileGenerator::GenerateImportFile() if(!foutPtr.get() || !*foutPtr) { std::string se = cmSystemTools::GetLastSystemError(); - cmOStringStream e; + std::ostringstream e; e << "cannot write to file \"" << this->MainImportFile << "\": " << se; cmSystemTools::Error(e.str().c_str()); @@ -247,7 +247,7 @@ static bool checkInterfaceDirs(const std::string &prepro, continue; } cmake::MessageType messageType = cmake::FATAL_ERROR; - cmOStringStream e; + std::ostringstream e; if (genexPos != std::string::npos) { switch (target->GetPolicyStatusCMP0041()) @@ -295,7 +295,7 @@ static bool checkInterfaceDirs(const std::string &prepro, { case cmPolicies::WARN: { - cmOStringStream s; + std::ostringstream s; s << target->GetMakefile()->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0052) << "\n"; s << "Directory:\n \"" << *li << "\"\nin " @@ -391,7 +391,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface( if (cge->GetHadContextSensitiveCondition()) { cmMakefile* mf = target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target->GetName() << "\" is installed with " "INCLUDES DESTINATION set to a context sensitive path. Paths which " "depend on the configuration, policy values or the link interface are " @@ -473,7 +473,7 @@ void getCompatibleInterfaceProperties(cmTarget *target, if (!info) { cmMakefile* mf = target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "Exporting the target \"" << target->GetName() << "\" is not " "allowed since its linker language cannot be determined"; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -773,7 +773,7 @@ cmExportFileGenerator if(newCMP0022Behavior && !this->ExportOld) { cmMakefile *mf = target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, " "but also has old-style LINK_INTERFACE_LIBRARIES properties " "populated, but it was exported without the " @@ -857,7 +857,7 @@ cmExportFileGenerator { std::string prop = "IMPORTED_LINK_INTERFACE_MULTIPLICITY"; prop += suffix; - cmOStringStream m; + std::ostringstream m; m << iface->Multiplicity; properties[prop] = m.str(); } diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 3f5866a..98ed818 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -56,7 +56,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) } else { - cmOStringStream e; + std::ostringstream e; e << "install(EXPORT \"" << this->IEGen->GetExportSet()->GetName() << "\" ...) " << "includes target \"" << te->Target->GetName() @@ -133,7 +133,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) if (te->GetProperty("INTERFACE_SOURCES")) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << te->GetName() << "\" has a populated INTERFACE_SOURCES property. This is not " @@ -290,7 +290,7 @@ cmExportInstallFileGenerator::GenerateImportFileConfig( if(!exportFileStream) { std::string se = cmSystemTools::GetLastSystemError(); - cmOStringStream e; + std::ostringstream e; e << "cannot write to file \"" << fileName << "\": " << se; cmSystemTools::Error(e.str().c_str()); @@ -516,7 +516,7 @@ cmExportInstallFileGenerator cmTarget* dependee, int occurrences) { - cmOStringStream e; + std::ostringstream e; e << "install(EXPORT \"" << this->IEGen->GetExportSet()->GetName() << "\" ...) " diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx index cc35f84..6016c4c 100644 --- a/Source/cmExprParserHelper.cxx +++ b/Source/cmExprParserHelper.cxx @@ -99,7 +99,7 @@ int cmExprParserHelper::LexInput(char* buf, int maxlen) void cmExprParserHelper::Error(const char* str) { unsigned long pos = static_cast(this->InputBufferPos); - cmOStringStream ostr; + std::ostringstream ostr; ostr << str << " (" << pos << ")"; this->ErrorString = ostr.str(); } diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index cc42bca..eb50a7d 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -454,7 +454,7 @@ cmExtraCodeLiteGenerator::GetBuildCommand(const cmMakefile* mf) const else if ( generator == "MinGW Makefiles" || generator == "Unix Makefiles" ) { - cmOStringStream ss; + std::ostringstream ss; ss << make << " -j " << this->CpuCount; buildCommand = ss.str(); } @@ -482,7 +482,7 @@ cmExtraCodeLiteGenerator::GetSingleFileBuildCommand std::string generator = mf->GetSafeDefinition("CMAKE_GENERATOR"); if ( generator == "Unix Makefiles" || generator == "MinGW Makefiles" ) { - cmOStringStream ss; + std::ostringstream ss; ss << make << " -f$(ProjectPath)/Makefile $(CurrentFileName).cpp.o"; buildCommand = ss.str(); } diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 3c2dfa5..0306f18 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -404,7 +404,7 @@ bool cmFileCommand::HandleHashCommand(std::vector const& args) #if defined(CMAKE_BUILD_WITH_CMAKE) if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " requires a file name and output variable"; this->SetError(e.str()); return false; @@ -419,14 +419,14 @@ bool cmFileCommand::HandleHashCommand(std::vector const& args) this->Makefile->AddDefinition(args[2], out.c_str()); return true; } - cmOStringStream e; + std::ostringstream e; e << args[0] << " failed to read file \"" << args[1] << "\": " << cmSystemTools::GetLastSystemError(); this->SetError(e.str()); } return false; #else - cmOStringStream e; + std::ostringstream e; e << args[0] << " not available during bootstrap"; this->SetError(e.str().c_str()); return false; @@ -519,7 +519,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) if(sscanf(args[i].c_str(), "%d", &limit_input) != 1 || limit_input < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LIMIT_INPUT value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -532,7 +532,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) if(sscanf(args[i].c_str(), "%d", &limit_output) != 1 || limit_output < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LIMIT_OUTPUT value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -545,7 +545,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) int count; if(sscanf(args[i].c_str(), "%d", &count) != 1 || count < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LIMIT_COUNT value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -559,7 +559,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) int len; if(sscanf(args[i].c_str(), "%d", &len) != 1 || len < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LENGTH_MINIMUM value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -573,7 +573,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) int len; if(sscanf(args[i].c_str(), "%d", &len) != 1 || len < 0) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option LENGTH_MAXIMUM value \"" << args[i] << "\" is not an unsigned integer."; this->SetError(e.str()); @@ -586,7 +586,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) { if(!regex.compile(args[i].c_str())) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option REGEX value \"" << args[i] << "\" could not be compiled."; this->SetError(e.str()); @@ -603,7 +603,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "STRINGS option ENCODING \"" << args[i] << "\" not recognized."; this->SetError(e.str()); @@ -613,7 +613,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "STRINGS given unknown argument \"" << args[i] << "\""; this->SetError(e.str()); @@ -641,7 +641,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) #endif if(!fin) { - cmOStringStream e; + std::ostringstream e; e << "STRINGS file \"" << fileName << "\" cannot be read."; this->SetError(e.str()); return false; @@ -1037,7 +1037,7 @@ cmFileCommand::HandleDifferentCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "DIFFERENT given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -1152,7 +1152,7 @@ protected: { if(permissions && !cmSystemTools::SetPermissions(toFile, permissions)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot set permissions on \"" << toFile << "\""; this->FileCommand->SetError(e.str()); return false; @@ -1176,7 +1176,7 @@ protected: else if(arg == "SETGID") { permissions |= mode_setgid; } else { - cmOStringStream e; + std::ostringstream e; e << this->Name << " given invalid permission \"" << arg << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -1203,7 +1203,7 @@ protected: virtual bool ReportMissing(const char* fromFile) { // The input file does not exist and installation is not optional. - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot find \"" << fromFile << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -1236,14 +1236,14 @@ protected: void NotBeforeMatch(std::string const& arg) { - cmOStringStream e; + std::ostringstream e; e << "option " << arg << " may not appear before PATTERN or REGEX."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; } void NotAfterMatch(std::string const& arg) { - cmOStringStream e; + std::ostringstream e; e << "option " << arg << " may not appear after PATTERN or REGEX."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; @@ -1281,7 +1281,7 @@ bool cmFileCopier::Parse(std::vector const& args) if(!this->CheckKeyword(args[i]) && !this->CheckValue(args[i])) { - cmOStringStream e; + std::ostringstream e; e << "called with unknown argument \"" << args[i] << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -1297,7 +1297,7 @@ bool cmFileCopier::Parse(std::vector const& args) // Require a destination. if(this->Destination.empty()) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " given no DESTINATION"; this->FileCommand->SetError(e.str()); return false; @@ -1477,7 +1477,7 @@ bool cmFileCopier::CheckValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "could not compile PATTERN \"" << arg << "\"."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; @@ -1493,7 +1493,7 @@ bool cmFileCopier::CheckValue(std::string const& arg) } else { - cmOStringStream e; + std::ostringstream e; e << "could not compile REGEX \"" << arg << "\"."; this->FileCommand->SetError(e.str()); this->Doing = DoingError; @@ -1573,7 +1573,7 @@ bool cmFileCopier::Install(const char* fromFile, const char* toFile) { if(!*fromFile) { - cmOStringStream e; + std::ostringstream e; e << "INSTALL encountered an empty string input file name."; this->FileCommand->SetError(e.str()); return false; @@ -1614,7 +1614,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile) std::string symlinkTarget; if(!cmSystemTools::ReadSymlink(fromFile, symlinkTarget)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot read symlink \"" << fromFile << "\" to duplicate at \"" << toFile << "\"."; this->FileCommand->SetError(e.str()); @@ -1647,7 +1647,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile) // Create the symlink. if(!cmSystemTools::CreateSymlink(symlinkTarget, toFile)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot duplicate symlink \"" << fromFile << "\" at \"" << toFile << "\"."; this->FileCommand->SetError(e.str()); @@ -1679,7 +1679,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile, // Copy the file. if(copy && !cmSystemTools::CopyAFile(fromFile, toFile, true)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot copy file \"" << fromFile << "\" to \"" << toFile << "\"."; this->FileCommand->SetError(e.str()); @@ -1698,7 +1698,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile, } if (!cmSystemTools::CopyFileTime(fromFile, toFile)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot set modification time on \"" << toFile << "\""; this->FileCommand->SetError(e.str()); @@ -1730,7 +1730,7 @@ bool cmFileCopier::InstallDirectory(const char* source, // Make sure the destination directory exists. if(!cmSystemTools::MakeDirectory(destination)) { - cmOStringStream e; + std::ostringstream e; e << this->Name << " cannot make directory \"" << destination << "\": " << cmSystemTools::GetLastSystemError(); this->FileCommand->SetError(e.str()); @@ -2075,7 +2075,7 @@ bool cmFileInstaller::CheckKeyword(std::string const& arg) else if(arg == "COMPONENTS" || arg == "CONFIGURATIONS" || arg == "PROPERTIES") { - cmOStringStream e; + std::ostringstream e; e << "INSTALL called with old-style " << arg << " argument. " << "This script was generated with an older version of CMake. " << "Re-run this cmake version on your build tree."; @@ -2143,7 +2143,7 @@ bool cmFileInstaller } else { - cmOStringStream e; + std::ostringstream e; e << "Option TYPE given unknown value \"" << stype << "\"."; this->FileCommand->SetError(e.str()); return false; @@ -2288,7 +2288,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHANGE given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -2311,7 +2311,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector const& args) } if(!cmSystemTools::FileExists(file, true)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHANGE given FILE \"" << file << "\" that does not exist."; this->SetError(e.str()); return false; @@ -2323,7 +2323,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector const& args) bool changed; if(!cmSystemTools::ChangeRPath(file, oldRPath, newRPath, &emsg, &changed)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHANGE could not write new RPATH:\n" << " " << newRPath << "\n" << "to the file:\n" @@ -2373,7 +2373,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "RPATH_REMOVE given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -2386,7 +2386,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector const& args) } if(!cmSystemTools::FileExists(file, true)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_REMOVE given FILE \"" << file << "\" that does not exist."; this->SetError(e.str()); return false; @@ -2398,7 +2398,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector const& args) bool removed; if(!cmSystemTools::RemoveRPath(file, &emsg, &removed)) { - cmOStringStream e; + std::ostringstream e; e << "RPATH_REMOVE could not remove RPATH from file:\n" << " " << file << "\n" << emsg; @@ -2454,7 +2454,7 @@ cmFileCommand::HandleRPathCheckCommand(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "RPATH_CHECK given unknown argument " << args[i]; this->SetError(e.str()); return false; @@ -2555,7 +2555,7 @@ bool cmFileCommand::HandleRename(std::vector const& args) if(!cmSystemTools::RenameFile(oldname.c_str(), newname.c_str())) { std::string err = cmSystemTools::GetLastSystemError(); - cmOStringStream e; + std::ostringstream e; e << "RENAME failed to rename\n" << " " << oldname << "\n" << "to\n" @@ -2722,7 +2722,7 @@ namespace { if (updated) { - cmOStringStream oss; + std::ostringstream oss; oss << "[" << this->Text << " " << this->CurrentPercentage << "% complete]"; status = oss.str(); @@ -2994,7 +2994,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) msg += "\""; if(statusVar.size()) { - cmOStringStream result; + std::ostringstream result; result << (int)0 << ";\"" << msg; this->Makefile->AddDefinition(statusVar, result.str().c_str()); @@ -3133,7 +3133,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) if(statusVar.size()) { - cmOStringStream result; + std::ostringstream result; result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\""; this->Makefile->AddDefinition(statusVar, result.str().c_str()); @@ -3159,7 +3159,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) if (expectedHash != actualHash) { - cmOStringStream oss; + std::ostringstream oss; oss << "DOWNLOAD HASH mismatch" << std::endl << " for file: [" << file << "]" << std::endl << " expected hash: [" << expectedHash << "]" << std::endl @@ -3392,7 +3392,7 @@ cmFileCommand::HandleUploadCommand(std::vector const& args) if(statusVar.size()) { - cmOStringStream result; + std::ostringstream result; result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\""; this->Makefile->AddDefinition(statusVar, result.str().c_str()); @@ -3568,7 +3568,7 @@ bool cmFileCommand::HandleLockCommand( } else { - cmOStringStream e; + std::ostringstream e; e << merr << ", but got:\n \"" << args[i] << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -3601,7 +3601,7 @@ bool cmFileCommand::HandleLockCommand( if(!cmSystemTools::StringToLong(args[i].c_str(), &scanned) || scanned < 0) { - cmOStringStream e; + std::ostringstream e; e << "TIMEOUT value \"" << args[i] << "\" is not an unsigned integer."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -3610,7 +3610,7 @@ bool cmFileCommand::HandleLockCommand( } else { - cmOStringStream e; + std::ostringstream e; e << "expected DIRECTORY, RELEASE, GUARD, RESULT_VARIABLE or TIMEOUT\n"; e << "but got: \"" << args[i] << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -3635,7 +3635,7 @@ bool cmFileCommand::HandleLockCommand( std::string parentDir = cmSystemTools::GetParentDirectory(path); if (!cmSystemTools::MakeDirectory(parentDir)) { - cmOStringStream e; + std::ostringstream e; e << "directory\n \"" << parentDir << "\"\ncreation failed "; e << "(check permissions)."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -3645,7 +3645,7 @@ bool cmFileCommand::HandleLockCommand( FILE *file = cmsys::SystemTools::Fopen(path, "w"); if (!file) { - cmOStringStream e; + std::ostringstream e; e << "file\n \"" << path << "\"\ncreation failed (check permissions)."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); cmSystemTools::SetFatalErrorOccured(); @@ -3685,7 +3685,7 @@ bool cmFileCommand::HandleLockCommand( if (resultVariable.empty() && !fileLockResult.IsOk()) { - cmOStringStream e; + std::ostringstream e; e << "error locking file\n \"" << path << "\"\n" << result << "."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); cmSystemTools::SetFatalErrorOccured(); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 8410cda..9386e42 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -301,7 +301,7 @@ bool cmFindPackageCommand if(args[i].find_first_of(":/\\") != args[i].npos || cmSystemTools::GetFilenameLastExtension(args[i]) != ".cmake") { - cmOStringStream e; + std::ostringstream e; e << "given CONFIGS option followed by invalid file name \"" << args[i] << "\". The names given must be file names without " << "a path and with a \".cmake\" extension."; @@ -317,7 +317,7 @@ bool cmFindPackageCommand } else { - cmOStringStream e; + std::ostringstream e; e << "called with invalid argument \"" << args[i] << "\""; this->SetError(e.str()); return false; @@ -330,7 +330,7 @@ bool cmFindPackageCommand std::back_inserter(doubledComponents)); if(!doubledComponents.empty()) { - cmOStringStream e; + std::ostringstream e; e << "called with components that are both required and optional:\n"; for(unsigned int i=0; iUseConfigFiles = moduleArgs.empty(); if(!this->UseFindModules && !this->UseConfigFiles) { - cmOStringStream e; + std::ostringstream e; e << "given options exclusive to Module mode:\n"; for(std::set::const_iterator si = moduleArgs.begin(); si != moduleArgs.end(); ++si) @@ -427,7 +427,7 @@ bool cmFindPackageCommand { if (this->Required) { - cmOStringStream e; + std::ostringstream e; e << "for module " << this->Name << " called with REQUIRED, but " << disableFindPackageVar << " is enabled. A REQUIRED package cannot be disabled."; @@ -460,7 +460,7 @@ bool cmFindPackageCommand if(this->UseFindModules && this->UseConfigFiles && this->Makefile->IsOn("CMAKE_FIND_PACKAGE_WARN_NO_MODULE")) { - cmOStringStream aw; + std::ostringstream aw; if(this->RequiredCMakeVersion >= CMake_VERSION_ENCODE(2,8,8)) { aw << "find_package called without either MODULE or CONFIG option and " @@ -751,8 +751,8 @@ bool cmFindPackageCommand::HandlePackageMode() if (result && !found && (!this->Quiet || this->Required)) { // The variable is not set. - cmOStringStream e; - cmOStringStream aw; + std::ostringstream e; + std::ostringstream aw; if (configFileSetFOUNDFalse) { e << "Found package configuration file:\n" @@ -1470,7 +1470,7 @@ void cmFindPackageCommand::FillPrefixesBuilds() // It is likely that CMake will have recently built the project. for(int i=0; i <= 10; ++i) { - cmOStringStream r; + std::ostringstream r; r << "[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\" "Settings\\StartPath;WhereBuild" << i << "]"; diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 03d6590..8e3510d 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -170,7 +170,7 @@ bool cmForEachCommand step == 0 ) { - cmOStringStream str; + std::ostringstream str; str << "called with incorrect range specification: start "; str << start << ", stop " << stop << ", step " << step; this->SetError(str.str()); @@ -243,7 +243,7 @@ bool cmForEachCommand::HandleInMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "Unknown argument:\n" << " " << args[i] << "\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return true; diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 3580374..556ef19 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -103,7 +103,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies); // set the value of argc - cmOStringStream strStream; + std::ostringstream strStream; strStream << expandedArgs.size(); this->Makefile->AddDefinition("ARGC",strStream.str().c_str()); this->Makefile->MarkVariableAsUsed("ARGC"); @@ -111,7 +111,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass // set the values for ARGV0 ARGV1 ... for (unsigned int t = 0; t < expandedArgs.size(); ++t) { - cmOStringStream tmpStream; + std::ostringstream tmpStream; tmpStream << "ARGV" << t; this->Makefile->AddDefinition(tmpStream.str(), expandedArgs[t].c_str()); diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx index 75a84cb..bfbe918 100644 --- a/Source/cmGeneratorExpressionDAGChecker.cxx +++ b/Source/cmGeneratorExpressionDAGChecker.cxx @@ -106,7 +106,7 @@ void cmGeneratorExpressionDAGChecker::ReportError( if (parent && !parent->Parent) { - cmOStringStream e; + std::ostringstream e; e << "Error evaluating generator expression:\n" << " " << expr << "\n" << "Self reference on target \"" @@ -118,7 +118,7 @@ void cmGeneratorExpressionDAGChecker::ReportError( } { - cmOStringStream e; + std::ostringstream e; e << "Error evaluating generator expression:\n" << " " << expr << "\n" << "Dependency loop found."; @@ -130,7 +130,7 @@ void cmGeneratorExpressionDAGChecker::ReportError( int loopStep = 1; while (parent) { - cmOStringStream e; + std::ostringstream e; e << "Loop step " << loopStep << "\n" << " " << (parent->Content ? parent->Content->GetOriginalExpression() : expr) diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index 03d0bc6..4e2a868 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -51,7 +51,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config, } if (condResult != "1") { - cmOStringStream e; + std::ostringstream e; e << "Evaluation file condition \"" << rawCondition << "\" did " "not evaluate to valid content. Got \"" << condResult << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -73,7 +73,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config, { return; } - cmOStringStream e; + std::ostringstream e; e << "Evaluation file to be written multiple times for different " "configurations with different content:\n " << outputFileName; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -123,7 +123,7 @@ void cmGeneratorExpressionEvaluationFile::Generate() cmsys::ifstream fin(this->Input.c_str()); if(!fin) { - cmOStringStream e; + std::ostringstream e; e << "Evaluation file \"" << this->Input << "\" cannot be read."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 7ddf4d0..2975c43 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -36,7 +36,7 @@ void reportError(cmGeneratorExpressionContext *context, return; } - cmOStringStream e; + std::ostringstream e; e << "Error evaluating generator expression:\n" << " " << expr << "\n" << result; @@ -456,7 +456,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << context->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0044); context->Makefile->GetCMakeInstance() @@ -953,7 +953,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode if (!target) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << targetName << "\" not found."; @@ -1253,7 +1253,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode { if (!context->EvaluateForBuildsystem) { - cmOStringStream e; + std::ostringstream e; e << "The evaluation of the TARGET_OBJECTS generator expression " "is only suitable for consumption by CMake. It is not suitable " "for writing out elsewhere."; @@ -1266,7 +1266,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode context->Makefile->FindGeneratorTargetToUse(tgtName); if (!gt) { - cmOStringStream e; + std::ostringstream e; e << "Objects of target \"" << tgtName << "\" referenced but no such target exists."; reportError(context, content->GetOriginalExpression(), e.str()); @@ -1274,7 +1274,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode } if (gt->GetType() != cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Objects of target \"" << tgtName << "\" referenced but is not an OBJECT library."; reportError(context, content->GetOriginalExpression(), e.str()); @@ -2028,7 +2028,7 @@ std::string GeneratorExpressionContent::EvaluateParameters( } else { - cmOStringStream e; + std::ostringstream e; e << "$<" + identifier + "> expression requires " << numExpected << " comma separated parameters, but got " diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 2b531e2..cca06bb 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -31,7 +31,7 @@ void reportBadObjLib(std::vector const& badObjLib, { if(!badObjLib.empty()) { - cmOStringStream e; + std::ostringstream e; e << "OBJECT library \"" << target->GetName() << "\" contains:\n"; for(std::vector::const_iterator i = badObjLib.begin(); i != badObjLib.end(); ++i) @@ -630,7 +630,7 @@ cmTargetTraceDependencies this->GlobalGenerator->GetFilenameTargetDepends(sf); if (tgts.find(this->Target) != tgts.end()) { - cmOStringStream e; + std::ostringstream e; e << "Evaluation output file\n \"" << sf->GetFullPath() << "\"\ndepends on the sources of a target it is used in. This " "is a dependency loop and is not allowed."; diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 3c59c25..f0b2686 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -73,7 +73,7 @@ bool cmGetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid scope " << args[1] << ". " << "Valid scopes are " << "GLOBAL, DIRECTORY, TARGET, SOURCE, TEST, VARIABLE, CACHE, INSTALL."; @@ -122,7 +122,7 @@ bool cmGetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; @@ -312,7 +312,7 @@ bool cmGetPropertyCommand::HandleTargetMode() } else { - cmOStringStream e; + std::ostringstream e; e << "could not find TARGET " << this->Name << ". Perhaps it has not yet been created."; this->SetError(e.str()); @@ -338,7 +338,7 @@ bool cmGetPropertyCommand::HandleSourceMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given SOURCE name that could not be found or created: " << this->Name; this->SetError(e.str()); @@ -362,7 +362,7 @@ bool cmGetPropertyCommand::HandleTestMode() } // If not found it is an error. - cmOStringStream e; + std::ostringstream e; e << "given TEST name that does not exist: " << this->Name; this->SetError(e.str()); return false; @@ -423,7 +423,7 @@ bool cmGetPropertyCommand::HandleInstallMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given INSTALL name that could not be found or created: " << this->Name; this->SetError(e.str()); diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index aa6f0c1..d8f7679 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -47,7 +47,7 @@ bool cmGetTargetPropertyCommand else { bool issueMessage = false; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0045)) { diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index dd7fbc8..aee96dd 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -88,7 +88,7 @@ bool cmGlobalGenerator::SetGeneratorPlatform(std::string const& p, } else { - cmOStringStream e; + std::ostringstream e; e << "Generator\n" " " << this->GetName() << "\n" @@ -109,7 +109,7 @@ bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts, } else { - cmOStringStream e; + std::ostringstream e; e << "Generator\n" " " << this->GetName() << "\n" @@ -284,7 +284,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM") || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) { - cmOStringStream err; + std::ostringstream err; err << "CMake was unable to find a build program corresponding to \"" << this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You " << "probably need to select a different build tool."; @@ -405,7 +405,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, const char* lang = li->c_str(); if(this->LanguagesReady.find(lang) == this->LanguagesReady.end()) { - cmOStringStream e; + std::ostringstream e; e << "The test project needs language " << lang << " which is not enabled."; this->TryCompileOuterMakefile @@ -467,7 +467,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (pop) #endif - cmOStringStream windowsVersionString; + std::ostringstream windowsVersionString; windowsVersionString << osvi.dwMajorVersion << "." << osvi.dwMinorVersion; windowsVersionString.str(); mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", @@ -660,7 +660,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, std::string compilerEnv = "CMAKE_"; compilerEnv += lang; compilerEnv += "_COMPILER_ENV_VAR"; - cmOStringStream noCompiler; + std::ostringstream noCompiler; const char* compilerFile = mf->GetDefinition(compilerName); if(!compilerFile || !*compilerFile || cmSystemTools::IsNOTFOUND(compilerFile)) @@ -852,7 +852,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf, if(!this->CMakeInstance->GetIsInTryCompile() && mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0025")) { - cmOStringStream w; + std::ostringstream w; w << policies->GetPolicyWarning(cmPolicies::CMP0025) << "\n" "Converting " << lang << " compiler id \"AppleClang\" to \"Clang\" for compatibility." @@ -884,7 +884,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf, if(!this->CMakeInstance->GetIsInTryCompile() && mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0047")) { - cmOStringStream w; + std::ostringstream w; w << policies->GetPolicyWarning(cmPolicies::CMP0047) << "\n" "Converting " << lang << " compiler id \"QCC\" to \"GNU\" for compatibility." @@ -1147,7 +1147,7 @@ void cmGlobalGenerator::Configure() if ( this->CMakeInstance->GetWorkingMode() == cmake::NORMAL_MODE) { - cmOStringStream msg; + std::ostringstream msg; if(cmSystemTools::GetErrorOccuredFlag()) { msg << "Configuring incomplete, errors occurred!"; @@ -1196,7 +1196,7 @@ bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const } // This generator does not support duplicate custom targets. - cmOStringStream e; + std::ostringstream e; e << "This project has enabled the ALLOW_DUPLICATE_CUSTOM_TARGETS " << "global property. " << "The \"" << this->GetName() << "\" generator does not support " @@ -1346,7 +1346,7 @@ void cmGlobalGenerator::Generate() if(!this->CMP0042WarnTargets.empty()) { - cmOStringStream w; + std::ostringstream w; w << (this->GetCMakeInstance()->GetPolicies()-> GetPolicyWarning(cmPolicies::CMP0042)) << "\n"; @@ -2331,7 +2331,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end()); depends.erase(depends.begin(), depends.end()); - cmOStringStream ostr; + std::ostringstream ostr; if ( componentsSet->size() > 0 ) { ostr << "Available install components are:"; diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 6f0586b..b93fbb3 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -71,7 +71,7 @@ std::string cmGlobalNinjaGenerator::EncodeIdent(const std::string &ident, if (std::find_if(ident.begin(), ident.end(), std::not1(std::ptr_fun(IsIdentChar))) != ident.end()) { static unsigned VarNum = 0; - cmOStringStream names; + std::ostringstream names; names << "ident" << VarNum++; vars << names.str() << " = " << ident << "\n"; return "$" + names.str(); @@ -191,7 +191,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os, build += " " + rule; // Write the variables bound to this build statement. - cmOStringStream variable_assignments; + std::ostringstream variable_assignments; for(cmNinjaVars::const_iterator i = variables.begin(); i != variables.end(); ++i) cmGlobalNinjaGenerator::WriteVariable(variable_assignments, @@ -295,7 +295,7 @@ cmGlobalNinjaGenerator::AddMacOSXContentRule() cmLocalGenerator *lg = this->LocalGenerators[0]; cmMakefile* mfRoot = lg->GetMakefile(); - cmOStringStream cmd; + std::ostringstream cmd; cmd << lg->ConvertToOutputFormat( mfRoot->GetRequiredDefinition("CMAKE_COMMAND"), cmLocalGenerator::SHELL) @@ -1103,7 +1103,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) cmLocalGenerator *lg = this->LocalGenerators[0]; cmMakefile* mfRoot = lg->GetMakefile(); - cmOStringStream cmd; + std::ostringstream cmd; cmd << lg->ConvertToOutputFormat( mfRoot->GetRequiredDefinition("CMAKE_COMMAND"), cmLocalGenerator::SHELL) diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 3478534..1f08629 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -783,7 +783,7 @@ cmGlobalUnixMakefileGenerator3 lg->GetMakefile()->GetHomeOutputDirectory(); progressDir += cmake::GetCMakeFilesDirectory(); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; // all target counts progCmd << lg->Convert(progressDir, @@ -824,7 +824,7 @@ cmGlobalUnixMakefileGenerator3 { // TODO: Convert the total progress count to a make variable. - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # in target progCmd << lg->Convert(progressDir, @@ -841,7 +841,7 @@ cmGlobalUnixMakefileGenerator3 commands.push_back(lg->GetRecursiveMakeCall (tmp.c_str(),localName)); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 progCmd << lg->Convert(progressDir, cmLocalGenerator::FULL, diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 499ac56..531a714 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -156,7 +156,7 @@ cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts, if (this->SystemIsWindowsCE && ts.empty() && this->DefaultPlatformToolset.empty()) { - cmOStringStream e; + std::ostringstream e; e << this->GetName() << " Windows CE version '" << this->SystemVersion << "' requires CMAKE_GENERATOR_TOOLSET to be set."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -202,7 +202,7 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf) { if(this->DefaultPlatformName != "Win32") { - cmOStringStream e; + std::ostringstream e; e << "CMAKE_SYSTEM_NAME is 'Android' but CMAKE_GENERATOR " << "specifies a platform too: '" << this->GetName() << "'"; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -231,7 +231,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf) { if (this->DefaultPlatformName != "Win32") { - cmOStringStream e; + std::ostringstream e; e << "CMAKE_SYSTEM_NAME is 'WindowsCE' but CMAKE_GENERATOR " << "specifies a platform too: '" << this->GetName() << "'"; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -246,7 +246,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf) //---------------------------------------------------------------------------- bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf) { - cmOStringStream e; + std::ostringstream e; e << this->GetName() << " does not support Windows Phone."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -255,7 +255,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf) //---------------------------------------------------------------------------- bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf) { - cmOStringStream e; + std::ostringstream e; e << this->GetName() << " does not support Windows Store."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -320,7 +320,7 @@ void cmGlobalVisualStudio10Generator::Generate() if(this->LongestSource.Length > 0) { cmMakefile* mf = this->LongestSource.Target->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "The binary and/or source directory paths may be too long to generate " "Visual Studio 10 files for this project. " @@ -574,7 +574,7 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf) "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\" "Windows\\v7.1;InstallationFolder", winSDK_7_1)) { - cmOStringStream m; + std::ostringstream m; m << "Found Windows SDK v7.1: " << winSDK_7_1; mf->DisplayStatus(m.str().c_str(), -1); this->DefaultPlatformToolset = "Windows7.1SDK"; @@ -582,7 +582,7 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf) } else { - cmOStringStream e; + std::ostringstream e; e << "Cannot enable 64-bit tools with Visual Studio 2010 Express.\n" << "Install the Microsoft Windows SDK v7.1 to get 64-bit tools:\n" << " http://msdn.microsoft.com/en-us/windows/bb980924.aspx"; diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 2b69222..3013200 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -133,7 +133,7 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf) { if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Phone '8.0', but not '" @@ -156,7 +156,7 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf) { if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Store '8.0', but not '" diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index 047f2ad..2bc9379 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -113,7 +113,7 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf) { if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Phone '8.0' and '8.1', but " @@ -136,7 +136,7 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf) { if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) { - cmOStringStream e; + std::ostringstream e; if(this->DefaultPlatformToolset.empty()) { e << this->GetName() << " supports Windows Store '8.0' and '8.1', but " diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 6a480a9..8831a8b 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1170,7 +1170,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, this->CreateString("2147483647")); copyFilesBuildPhase->AddAttribute("dstSubfolderSpec", this->CreateString("6")); - cmOStringStream ostr; + std::ostringstream ostr; if (cmtarget.IsFrameworkOnApple()) { // dstPath in frameworks is relative to Versions/ @@ -1581,7 +1581,7 @@ void cmGlobalXCodeGenerator } else { - cmOStringStream str; + std::ostringstream str; str << "_buildpart_" << count++ ; tname[&ccg.GetCC()] = std::string(target.GetName()) + str.str(); makefileStream << "\\\n\t" << tname[&ccg.GetCC()]; @@ -2299,7 +2299,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, // VERSION -> current_version target.GetTargetVersion(false, major, minor, patch); - cmOStringStream v; + std::ostringstream v; // Xcode always wants at least 1.0.0 or nothing if(!(major == 0 && minor == 0 && patch == 0)) @@ -2311,7 +2311,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, // SOVERSION -> compatibility_version target.GetTargetVersion(true, major, minor, patch); - cmOStringStream vso; + std::ostringstream vso; // Xcode always wants at least 1.0.0 or nothing if(!(major == 0 && minor == 0 && patch == 0)) diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 601993f..11a5466 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -497,7 +497,7 @@ int cmGraphVizWriter::CollectAllTargets() continue; } //std::cout << "Found target: " << tit->first.c_str() << std::endl; - cmOStringStream ostr; + std::ostringstream ostr; ostr << this->GraphNodePrefix << cnt++; this->TargetNamesNodes[realTargetName] = ostr.str(); this->TargetPtrs[realTargetName] = &tit->second; @@ -544,7 +544,7 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt) this->TargetPtrs.find(libName); if ( tarIt == this->TargetPtrs.end() ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << this->GraphNodePrefix << cnt++; this->TargetNamesNodes[libName] = ostr.str(); this->TargetPtrs[libName] = NULL; diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 0a1d280..9d44db1 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -98,7 +98,7 @@ bool cmIncludeCommand if (gg->IsExportedTargetsFile(fname_abs)) { const char *modal = 0; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0024)) diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index c3c9c55..c30cf85 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -273,7 +273,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) if(!unknownArgs.empty()) { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << "TARGETS given unknown argument \"" << unknownArgs[0] << "\"."; this->SetError(e.str()); return false; @@ -373,7 +373,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) if (this->Makefile->IsAlias(*targetIt)) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given target \"" << (*targetIt) << "\" which is an alias."; this->SetError(e.str()); @@ -390,7 +390,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) target->GetType() != cmTarget::OBJECT_LIBRARY && target->GetType() != cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given target \"" << (*targetIt) << "\" which is not an executable, library, or module."; this->SetError(e.str()); @@ -398,7 +398,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else if(target->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given OBJECT library \"" << (*targetIt) << "\" which may not be installed."; this->SetError(e.str()); @@ -410,7 +410,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) else { // Did not find the target. - cmOStringStream e; + std::ostringstream e; e << "TARGETS given target \"" << (*targetIt) << "\" which does not exist in this directory."; this->SetError(e.str()); @@ -502,7 +502,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no FRAMEWORK DESTINATION for shared library " "FRAMEWORK target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -522,7 +522,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no LIBRARY DESTINATION for shared library " "target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -542,7 +542,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no ARCHIVE DESTINATION for static library " "target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -563,7 +563,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no LIBRARY DESTINATION for module target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -598,7 +598,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } if(!bundleGenerator) { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE " "executable target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -615,7 +615,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "TARGETS given no RUNTIME DESTINATION for executable " "target \"" << target.GetName() << "\"."; this->SetError(e.str()); @@ -681,7 +681,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "INSTALL TARGETS - target " << target.GetName() << " has " << "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION."; cmSystemTools::Message(e.str().c_str(), "Warning"); @@ -708,7 +708,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "INSTALL TARGETS - target " << target.GetName() << " has " << "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION."; cmSystemTools::Message(e.str().c_str(), "Warning"); @@ -734,7 +734,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector const& args) } else { - cmOStringStream e; + std::ostringstream e; e << "INSTALL TARGETS - target " << target.GetName() << " has " << "RESOURCE files but no RESOURCE DESTINATION."; cmSystemTools::Message(e.str().c_str(), "Warning"); @@ -855,7 +855,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) if(!unknownArgs.empty()) { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given unknown argument \"" << unknownArgs[0] << "\"."; this->SetError(e.str()); return false; @@ -870,7 +870,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) if(!ica.GetRename().empty() && files.GetVector().size() > 1) { // The rename option works only with one file. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given RENAME option with more than one file."; this->SetError(e.str()); return false; @@ -890,7 +890,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector const& args) if(ica.GetDestination().empty()) { // A destination is required. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given no DESTINATION!"; this->SetError(e.str()); return false; @@ -931,7 +931,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -945,7 +945,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -960,7 +960,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -988,7 +988,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Add this property to the current match rule. if(!in_match_mode || doing == DoingPattern || doing == DoingRegex) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" before a PATTERN or REGEX is given."; this->SetError(e.str()); @@ -1001,7 +1001,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(!in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" before a PATTERN or REGEX is given."; this->SetError(e.str()); @@ -1016,7 +1016,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1030,7 +1030,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1044,7 +1044,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1059,7 +1059,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1074,7 +1074,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1088,7 +1088,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) { if(in_match_mode) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " does not allow \"" << args[i] << "\" after PATTERN or REGEX."; this->SetError(e.str()); @@ -1113,7 +1113,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) if(cmSystemTools::FileExists(dir.c_str()) && !cmSystemTools::FileIsDirectory(dir)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given non-directory \"" << args[i] << "\" to install."; this->SetError(e.str()); @@ -1169,7 +1169,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Check the requested permission. if(!cmInstallCommandArguments::CheckPermissions(args[i],permissions_file)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid file permission \"" << args[i] << "\"."; this->SetError(e.str()); @@ -1181,7 +1181,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Check the requested permission. if(!cmInstallCommandArguments::CheckPermissions(args[i],permissions_dir)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid directory permission \"" << args[i] << "\"."; this->SetError(e.str()); @@ -1193,7 +1193,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) // Check the requested permission. if(!cmInstallCommandArguments::CheckPermissions(args[i], literal_args)) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid permission \"" << args[i] << "\"."; this->SetError(e.str()); @@ -1203,7 +1203,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) else { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given unknown argument \"" << args[i] << "\"."; this->SetError(e.str()); return false; @@ -1224,7 +1224,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector const& args) if(!destination) { // A destination is required. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given no DESTINATION!"; this->SetError(e.str()); return false; @@ -1271,7 +1271,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if (!unknownArgs.empty()) { // Unknown argument. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given unknown argument \"" << unknownArgs[0] << "\"."; this->SetError(e.str()); return false; @@ -1286,7 +1286,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(ica.GetDestination().empty()) { // A destination is required. - cmOStringStream e; + std::ostringstream e; e << args[0] << " given no DESTINATION!"; this->SetError(e.str()); return false; @@ -1296,7 +1296,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) std::string fname = filename.GetString(); if(fname.find_first_of(":/\\") != fname.npos) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid export file name \"" << fname << "\". " << "The FILE argument may not contain a path. " << "Specify the path in the DESTINATION argument."; @@ -1308,7 +1308,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(!fname.empty() && cmSystemTools::GetFilenameLastExtension(fname) != ".cmake") { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given invalid export file name \"" << fname << "\". " << "The FILE argument must specify a name ending in \".cmake\"."; this->SetError(e.str()); @@ -1323,7 +1323,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(fname.find_first_of(":/\\") != fname.npos) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " given export name \"" << exp.GetString() << "\". " << "This name cannot be safely converted to a file name. " << "Specify a different export name or use the FILE option to set " @@ -1348,7 +1348,7 @@ bool cmInstallCommand::HandleExportMode(std::vector const& args) if(!newCMP0022Behavior) { - cmOStringStream e; + std::ostringstream e; e << "INSTALL(EXPORT) given keyword \"" << "EXPORT_LINK_INTERFACE_LIBRARIES" << "\", but target \"" << te->Target->GetName() @@ -1395,7 +1395,7 @@ bool cmInstallCommand::MakeFilesFullPath(const char* modeName, // Make sure the file is not a directory. if(gpos == file.npos && cmSystemTools::FileIsDirectory(file)) { - cmOStringStream e; + std::ostringstream e; e << modeName << " given directory \"" << (*fileIt) << "\" to install."; this->SetError(e.str()); return false; diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index ddfd6c5..4480cc6 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -121,7 +121,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os) // Skip empty sets. if(ExportSet->GetTargetExports()->empty()) { - cmOStringStream e; + std::ostringstream e; e << "INSTALL(EXPORT) given unknown export \"" << ExportSet->GetName() << "\""; cmSystemTools::Error(e.str().c_str()); diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index bb346fb..8701b73 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -47,7 +47,7 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os) // Warn if installing an exclude-from-all target. if(this->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) { - cmOStringStream msg; + std::ostringstream msg; msg << "WARNING: Target \"" << this->Target->GetName() << "\" has EXCLUDE_FROM_ALL set and will not be built by default " << "but an install rule has been provided for it. CMake does " @@ -424,7 +424,7 @@ cmInstallTargetGenerator ::AddTweak(std::ostream& os, Indent const& indent, const std::string& config, std::string const& file, TweakMethod tweak) { - cmOStringStream tw; + std::ostringstream tw; (this->*tweak)(tw, indent.Next(), config, file); std::string tws = tw.str(); if(!tws.empty()) @@ -450,7 +450,7 @@ cmInstallTargetGenerator else { // Generate a foreach loop to tweak multiple files. - cmOStringStream tw; + std::ostringstream tw; this->AddTweak(tw, indent.Next(), config, "${file}", tweak); std::string tws = tw.str(); if(!tws.empty()) @@ -699,7 +699,7 @@ cmInstallTargetGenerator (!oldRuntimeDirs.empty() || !newRuntimeDirs.empty()) ) { - cmOStringStream msg; + std::ostringstream msg; msg << "WARNING: Target \"" << this->Target->GetName() << "\" has runtime paths which cannot be changed during install. " << "To change runtime paths, OS X version 10.6 or newer is required. " diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx index 3644d93..ade1feb 100644 --- a/Source/cmLinkDirectoriesCommand.cxx +++ b/Source/cmLinkDirectoriesCommand.cxx @@ -36,7 +36,7 @@ void cmLinkDirectoriesCommand::AddLinkDir(std::string const& dir) if(!cmSystemTools::FileIsFullPath(unixPath.c_str())) { bool convertToAbsolute = false; - cmOStringStream e; + std::ostringstream e; e << "This command specifies the relative path\n" << " " << unixPath << "\n" << "as a link directory.\n"; diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index f1ea088..47b8be5 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -225,7 +225,7 @@ bool cmListCommand::HandleGetCommand(std::vector const& args) } if ( item < 0 || nitem <= (size_t)item ) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << varArgsExpanded.size()-1 << ")"; @@ -322,7 +322,7 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) if((!this->GetList(varArgsExpanded, listName) || varArgsExpanded.empty()) && item != 0) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (0, 0)"; this->SetError(str.str()); return false; @@ -337,7 +337,7 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) } if ( item < 0 || nitem <= (size_t)item ) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << (varArgsExpanded.size() == 0?0:(varArgsExpanded.size()-1)) << ")"; @@ -570,7 +570,7 @@ bool cmListCommand::HandleRemoveAtCommand( } if ( item < 0 || nitem <= (size_t)item ) { - cmOStringStream str; + std::ostringstream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " << varArgsExpanded.size()-1 << ")"; diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 1c39563..3e26349 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -68,7 +68,7 @@ bool cmListFileParser::ParseFile() bom != cmListFileLexer_BOM_UTF8) { cmListFileLexer_SetFileName(this->Lexer, 0, 0); - cmOStringStream m; + std::ostringstream m; m << "File\n " << this->FileName << "\n" << "starts with a Byte-Order-Mark that is not UTF-8."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, m.str()); @@ -108,7 +108,7 @@ bool cmListFileParser::ParseFile() } else { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << token->line << ":\n" << "Parse error. Expected a newline, got " @@ -120,7 +120,7 @@ bool cmListFileParser::ParseFile() } else { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << token->line << ":\n" << "Parse error. Expected a command name, got " @@ -268,7 +268,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) token->type == cmListFileLexer_Token_Space) {} if(!token) { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << "Parse error. Function missing opening \"(\"."; @@ -277,7 +277,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) } if(token->type != cmListFileLexer_Token_ParenLeft) { - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << "Parse error. Expected \"(\", got " @@ -355,7 +355,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) else { // Error. - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << "Parse error. Function missing ending \")\". " @@ -367,7 +367,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line) } } - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << this->FileName << ":" << lastLine << ":\n" << "Parse error. Function missing ending \")\". " @@ -389,7 +389,7 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token, } bool isError = (this->Separation == SeparationError || delim == cmListFileArgument::Bracket); - cmOStringStream m; + std::ostringstream m; m << "Syntax " << (isError? "Error":"Warning") << " in cmake code at\n" << " " << this->FileName << ":" << token->line << ":" << token->column << "\n" diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx index a4063a6..cdfd00c 100644 --- a/Source/cmLoadCommandCommand.cxx +++ b/Source/cmLoadCommandCommand.cxx @@ -226,7 +226,7 @@ bool cmLoadCommandCommand std::string fullPath = cmSystemTools::FindFile(moduleName.c_str(), path); if (fullPath == "") { - cmOStringStream e; + std::ostringstream e; e << "Attempt to load command failed from file \"" << moduleName << "\""; this->SetError(e.str()); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2de6c93..52d312e 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -153,7 +153,7 @@ void cmLocalGenerator::ComputeObjectMaxPath() } else { - cmOStringStream w; + std::ostringstream w; w << "CMAKE_OBJECT_PATH_MAX is set to " << pmax << ", which is less than the minimum of 128. " << "The value will be ignored."; @@ -162,7 +162,7 @@ void cmLocalGenerator::ComputeObjectMaxPath() } else { - cmOStringStream w; + std::ostringstream w; w << "CMAKE_OBJECT_PATH_MAX is set to \"" << plen << "\", which fails to parse as a positive integer. " << "The value will be ignored."; @@ -191,7 +191,7 @@ void cmLocalGenerator::ReadInputFile() // The file is missing. Check policy CMP0014. cmMakefile* mf = this->Parent->GetMakefile(); - cmOStringStream e; + std::ostringstream e; e << "The source directory\n" << " " << this->Makefile->GetStartDirectory() << "\n" << "does not contain a CMakeLists.txt file."; @@ -1245,7 +1245,7 @@ void cmLocalGenerator::InsertRuleLauncher(std::string& s, cmTarget* target, { if(const char* val = this->GetRuleLauncher(target, prop)) { - cmOStringStream wrapped; + std::ostringstream wrapped; wrapped << val << " " << s; s = wrapped.str(); } @@ -1326,7 +1326,7 @@ std::string cmLocalGenerator::GetIncludeFlags( } OutputFormat shellFormat = forResponseFile? RESPONSE : SHELL; - cmOStringStream includeFlags; + std::ostringstream includeFlags; std::string flagVar = "CMAKE_INCLUDE_FLAG_"; flagVar += lang; @@ -1521,7 +1521,7 @@ void cmLocalGenerator::AddCompileOptions( } if (this->Makefile->IsLaterStandard(it->first, standard, it->second)) { - cmOStringStream e; + std::ostringstream e; e << "The COMPILE_FEATURES property of target \"" << target->GetName() << "\" was evaluated when computing the link " "implementation, and the \"" << it->first << "_STANDARD\" was \"" @@ -1880,7 +1880,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries, OutputFormat shellFormat = (forResponseFile) ? RESPONSE : ((useWatcomQuote) ? WATCOMQUOTE : SHELL); bool escapeAllowMakeVars = !forResponseFile; - cmOStringStream fout; + std::ostringstream fout; std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); cmComputeLinkInformation* pcli = tgt.Target->GetLinkInformation(config); if(!pcli) @@ -2242,7 +2242,7 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, const char *opt = target->GetMakefile()->GetDefinition(option_flag); if (!opt) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target->GetName() << "\" requires the language " "dialect \"" << lang << standardProp << "\" " << (ext ? "(with compiler extensions)" : "") << ", but CMake " @@ -2327,7 +2327,7 @@ static void AddVisibilityCompileOption(std::string &flags, cmTarget* target, && strcmp(prop, "protected") != 0 && strcmp(prop, "internal") != 0 ) { - cmOStringStream e; + std::ostringstream e; e << "Target " << target->GetName() << " uses unsupported value \"" << prop << "\" for " << flagDefine << "."; cmSystemTools::Error(e.str().c_str()); @@ -2442,7 +2442,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared, { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << "Variable " << flagsVar << " has been modified. CMake " "will ignore the POSITION_INDEPENDENT_CODE target property for " "shared libraries and will use the " << flagsVar << " variable " @@ -3251,7 +3251,7 @@ cmLocalGenerator // Warn if this is the first time the path has been seen. if(this->ObjectMaxPathViolations.insert(dir_max).second) { - cmOStringStream m; + std::ostringstream m; m << "The object file directory\n" << " " << dir_max << "\n" << "has " << dir_max.size() << " characters. " @@ -3649,7 +3649,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const } if(function_style) { - cmOStringStream e; + std::ostringstream e; e << "WARNING: Function-style preprocessor definitions may not be " << "passed on the compiler command line because many compilers " << "do not support it.\n" @@ -3662,7 +3662,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const // Many compilers do not support # in the value so we disable it. if(define.find_first_of("#") != define.npos) { - cmOStringStream e; + std::ostringstream e; e << "WARNING: Preprocessor definitions containing '#' may not be " << "passed on the compiler command line because many compilers " << "do not support it.\n" @@ -3704,7 +3704,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmTarget* target, } if(!cmSystemTools::FileExists(inFile.c_str(), true)) { - cmOStringStream e; + std::ostringstream e; e << "Target " << target->GetName() << " Info.plist template \"" << inFile << "\" could not be found."; cmSystemTools::Error(e.str().c_str()); @@ -3748,7 +3748,7 @@ void cmLocalGenerator::GenerateFrameworkInfoPList(cmTarget* target, } if(!cmSystemTools::FileExists(inFile.c_str(), true)) { - cmOStringStream e; + std::ostringstream e; e << "Target " << target->GetName() << " Info.plist template \"" << inFile << "\" could not be found."; cmSystemTools::Error(e.str().c_str()); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 0b0d971..413dc0f 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -369,7 +369,7 @@ std::string cmLocalNinjaGenerator::BuildCommandLine( return ":"; #endif - cmOStringStream cmd; + std::ostringstream cmd; for (std::vector::const_iterator li = cmdLines.begin(); li != cmdLines.end(); ++li) #ifdef _WIN32 @@ -409,7 +409,7 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines( if (wd.empty()) wd = this->GetMakefile()->GetStartOutputDirectory(); - cmOStringStream cdCmd; + std::ostringstream cdCmd; #ifdef _WIN32 std::string cdStr = "cd /D "; #else diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 812ded3..75231b7 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1554,7 +1554,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo, { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << tgtInfo << "\" is newer than depender \"" << internalDependFile << "\"." << std::endl; @@ -1577,7 +1577,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo, { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Dependee \"" << dirInfoFile << "\" is newer than depender \"" << internalDependFile << "\"." << std::endl; @@ -1788,7 +1788,7 @@ void cmLocalUnixMakefileGenerator3::CheckMultipleOutputs(bool verbose) { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Deleting primary custom command output \"" << dependee << "\" because another output \"" << depender << "\" does not exist." << std::endl; @@ -1918,7 +1918,7 @@ void cmLocalUnixMakefileGenerator3 std::string progressDir = this->Makefile->GetHomeOutputDirectory(); progressDir += cmake::GetCMakeFilesDirectory(); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; progCmd << this->Convert(progressDir, @@ -1942,7 +1942,7 @@ void cmLocalUnixMakefileGenerator3 this->Makefile->GetHomeOutputDirectory(), cmLocalGenerator::START_OUTPUT); { - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 progCmd << this->Convert(progressDir, cmLocalGenerator::FULL, diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index b9a5074..1d62093 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -1321,7 +1321,7 @@ void cmLocalVisualStudio6Generator int major; int minor; target.GetTargetVersion(major, minor); - cmOStringStream targetVersionStream; + std::ostringstream targetVersionStream; targetVersionStream << "/version:" << major << "." << minor; targetVersionFlag = targetVersionStream.str(); } @@ -1998,7 +1998,7 @@ cmLocalVisualStudio6Generator if(define.find_first_of(" ") != define.npos && define.find_first_of("\"$;") != define.npos) { - cmOStringStream e; + std::ostringstream e; e << "WARNING: The VS6 IDE does not support preprocessor definition " << "values with spaces and '\"', '$', or ';'.\n" << "CMake is dropping a preprocessor definition: " << define << "\n" diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 0e66764..914df5f 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1115,7 +1115,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, if(this->GetVersion() < VS8 || this->FortranProject) { - cmOStringStream libdeps; + std::ostringstream libdeps; this->Internal->OutputObjects(libdeps, &target); if(!libdeps.str().empty()) { @@ -1713,7 +1713,7 @@ bool cmLocalVisualStudio7Generator // Write the children to temporary output. bool hasChildrenWithSources = false; - cmOStringStream tmpOut; + std::ostringstream tmpOut; for(unsigned int i=0;iWriteGroup(&children[i], target, tmpOut, libName, configs)) diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index ae81c58..8c2489a 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -107,7 +107,7 @@ bool cmMacroHelperCommand::InvokeInitialPass cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies); // set the value of argc - cmOStringStream argcDefStream; + std::ostringstream argcDefStream; argcDefStream << expandedArgs.size(); std::string argcDef = argcDefStream.str(); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 20dae5a..1438f7e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -363,7 +363,7 @@ cmListFileBacktrace cmMakefile::GetBacktrace() const //---------------------------------------------------------------------------- void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const { - cmOStringStream msg; + std::ostringstream msg; msg << lff.FilePath << "(" << lff.Line << "): "; msg << lff.Name << "("; for(std::vector::const_iterator i = @@ -556,7 +556,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011() case cmPolicies::WARN: // Warn because the user did not set this policy. { - cmOStringStream w; + std::ostringstream w; w << policies->GetPolicyWarning(cmPolicies::CMP0011) << "\n" << "The included script\n " << this->File << "\n" << "affects policy settings. " @@ -568,7 +568,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011() case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << policies->GetRequiredPolicyError(cmPolicies::CMP0011) << "\n" << "The included script\n " << this->File << "\n" << "affects policy settings, so it requires this policy to be set."; @@ -741,7 +741,7 @@ void cmMakefile::EnforceDirectoryLevelRules() const // Diagnose a violation of CMP0000 if necessary. if(this->CheckCMP0000) { - cmOStringStream msg; + std::ostringstream msg; msg << "No cmake_minimum_required command is present. " << "A line of code such as\n" << " cmake_minimum_required(VERSION " @@ -897,7 +897,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target, { cmake::MessageType messageType = cmake::AUTHOR_WARNING; bool issueMessage = false; - cmOStringStream e; + std::ostringstream e; switch(this->GetPolicyStatus(cmPolicies::CMP0040)) { case cmPolicies::WARN: @@ -924,7 +924,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target, if(ti->second.GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target << "\" is an OBJECT library " "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -932,7 +932,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target, } if(ti->second.GetType() == cmTarget::INTERFACE_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << target << "\" is an INTERFACE library " "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -997,7 +997,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector& outputs, cmCustomCommandLine const& cl = *i; if(!cl.empty() && !cl[0].empty() && cl[0][0] == '"') { - cmOStringStream e; + std::ostringstream e; e << "COMMAND may not contain literal quotes:\n " << cl[0] << "\n"; this->IssueMessage(cmake::FATAL_ERROR, e.str()); return 0; @@ -1555,7 +1555,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target, (tgt->GetType() == cmTarget::INTERFACE_LIBRARY) || tgt->IsExecutableWithExports())) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << lib << "\" of type " << cmTarget::GetTargetTypeName(tgt->GetType()) << " may not be linked into another target. " @@ -1568,7 +1568,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target, } else { - cmOStringStream e; + std::ostringstream e; e << "Attempt to add link library \"" << lib << "\" to target \"" << target << "\" which is not built in this directory."; @@ -1584,7 +1584,7 @@ void cmMakefile::AddLinkDirectoryForTarget(const std::string& target, { if(this->IsAlias(target)) { - cmOStringStream e; + std::ostringstream e; e << "ALIAS target \"" << target << "\" " << "may not be linked into another target."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -2006,7 +2006,7 @@ void cmMakefile::CheckForUnused(const char* reason, !cmSystemTools::IsSubDirectory(path, cmake::GetCMakeFilesDirectory()))) { - cmOStringStream msg; + std::ostringstream msg; msg << "unused variable (" << reason << ") \'" << name << "\'"; this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, msg.str(), @@ -2311,7 +2311,7 @@ void cmMakefile::ExpandVariablesCMP0019() { return; } - cmOStringStream w; + std::ostringstream w; const char *includeDirs = this->GetProperty("INCLUDE_DIRECTORIES"); if(mightExpandVariablesCMP0019(includeDirs)) @@ -2389,7 +2389,7 @@ void cmMakefile::ExpandVariablesCMP0019() if(!w.str().empty()) { - cmOStringStream m; + std::ostringstream m; m << this->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0019) << "\n" << "The following variable evaluations were encountered:\n" @@ -2782,7 +2782,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld( else { // Construct the main error message. - cmOStringStream error; + std::ostringstream error; error << "Syntax error in cmake code "; if(filename && line > 0) { @@ -2890,7 +2890,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( case NORMAL: if(filename && lookup == lineVar) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << line; varresult = ostr.str(); } @@ -2932,7 +2932,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( cmSystemTools::IsSubDirectory(filename, this->GetHomeOutputDirectory())) { - cmOStringStream msg; + std::ostringstream msg; cmListFileBacktrace bt(this->GetLocalGenerator()); cmListFileContext lfc; lfc.FilePath = filename; @@ -3126,7 +3126,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew( if(error) { - cmOStringStream emsg; + std::ostringstream emsg; emsg << "Syntax error in cmake code "; if(filename) { @@ -3341,7 +3341,7 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError) { // Report the context in which the unclosed block was opened. cmListFileContext const& lfc = fb->GetStartingContext(); - cmOStringStream e; + std::ostringstream e; e << "A logical block opening on the line\n" << " " << lfc << "\n" << "is not closed."; @@ -3499,7 +3499,7 @@ cmMakefile::RemoveFunctionBlocker(cmFunctionBlocker* fb, if(!(*pos)->ShouldRemove(lff, *this)) { cmListFileContext const& lfc = fb->GetStartingContext(); - cmOStringStream e; + std::ostringstream e; e << "A logical block opening on the line\n" << " " << lfc << "\n" << "closes on the line\n" @@ -3559,14 +3559,14 @@ void cmMakefile::SetScriptModeFile(const char* scriptfile) void cmMakefile::SetArgcArgv(const std::vector& args) { - cmOStringStream strStream; + std::ostringstream strStream; strStream << args.size(); this->AddDefinition("CMAKE_ARGC", strStream.str().c_str()); //this->MarkVariableAsUsed("CMAKE_ARGC"); for (unsigned int t = 0; t < args.size(); ++t) { - cmOStringStream tmpStream; + std::ostringstream tmpStream; tmpStream << "CMAKE_ARGV" << t; this->AddDefinition(tmpStream.str(), args[t].c_str()); //this->MarkVariableAsUsed(tmpStream.str().c_str()); @@ -3918,7 +3918,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << "File " << currentFile << " includes " << moduleInCMakeModulePath << " (found via CMAKE_MODULE_PATH) which shadows " @@ -4098,7 +4098,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile, if(bom != cmsys::FStream::BOM_None && bom != cmsys::FStream::BOM_UTF8) { - cmOStringStream e; + std::ostringstream e; e << "File starts with a Byte-Order-Mark that is not UTF-8:\n " << sinfile; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -4310,7 +4310,7 @@ const char *cmMakefile::GetProperty(const std::string& prop, } else if (prop == "LINK_DIRECTORIES") { - cmOStringStream str; + std::ostringstream str; for (std::vector::const_iterator it = this->GetLinkDirectories().begin(); it != this->GetLinkDirectories().end(); @@ -4488,7 +4488,7 @@ void cmMakefile::AddCMakeDependFilesFromUser() std::string cmMakefile::GetListFileStack() const { - cmOStringStream tmp; + std::ostringstream tmp; size_t depth = this->ListFileStack.size(); if (depth > 0) { @@ -4606,7 +4606,7 @@ void cmMakefile::RaiseScope(const std::string& var, const char *varDef) } else { - cmOStringStream m; + std::ostringstream m; m << "Cannot set \"" << var << "\": current scope has no parent."; this->IssueMessage(cmake::AUTHOR_WARNING, m.str()); } @@ -4701,7 +4701,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, { if(this->IsAlias(name)) { - cmOStringStream e; + std::ostringstream e; e << "cannot create target \"" << name << "\" because an alias with the same name already exists."; msg = e.str(); @@ -4715,7 +4715,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, { // Imported targets were not supported in previous versions. // This is new code, so we can make it an error. - cmOStringStream e; + std::ostringstream e; e << "cannot create target \"" << name << "\" because an imported target with the same name already exists."; msg = e.str(); @@ -4754,7 +4754,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, // Produce an error that tells the user how to work around the // problem. - cmOStringStream e; + std::ostringstream e; e << "cannot create target \"" << name << "\" because another target with the same name already exists. " << "The existing target is "; @@ -4800,7 +4800,7 @@ bool cmMakefile::EnforceUniqueDir(const std::string& srcPath, { return true; } - cmOStringStream e; + std::ostringstream e; switch (this->GetPolicyStatus(cmPolicies::CMP0013)) { case cmPolicies::WARN: @@ -4985,7 +4985,7 @@ bool cmMakefile::SetPolicy(const char *id, cmPolicies::PolicyID pid; if (!this->GetPolicies()->GetPolicyID(id, /* out */ pid)) { - cmOStringStream e; + std::ostringstream e; e << "Policy \"" << id << "\" is not known to this version of CMake."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; @@ -5200,7 +5200,7 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature, availableFeatures.end(), feature) == availableFeatures.end()) { - cmOStringStream e; + std::ostringstream e; e << "The compiler feature \"" << feature << "\" is not known to " << lang << " compiler\n\"" << this->GetDefinition("CMAKE_" + lang + "_COMPILER_ID") @@ -5240,7 +5240,7 @@ CompileFeatureKnown(cmTarget const* target, const std::string& feature, lang = "CXX"; return true; } - cmOStringStream e; + std::ostringstream e; if (error) { e << "specified"; @@ -5271,7 +5271,7 @@ CompileFeaturesAvailable(const std::string& lang, std::string *error) const if (!featuresKnown || !*featuresKnown) { - cmOStringStream e; + std::ostringstream e; if (error) { e << "no"; @@ -5326,7 +5326,7 @@ HaveCFeatureAvailable(cmTarget const* target, const std::string& feature) const if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The C_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -5403,7 +5403,7 @@ bool cmMakefile::HaveCxxFeatureAvailable(cmTarget const* target, if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), cmStrCmp(existingCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The CXX_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCxxStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -5478,7 +5478,7 @@ AddRequiredTargetCxxFeature(cmTarget *target, if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), cmStrCmp(existingCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The CXX_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCxxStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -5577,7 +5577,7 @@ AddRequiredTargetCFeature(cmTarget *target, const std::string& feature) const if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS)) { - cmOStringStream e; + std::ostringstream e; e << "The C_STANDARD property on target \"" << target->GetName() << "\" contained an invalid value: \"" << existingCStandard << "\"."; this->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index fc52ccc..d4036d2 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -371,8 +371,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) std::string targetVersionMajor; std::string targetVersionMinor; { - cmOStringStream majorStream; - cmOStringStream minorStream; + std::ostringstream majorStream; + std::ostringstream minorStream; int major; int minor; this->Target->GetTargetVersion(major, minor); diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 305d81d..cdda36c 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -566,8 +566,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules std::string targetVersionMajor; std::string targetVersionMinor; { - cmOStringStream majorStream; - cmOStringStream minorStream; + std::ostringstream majorStream; + std::ostringstream minorStream; int major; int minor; this->Target->GetTargetVersion(major, minor); @@ -805,7 +805,7 @@ cmMakefileLibraryTargetGenerator if(major > 0 || minor > 0 || patch > 0) { // Append the flag since a non-zero version is specified. - cmOStringStream vflag; + std::ostringstream vflag; vflag << flag << major << "." << minor << "." << patch; this->LocalGenerator->AppendFlags(flags, vflag.str()); } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index cbf8573..ef08c21 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -451,7 +451,7 @@ void cmMakefileTargetGenerator } else { - cmOStringStream err; + std::ostringstream err; err << "Warning: Source file \"" << source.GetFullPath() << "\" is listed multiple times for target \"" @@ -1101,7 +1101,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() // Add a command to call CMake to scan dependencies. CMake will // touch the corresponding depends file after scanning dependencies. - cmOStringStream depCmd; + std::ostringstream depCmd; // TODO: Account for source file properties and directory-level // definitions when scanning for dependencies. #if !defined(_WIN32) || defined(__CYGWIN__) @@ -1217,7 +1217,7 @@ void cmMakefileTargetGenerator } // Now append the actual user-specified commands. - cmOStringStream content; + std::ostringstream content; this->LocalGenerator->AppendCustomCommand(commands, ccg, this->Target, false, cmLocalGenerator::HOME_OUTPUT, &content); @@ -1279,7 +1279,7 @@ cmMakefileTargetGenerator::AppendProgress(std::vector& commands) } std::string progressDir = this->Makefile->GetHomeOutputDirectory(); progressDir += cmake::GetCMakeFilesDirectory(); - cmOStringStream progCmd; + std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; progCmd << this->LocalGenerator->Convert(progressDir, cmLocalGenerator::FULL, diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 53b7a8e..32a5ccf 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -218,8 +218,8 @@ cmNinjaNormalTargetGenerator std::string targetVersionMajor; std::string targetVersionMinor; { - cmOStringStream majorStream; - cmOStringStream minorStream; + std::ostringstream majorStream; + std::ostringstream minorStream; int major; int minor; this->GetTarget()->GetTargetVersion(major, minor); @@ -255,10 +255,10 @@ cmNinjaNormalTargetGenerator this->GetLocalGenerator()->BuildCommandLine(linkCmds); // Write the linker rule with response file if needed. - cmOStringStream comment; + std::ostringstream comment; comment << "Rule for linking " << this->TargetLinkLanguage << " " << this->GetVisibleTypeName() << "."; - cmOStringStream description; + std::ostringstream description; description << "Linking " << this->TargetLinkLanguage << " " << this->GetVisibleTypeName() << " $TARGET_FILE"; this->GetGlobalGenerator()->AddRule(ruleName, @@ -435,7 +435,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() cmNinjaVars vars; // Compute the comment. - cmOStringStream comment; + std::ostringstream comment; comment << "Link the " << this->GetVisibleTypeName() << " " << targetOutputReal; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index b36ff93..c019ceb 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -468,9 +468,9 @@ cmNinjaTargetGenerator // Write the rule for compiling file of the given language. - cmOStringStream comment; + std::ostringstream comment; comment << "Rule for compiling " << lang << " files."; - cmOStringStream description; + std::ostringstream description; description << "Building " << lang << " object $out"; this->GetGlobalGenerator()->AddRule(this->LanguageCompilerRule(lang), cmdLine, diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 3cdd2f6..116d42f 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -86,7 +86,7 @@ public: } } - void FindImplicitConflicts(cmOStringStream& w) + void FindImplicitConflicts(std::ostringstream& w) { bool first = true; for(unsigned int i=0; i < this->OD->OriginalDirectories.size(); ++i) @@ -541,7 +541,7 @@ void cmOrderDirectories::FindImplicitConflicts() { // Check for items in implicit link directories that have conflicts // in the explicit directories. - cmOStringStream conflicts; + std::ostringstream conflicts; for(unsigned int i=0; i < this->ImplicitDirEntries.size(); ++i) { this->ImplicitDirEntries[i]->FindImplicitConflicts(conflicts); @@ -555,7 +555,7 @@ void cmOrderDirectories::FindImplicitConflicts() } // Warn about the conflicts. - cmOStringStream w; + std::ostringstream w; w << "Cannot generate a safe " << this->Purpose << " for target " << this->Target->GetName() << " because files in some directories may conflict with " @@ -624,7 +624,7 @@ void cmOrderDirectories::DiagnoseCycle() this->CycleDiagnosed = true; // Construct the message. - cmOStringStream e; + std::ostringstream e; e << "Cannot generate a safe " << this->Purpose << " for target " << this->Target->GetName() << " because there is a cycle in the constraint graph:\n"; diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 1a27a25..da64617 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -41,7 +41,7 @@ public: std::string GetVersionString() { - cmOStringStream v; + std::ostringstream v; v << this->MajorVersionIntroduced << "." << this->MinorVersionIntroduced; if(this->PatchVersionIntroduced > 0) { @@ -432,7 +432,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, if(sscanf(ver.c_str(), "%u.%u.%u.%u", &majorVer, &minorVer, &patchVer, &tweakVer) < 2) { - cmOStringStream e; + std::ostringstream e; e << "Invalid policy version value \"" << ver << "\". " << "A numeric major.minor[.patch[.tweak]] must be given."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -462,7 +462,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, patchVer == cmVersion::GetPatchVersion() && tweakVer > cmVersion::GetTweakVersion())) { - cmOStringStream e; + std::ostringstream e; e << "An attempt was made to set the policy version of CMake to \"" << version << "\" which is greater than this version of CMake. " << "This is not allowed because the greater version may have new " @@ -534,7 +534,7 @@ bool cmPolicies::GetPolicyDefault(cmMakefile* mf, std::string const& policy, } else { - cmOStringStream e; + std::ostringstream e; e << defaultVar << " has value \"" << defaultValue << "\" but must be \"OLD\", \"NEW\", or \"\" (empty)."; mf->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -584,7 +584,7 @@ std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id) return "Request for warning text for undefined policy!"; } - cmOStringStream msg; + std::ostringstream msg; msg << "Policy " << pos->second->IDString << " is not set: " "" << pos->second->ShortDescription << " " @@ -608,7 +608,7 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id) return "Request for error text for undefined policy!"; } - cmOStringStream error; + std::ostringstream error; error << "Policy " << pos->second->IDString << " is not set to NEW: " "" << pos->second->ShortDescription << " " @@ -645,7 +645,7 @@ std::string cmPolicies::GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id) { std::string pid = this->GetPolicyIDString(id); - cmOStringStream e; + std::ostringstream e; e << "Policy " << pid << " may not be set to OLD behavior because this " << "version of CMake no longer supports it. " << "The policy was introduced in " @@ -667,7 +667,7 @@ cmPolicies::DiagnoseAncientPolicies(std::vector const& ancient, unsigned int patchVer, cmMakefile* mf) { - cmOStringStream e; + std::ostringstream e; e << "The project requests behavior compatible with CMake version \"" << majorVer << "." << minorVer << "." << patchVer << "\", which requires the OLD behavior for some policies:\n"; diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 12318c8..61c0133 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -215,7 +215,7 @@ bool cmProjectCommand } if(!vw.empty()) { - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0048)) << "\nThe following variable(s) would be set to empty:" << vw; diff --git a/Source/cmSeparateArgumentsCommand.cxx b/Source/cmSeparateArgumentsCommand.cxx index 1ee3f29..8e6c311 100644 --- a/Source/cmSeparateArgumentsCommand.cxx +++ b/Source/cmSeparateArgumentsCommand.cxx @@ -51,7 +51,7 @@ bool cmSeparateArgumentsCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given unknown argument " << args[i]; this->SetError(e.str()); return false; diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index 653d764..1150bc7 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -67,7 +67,7 @@ bool cmSetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid scope " << *arg << ". " << "Valid scopes are GLOBAL, DIRECTORY, " "TARGET, SOURCE, TEST, CACHE, INSTALL."; @@ -117,7 +117,7 @@ bool cmSetPropertyCommand } else { - cmOStringStream e; + std::ostringstream e; e << "given invalid argument \"" << *arg << "\"."; this->SetError(e.str()); return false; @@ -265,7 +265,7 @@ bool cmSetPropertyCommand::HandleTargetMode() } else { - cmOStringStream e; + std::ostringstream e; e << "could not find TARGET " << *ni << ". Perhaps it has not yet been created."; this->SetError(e.str()); @@ -316,7 +316,7 @@ bool cmSetPropertyCommand::HandleSourceMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given SOURCE name that could not be found or created: " << *ni; this->SetError(e.str()); return false; @@ -373,7 +373,7 @@ bool cmSetPropertyCommand::HandleTestMode() // Names that are still left were not found. if(!this->Names.empty()) { - cmOStringStream e; + std::ostringstream e; e << "given TEST names that do not exist:\n"; for(std::set::const_iterator ni = this->Names.begin(); ni != this->Names.end(); ++ni) @@ -417,7 +417,7 @@ bool cmSetPropertyCommand::HandleCacheMode() !cmSystemTools::IsOn(this->PropertyValue.c_str()) && !cmSystemTools::IsOff(this->PropertyValue.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "given non-boolean value \"" << this->PropertyValue << "\" for CACHE property \"ADVANCED\". "; this->SetError(e.str()); @@ -428,7 +428,7 @@ bool cmSetPropertyCommand::HandleCacheMode() { if(!cmCacheManager::IsType(this->PropertyValue.c_str())) { - cmOStringStream e; + std::ostringstream e; e << "given invalid CACHE entry TYPE \"" << this->PropertyValue << "\""; this->SetError(e.str()); return false; @@ -438,7 +438,7 @@ bool cmSetPropertyCommand::HandleCacheMode() this->PropertyName != "STRINGS" && this->PropertyName != "VALUE") { - cmOStringStream e; + std::ostringstream e; e << "given invalid CACHE property " << this->PropertyName << ". " << "Settable CACHE properties are: " << "ADVANCED, HELPSTRING, STRINGS, TYPE, and VALUE."; @@ -463,7 +463,7 @@ bool cmSetPropertyCommand::HandleCacheMode() } else { - cmOStringStream e; + std::ostringstream e; e << "could not find CACHE variable " << *ni << ". Perhaps it has not yet been created."; this->SetError(e.str()); @@ -513,7 +513,7 @@ bool cmSetPropertyCommand::HandleInstallMode() } else { - cmOStringStream e; + std::ostringstream e; e << "given INSTALL name that could not be found or created: " << *i; this->SetError(e.str()); return false; diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 6fe5c62..27fda40 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -202,7 +202,7 @@ bool cmSourceFile::FindFullPath(std::string* error) } } - cmOStringStream e; + std::ostringstream e; std::string missing = this->Location.GetDirectory(); if(!missing.empty()) { diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index edba5ba..1741e05 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -90,7 +90,7 @@ bool cmSourceGroupCommand } else { - cmOStringStream err; + std::ostringstream err; err << "Unknown argument \"" << args[i] << "\". " << "Perhaps the FILES keyword is missing.\n"; this->SetError(err.str()); diff --git a/Source/cmStandardIncludes.cxx b/Source/cmStandardIncludes.cxx index a4bdb2e..23c570c 100644 --- a/Source/cmStandardIncludes.cxx +++ b/Source/cmStandardIncludes.cxx @@ -11,6 +11,6 @@ ============================================================================*/ #include "cmStandardIncludes.h" #if !defined(CMAKE_NO_ANSI_STRING_STREAM) -cmOStringStream::cmOStringStream() {} -cmOStringStream::~cmOStringStream() {} +std::ostringstream::cmOStringStream() {} +std::ostringstream::~cmOStringStream() {} #endif diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index df031b9..a7db271 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -140,7 +140,7 @@ private: #endif /* Poison this operator to avoid common mistakes. */ -extern void operator << (std::ostream&, const cmOStringStream&); +extern void operator << (std::ostream&, const std::ostringstream&); /** Standard documentation entry for cmDocumentation's formatting. */ struct cmDocumentationEntry diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 8341027..fe962ba 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -122,7 +122,7 @@ bool cmStringCommand::HandleHashCommand(std::vector const& args) #if defined(CMAKE_BUILD_WITH_CMAKE) if(args.size() != 3) { - cmOStringStream e; + std::ostringstream e; e << args[0] << " requires an output variable and an input string"; this->SetError(e.str()); return false; @@ -137,7 +137,7 @@ bool cmStringCommand::HandleHashCommand(std::vector const& args) } return false; #else - cmOStringStream e; + std::ostringstream e; e << args[0] << " not available during bootstrap"; this->SetError(e.str().c_str()); return false; @@ -233,7 +233,7 @@ bool cmStringCommand::HandleConfigureCommand( } else { - cmOStringStream err; + std::ostringstream err; err << "Unrecognized argument \"" << args[i] << "\""; this->SetError(err.str()); return false; @@ -591,7 +591,7 @@ bool cmStringCommand::HandleFindCommand(std::vector const& } if(std::string::npos != pos) { - cmOStringStream s; + std::ostringstream s; s << pos; this->Makefile->AddDefinition(outvar, s.str().c_str()); return true; @@ -705,7 +705,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector const& int intStringLength = static_cast(stringLength); if ( begin < 0 || begin > intStringLength ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "begin index: " << begin << " is out of range 0 - " << stringLength; this->SetError(ostr.str()); @@ -713,7 +713,7 @@ bool cmStringCommand::HandleSubstringCommand(std::vector const& } if ( end < -1 ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "end index: " << end << " should be -1 or greater"; this->SetError(ostr.str()); return false; @@ -1089,7 +1089,7 @@ bool cmStringCommand this->Makefile->AddDefinition(outputVariable, uuid.c_str()); return true; #else - cmOStringStream e; + std::ostringstream e; e << args[0] << " not available during bootstrap"; this->SetError(e.str().c_str()); return false; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 1d36ff5..16e71cc 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2501,7 +2501,7 @@ bool cmSystemTools::ChangeRPath(std::string const& file, } if(emsg) { - cmOStringStream e; + std::ostringstream e; e << "The current " << se_name[i] << " is:\n" << " " << se[i]->Value << "\n" << "which does not contain:\n" diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 94a6de3..5d68d9d 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -686,7 +686,7 @@ static bool processSources(cmTarget const* tgt, if (!targetName.empty() && !cmSystemTools::FileIsFullPath(src.c_str())) { - cmOStringStream err; + std::ostringstream err; if (!targetName.empty()) { err << "Target \"" << targetName << "\" contains relative " @@ -863,7 +863,7 @@ cmTarget::GetConfigCommonSourceFiles(std::vector& files) const thisConfigFiles += (*fi)->GetFullPath(); sep = "\n "; } - cmOStringStream e; + std::ostringstream e; e << "Target \"" << this->Name << "\" has source files which vary by " "configuration. This is not supported by the \"" << this->Makefile->GetLocalGenerator() @@ -996,7 +996,7 @@ std::string cmTarget::ProcessSourceItemCMP0049(const std::string& s) this->Makefile->ExpandVariablesInString(src); if (src != s) { - cmOStringStream e; + std::ostringstream e; bool noMessage = false; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0049)) @@ -1279,7 +1279,7 @@ bool cmTarget::PushTLLCommandTrace(TLLSignature signature) } //---------------------------------------------------------------------------- -void cmTarget::GetTllSignatureTraces(cmOStringStream &s, +void cmTarget::GetTllSignatureTraces(std::ostringstream &s, TLLSignature sig) const { std::vector sigs; @@ -1307,7 +1307,7 @@ void cmTarget::GetTllSignatureTraces(cmOStringStream &s, if(i != it->end()) { cmListFileContext const& lfc = *i; - cmOStringStream line; + std::ostringstream line; line << " * " << (lfc.Line? "": " in ") << lfc << std::endl; if (emitted.insert(line.str()).second) { @@ -1749,7 +1749,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) if (this->GetType() == INTERFACE_LIBRARY && !whiteListedInterfaceProperty(prop)) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " "The property \"" << prop << "\" is not allowed."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1757,7 +1757,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) } else if (prop == "NAME") { - cmOStringStream e; + std::ostringstream e; e << "NAME property is read-only\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; @@ -1800,7 +1800,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) } else if(prop == "EXPORT_NAME" && this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT_NAME property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1816,7 +1816,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) { if(this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "SOURCES property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1844,7 +1844,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, if (this->GetType() == INTERFACE_LIBRARY && !whiteListedInterfaceProperty(prop)) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " "The property \"" << prop << "\" is not allowed."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1852,7 +1852,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } else if (prop == "NAME") { - cmOStringStream e; + std::ostringstream e; e << "NAME property is read-only\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; @@ -1887,7 +1887,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, } else if(prop == "EXPORT_NAME" && this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT_NAME property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1902,7 +1902,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, { if(this->IsImported()) { - cmOStringStream e; + std::ostringstream e; e << "SOURCES property can't be set on imported targets (\"" << this->Name << "\")\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -1931,7 +1931,7 @@ std::string cmTarget::GetExportName() const { if (!cmGeneratorExpression::IsValidTargetName(exportName)) { - cmOStringStream e; + std::ostringstream e; e << "EXPORT_NAME property \"" << exportName << "\" for \"" << this->GetName() << "\": is not valid."; cmSystemTools::Error(e.str().c_str()); @@ -2043,7 +2043,7 @@ static void processIncludeDirectories(cmTarget const* tgt, if (fromImported && !cmSystemTools::FileExists(li->c_str())) { - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::FATAL_ERROR; if (checkCMP0027) { @@ -2076,7 +2076,7 @@ static void processIncludeDirectories(cmTarget const* tgt, if (!cmSystemTools::FileIsFullPath(li->c_str())) { - cmOStringStream e; + std::ostringstream e; bool noMessage = false; cmake::MessageType messageType = cmake::FATAL_ERROR; if (!targetName.empty()) @@ -2426,7 +2426,7 @@ void cmTarget::GetCompileDefinitions(std::vector &list, { case cmPolicies::WARN: { - cmOStringStream e; + std::ostringstream e; e << this->Makefile->GetCMakeInstance()->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0043); this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, @@ -2559,7 +2559,7 @@ static void cmTargetCheckLINK_INTERFACE_LIBRARIES( "LINK_INTERFACE_LIBRARIES"); // Report an error. - cmOStringStream e; + std::ostringstream e; e << "Property " << prop << " may not contain link-type keyword \"" << keys.match(2) << "\". " << "The " << base << " property has a per-configuration " @@ -2596,7 +2596,7 @@ static void cmTargetCheckINTERFACE_LINK_LIBRARIES(const char* value, } // Report an error. - cmOStringStream e; + std::ostringstream e; e << "Property INTERFACE_LINK_LIBRARIES may not contain link-type " "keyword \"" << keys.match(2) << "\". The INTERFACE_LINK_LIBRARIES " @@ -2895,7 +2895,7 @@ bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const { return true; } - cmOStringStream e; + std::ostringstream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch (context->GetPolicyStatus(cmPolicies::CMP0026)) @@ -2954,7 +2954,7 @@ const char *cmTarget::GetProperty(const std::string& prop, if (this->GetType() == INTERFACE_LIBRARY && !whiteListedInterfaceProperty(prop)) { - cmOStringStream e; + std::ostringstream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " "The property \"" << prop << "\" is not allowed."; context->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -3130,7 +3130,7 @@ const char *cmTarget::GetProperty(const std::string& prop, return 0; } - cmOStringStream ss; + std::ostringstream ss; const char* sep = ""; typedef cmTargetInternals::TargetPropertyEntry TargetPropertyEntry; @@ -3160,7 +3160,7 @@ const char *cmTarget::GetProperty(const std::string& prop, bool addContent = false; bool noMessage = true; - cmOStringStream e; + std::ostringstream e; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(context->GetPolicyStatus(cmPolicies::CMP0051)) { @@ -3258,7 +3258,7 @@ public: { bool noMessage = false; cmake::MessageType messageType = cmake::FATAL_ERROR; - cmOStringStream e; + std::ostringstream e; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028)) { case cmPolicies::WARN: @@ -3379,7 +3379,7 @@ public: } else if(this->Preferred.size() > 1) { - cmOStringStream e; + std::ostringstream e; e << "Target " << this->Target->GetName() << " contains multiple languages with the highest linker preference" << " (" << this->Preference << "):\n"; @@ -3751,7 +3751,7 @@ bool cmTarget::HasMacOSXRpathInstallNameDir(const std::string& config) const if(!this->Makefile->IsSet("CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG")) { - cmOStringStream w; + std::ostringstream w; w << "Attempting to use"; if(macosx_rpath) { @@ -5049,7 +5049,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, report += compatibilityAgree(t, propContent != consistent.second); if (!consistent.first) { - cmOStringStream e; + std::ostringstream e; e << "Property " << p << " on target \"" << tgt->GetName() << "\" does\nnot match the " "INTERFACE_" << p << " property requirement\nof " @@ -5082,7 +5082,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, report += compatibilityAgree(t, propContent != consistent.second); if (!consistent.first) { - cmOStringStream e; + std::ostringstream e; e << "Property " << p << " on target \"" << tgt->GetName() << "\" is\nimplied to be " << defaultValue << " because it was used to determine the link libraries\n" @@ -5116,7 +5116,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, report += compatibilityAgree(t, propContent != consistent.second); if (!consistent.first) { - cmOStringStream e; + std::ostringstream e; e << "The INTERFACE_" << p << " property of \"" << theTarget->GetName() << "\" does\nnot agree with the value " "of " << p << " already determined\nfor \"" @@ -6024,7 +6024,7 @@ cmTargetInternals::ComputeLinkInterfaceLibraries( if (newExplicitLibraries && strcmp(newExplicitLibraries, explicitLibraries) != 0) { - cmOStringStream w; + std::ostringstream w; w << (thisTarget->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n" @@ -6111,7 +6111,7 @@ cmTargetInternals::ComputeLinkInterfaceLibraries( if(newLibraries.empty()) { newLibraries = "(empty)"; } - cmOStringStream w; + std::ostringstream w; w << (thisTarget->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n" @@ -6366,7 +6366,7 @@ cmTargetInternals::ComputeLinkImplementationLibraries( { bool noMessage = false; cmake::MessageType messageType = cmake::FATAL_ERROR; - cmOStringStream e; + std::ostringstream e; switch(thisTarget->GetPolicyStatusCMP0038()) { case cmPolicies::WARN: @@ -6472,7 +6472,7 @@ cmTarget const* cmTarget::FindTargetToLink(std::string const& name) const if(tgt && tgt->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << this->GetName() << "\" links to " "OBJECT library \"" << tgt->GetName() << "\" but this is not " "allowed. " @@ -6511,7 +6511,7 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const { case cmPolicies::WARN: { - cmOStringStream w; + std::ostringstream w; w << (this->Makefile->GetPolicies() ->GetPolicyWarning(cmPolicies::CMP0004)) << "\n" << "Target \"" << this->GetName() << "\" links to item \"" @@ -6523,7 +6523,7 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const break; case cmPolicies::NEW: { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << this->GetName() << "\" links to item \"" << item << "\" which has leading or trailing whitespace. " << "This is now an error according to policy CMP0004."; @@ -6533,7 +6533,7 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: { - cmOStringStream e; + std::ostringstream e; e << (this->Makefile->GetPolicies() ->GetRequiredPolicyError(cmPolicies::CMP0004)) << "\n" << "Target \"" << this->GetName() << "\" links to item \"" @@ -6614,7 +6614,7 @@ void checkPropertyConsistency(cmTarget const* depender, std::string pfile = pdir + pname + ".rst"; if(cmSystemTools::FileExists(pfile.c_str(), true)) { - cmOStringStream e; + std::ostringstream e; e << "Target \"" << dependee->GetName() << "\" has property \"" << *pi << "\" listed in its " << propName << " property. " "This is not allowed. Only user-defined properties may appear " @@ -6776,7 +6776,7 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info, { propsString += " and the " + *props.begin(); } - cmOStringStream e; + std::ostringstream e; e << "Property \"" << prop << "\" appears in both the " << propsString << " property in the dependencies of target \"" << this->GetName() << diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a3ecca0..ddd9859 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -202,7 +202,7 @@ public: PlainTLLSignature }; bool PushTLLCommandTrace(TLLSignature signature); - void GetTllSignatureTraces(cmOStringStream &s, TLLSignature sig) const; + void GetTllSignatureTraces(std::ostringstream &s, TLLSignature sig) const; void MergeLinkLibraries( cmMakefile& mf, const std::string& selfname, const LinkLibraryVectorType& libs ); diff --git a/Source/cmTargetCompileDefinitionsCommand.cxx b/Source/cmTargetCompileDefinitionsCommand.cxx index 66d8ad3..dc19720 100644 --- a/Source/cmTargetCompileDefinitionsCommand.cxx +++ b/Source/cmTargetCompileDefinitionsCommand.cxx @@ -20,7 +20,7 @@ bool cmTargetCompileDefinitionsCommand void cmTargetCompileDefinitionsCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile definitions for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -29,7 +29,7 @@ void cmTargetCompileDefinitionsCommand void cmTargetCompileDefinitionsCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile definitions for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx index 10daad4..15a9a38 100644 --- a/Source/cmTargetCompileFeaturesCommand.cxx +++ b/Source/cmTargetCompileFeaturesCommand.cxx @@ -21,7 +21,7 @@ bool cmTargetCompileFeaturesCommand::InitialPass( void cmTargetCompileFeaturesCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile features for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -30,7 +30,7 @@ void cmTargetCompileFeaturesCommand void cmTargetCompileFeaturesCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile features for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx index 3fb76a6..e16468b 100644 --- a/Source/cmTargetCompileOptionsCommand.cxx +++ b/Source/cmTargetCompileOptionsCommand.cxx @@ -20,7 +20,7 @@ bool cmTargetCompileOptionsCommand void cmTargetCompileOptionsCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile options for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -29,7 +29,7 @@ void cmTargetCompileOptionsCommand void cmTargetCompileOptionsCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify compile options for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx index e9f0e04..6dc58b1 100644 --- a/Source/cmTargetIncludeDirectoriesCommand.cxx +++ b/Source/cmTargetIncludeDirectoriesCommand.cxx @@ -25,7 +25,7 @@ bool cmTargetIncludeDirectoriesCommand void cmTargetIncludeDirectoriesCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify include directories for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -35,7 +35,7 @@ void cmTargetIncludeDirectoriesCommand void cmTargetIncludeDirectoriesCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify include directories for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 56e1338..75c94c5 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -43,7 +43,7 @@ bool cmTargetLinkLibrariesCommand if(!this->Target) { cmake::MessageType t = cmake::FATAL_ERROR; // fail by default - cmOStringStream e; + std::ostringstream e; e << "Cannot specify link libraries for target \"" << args[0] << "\" " << "which is not built by this project."; // The bad target is the only argument. Check how policy CMP0016 is set, @@ -92,7 +92,7 @@ bool cmTargetLinkLibrariesCommand if(this->Target->GetType() == cmTarget::OBJECT_LIBRARY) { - cmOStringStream e; + std::ostringstream e; e << "Object library target \"" << args[0] << "\" " << "may not link to anything."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -102,7 +102,7 @@ bool cmTargetLinkLibrariesCommand if (this->Target->GetType() == cmTarget::UTILITY) { - cmOStringStream e; + std::ostringstream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0039)) @@ -311,7 +311,7 @@ bool cmTargetLinkLibrariesCommand // Make sure the last argument was not a library type specifier. if(haveLLT) { - cmOStringStream e; + std::ostringstream e; e << "The \"" << this->LinkLibraryTypeNames[llt] << "\" argument must be followed by a library."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -342,7 +342,7 @@ void cmTargetLinkLibrariesCommand ::LinkLibraryTypeSpecifierWarning(int left, int right) { - cmOStringStream w; + std::ostringstream w; w << "Link library type specifier \"" << this->LinkLibraryTypeNames[left] << "\" is followed by specifier \"" << this->LinkLibraryTypeNames[right] << "\" instead of a library name. " @@ -373,7 +373,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib, ? cmTarget::KeywordTLLSignature : cmTarget::PlainTLLSignature; if (!this->Target->PushTLLCommandTrace(sig)) { - cmOStringStream e; + std::ostringstream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0023)) diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx index ce3b11e..5153926 100644 --- a/Source/cmTargetSourcesCommand.cxx +++ b/Source/cmTargetSourcesCommand.cxx @@ -24,7 +24,7 @@ bool cmTargetSourcesCommand void cmTargetSourcesCommand ::HandleImportedTarget(const std::string &tgt) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify sources for imported target \"" << tgt << "\"."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); @@ -34,7 +34,7 @@ void cmTargetSourcesCommand void cmTargetSourcesCommand ::HandleMissingTarget(const std::string &name) { - cmOStringStream e; + std::ostringstream e; e << "Cannot specify sources for target \"" << name << "\" " "which is not built by this project."; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx index debe243..9473008 100644 --- a/Source/cmVariableWatchCommand.cxx +++ b/Source/cmVariableWatchCommand.cxx @@ -70,7 +70,7 @@ static void cmVariableWatchCommandVariableAccessed( { arg.FilePath = "Unknown"; arg.Line = 0; - cmOStringStream error; + std::ostringstream error; error << "Error in cmake code at\n" << arg.FilePath << ":" << arg.Line << ":\n" << "A command failed during the invocation of callback \"" @@ -83,7 +83,7 @@ static void cmVariableWatchCommandVariableAccessed( } if ( !processed ) { - cmOStringStream msg; + std::ostringstream msg; msg << "Variable \"" << variable << "\" was accessed using " << accessString << " with value \"" << (newValue?newValue:"") << "\"."; makefile->IssueMessage(cmake::LOG, msg.str()); @@ -135,7 +135,7 @@ bool cmVariableWatchCommand } if ( variable == "CMAKE_CURRENT_LIST_FILE" ) { - cmOStringStream ostr; + std::ostringstream ostr; ostr << "cannot be set on the variable: " << variable; this->SetError(ostr.str()); return false; diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx index 391b874..1d3e0e9 100644 --- a/Source/cmXMLParser.cxx +++ b/Source/cmXMLParser.cxx @@ -54,7 +54,7 @@ int cmXMLParser::ParseFile(const char* file) return 0; } - cmOStringStream str; + std::ostringstream str; str << ifs.rdbuf(); return this->Parse(str.str().c_str()); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bbd3fe4..5edb7dd 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1182,7 +1182,7 @@ int cmake::DoPreConfigureChecks() srcList += "/CMakeLists.txt"; if(!cmSystemTools::FileExists(srcList.c_str())) { - cmOStringStream err; + std::ostringstream err; if(cmSystemTools::FileIsDirectory(this->GetHomeDirectory())) { err << "The source directory \"" << this->GetHomeDirectory() @@ -1250,7 +1250,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var) } cmCacheManager::CacheIterator ci = this->CacheManager->NewIterator(); std::vector saved; - cmOStringStream warning; + std::ostringstream warning; warning << "You have changed variables that require your cache to be deleted.\n" << "Configure will be re-run and you may have to reset some variables.\n" @@ -1971,7 +1971,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake no build system arguments\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -1983,7 +1983,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake missing file: " << this->CheckBuildSystemArgument << "\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2003,7 +2003,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake error reading : " << this->CheckBuildSystemArgument << "\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2045,7 +2045,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake, missing byproduct: " << *pi << "\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -2068,7 +2068,7 @@ int cmake::CheckBuildSystem() // Not enough information was provided to do the test. Just rerun. if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake no CMAKE_MAKEFILE_DEPENDS " "or CMAKE_MAKEFILE_OUTPUTS :\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2094,7 +2094,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake: build system dependency is missing\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -2120,7 +2120,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake: build system output is missing\n"; cmSystemTools::Stdout(msg.str().c_str()); } @@ -2138,7 +2138,7 @@ int cmake::CheckBuildSystem() { if(verbose) { - cmOStringStream msg; + std::ostringstream msg; msg << "Re-run cmake file: " << out_oldest << " older than: " << dep_newest << "\n"; cmSystemTools::Stdout(msg.str().c_str()); @@ -2563,7 +2563,7 @@ static bool cmakeCheckStampFile(const char* stampName) // The build system is up to date. The stamp file has been removed // by the VS IDE due to a "rebuild" request. Restore it atomically. - cmOStringStream stampTempStream; + std::ostringstream stampTempStream; stampTempStream << stampName << ".tmp" << cmSystemTools::RandomSeed(); std::string stampTempString = stampTempStream.str(); const char* stampTemp = stampTempString.c_str(); @@ -2627,7 +2627,7 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text, cmListFileBacktrace backtrace = bt; backtrace.MakeRelative(); - cmOStringStream msg; + std::ostringstream msg; bool isError = false; // Construct the message header. if(t == cmake::FATAL_ERROR) @@ -2835,7 +2835,7 @@ void cmake::RunCheckForUnusedVariables() { #ifdef CMAKE_BUILD_WITH_CMAKE bool haveUnused = false; - cmOStringStream msg; + std::ostringstream msg; msg << "Manually-specified variables were not used by the project:"; for(std::map::const_iterator it = this->UsedCliVariables.begin(); diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 37d2916..d3d85a5 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -36,7 +36,7 @@ void CMakeCommandUsage(const char* program) { - cmOStringStream errorStream; + std::ostringstream errorStream; #ifdef CMAKE_BUILD_WITH_CMAKE errorStream diff --git a/Tests/CMakeLib/testXMLSafe.cxx b/Tests/CMakeLib/testXMLSafe.cxx index 60442fa..9e4960c 100644 --- a/Tests/CMakeLib/testXMLSafe.cxx +++ b/Tests/CMakeLib/testXMLSafe.cxx @@ -34,7 +34,7 @@ int testXMLSafe(int, char*[]) for(test_pair const* p = pairs; p->in; ++p) { cmXMLSafe xs(p->in); - cmOStringStream oss; + std::ostringstream oss; oss << xs; std::string out = oss.str(); if(out != p->out) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 11:35:14 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 11:35:14 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1684-g34a36ea Message-ID: <20150111163514.57EDEA9FF2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 34a36eafe1aa71a1672e933386622b9c6fd68846 (commit) via f73718c9b893e1489f904cf30392742cb456c341 (commit) from 06ba9bf3f9e191daae83735f55c20f269334af6c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=34a36eafe1aa71a1672e933386622b9c6fd68846 commit 34a36eafe1aa71a1672e933386622b9c6fd68846 Merge: 06ba9bf f73718c Author: Brad King AuthorDate: Sun Jan 11 11:35:13 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 11:35:13 2015 -0500 Merge topic 'feature_record_msvc' into next f73718c9 Features: Enable writing of MSVC compiler feature header. diff --cc Tests/CompileFeatures/CMakeLists.txt index 3175227,9fb8d1b..f0a4e74 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -83,25 -63,6 +83,36 @@@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU cxx_return_type_deduction ) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM CXX_non_features + # Micrsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() + +set(MSVC_) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + MSVC_VERSION LESS 1800) + list(REMOVE_ITEM CXX_non_features + # Microsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because ++ # older compiler pass the test but might not actually conform ++ cxx_contextual_conversions ++ ) ++endif() ++ ++set(MSVC_) ++if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND ++ MSVC_VERSION LESS 1800) ++ list(REMOVE_ITEM CXX_non_features ++ # Microsoft only officially supports this feature in VS2013 and above, due ++ # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() set(MSVC_) if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f73718c9b893e1489f904cf30392742cb456c341 commit f73718c9b893e1489f904cf30392742cb456c341 Author: Robert Maynard AuthorDate: Tue Jan 6 13:19:44 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 11:32:36 2015 -0500 Features: Enable writing of MSVC compiler feature header. Notes: VS2015 and above are the only MSVC versions to support cxx_final, so remove usages from the tests, and instead only test for cxx_override. VS2012 and above to conform to cxx_decltype_incomplete_return_types proposal, but without support for auto return types the dcl.type.simple example in the proposal doesn't compile. VS2013 and above to conform to the updated cxx_contextual_conversions proposal, but VS2010 and above pass the test. Compilers such as MSVC have no explicit flags to enable C++11 mode, it just is always on. So only run the link tests with compilers that require a flag to specify the language version. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 36b9706..bcaaafa 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -316,6 +316,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC ) set(_hex_compilers ADSP Borland Embarcadero SunPro) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index b164f06..9fb8d1b 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -26,7 +26,18 @@ get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) foreach(feature ${c_features}) run_test(${feature} C) endforeach() + get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) + +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM cxx_features + # This test requires auto return type deduction to work properly, but + # that is not supported by all versions of MSVC that support decltype + # incomplete return types. + cxx_decltype_incomplete_return_types + ) +endif() + foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() @@ -53,6 +64,17 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) endif() +set(MSVC_) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + MSVC_VERSION LESS 1800) + list(REMOVE_ITEM CXX_non_features + # Microsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() + set(C_ext c) set(C_standard_flag 11) set(CXX_ext cpp) @@ -126,6 +148,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) + target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index f667cc4..4412569 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -10,7 +10,7 @@ struct A virtual int getA() { return 7; } }; -struct B final : A +struct B : A { int getA() override { return 42; } }; diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 401de95..cfaa78c 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 MSVC VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -64,6 +64,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -81,7 +93,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 MSVC VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..3b37091 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,8 +27,13 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) - run_cmake(LinkImplementationFeatureCycleSolved) + # compilers such as MSVC have no explicit flags to enable c++11 mode. + # Instead they come with all c++11 features implicitly enabled. + # So for those types of compilers this tests is not applicable. + if(CMAKE_CXX11_STANDARD_COMPILE_OPTION) + run_cmake(LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycleSolved) + endif() if (";${CXX_FEATURES};" MATCHES ";cxx_final;") set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 11:38:21 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 11:38:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1686-ga505369 Message-ID: <20150111163821.B3B42AA03D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a5053694a6e81aa78fea96ad4f3d247c71faade4 (commit) via 2d738ce37acda92b344b1d3f2be2d3b6df63763c (commit) from 34a36eafe1aa71a1672e933386622b9c6fd68846 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5053694a6e81aa78fea96ad4f3d247c71faade4 commit a5053694a6e81aa78fea96ad4f3d247c71faade4 Merge: 34a36ea 2d738ce Author: Brad King AuthorDate: Sun Jan 11 11:38:20 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 11:38:20 2015 -0500 Merge topic 'feature_record_msvc' into next 2d738ce3 Help: Add notes for topic 'feature_record_msvc' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d738ce37acda92b344b1d3f2be2d3b6df63763c commit 2d738ce37acda92b344b1d3f2be2d3b6df63763c Author: Brad King AuthorDate: Sun Jan 11 11:37:12 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 11:37:12 2015 -0500 Help: Add notes for topic 'feature_record_msvc' diff --git a/Help/release/dev/feature_record_msvc.rst b/Help/release/dev/feature_record_msvc.rst new file mode 100644 index 0000000..63b642d --- /dev/null +++ b/Help/release/dev/feature_record_msvc.rst @@ -0,0 +1,6 @@ +feature_record_msvc +------------------- + +* The :manual:`Compile Features ` functionality + is now aware of features supported by Visual Studio 2010 and above + (``MSVC``). ----------------------------------------------------------------------- Summary of changes: Help/release/dev/feature_record_msvc.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Help/release/dev/feature_record_msvc.rst hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 11:49:37 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 11:49:37 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1688-gac9cfbf Message-ID: <20150111164937.963B0A8A89@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ac9cfbfcaf1081272fc1f4cc4a90b7b724ea9bcd (commit) via a9e20794cf660b2d7aef399bccf1b60f5cfeaad7 (commit) from a5053694a6e81aa78fea96ad4f3d247c71faade4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac9cfbfcaf1081272fc1f4cc4a90b7b724ea9bcd commit ac9cfbfcaf1081272fc1f4cc4a90b7b724ea9bcd Merge: a505369 a9e2079 Author: Brad King AuthorDate: Sun Jan 11 11:49:36 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 11:49:36 2015 -0500 Merge topic 'fix-empty-target-property-queries' into next a9e20794 Tests/RunCMake: Improve order of tests http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a9e20794cf660b2d7aef399bccf1b60f5cfeaad7 commit a9e20794cf660b2d7aef399bccf1b60f5cfeaad7 Author: Brad King AuthorDate: Sun Jan 11 11:49:16 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 11:49:16 2015 -0500 Tests/RunCMake: Improve order of tests diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 05c51cc..1697025 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -121,6 +121,7 @@ add_RunCMake_test(file) add_RunCMake_test(find_library) add_RunCMake_test(find_package) add_RunCMake_test(get_filename_component) +add_RunCMake_test(get_property) add_RunCMake_test(if) add_RunCMake_test(include) add_RunCMake_test(include_directories) @@ -173,4 +174,3 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) -add_RunCMake_test(get_property) ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 11:50:04 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 11:50:04 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1693-gd327bb1 Message-ID: <20150111165004.AA0DFA8BB9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d327bb19f232337a1492638617097e1d19f2d6d7 (commit) via c6d03a1072c8f3ae285f4297caf96637b3a47c22 (commit) via 76ff92e0c96fc09813f119770d86bd6edc84820b (commit) via 282148628f362693334da1f7d242418011629afb (commit) via 34a990946c655a0be69e4168461c5e23a2d64bfa (commit) from ac9cfbfcaf1081272fc1f4cc4a90b7b724ea9bcd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d327bb19f232337a1492638617097e1d19f2d6d7 commit d327bb19f232337a1492638617097e1d19f2d6d7 Merge: ac9cfbf c6d03a1 Author: Brad King AuthorDate: Sun Jan 11 11:50:03 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 11:50:03 2015 -0500 Merge topic 'fix-empty-target-property-queries' into next c6d03a10 tests: add tests for querying properties 76ff92e0 set_tests_properties: fix documentation 28214862 get_test_property: clarify the documentation 34a99094 get_target_property: discern empty from undefined properties (#15333) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6d03a1072c8f3ae285f4297caf96637b3a47c22 commit c6d03a1072c8f3ae285f4297caf96637b3a47c22 Author: Ben Boeckel AuthorDate: Thu Jan 8 15:27:46 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 11:45:44 2015 -0500 tests: add tests for querying properties diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index fd3bb03..642665b 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -102,6 +102,7 @@ add_RunCMake_test(cmake_minimum_required) add_RunCMake_test(file) add_RunCMake_test(find_package) add_RunCMake_test(get_filename_component) +add_RunCMake_test(get_property) add_RunCMake_test(if) add_RunCMake_test(include) add_RunCMake_test(include_directories) diff --git a/Tests/RunCMake/get_property/CMakeLists.txt b/Tests/RunCMake/get_property/CMakeLists.txt new file mode 100644 index 0000000..12cd3c7 --- /dev/null +++ b/Tests/RunCMake/get_property/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/get_property/RunCMakeTest.cmake b/Tests/RunCMake/get_property/RunCMakeTest.cmake new file mode 100644 index 0000000..1964824 --- /dev/null +++ b/Tests/RunCMake/get_property/RunCMakeTest.cmake @@ -0,0 +1,9 @@ +include(RunCMake) + +run_cmake(cache_properties) +run_cmake(directory_properties) +run_cmake(global_properties) +run_cmake(install_properties) +run_cmake(source_properties) +run_cmake(target_properties) +run_cmake(test_properties) diff --git a/Tests/RunCMake/get_property/cache_properties-stderr.txt b/Tests/RunCMake/get_property/cache_properties-stderr.txt new file mode 100644 index 0000000..ee019c6 --- /dev/null +++ b/Tests/RunCMake/get_property/cache_properties-stderr.txt @@ -0,0 +1,3 @@ +^get_property: --><-- +get_property: -->TRUE<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/cache_properties.cmake b/Tests/RunCMake/get_property/cache_properties.cmake new file mode 100644 index 0000000..bf3e7ab --- /dev/null +++ b/Tests/RunCMake/get_property/cache_properties.cmake @@ -0,0 +1,15 @@ +function (check_cache_property var prop) + get_property(gp_val + CACHE "${var}" + PROPERTY "${prop}") + + message("get_property: -->${gp_val}<--") +endfunction () + +set(var val CACHE STRING "doc") +set_property(CACHE var PROPERTY VALUE "") # empty +set_property(CACHE var PROPERTY ADVANCED TRUE) + +check_cache_property(var VALUE) +check_cache_property(var ADVANCED) +check_cache_property(var noexist) diff --git a/Tests/RunCMake/get_property/directory_properties-stderr.txt b/Tests/RunCMake/get_property/directory_properties-stderr.txt new file mode 100644 index 0000000..80c9877 --- /dev/null +++ b/Tests/RunCMake/get_property/directory_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_directory_property: --><-- +get_property: --><-- +get_directory_property: -->value<-- +get_property: -->value<-- +get_directory_property: --><-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/directory_properties.cmake b/Tests/RunCMake/get_property/directory_properties.cmake new file mode 100644 index 0000000..b0a9b1b --- /dev/null +++ b/Tests/RunCMake/get_property/directory_properties.cmake @@ -0,0 +1,15 @@ +function (check_directory_property dir prop) + get_directory_property(gdp_val DIRECTORY "${dir}" "${prop}") + get_property(gp_val + DIRECTORY "${dir}" + PROPERTY "${prop}") + + message("get_directory_property: -->${gdp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +set_directory_properties(PROPERTIES empty "" custom value) + +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" empty) +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" custom) +check_directory_property("${CMAKE_CURRENT_SOURCE_DIR}" noexist) diff --git a/Tests/RunCMake/get_property/global_properties-stderr.txt b/Tests/RunCMake/get_property/global_properties-stderr.txt new file mode 100644 index 0000000..4c08ad7 --- /dev/null +++ b/Tests/RunCMake/get_property/global_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_cmake_property: --><-- +get_property: --><-- +get_cmake_property: -->value<-- +get_property: -->value<-- +get_cmake_property: -->NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/global_properties.cmake b/Tests/RunCMake/get_property/global_properties.cmake new file mode 100644 index 0000000..2073136 --- /dev/null +++ b/Tests/RunCMake/get_property/global_properties.cmake @@ -0,0 +1,16 @@ +function (check_global_property prop) + get_cmake_property(gcp_val "${prop}") + get_property(gp_val + GLOBAL + PROPERTY "${prop}") + + message("get_cmake_property: -->${gcp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +set_property(GLOBAL PROPERTY empty "") +set_property(GLOBAL PROPERTY custom value) + +check_global_property(empty) +check_global_property(custom) +check_global_property(noexist) diff --git a/Tests/RunCMake/get_property/install_properties-stderr.txt b/Tests/RunCMake/get_property/install_properties-stderr.txt new file mode 100644 index 0000000..b1a2987 --- /dev/null +++ b/Tests/RunCMake/get_property/install_properties-stderr.txt @@ -0,0 +1,3 @@ +^get_property: --><-- +get_property: -->value<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/install_properties.cmake b/Tests/RunCMake/get_property/install_properties.cmake new file mode 100644 index 0000000..aa89225 --- /dev/null +++ b/Tests/RunCMake/get_property/install_properties.cmake @@ -0,0 +1,18 @@ +function (check_install_property file prop) + get_property(gp_val + INSTALL "${file}" + PROPERTY "${prop}") + + message("get_property: -->${gp_val}<--") +endfunction () + +install( + FILES "${CMAKE_CURRENT_LIST_FILE}" + DESTINATION "${CMAKE_CURRENT_LIST_DIR}" + RENAME "installed-file-dest") +set_property(INSTALL "${CMAKE_CURRENT_LIST_FILE}" PROPERTY empty "") +set_property(INSTALL "${CMAKE_CURRENT_LIST_FILE}" PROPERTY custom value) + +check_install_property("${CMAKE_CURRENT_LIST_FILE}" empty) +check_install_property("${CMAKE_CURRENT_LIST_FILE}" custom) +check_install_property("${CMAKE_CURRENT_LIST_FILE}" noexist) diff --git a/Tests/RunCMake/get_property/source_properties-stderr.txt b/Tests/RunCMake/get_property/source_properties-stderr.txt new file mode 100644 index 0000000..0a46f96 --- /dev/null +++ b/Tests/RunCMake/get_property/source_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_source_file_property: --><-- +get_property: --><-- +get_source_file_property: -->value<-- +get_property: -->value<-- +get_source_file_property: -->NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/source_properties.cmake b/Tests/RunCMake/get_property/source_properties.cmake new file mode 100644 index 0000000..263ffe1 --- /dev/null +++ b/Tests/RunCMake/get_property/source_properties.cmake @@ -0,0 +1,15 @@ +function (check_source_file_property file prop) + get_source_file_property(gsfp_val "${file}" "${prop}") + get_property(gp_val + SOURCE "${file}" + PROPERTY "${prop}") + + message("get_source_file_property: -->${gsfp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +set_source_files_properties(file.c PROPERTIES empty "" custom value) + +check_source_file_property(file.c empty) +check_source_file_property(file.c custom) +check_source_file_property(file.c noexist) diff --git a/Tests/RunCMake/get_property/target_properties-stderr.txt b/Tests/RunCMake/get_property/target_properties-stderr.txt new file mode 100644 index 0000000..d0981ac --- /dev/null +++ b/Tests/RunCMake/get_property/target_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_target_property: --><-- +get_property: --><-- +get_target_property: -->value<-- +get_property: -->value<-- +get_target_property: -->gtp_val-NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/target_properties.cmake b/Tests/RunCMake/get_property/target_properties.cmake new file mode 100644 index 0000000..c5a141d --- /dev/null +++ b/Tests/RunCMake/get_property/target_properties.cmake @@ -0,0 +1,16 @@ +function (check_target_property target prop) + get_target_property(gtp_val "${target}" "${prop}") + get_property(gp_val + TARGET "${target}" + PROPERTY "${prop}") + + message("get_target_property: -->${gtp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +add_custom_target(tgt) +set_target_properties(tgt PROPERTIES empty "" custom value) + +check_target_property(tgt empty) +check_target_property(tgt custom) +check_target_property(tgt noexist) diff --git a/Tests/RunCMake/get_property/test_properties-stderr.txt b/Tests/RunCMake/get_property/test_properties-stderr.txt new file mode 100644 index 0000000..a447280 --- /dev/null +++ b/Tests/RunCMake/get_property/test_properties-stderr.txt @@ -0,0 +1,6 @@ +^get_test_property: --><-- +get_property: --><-- +get_test_property: -->value<-- +get_property: -->value<-- +get_test_property: -->NOTFOUND<-- +get_property: --><--$ diff --git a/Tests/RunCMake/get_property/test_properties.cmake b/Tests/RunCMake/get_property/test_properties.cmake new file mode 100644 index 0000000..1d0295c --- /dev/null +++ b/Tests/RunCMake/get_property/test_properties.cmake @@ -0,0 +1,17 @@ +function (check_test_property test prop) + get_test_property("${test}" "${prop}" gtp_val) + get_property(gp_val + TEST "${test}" + PROPERTY "${prop}") + + message("get_test_property: -->${gtp_val}<--") + message("get_property: -->${gp_val}<--") +endfunction () + +include(CTest) +add_test(NAME test COMMAND "${CMAKE_COMMAND}" --help) +set_tests_properties(test PROPERTIES empty "" custom value) + +check_test_property(test empty) +check_test_property(test custom) +check_test_property(test noexist) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76ff92e0c96fc09813f119770d86bd6edc84820b commit 76ff92e0c96fc09813f119770d86bd6edc84820b Author: Ben Boeckel AuthorDate: Thu Jan 8 16:19:26 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 11:45:43 2015 -0500 set_tests_properties: fix documentation The error is raised if the *test* doesn't exist, not the property. diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst index e29d690..afac847 100644 --- a/Help/command/set_tests_properties.rst +++ b/Help/command/set_tests_properties.rst @@ -7,7 +7,7 @@ Set a property of the tests. set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2) -Set a property for the tests. If the property is not found, CMake +Set a property for the tests. If the test is not found, CMake will report an error. Generator expressions will be expanded the same as supported by the test's add_test call. The properties include: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=282148628f362693334da1f7d242418011629afb commit 282148628f362693334da1f7d242418011629afb Author: Ben Boeckel AuthorDate: Thu Jan 8 16:18:46 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 11:45:43 2015 -0500 get_test_property: clarify the documentation If either the test or the property doesn't exist, NOTFOUND will be used. No error is raised in either case. diff --git a/Help/command/get_test_property.rst b/Help/command/get_test_property.rst index 2623755..391a32e 100644 --- a/Help/command/get_test_property.rst +++ b/Help/command/get_test_property.rst @@ -7,9 +7,9 @@ Get a property of the test. get_test_property(test property VAR) -Get a property from the Test. The value of the property is stored in -the variable VAR. If the property is not found, VAR will be set to -"NOTFOUND". For a list of standard properties you can type cmake ---help-property-list +Get a property from the test. The value of the property is stored in +the variable VAR. If the test or property is not found, VAR will be +set to "NOTFOUND". For a list of standard properties you can type cmake +--help-property-list. See also the more general get_property() command. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=34a990946c655a0be69e4168461c5e23a2d64bfa commit 34a990946c655a0be69e4168461c5e23a2d64bfa Author: Stephen Kelly AuthorDate: Thu Jan 8 15:20:38 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 11:43:58 2015 -0500 get_target_property: discern empty from undefined properties (#15333) This was accidentally regressed by commit v3.1.0-rc1~812^2~50 (stringapi: Use strings for property names, 2013-09-02). diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index aa6f0c1..fb59df8 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -23,6 +23,7 @@ bool cmGetTargetPropertyCommand std::string var = args[0]; const std::string& targetName = args[1]; std::string prop; + bool prop_exists = false; if(args[2] == "ALIASED_TARGET") { @@ -32,6 +33,7 @@ bool cmGetTargetPropertyCommand this->Makefile->FindTargetToUse(targetName)) { prop = target->GetName(); + prop_exists = true; } } } @@ -42,6 +44,7 @@ bool cmGetTargetPropertyCommand if(prop_cstr) { prop = prop_cstr; + prop_exists = true; } } else @@ -74,7 +77,7 @@ bool cmGetTargetPropertyCommand } } } - if (!prop.empty()) + if (prop_exists) { this->Makefile->AddDefinition(var, prop.c_str()); return true; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 11:51:31 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 11:51:31 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1695-g020324f Message-ID: <20150111165131.164B1A8CA4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 020324f29f9d58cf5fef7a3c09aac6b81bc6c930 (commit) via 2866a503a78ac63cd95695e92670ea9231c95350 (commit) from d327bb19f232337a1492638617097e1d19f2d6d7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=020324f29f9d58cf5fef7a3c09aac6b81bc6c930 commit 020324f29f9d58cf5fef7a3c09aac6b81bc6c930 Merge: d327bb1 2866a50 Author: Brad King AuthorDate: Sun Jan 11 11:51:30 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 11:51:30 2015 -0500 Merge topic 'kwsys-Terminal-xterm-termite' into next 2866a503 KWSys Terminal: Add xterm-termite to VT100 color support whitelist http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2866a503a78ac63cd95695e92670ea9231c95350 commit 2866a503a78ac63cd95695e92670ea9231c95350 Author: Simon Gomizelj AuthorDate: Mon Dec 29 15:56:30 2014 -0500 Commit: Brad King CommitDate: Thu Jan 8 12:02:37 2015 -0500 KWSys Terminal: Add xterm-termite to VT100 color support whitelist diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c index e13003f..d13f79a 100644 --- a/Source/kwsys/Terminal.c +++ b/Source/kwsys/Terminal.c @@ -175,6 +175,7 @@ static const char* kwsysTerminalVT100Names[] = "xterm-88color", "xterm-color", "xterm-debian", + "xterm-termite", 0 }; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:00:15 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:00:15 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-640-g4a549e7 Message-ID: <20150111170015.73701A9520@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 4a549e7e0eb769780c76e94c9fac69a8a2e693ed (commit) via e5b914209742a70c72c6cf8a8e6e1e005d8830f2 (commit) via 54d83caecfc1e0b8f047037ea6aaa7d54b64d8b3 (commit) from 7e5e8a37b56dd7c858d54c49e7fa6697cc72395b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4a549e7e0eb769780c76e94c9fac69a8a2e693ed commit 4a549e7e0eb769780c76e94c9fac69a8a2e693ed Merge: 7e5e8a3 e5b9142 Author: Brad King AuthorDate: Sun Jan 11 12:00:14 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 12:00:14 2015 -0500 Merge topic 'update-kwsys' e5b91420 Merge branch 'upstream-kwsys' into update-kwsys 54d83cae KWSys 2015-01-09 (425fa73e) ----------------------------------------------------------------------- Summary of changes: Source/kwsys/EncodingC.c | 4 ++-- Source/kwsys/ProcessUNIX.c | 4 ++-- Source/kwsys/SystemTools.cxx | 11 +++++++++-- Source/kwsys/Terminal.c | 1 + Source/kwsys/kwsysPlatformTestsCXX.cxx | 4 ++++ 5 files changed, 18 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:00:17 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:00:17 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-642-gf098e0e Message-ID: <20150111170017.D028DA95A3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f098e0e22bedbaf7aa41ef5f8fb9e10478b6672e (commit) via 2866a503a78ac63cd95695e92670ea9231c95350 (commit) from 4a549e7e0eb769780c76e94c9fac69a8a2e693ed (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f098e0e22bedbaf7aa41ef5f8fb9e10478b6672e commit f098e0e22bedbaf7aa41ef5f8fb9e10478b6672e Merge: 4a549e7 2866a50 Author: Brad King AuthorDate: Sun Jan 11 12:00:16 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 12:00:16 2015 -0500 Merge topic 'kwsys-Terminal-xterm-termite' 2866a503 KWSys Terminal: Add xterm-termite to VT100 color support whitelist ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:00:21 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:00:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-647-gcb5fc7b Message-ID: <20150111170021.821CCA95B8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via cb5fc7b993866e7398922d34a1b1807ad061d4b0 (commit) via c6d03a1072c8f3ae285f4297caf96637b3a47c22 (commit) via 76ff92e0c96fc09813f119770d86bd6edc84820b (commit) via 282148628f362693334da1f7d242418011629afb (commit) via 34a990946c655a0be69e4168461c5e23a2d64bfa (commit) from f098e0e22bedbaf7aa41ef5f8fb9e10478b6672e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb5fc7b993866e7398922d34a1b1807ad061d4b0 commit cb5fc7b993866e7398922d34a1b1807ad061d4b0 Merge: f098e0e c6d03a1 Author: Brad King AuthorDate: Sun Jan 11 12:00:20 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 12:00:20 2015 -0500 Merge topic 'fix-empty-target-property-queries' c6d03a10 tests: add tests for querying properties 76ff92e0 set_tests_properties: fix documentation 28214862 get_test_property: clarify the documentation 34a99094 get_target_property: discern empty from undefined properties (#15333) diff --cc Tests/RunCMake/CMakeLists.txt index b5e41d9,642665b..1697025 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@@ -116,11 -99,10 +116,12 @@@ add_RunCMake_test(add_dependencies add_RunCMake_test(build_command) add_RunCMake_test(export) add_RunCMake_test(cmake_minimum_required) +add_RunCMake_test(continue) add_RunCMake_test(file) +add_RunCMake_test(find_library) add_RunCMake_test(find_package) add_RunCMake_test(get_filename_component) + add_RunCMake_test(get_property) add_RunCMake_test(if) add_RunCMake_test(include) add_RunCMake_test(include_directories) ----------------------------------------------------------------------- Summary of changes: Help/command/get_test_property.rst | 8 ++++---- Help/command/set_tests_properties.rst | 2 +- Source/cmGetTargetPropertyCommand.cxx | 5 ++++- Tests/RunCMake/CMakeLists.txt | 1 + .../{CMP0004 => get_property}/CMakeLists.txt | 0 Tests/RunCMake/get_property/RunCMakeTest.cmake | 9 +++++++++ .../get_property/cache_properties-stderr.txt | 3 +++ Tests/RunCMake/get_property/cache_properties.cmake | 15 +++++++++++++++ .../get_property/directory_properties-stderr.txt | 6 ++++++ .../RunCMake/get_property/directory_properties.cmake | 15 +++++++++++++++ .../get_property/global_properties-stderr.txt | 6 ++++++ Tests/RunCMake/get_property/global_properties.cmake | 16 ++++++++++++++++ .../get_property/install_properties-stderr.txt | 3 +++ Tests/RunCMake/get_property/install_properties.cmake | 18 ++++++++++++++++++ .../get_property/source_properties-stderr.txt | 6 ++++++ Tests/RunCMake/get_property/source_properties.cmake | 15 +++++++++++++++ .../get_property/target_properties-stderr.txt | 6 ++++++ Tests/RunCMake/get_property/target_properties.cmake | 16 ++++++++++++++++ .../RunCMake/get_property/test_properties-stderr.txt | 6 ++++++ Tests/RunCMake/get_property/test_properties.cmake | 17 +++++++++++++++++ 20 files changed, 167 insertions(+), 6 deletions(-) copy Tests/RunCMake/{CMP0004 => get_property}/CMakeLists.txt (100%) create mode 100644 Tests/RunCMake/get_property/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/get_property/cache_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/cache_properties.cmake create mode 100644 Tests/RunCMake/get_property/directory_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/directory_properties.cmake create mode 100644 Tests/RunCMake/get_property/global_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/global_properties.cmake create mode 100644 Tests/RunCMake/get_property/install_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/install_properties.cmake create mode 100644 Tests/RunCMake/get_property/source_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/source_properties.cmake create mode 100644 Tests/RunCMake/get_property/target_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/target_properties.cmake create mode 100644 Tests/RunCMake/get_property/test_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/test_properties.cmake hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:00:23 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:00:23 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-654-g1c0d6a7 Message-ID: <20150111170023.C5B2AA95B9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 1c0d6a7cb5c51fef3ee8804ed298da95e2c1ca1a (commit) via a15675efc3d96906d4e803def2e83fd3bd1cf812 (commit) via 07d1f6fca1d6ea21dea64b32639c44d5eecf98a6 (commit) via 6296192defaaaa4c18b1821614c20b95ad94f806 (commit) via c13656e7173a517961349a5fe20ce0f727d37568 (commit) via 3e34e8331a72f227248a235595e3cfeabf65312e (commit) via b3e86f4e976562913bbe322bd2856a75a1542b27 (commit) from cb5fc7b993866e7398922d34a1b1807ad061d4b0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c0d6a7cb5c51fef3ee8804ed298da95e2c1ca1a commit 1c0d6a7cb5c51fef3ee8804ed298da95e2c1ca1a Merge: cb5fc7b a15675e Author: Brad King AuthorDate: Sun Jan 11 12:00:22 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 12:00:22 2015 -0500 Merge topic 'refactor-CompileFeatures-test' a15675ef Features: Quote all compiler names when comparing with COMPILER_ID 07d1f6fc Features: Properly evaluate if the compiler supports cxx_final. 6296192d Features: Add a comment explaining part of test. c13656e7 Features: Test nullptr as a side-effect activation of static_assert. 3e34e833 Features: Test feature propagation with more-common features. b3e86f4e Features: Test an expectation of whether OVERRIDE_CONTROL is expected ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 33 ++++++++++++++------ Tests/CompileFeatures/genex_test.cpp | 13 ++++++++ .../WriteCompilerDetectionHeader/CMakeLists.txt | 14 ++++----- .../RunCMake/CompileFeatures/NonValidTarget1.cmake | 4 +-- 4 files changed, 45 insertions(+), 19 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:00:25 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:00:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-659-g775fb2e Message-ID: <20150111170025.E685EA95B8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 775fb2e0b03772f08b5740ad5463f849109f0c7f (commit) via 2d738ce37acda92b344b1d3f2be2d3b6df63763c (commit) via f73718c9b893e1489f904cf30392742cb456c341 (commit) via 64c30bdc48d0a3e1da48fdbfeb200740fa5dac43 (commit) via 225c0ef88bf21c39694b51798390b87328a163de (commit) from 1c0d6a7cb5c51fef3ee8804ed298da95e2c1ca1a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=775fb2e0b03772f08b5740ad5463f849109f0c7f commit 775fb2e0b03772f08b5740ad5463f849109f0c7f Merge: 1c0d6a7 2d738ce Author: Brad King AuthorDate: Sun Jan 11 12:00:24 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 12:00:24 2015 -0500 Merge topic 'feature_record_msvc' 2d738ce3 Help: Add notes for topic 'feature_record_msvc' f73718c9 Features: Enable writing of MSVC compiler feature header. 64c30bdc Features: Record for MSVC C++ 2015 and MSVC C 2010-2015. 225c0ef8 Features: Record for MSVC 2010-2013. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/feature_record_msvc.rst | 6 ++ Modules/Compiler/MSVC-C-FeatureTests.cmake | 23 +++++ Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 97 ++++++++++++++++++++ Modules/Platform/Windows-MSVC-C.cmake | 2 + Modules/Platform/Windows-MSVC-CXX.cmake | 9 ++ Modules/WriteCompilerDetectionHeader.cmake | 5 +- Tests/CompileFeatures/CMakeLists.txt | 23 +++++ Tests/CompileFeatures/genex_test.cpp | 2 +- .../WriteCompilerDetectionHeader/CMakeLists.txt | 16 +++- Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake | 9 +- 10 files changed, 185 insertions(+), 7 deletions(-) create mode 100644 Help/release/dev/feature_record_msvc.rst create mode 100644 Modules/Compiler/MSVC-C-FeatureTests.cmake create mode 100644 Modules/Compiler/MSVC-CXX-FeatureTests.cmake hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:00:27 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:00:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-661-g20d60c6 Message-ID: <20150111170027.9F3B2A961A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 20d60c636116c55bfeaa7ebd02045fafe0b96808 (commit) via 61cf781a6216c55a60fb73d4fb5fab76b1e7fc34 (commit) from 775fb2e0b03772f08b5740ad5463f849109f0c7f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20d60c636116c55bfeaa7ebd02045fafe0b96808 commit 20d60c636116c55bfeaa7ebd02045fafe0b96808 Merge: 775fb2e 61cf781 Author: Brad King AuthorDate: Sun Jan 11 12:00:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 12:00:26 2015 -0500 Merge topic 'sln-bom' 61cf781a Encoding: Write Visual Studio solution file with BOM. ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalVisualStudio71Generator.cxx | 5 +++++ Source/cmGlobalVisualStudio7Generator.cxx | 5 +++++ 2 files changed, 10 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:00:29 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:00:29 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-663-g5632456 Message-ID: <20150111170029.7535EA961B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 56324568cf24263f23523caf4dc6a85323c0d56d (commit) via b4e54f9b8c748f78d16e9da055a7e0436d7654ef (commit) from 20d60c636116c55bfeaa7ebd02045fafe0b96808 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56324568cf24263f23523caf4dc6a85323c0d56d commit 56324568cf24263f23523caf4dc6a85323c0d56d Merge: 20d60c6 b4e54f9 Author: Brad King AuthorDate: Sun Jan 11 12:00:28 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 12:00:28 2015 -0500 Merge topic 'FindCUDA.cmake/UseCMAKE_CXX_FLAGS_separableCompilation' b4e54f9b FindCUDA: Add relevant CMAKE_{C,CXX}_FLAGS for separable compilation ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:00:31 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:00:31 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-665-g68f9e67 Message-ID: <20150111170031.7A349A95A3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 68f9e6724275e2b0fc05604163c315e3392f8d93 (commit) via 9a8ab86645b0ea1fcbd1b069694d0cbb4fa2621a (commit) from 56324568cf24263f23523caf4dc6a85323c0d56d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68f9e6724275e2b0fc05604163c315e3392f8d93 commit 68f9e6724275e2b0fc05604163c315e3392f8d93 Merge: 5632456 9a8ab86 Author: Brad King AuthorDate: Sun Jan 11 12:00:30 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 12:00:30 2015 -0500 Merge topic 'tests-encoding' 9a8ab866 Encoding: Modify tests to work using non-ascii paths. ----------------------------------------------------------------------- Summary of changes: Tests/Complex/Executable/CMakeLists.txt | 14 ++++++++----- Tests/Complex/Executable/complex.cxx | 22 ++++++++++---------- Tests/ComplexOneConfig/Executable/CMakeLists.txt | 14 ++++++++----- Tests/ComplexOneConfig/Executable/complex.cxx | 22 ++++++++++---------- Tests/CustomCommand/CMakeLists.txt | 7 ------- Tests/CustomCommand/config.h.in | 1 - Tests/CustomCommand/foo.in | 3 +-- Tests/OutDir/OutDir.cmake | 10 ++++++--- .../ValidTarget-TARGET_PDB_FILE-check.cmake | 2 +- 9 files changed, 49 insertions(+), 46 deletions(-) delete mode 100644 Tests/CustomCommand/config.h.in hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:02:13 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:02:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1705-g00204d5 Message-ID: <20150111170213.D0F12A97B6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 00204d5d621b06ebf5094d8e7636cd5269365698 (commit) via 68f9e6724275e2b0fc05604163c315e3392f8d93 (commit) via 56324568cf24263f23523caf4dc6a85323c0d56d (commit) via 20d60c636116c55bfeaa7ebd02045fafe0b96808 (commit) via 775fb2e0b03772f08b5740ad5463f849109f0c7f (commit) via 1c0d6a7cb5c51fef3ee8804ed298da95e2c1ca1a (commit) via cb5fc7b993866e7398922d34a1b1807ad061d4b0 (commit) via f098e0e22bedbaf7aa41ef5f8fb9e10478b6672e (commit) via 4a549e7e0eb769780c76e94c9fac69a8a2e693ed (commit) via 7e5e8a37b56dd7c858d54c49e7fa6697cc72395b (commit) from 020324f29f9d58cf5fef7a3c09aac6b81bc6c930 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00204d5d621b06ebf5094d8e7636cd5269365698 commit 00204d5d621b06ebf5094d8e7636cd5269365698 Merge: 020324f 68f9e67 Author: Brad King AuthorDate: Sun Jan 11 12:02:04 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 12:02:04 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:06:22 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:06:22 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-675-g30289e0 Message-ID: <20150111170622.6C638A9D96@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 30289e07ce138598e813ae24d37d7191b2eb9935 (commit) via ca5fe169aa4873af5b1ba4c6b2ecb35b84364974 (commit) via ac16b88e5062c0c5d7bd020fdd139a2953d427c9 (commit) via f00e44a9f71395c5960bd83a86a1a537a7bf7e79 (commit) via 13a2154c380d03e5256aa4d7013dd8465bca0a9c (commit) via 13f0653375f94d42cb0cfa9ab8c78090b2f67eb0 (commit) via a2e4b09329dc518518165a21eae3021b50791bc0 (commit) via 344604220d48b5e1180096a7f02ede1d6b99bbff (commit) via f35febab2276bb031e26ef62339cb75fcf2c51a3 (commit) via 8afa15fab1a604a7f20490854f477e603d195df4 (commit) from 68f9e6724275e2b0fc05604163c315e3392f8d93 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:06:22 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:06:22 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1716-g2bfca58 Message-ID: <20150111170622.933C4A9D98@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2bfca5803250de609c158c8f1c5c7db4c86a883d (commit) via 30289e07ce138598e813ae24d37d7191b2eb9935 (commit) via ca5fe169aa4873af5b1ba4c6b2ecb35b84364974 (commit) via ac16b88e5062c0c5d7bd020fdd139a2953d427c9 (commit) via f00e44a9f71395c5960bd83a86a1a537a7bf7e79 (commit) via 13a2154c380d03e5256aa4d7013dd8465bca0a9c (commit) via 13f0653375f94d42cb0cfa9ab8c78090b2f67eb0 (commit) via a2e4b09329dc518518165a21eae3021b50791bc0 (commit) via 344604220d48b5e1180096a7f02ede1d6b99bbff (commit) via f35febab2276bb031e26ef62339cb75fcf2c51a3 (commit) via 8afa15fab1a604a7f20490854f477e603d195df4 (commit) from 00204d5d621b06ebf5094d8e7636cd5269365698 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2bfca5803250de609c158c8f1c5c7db4c86a883d commit 2bfca5803250de609c158c8f1c5c7db4c86a883d Merge: 00204d5 30289e0 Author: Brad King AuthorDate: Sun Jan 11 12:05:55 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 12:05:55 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:06:23 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:06:23 -0500 (EST) Subject: [Cmake-commits] CMake branch, release, updated. v3.1.0-34-gca5fe16 Message-ID: <20150111170623.165CBA983B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via ca5fe169aa4873af5b1ba4c6b2ecb35b84364974 (commit) via c6d03a1072c8f3ae285f4297caf96637b3a47c22 (commit) via 76ff92e0c96fc09813f119770d86bd6edc84820b (commit) via 282148628f362693334da1f7d242418011629afb (commit) via 34a990946c655a0be69e4168461c5e23a2d64bfa (commit) via ac16b88e5062c0c5d7bd020fdd139a2953d427c9 (commit) via 67516fb57e7f0781c79801efdcae8f76bb1adaae (commit) via f00e44a9f71395c5960bd83a86a1a537a7bf7e79 (commit) via 13a2154c380d03e5256aa4d7013dd8465bca0a9c (commit) via 13f0653375f94d42cb0cfa9ab8c78090b2f67eb0 (commit) via a2e4b09329dc518518165a21eae3021b50791bc0 (commit) via 344604220d48b5e1180096a7f02ede1d6b99bbff (commit) via d5846eb153e277980f59f70c92807851a429c3c1 (commit) via cbaf0802a5646dd1fdf9fabc0f0c274621349619 (commit) via 72a0d6df6dfa7c81a5a81c6f5b85b964815ffbc1 (commit) via 7a2c3f0c0ec5b542c89456826adeb56c3cbd7df0 (commit) via 2866a503a78ac63cd95695e92670ea9231c95350 (commit) via f35febab2276bb031e26ef62339cb75fcf2c51a3 (commit) via 8afa15fab1a604a7f20490854f477e603d195df4 (commit) via 8d70a91489d74bd6056ba6858d815f5ee47a2e67 (commit) via 07fc7b75ef981300e7d873091ee90083b18d1c4a (commit) via fdbfcfdf0173c34845e495f4c0bd407faafc45b4 (commit) from 62b19984039235d5325ee1ad6a7643a4ccd696a8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/command/get_test_property.rst | 8 +++---- Help/command/if.rst | 9 ++++---- Help/command/set_tests_properties.rst | 2 +- Help/prop_tgt/CXX_STANDARD.rst | 2 +- Help/release/3.1.0.rst | 22 ++++++++++++++++++++ Modules/FindCUDA.cmake | 4 ++-- Modules/FindIce.cmake | 10 ++++----- Modules/FindSDL.cmake | 2 +- Source/cmGetTargetPropertyCommand.cxx | 5 ++++- Source/cmNinjaNormalTargetGenerator.cxx | 17 +++++++++++++-- Source/kwsys/Terminal.c | 1 + Tests/CMakeLists.txt | 1 + Tests/CxxSubdirC/CMakeLists.txt | 4 ++++ Tests/CxxSubdirC/Cdir/CMakeLists.txt | 2 ++ Tests/CxxSubdirC/Cdir/Cobj.c | 1 + Tests/CxxSubdirC/main.cxx | 2 ++ Tests/RunCMake/CMakeLists.txt | 1 + .../{CMP0004 => get_property}/CMakeLists.txt | 0 Tests/RunCMake/get_property/RunCMakeTest.cmake | 9 ++++++++ .../get_property/cache_properties-stderr.txt | 3 +++ Tests/RunCMake/get_property/cache_properties.cmake | 15 +++++++++++++ .../get_property/directory_properties-stderr.txt | 6 ++++++ .../get_property/directory_properties.cmake | 15 +++++++++++++ .../get_property/global_properties-stderr.txt | 6 ++++++ .../RunCMake/get_property/global_properties.cmake | 16 ++++++++++++++ .../get_property/install_properties-stderr.txt | 3 +++ .../RunCMake/get_property/install_properties.cmake | 18 ++++++++++++++++ .../get_property/source_properties-stderr.txt | 6 ++++++ .../RunCMake/get_property/source_properties.cmake | 15 +++++++++++++ .../get_property/target_properties-stderr.txt | 6 ++++++ .../RunCMake/get_property/target_properties.cmake | 16 ++++++++++++++ .../get_property/test_properties-stderr.txt | 6 ++++++ Tests/RunCMake/get_property/test_properties.cmake | 17 +++++++++++++++ 33 files changed, 229 insertions(+), 21 deletions(-) create mode 100644 Tests/CxxSubdirC/CMakeLists.txt create mode 100644 Tests/CxxSubdirC/Cdir/CMakeLists.txt create mode 100644 Tests/CxxSubdirC/Cdir/Cobj.c create mode 100644 Tests/CxxSubdirC/main.cxx copy Tests/RunCMake/{CMP0004 => get_property}/CMakeLists.txt (100%) create mode 100644 Tests/RunCMake/get_property/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/get_property/cache_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/cache_properties.cmake create mode 100644 Tests/RunCMake/get_property/directory_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/directory_properties.cmake create mode 100644 Tests/RunCMake/get_property/global_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/global_properties.cmake create mode 100644 Tests/RunCMake/get_property/install_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/install_properties.cmake create mode 100644 Tests/RunCMake/get_property/source_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/source_properties.cmake create mode 100644 Tests/RunCMake/get_property/target_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/target_properties.cmake create mode 100644 Tests/RunCMake/get_property/test_properties-stderr.txt create mode 100644 Tests/RunCMake/get_property/test_properties.cmake hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 11 12:08:47 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 11 Jan 2015 12:08:47 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1719-g0452db7 Message-ID: <20150111170849.797C9AA05C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0452db7c106afd86139b90690d205f4f4b066df6 (commit) via ed8fba843b77d17f5d3b320ef8d31418b97d07d0 (commit) via a0b2da07794db73b54d370720d4f44a1f607dd18 (commit) from 2bfca5803250de609c158c8f1c5c7db4c86a883d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0452db7c106afd86139b90690d205f4f4b066df6 commit 0452db7c106afd86139b90690d205f4f4b066df6 Merge: 2bfca58 ed8fba8 Author: Stephen Kelly AuthorDate: Sun Jan 11 12:08:46 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 12:08:46 2015 -0500 Merge topic 'fix-COMPILE_FEATURES-genex' into next ed8fba84 Features: Fix the COMPILE_FEATURES genex for unavailable features. a0b2da07 cmMakefile: Rename a method to what it really does. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed8fba843b77d17f5d3b320ef8d31418b97d07d0 commit ed8fba843b77d17f5d3b320ef8d31418b97d07d0 Author: Stephen Kelly AuthorDate: Sun Jan 11 17:53:37 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:08:09 2015 +0100 Features: Fix the COMPILE_FEATURES genex for unavailable features. Previously, the genex tested only for CMake knowledge of the feature, but not compiler knowledge of the feature. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 9ffe9f2..d5d78d5 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1373,9 +1373,16 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode for (LangMap::const_iterator lit = testedFeatures.begin(); lit != testedFeatures.end(); ++lit) { + std::vector const& langAvailable + = availableFeatures[lit->first]; for (std::vector::const_iterator it = lit->second.begin(); it != lit->second.end(); ++it) { + if (std::find(langAvailable.begin(), langAvailable.end(), *it) + == langAvailable.end()) + { + return "0"; + } if (!context->Makefile->HaveStandardAvailable(target, lit->first, *it)) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0b2da07794db73b54d370720d4f44a1f607dd18 commit a0b2da07794db73b54d370720d4f44a1f607dd18 Author: Stephen Kelly AuthorDate: Sun Jan 11 17:43:44 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:08:03 2015 +0100 cmMakefile: Rename a method to what it really does. The method does not test availability of compile features. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 84a4daa..9ffe9f2 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1376,7 +1376,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode for (std::vector::const_iterator it = lit->second.begin(); it != lit->second.end(); ++it) { - if (!context->Makefile->HaveFeatureAvailable(target, + if (!context->Makefile->HaveStandardAvailable(target, lit->first, *it)) { if (evalLL) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b7e89b8..e15a1c1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -5130,18 +5130,18 @@ CompileFeaturesAvailable(const std::string& lang, std::string *error) const } //---------------------------------------------------------------------------- -bool cmMakefile::HaveFeatureAvailable(cmTarget const* target, +bool cmMakefile::HaveStandardAvailable(cmTarget const* target, std::string const& lang, const std::string& feature) const { return lang == "C" - ? this->HaveCFeatureAvailable(target, feature) - : this->HaveCxxFeatureAvailable(target, feature); + ? this->HaveCStandardAvailable(target, feature) + : this->HaveCxxStandardAvailable(target, feature); } //---------------------------------------------------------------------------- bool cmMakefile:: -HaveCFeatureAvailable(cmTarget const* target, const std::string& feature) const +HaveCStandardAvailable(cmTarget const* target, const std::string& feature) const { bool needC90 = false; bool needC99 = false; @@ -5218,7 +5218,7 @@ bool cmMakefile::IsLaterStandard(std::string const& lang, } //---------------------------------------------------------------------------- -bool cmMakefile::HaveCxxFeatureAvailable(cmTarget const* target, +bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const { bool needCxx98 = false; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 28f8686..24a4f00 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -935,7 +935,7 @@ public: const char* CompileFeaturesAvailable(const std::string& lang, std::string *error) const; - bool HaveFeatureAvailable(cmTarget const* target, std::string const& lang, + bool HaveStandardAvailable(cmTarget const* target, std::string const& lang, const std::string& feature) const; bool IsLaterStandard(std::string const& lang, @@ -1158,9 +1158,9 @@ private: void CheckNeededCxxLanguage(const std::string& feature, bool& needCxx98, bool& needCxx11, bool& needCxx14) const; - bool HaveCFeatureAvailable(cmTarget const* target, + bool HaveCStandardAvailable(cmTarget const* target, const std::string& feature) const; - bool HaveCxxFeatureAvailable(cmTarget const* target, + bool HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const; mutable bool SuppressWatches; ----------------------------------------------------------------------- Summary of changes: Source/cmGeneratorExpressionEvaluator.cxx | 9 ++++++++- Source/cmMakefile.cxx | 10 +++++----- Source/cmMakefile.h | 6 +++--- 3 files changed, 16 insertions(+), 9 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 12:38:32 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 12:38:32 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1721-g71372f0 Message-ID: <20150111173832.3B781AA02F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 71372f0784a5c25b21ab070461730781149eb35b (commit) via 07a3f9ad17194eda4a8df48351f25682aab50345 (commit) from 0452db7c106afd86139b90690d205f4f4b066df6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=71372f0784a5c25b21ab070461730781149eb35b commit 71372f0784a5c25b21ab070461730781149eb35b Merge: 0452db7 07a3f9a Author: Brad King AuthorDate: Sun Jan 11 12:38:31 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 12:38:31 2015 -0500 Merge topic 'FindLATEX-components' into next 07a3f9ad FindLATEX: Add components handling http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=07a3f9ad17194eda4a8df48351f25682aab50345 commit 07a3f9ad17194eda4a8df48351f25682aab50345 Author: Christoph Gr?ninger AuthorDate: Tue Dec 23 11:33:32 2014 +0100 Commit: Brad King CommitDate: Tue Dec 23 09:11:31 2014 -0500 FindLATEX: Add components handling diff --git a/Help/release/dev/FindLATEX-components.rst b/Help/release/dev/FindLATEX-components.rst new file mode 100644 index 0000000..d161c1f --- /dev/null +++ b/Help/release/dev/FindLATEX-components.rst @@ -0,0 +1,4 @@ +FindLATEX-components +-------------------- + +* The :module:`FindLATEX` module learned to support components. diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake index a935f00..db4902f 100644 --- a/Modules/FindLATEX.cmake +++ b/Modules/FindLATEX.cmake @@ -6,17 +6,36 @@ # # This module finds an installed Latex and determines the location # of the compiler. Additionally the module looks for Latex-related -# software like BibTeX. This code sets the following variables: +# software like BibTeX. # -# :: +# This module sets the following result variables:: # +# LATEX_FOUND: whether found Latex and requested components +# LATEX__FOUND: whether found # LATEX_COMPILER: path to the LaTeX compiler # PDFLATEX_COMPILER: path to the PdfLaTeX compiler # BIBTEX_COMPILER: path to the BibTeX compiler # MAKEINDEX_COMPILER: path to the MakeIndex compiler # DVIPS_CONVERTER: path to the DVIPS converter +# DVIPDF_CONVERTER: path to the DVIPDF converter # PS2PDF_CONVERTER: path to the PS2PDF converter # LATEX2HTML_CONVERTER: path to the LaTeX2Html converter +# +# Possible components are:: +# +# PDFLATEX +# BIBTEX +# MAKEINDEX +# DVIPS +# DVIPDF +# PS2PDF +# LATEX2HTML +# +# Example Usages:: +# +# find_package(LATEX) +# find_package(LATEX COMPONENTS PDFLATEX) +# find_package(LATEX COMPONENTS BIBTEX PS2PDF) #============================================================================= # Copyright 2002-2014 Kitware, Inc. @@ -32,9 +51,7 @@ # License text for the above reference.) if (WIN32) - # Try to find the MikTex binary path (look for its package manager). - find_path(MIKTEX_BINARY_PATH mpm.exe "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MiK\\MiKTeX\\CurrentVersion\\MiKTeX;Install Root]/miktex/bin" DOC @@ -43,7 +60,6 @@ if (WIN32) mark_as_advanced(MIKTEX_BINARY_PATH) # Try to find the GhostScript binary path (look for gswin32). - get_filename_component(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\8.00;GS_DLL]" PATH ) @@ -64,45 +80,76 @@ if (WIN32) DOC "Path to the GhostScript library directory." ) mark_as_advanced(GHOSTSCRIPT_LIBRARY_PATH) - endif () +# try to find Latex and the related programs find_program(LATEX_COMPILER NAMES latex PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +# find pdflatex find_program(PDFLATEX_COMPILER NAMES pdflatex PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (PDFLATEX_COMPILER) + set(LATEX_PDFLATEX_FOUND TRUE) +else() + set(LATEX_PDFLATEX_FOUND FALSE) +endif() +# find bibtex find_program(BIBTEX_COMPILER NAMES bibtex PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (BIBTEX_COMPILER) + set(LATEX_BIBTEX_FOUND TRUE) +else() + set(LATEX_BIBTEX_FOUND FALSE) +endif() +# find makeindex find_program(MAKEINDEX_COMPILER NAMES makeindex PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (MAKEINDEX_COMPILER) + set(LATEX_MAKEINDEX_FOUND TRUE) +else() + set(LATEX_MAKEINDEX_FOUND FALSE) +endif() +# find dvips find_program(DVIPS_CONVERTER NAMES dvips PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (DVIPS_CONVERTER) + set(LATEX_DVIPS_FOUND TRUE) +else() + set(LATEX_DVIPS_FOUND FALSE) +endif() +# find dvipdf find_program(DVIPDF_CONVERTER NAMES dvipdfm dvipdft dvipdf PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (DVIPDF_CONVERTER) + set(LATEX_DVIPDF_FOUND TRUE) +else() + set(LATEX_DVIPDF_FOUND FALSE) +endif() +# find ps2pdf if (WIN32) find_program(PS2PDF_CONVERTER NAMES ps2pdf14.bat ps2pdf14 ps2pdf @@ -114,12 +161,23 @@ else () NAMES ps2pdf14 ps2pdf ) endif () +if (PS2PDF_CONVERTER) + set(LATEX_PS2PDF_FOUND TRUE) +else() + set(LATEX_PS2PDF_FOUND FALSE) +endif() +# find latex2html find_program(LATEX2HTML_CONVERTER NAMES latex2html PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (LATEX2HTML_CONVERTER) + set(LATEX_LATEX2HTML_FOUND TRUE) +else() + set(LATEX_LATEX2HTML_FOUND FALSE) +endif() mark_as_advanced( @@ -133,7 +191,9 @@ mark_as_advanced( LATEX2HTML_CONVERTER ) +# handle variables for found Latex and its components include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(Latex +find_package_handle_standard_args(LATEX REQUIRED_VARS LATEX_COMPILER + HANDLE_COMPONENTS ) ----------------------------------------------------------------------- Summary of changes: Help/release/dev/FindLATEX-components.rst | 4 ++ Modules/FindLATEX.cmake | 74 ++++++++++++++++++++++++++--- 2 files changed, 71 insertions(+), 7 deletions(-) create mode 100644 Help/release/dev/FindLATEX-components.rst hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 11 12:49:10 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 11 Jan 2015 12:49:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1733-g78bb456 Message-ID: <20150111174910.C0812A81A4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 78bb45601fe03f041adcac56e98acac7b82213a7 (commit) via 4480092c7b19da6e020c2f893c5b08d9acf1ab81 (commit) via b594522f7b50d99ce52c2ae40e5604bc59093097 (commit) via b8441bfcf23ab38367bcda8ca9ea004a02b1bfa5 (commit) via 5fb5b9a0ad4e346c94e7d90d32eb3b8f95b7d1f7 (commit) via aa86b9a9e346313dae56c34b662407441c602471 (commit) via 9f5b65e3f0fccfa5749d24a867a1bb3ca7f500d5 (commit) via 070921f6e04ca45aa74ceaf298b3d0155f3ca926 (commit) via 0b5df0345c38624636d3ec29a8efc254b9d28a43 (commit) via c120afd24eb8d3e07e941480c9d1081f47c77250 (commit) via 900c349fff49949f0380e094913fd3da4b2ebc53 (commit) via 00f66a045144a363b497874613457fe0cf80683f (commit) from 71372f0784a5c25b21ab070461730781149eb35b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78bb45601fe03f041adcac56e98acac7b82213a7 commit 78bb45601fe03f041adcac56e98acac7b82213a7 Merge: 71372f0 4480092 Author: Stephen Kelly AuthorDate: Sun Jan 11 12:49:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 12:49:09 2015 -0500 Merge topic 'GNU-4.6-compile-features' into next 4480092c Features: Record for GNU 4.6. b594522f Features: Record that variadic_templates does not work with GNU 4.6. b8441bfc Features: Extend the generalized_initializers test for GNU 4.6. 5fb5b9a0 Features: Test __GXX_EXPERIMENTAL_CXX0X__ macro for GNU 4.6 compatibility. aa86b9a9 Features: Don't test __cplusplus value for CXX98 on GNU. 9f5b65e3 Features: Test an old value of __STDC_VERSION__ for GNU 4.6 compatibility. 070921f6 Features: Record C/CXX dialect flags for GNU 4.6. 0b5df034 Features: Remove wrong content from else() condition. c120afd2 Features: Make cxx_noexcept available from GNU 4.6. 900c349f Update the default_dialect test for old GNU-like compilers. 00f66a04 Record compile features for GNU on Apple. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4480092c7b19da6e020c2f893c5b08d9acf1ab81 commit 4480092c7b19da6e020c2f893c5b08d9acf1ab81 Author: Stephen Kelly AuthorDate: Sat Jan 10 20:05:54 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:46:00 2015 +0100 Features: Record for GNU 4.6. diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake index ddac0e8..7e840aa 100644 --- a/Modules/Compiler/GNU-C-FeatureTests.cmake +++ b/Modules/Compiler/GNU-C-FeatureTests.cmake @@ -1,12 +1,12 @@ -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") # GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it # to 201000L. As the former is strictly greater than the latter, test only # for the latter. If in the future CMake learns about a C feature which was # introduced with GNU 4.7, that should test for the correct version, similar # to the distinction between __cplusplus and __GXX_EXPERIMENTAL_CXX0X__ tests. -set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") +set(GNU46_C11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") set(_cmake_feature_test_c_static_assert "${GNU46_C11}") # Since 4.4 at least: set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 2720fbc..07200f4 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -28,7 +28,7 @@ macro(cmake_record_c_compile_features) record_compiler_features(C "${std_version}" ${list}) endmacro() - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 89d9efe..35fff95 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -2,7 +2,7 @@ # Reference: http://gcc.gnu.org/projects/cxx0x.html # http://gcc.gnu.org/projects/cxx1y.html -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L") set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}") @@ -61,7 +61,7 @@ set(_cmake_feature_test_cxx_variadic_templates "${GNU47_CXX11}") # defined in the future. set(GNU_CXX0X_DEFINED "(__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))") # TODO: Should be supported by GNU 4.6 -set(GNU46_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU46_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index e746267..18bcf15 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -45,7 +45,7 @@ macro(cmake_record_cxx_compile_features) if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() - if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9fb8d1b..75beaf7 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -144,7 +144,12 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(IfaceCompileFeatures main.cpp) target_link_libraries(IfaceCompileFeatures iface) - add_definitions(-DEXPECT_OVERRIDE_CONTROL=1) + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" + AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + add_definitions(-DEXPECT_OVERRIDE_CONTROL=1) + else() + add_definitions(-DEXPECT_OVERRIDE_CONTROL=0) + endif() add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b594522f7b50d99ce52c2ae40e5604bc59093097 commit b594522f7b50d99ce52c2ae40e5604bc59093097 Author: Stephen Kelly AuthorDate: Sun Jan 11 18:44:49 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:46:00 2015 +0100 Features: Record that variadic_templates does not work with GNU 4.6. The unit test for this fails with Building CXX object CMakeFiles/test_cxx_variadic_templates.dir/cxx_variadic_templates.cpp.o /home/stephen/dev/src/cmake/Tests/CompileFeatures/cxx_variadic_templates.cpp: In static member function ?static int Interface::accumulate()?: /home/stephen/dev/src/cmake/Tests/CompileFeatures/cxx_variadic_templates.cpp:18:31: sorry, unimplemented: cannot expand ?Is ...? into a fixed-length argument list CMakeFiles/test_cxx_variadic_templates.dir/build.make:54: recipe for target 'CMakeFiles/test_cxx_variadic_templates.dir/cxx_variadic_templates.cpp.o' failed diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 41f1803..89d9efe 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -49,6 +49,7 @@ set(_cmake_feature_test_cxx_final "${GNU47_CXX11}") set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}") set(_cmake_feature_test_cxx_override "${GNU47_CXX11}") set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") +set(_cmake_feature_test_cxx_variadic_templates "${GNU47_CXX11}") # NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor # release following that (March 2012), and the first minor release to # support -std=c++11. Prior to that, support for C++11 features is technically @@ -86,7 +87,6 @@ set(_cmake_feature_test_cxx_strong_enums "${GNU44_CXX11}") set(_cmake_feature_test_cxx_trailing_return_types "${GNU44_CXX11}") set(_cmake_feature_test_cxx_unicode_literals "${GNU44_CXX11}") set(_cmake_feature_test_cxx_uniform_initialization "${GNU44_CXX11}") -set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}") # TODO: If features are ever recorded for GNU 4.3, there should possibly # be a new feature added like cxx_variadic_template_template_parameters, # which is implemented by GNU 4.4, but not 4.3. cxx_variadic_templates is http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8441bfcf23ab38367bcda8ca9ea004a02b1bfa5 commit b8441bfcf23ab38367bcda8ca9ea004a02b1bfa5 Author: Stephen Kelly AuthorDate: Sun Jan 11 18:43:31 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:46:00 2015 +0100 Features: Extend the generalized_initializers test for GNU 4.6. That compiler requires a different initializer_list constructor, so update the test to match. diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp index 8013ef5..7bf356b 100644 --- a/Tests/CompileFeatures/cxx_generalized_initializers.cpp +++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp @@ -8,6 +8,7 @@ namespace std { const _E* __begin_; size_t __size_; + initializer_list(const int*, long unsigned int) {} }; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5fb5b9a0ad4e346c94e7d90d32eb3b8f95b7d1f7 commit 5fb5b9a0ad4e346c94e7d90d32eb3b8f95b7d1f7 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:22:24 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:34:26 2015 +0100 Features: Test __GXX_EXPERIMENTAL_CXX0X__ macro for GNU 4.6 compatibility. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 27cff40..41f1803 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -54,8 +54,13 @@ set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") # support -std=c++11. Prior to that, support for C++11 features is technically # experiemental and possibly incomplete (see for example the note below about # cxx_variadic_template_template_parameters) +# GNU does not define __cplusplus correctly before version 4.7. +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773 +# __GXX_EXPERIMENTAL_CXX0X__ is defined in prior versions, but may not be +# defined in the future. +set(GNU_CXX0X_DEFINED "(__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))") # TODO: Should be supported by GNU 4.6 -set(GNU46_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU46_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}") @@ -64,13 +69,13 @@ set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}") set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}") # TODO: Should be supported by GNU 4.5 -set(GNU45_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU45_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}") set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}") set(_cmake_feature_test_cxx_local_type_template_args "${GNU45_CXX11}") set(_cmake_feature_test_cxx_raw_string_literals "${GNU45_CXX11}") # TODO: Should be supported by GNU 4.4 -set(GNU44_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU44_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}") set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}") set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}") @@ -90,7 +95,7 @@ set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}") # templates capability in CMake. See # http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf # TODO: Should be supported by GNU 4.3 -set(GNU43_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU43_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}") set(_cmake_feature_test_cxx_default_function_template_args "${GNU43_CXX11}") set(_cmake_feature_test_cxx_long_long_type "${GNU43_CXX11}") @@ -98,8 +103,8 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}") set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}") set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}") # TODO: Should be supported since GNU 3.4? -set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") # TODO: Should be supported forever? -set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && __cplusplus >= 201103L") -set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported}") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa86b9a9e346313dae56c34b662407441c602471 commit aa86b9a9e346313dae56c34b662407441c602471 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:23:34 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:34:26 2015 +0100 Features: Don't test __cplusplus value for CXX98 on GNU. The macro is defined to 1 for GNU 4.6, and such a test is only useful for features in language dialects newer than the default (CXX98 for GNU currently). diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 03b53e1..27cff40 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -102,4 +102,4 @@ set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && __cpl # TODO: Should be supported forever? set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && __cplusplus >= 201103L") -set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported} && __cplusplus >= 199711L") +set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported}") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9f5b65e3f0fccfa5749d24a867a1bb3ca7f500d5 commit 9f5b65e3f0fccfa5749d24a867a1bb3ca7f500d5 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:20:03 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:34:26 2015 +0100 Features: Test an old value of __STDC_VERSION__ for GNU 4.6 compatibility. diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake index dfaeebf..ddac0e8 100644 --- a/Modules/Compiler/GNU-C-FeatureTests.cmake +++ b/Modules/Compiler/GNU-C-FeatureTests.cmake @@ -1,7 +1,12 @@ set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") -set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L") +# GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it +# to 201000L. As the former is strictly greater than the latter, test only +# for the latter. If in the future CMake learns about a C feature which was +# introduced with GNU 4.7, that should test for the correct version, similar +# to the distinction between __cplusplus and __GXX_EXPERIMENTAL_CXX0X__ tests. +set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") set(_cmake_feature_test_c_static_assert "${GNU46_C11}") # Since 4.4 at least: set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=070921f6e04ca45aa74ceaf298b3d0155f3ca926 commit 070921f6e04ca45aa74ceaf298b3d0155f3ca926 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:09:50 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:34:26 2015 +0100 Features: Record C/CXX dialect flags for GNU 4.6. This release was prior to standardization of C11/CXX11. diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 031eb81..2720fbc 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -1,15 +1,20 @@ include(Compiler/GNU) __compiler_gnu(C) -if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99") set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99") +endif() +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") +elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) + set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x") + set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x") endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index 4a26963..e746267 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -11,7 +11,7 @@ else() endif() endif() -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) # Supported since 4.3 set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98") @@ -20,7 +20,10 @@ endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") +elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) # 4.3 supports 0x variants + set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x") + set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x") endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b5df0345c38624636d3ec29a8efc254b9d28a43 commit 0b5df0345c38624636d3ec29a8efc254b9d28a43 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:14:26 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:34:25 2015 +0100 Features: Remove wrong content from else() condition. As this is not elseif(), the content has no effect. Rather than changing it to an elseif(), remove the conditional content. All versions of GNU prior to 5.0 default to C90/89. Clang-C.cmake has a similar code block which correctly uses elseif() for setting the default C dialect to C99. That may have been updated from a C90 default at some point, so leave the version condition there in place for now. diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index db9089d..031eb81 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -14,7 +14,7 @@ endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set(CMAKE_C_STANDARD_DEFAULT 11) -else(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) +else() set(CMAKE_C_STANDARD_DEFAULT 90) endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c120afd24eb8d3e07e941480c9d1081f47c77250 commit c120afd24eb8d3e07e941480c9d1081f47c77250 Author: Stephen Kelly AuthorDate: Sun Jan 11 15:55:09 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:34:25 2015 +0100 Features: Make cxx_noexcept available from GNU 4.6. As listed in the reference document. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 6de06dd..03b53e1 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -46,7 +46,6 @@ set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}") set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}") set(_cmake_feature_test_cxx_extended_friend_declarations "${GNU47_CXX11}") set(_cmake_feature_test_cxx_final "${GNU47_CXX11}") -set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}") set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}") set(_cmake_feature_test_cxx_override "${GNU47_CXX11}") set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") @@ -60,6 +59,7 @@ set(GNU46_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}") +set(_cmake_feature_test_cxx_noexcept "${GNU46_CXX11}") set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}") set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=900c349fff49949f0380e094913fd3da4b2ebc53 commit 900c349fff49949f0380e094913fd3da4b2ebc53 Author: Stephen Kelly AuthorDate: Fri Jan 9 20:18:24 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:34:25 2015 +0100 Update the default_dialect test for old GNU-like compilers. Prior to GNU 4.7, GNU defined __cplusplus incorrectly, and defined __GXX_EXPERIMENTAL_CXX0X__ in C++11 mode. diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp index 8d97926..a2ca268 100644 --- a/Tests/CompileFeatures/default_dialect.cpp +++ b/Tests/CompileFeatures/default_dialect.cpp @@ -14,7 +14,7 @@ Outputter<__cplusplus> o; # if !DEFAULT_CXX98 # error Buildsystem error # endif -# if __cplusplus != 199711L +# if __cplusplus != 199711L && __cplusplus != 1 && !defined(__GXX_EXPERIMENTAL_CXX0X__) Outputter<__cplusplus> o; # endif #endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00f66a045144a363b497874613457fe0cf80683f commit 00f66a045144a363b497874613457fe0cf80683f Author: Stephen Kelly AuthorDate: Fri Jan 9 20:18:25 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 11 18:34:25 2015 +0100 Record compile features for GNU on Apple. Tested with GNU 4.8 binary (bottle) from homebrew, and assumed to work with the others. diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 9018450..db9089d 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -23,7 +23,7 @@ macro(cmake_record_c_compile_features) record_compiler_features(C "${std_version}" ${list}) endmacro() - if (UNIX AND NOT APPLE AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index a91c901..4a26963 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -39,10 +39,10 @@ macro(cmake_record_cxx_compile_features) endmacro() set(_result 0) - if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() - if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/GNU-CXX-FeatureTests.cmake | 2 +- Tests/CompileFeatures/CMakeLists.txt | 7 ++++++- Tests/CompileFeatures/cxx_generalized_initializers.cpp | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 14:51:21 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 14:51:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1735-g29755e8 Message-ID: <20150111195121.0C0E4A986A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 29755e8b9dec5b7ef9473b0ed17e6b0ac0606df6 (commit) via 802d0aa0b0a0af72fdc95bf1f69afeb362b6ef95 (commit) from 78bb45601fe03f041adcac56e98acac7b82213a7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=29755e8b9dec5b7ef9473b0ed17e6b0ac0606df6 commit 29755e8b9dec5b7ef9473b0ed17e6b0ac0606df6 Merge: 78bb456 802d0aa Author: Brad King AuthorDate: Sun Jan 11 14:51:20 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 14:51:20 2015 -0500 Merge topic 'FindRuby-fix-version' into next 802d0aa0 FindRuby: Fix output check in _RUBY_CONFIG_VAR http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=802d0aa0b0a0af72fdc95bf1f69afeb362b6ef95 commit 802d0aa0b0a0af72fdc95bf1f69afeb362b6ef95 Author: Evangelos Foutras AuthorDate: Mon Dec 29 19:02:04 2014 +0200 Commit: Brad King CommitDate: Sun Jan 11 14:49:51 2015 -0500 FindRuby: Fix output check in _RUBY_CONFIG_VAR Since commit v2.8.8~173^2 (FindRuby: clean up querying variables from Ruby, 2012-02-17) we query RbConfig::CONFIG first and, if the command fails or its output equates to a false constant, then fall back to querying Config::CONFIG. Due to the above, an error condition exists with Ruby 2.2.0; when querying RbConfig::CONFIG['TEENY'], the output of '0' will be discarded since it matches the false constant '0'. In previous versions this wasn't a problem, but Ruby 2.2 has completely removed Config::CONFIG. This causes RUBY_VERSION_PATCH to be set to an empty string and the Ruby version to be detected as '2.2.' (instead of '2.2.0'). Fix the output check to explicitly look for an empty string before using the fallback query method. (Someone more familiar with Ruby might be able to deem the fallback as unnecessary and fully remove it.) diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index b5ac703..0950d15 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -90,7 +90,7 @@ if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) RESULT_VARIABLE _RUBY_SUCCESS OUTPUT_VARIABLE _RUBY_OUTPUT ERROR_QUIET) - if(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT) + if(_RUBY_SUCCESS OR _RUBY_OUTPUT STREQUAL "") execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']" RESULT_VARIABLE _RUBY_SUCCESS OUTPUT_VARIABLE _RUBY_OUTPUT ----------------------------------------------------------------------- Summary of changes: Modules/FindRuby.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 14:58:35 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 14:58:35 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-677-g16d68da Message-ID: <20150111195835.8786EAA069@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 16d68daccb41ca97b42c0074f0de35a53448d8b7 (commit) via 4729547a5b2596d6997e9b9131751995dbc4695d (commit) from 30289e07ce138598e813ae24d37d7191b2eb9935 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=16d68daccb41ca97b42c0074f0de35a53448d8b7 commit 16d68daccb41ca97b42c0074f0de35a53448d8b7 Merge: 30289e0 4729547 Author: Brad King AuthorDate: Sun Jan 11 14:58:34 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 14:58:34 2015 -0500 Merge topic 'linux-XL-fortran' 4729547a XL: Fix link flags for executables on Linux with XL compilers ----------------------------------------------------------------------- Summary of changes: Modules/Platform/Linux-XL-C.cmake | 1 + Modules/Platform/Linux-XL-CXX.cmake | 1 + Modules/Platform/Linux-XL-Fortran.cmake | 1 + 3 files changed, 3 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 14:58:52 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 14:58:52 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1737-gdda9962 Message-ID: <20150111195852.E904FAA068@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via dda9962f80194e91ab395859ab9caf8dc7c8523d (commit) via 16d68daccb41ca97b42c0074f0de35a53448d8b7 (commit) from 29755e8b9dec5b7ef9473b0ed17e6b0ac0606df6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dda9962f80194e91ab395859ab9caf8dc7c8523d commit dda9962f80194e91ab395859ab9caf8dc7c8523d Merge: 29755e8 16d68da Author: Brad King AuthorDate: Sun Jan 11 14:58:46 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 14:58:46 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 15:12:03 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 15:12:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1739-g16e597e Message-ID: <20150111201203.82087515B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 16e597ec9e3e2e7fee69d8b8a150a413a24d0dc0 (commit) via 7c585699304ac071cdf7c1b8d7677d38b859e70f (commit) from dda9962f80194e91ab395859ab9caf8dc7c8523d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=16e597ec9e3e2e7fee69d8b8a150a413a24d0dc0 commit 16e597ec9e3e2e7fee69d8b8a150a413a24d0dc0 Merge: dda9962 7c58569 Author: Brad King AuthorDate: Sun Jan 11 15:12:02 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 15:12:02 2015 -0500 Merge topic 'fix-autouic-regression' into next 7c585699 QtAutoUic: Restore source file AUTOUIC_OPTIONS settings http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c585699304ac071cdf7c1b8d7677d38b859e70f commit 7c585699304ac071cdf7c1b8d7677d38b859e70f Author: Justin Borodinsky AuthorDate: Thu Jan 1 14:20:14 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 15:11:18 2015 -0500 QtAutoUic: Restore source file AUTOUIC_OPTIONS settings The "." in the extension was dropped by commit v3.1.0-rc1~556^2~2 (cmSourceFile: Cache the isUiFile check, 2014-02-08) by mistake. This caused the options to not be set. diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index b833d3f..12eb411 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -24,7 +24,7 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name): this->CustomCommand = 0; this->Properties.SetCMakeInstance(mf->GetCMakeInstance()); this->FindFullPathFailed = false; - this->IsUiFile = ("ui" == + this->IsUiFile = (".ui" == cmSystemTools::GetFilenameLastExtension(this->Location.GetName())); } ----------------------------------------------------------------------- Summary of changes: Source/cmSourceFile.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 15:21:14 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 15:21:14 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1742-g1756828 Message-ID: <20150111202114.C4306A8C59@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1756828f2df84e72da330848896d3e877810093f (commit) via 8435088d6a387847bf58c3805424bd82ad6e09ca (commit) via b8abd25897c49aaf7461937283043f33c837031d (commit) from 16e597ec9e3e2e7fee69d8b8a150a413a24d0dc0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1756828f2df84e72da330848896d3e877810093f commit 1756828f2df84e72da330848896d3e877810093f Merge: 16e597e 8435088 Author: Brad King AuthorDate: Sun Jan 11 15:21:13 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 15:21:13 2015 -0500 Merge topic 'doc-CMAKE_FIND_PACKAGE_NAME' into next 8435088d Help: Document CMAKE_FIND_PACKAGE_NAME variable b8abd258 find_package: Document CMAKE_FIND_PACKAGE_NAME variable http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8435088d6a387847bf58c3805424bd82ad6e09ca commit 8435088d6a387847bf58c3805424bd82ad6e09ca Author: Brad King AuthorDate: Sun Jan 11 15:20:14 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 15:20:14 2015 -0500 Help: Document CMAKE_FIND_PACKAGE_NAME variable diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 99088e0..2a22f14 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -36,6 +36,7 @@ Variables that Provide Information /variable/CMAKE_EXECUTABLE_SUFFIX /variable/CMAKE_EXTRA_GENERATOR /variable/CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES + /variable/CMAKE_FIND_PACKAGE_NAME /variable/CMAKE_GENERATOR /variable/CMAKE_GENERATOR_PLATFORM /variable/CMAKE_GENERATOR_TOOLSET diff --git a/Help/variable/CMAKE_FIND_PACKAGE_NAME.rst b/Help/variable/CMAKE_FIND_PACKAGE_NAME.rst new file mode 100644 index 0000000..bd1a30f --- /dev/null +++ b/Help/variable/CMAKE_FIND_PACKAGE_NAME.rst @@ -0,0 +1,6 @@ +CMAKE_FIND_PACKAGE_NAME +----------------------- + +Defined by the :command:`find_package` command while loading +a find module to record the caller-specified package name. +See command documentation for details. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8abd25897c49aaf7461937283043f33c837031d commit b8abd25897c49aaf7461937283043f33c837031d Author: Gregor Jasny AuthorDate: Sat Jan 10 20:41:52 2015 +0100 Commit: Brad King CommitDate: Sun Jan 11 15:16:48 2015 -0500 find_package: Document CMAKE_FIND_PACKAGE_NAME variable Signed-off-by: Gregor Jasny diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst index 190d05c..7f518a6 100644 --- a/Help/command/find_package.rst +++ b/Help/command/find_package.rst @@ -312,6 +312,8 @@ When loading a find module or package configuration file ``find_package`` defines variables to provide information about the call arguments (and restores their original state before returning): +``CMAKE_FIND_PACKAGE_NAME`` + the ```` name which is searched for ``_FIND_REQUIRED`` true if ``REQUIRED`` option was given ``_FIND_QUIETLY`` ----------------------------------------------------------------------- Summary of changes: Help/command/find_package.rst | 2 ++ Help/manual/cmake-variables.7.rst | 1 + Help/variable/CMAKE_FIND_PACKAGE_NAME.rst | 6 ++++++ 3 files changed, 9 insertions(+) create mode 100644 Help/variable/CMAKE_FIND_PACKAGE_NAME.rst hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 15:28:43 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 15:28:43 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1744-g19ef10a Message-ID: <20150111202843.328ADA92EE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 19ef10a664a003fb0bf12e575e021e15857c7bf4 (commit) via 69f0b6d21e6028fe7d176cf22702a90883aeaf15 (commit) from 1756828f2df84e72da330848896d3e877810093f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=19ef10a664a003fb0bf12e575e021e15857c7bf4 commit 19ef10a664a003fb0bf12e575e021e15857c7bf4 Merge: 1756828 69f0b6d Author: Brad King AuthorDate: Sun Jan 11 15:28:42 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 15:28:42 2015 -0500 Merge topic 'FindOpenSSL-use-header-version' into next 69f0b6d2 FindOpenSSL: Always extract version from detected header http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=69f0b6d21e6028fe7d176cf22702a90883aeaf15 commit 69f0b6d21e6028fe7d176cf22702a90883aeaf15 Author: Aku Kotkavuo AuthorDate: Sat Jan 10 00:40:20 2015 +0200 Commit: Brad King CommitDate: Sun Jan 11 15:27:25 2015 -0500 FindOpenSSL: Always extract version from detected header Do not use the _OPENSSL_VERSION computed by pkg-config because the user may change OPENSSL_INCLUDE_DIR. diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index b2722a6..bfbe01f 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -283,9 +283,7 @@ function(from_hex HEX DEC) endfunction() if (OPENSSL_INCLUDE_DIR) - if (_OPENSSL_VERSION) - set(OPENSSL_VERSION "${_OPENSSL_VERSION}") - elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") + if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") ----------------------------------------------------------------------- Summary of changes: Modules/FindOpenSSL.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 15:33:27 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 15:33:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1746-g2e97819 Message-ID: <20150111203327.C6A0DA9E98@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2e978198af1bfa1f32849047bb7c792206fb5208 (commit) via 99b13820715ff3b98c2c0cb114b38620b6da4466 (commit) from 19ef10a664a003fb0bf12e575e021e15857c7bf4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e978198af1bfa1f32849047bb7c792206fb5208 commit 2e978198af1bfa1f32849047bb7c792206fb5208 Merge: 19ef10a 99b1382 Author: Brad King AuthorDate: Sun Jan 11 15:33:27 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 15:33:27 2015 -0500 Merge topic 'FindOpenSSL-use-header-version' into next 99b13820 FindOpenSSL: Always extract version from detected header (#15075) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=99b13820715ff3b98c2c0cb114b38620b6da4466 commit 99b13820715ff3b98c2c0cb114b38620b6da4466 Author: Aku Kotkavuo AuthorDate: Sat Jan 10 00:40:20 2015 +0200 Commit: Brad King CommitDate: Sun Jan 11 15:32:55 2015 -0500 FindOpenSSL: Always extract version from detected header (#15075) Do not use the _OPENSSL_VERSION computed by pkg-config because the user may change OPENSSL_INCLUDE_DIR. diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index b2722a6..bfbe01f 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -283,9 +283,7 @@ function(from_hex HEX DEC) endfunction() if (OPENSSL_INCLUDE_DIR) - if (_OPENSSL_VERSION) - set(OPENSSL_VERSION "${_OPENSSL_VERSION}") - elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") + if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 15:42:56 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 15:42:56 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1750-g9f45398 Message-ID: <20150111204256.46528A902D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9f453984d4ec1537e9a75b8034a682e651b3b9c8 (commit) via 89e08de8c2e7833461032c9309e1a6416ba35438 (commit) via c32f691944b6b7629de7e6c1366d269a6b54fd8d (commit) via 222ee2c05932489f6b5879e423c3f07fd7f67996 (commit) from 2e978198af1bfa1f32849047bb7c792206fb5208 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9f453984d4ec1537e9a75b8034a682e651b3b9c8 commit 9f453984d4ec1537e9a75b8034a682e651b3b9c8 Merge: 2e97819 89e08de Author: Brad King AuthorDate: Sun Jan 11 15:42:55 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 15:42:55 2015 -0500 Merge topic 'FindLATEX-components' into next 89e08de8 FindLATEX: Add components for XeLaTeX and LuaLaTeX c32f6919 FindLATEX: Add components Biber and xindy 222ee2c0 FindLATEX: Add components PDFtoPS and HTLATEX http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=89e08de8c2e7833461032c9309e1a6416ba35438 commit 89e08de8c2e7833461032c9309e1a6416ba35438 Author: Christoph Gr?ninger AuthorDate: Sat Jan 10 14:48:31 2015 +0100 Commit: Brad King CommitDate: Sun Jan 11 15:42:12 2015 -0500 FindLATEX: Add components for XeLaTeX and LuaLaTeX diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake index 96acbb9..ae83733 100644 --- a/Modules/FindLATEX.cmake +++ b/Modules/FindLATEX.cmake @@ -14,6 +14,8 @@ # LATEX__FOUND: whether found # LATEX_COMPILER: path to the LaTeX compiler # PDFLATEX_COMPILER: path to the PdfLaTeX compiler +# XELATEX_COMPILER: path to the XeLaTeX compiler +# LUALATEX_COMPILER: path to the LuaLaTeX compiler # BIBTEX_COMPILER: path to the BibTeX compiler # BIBER_COMPILER: path to the Biber compiler # MAKEINDEX_COMPILER: path to the MakeIndex compiler @@ -28,6 +30,8 @@ # Possible components are:: # # PDFLATEX +# XELATEX +# LUALATEX # BIBTEX # BIBER # MAKEINDEX @@ -46,7 +50,8 @@ # find_package(LATEX COMPONENTS BIBTEX PS2PDF) #============================================================================= -# Copyright 2002-2014 Kitware, Inc. +# Copyright 2002-2015 Kitware, Inc. +# Copyright 2014-2015 Christoph Gr?ninger # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -109,6 +114,30 @@ else() set(LATEX_PDFLATEX_FOUND FALSE) endif() +# find xelatex +find_program(XELATEX_COMPILER + NAMES xelatex + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (XELATEX_COMPILER) + set(LATEX_XELATEX_FOUND TRUE) +else() + set(LATEX_XELATEX_FOUND FALSE) +endif() + +# find lualatex +find_program(LUALATEX_COMPILER + NAMES lualatex + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (LUALATEX_COMPILER) + set(LATEX_LUALATEX_FOUND TRUE) +else() + set(LATEX_LUALATEX_FOUND FALSE) +endif() + # find bibtex find_program(BIBTEX_COMPILER NAMES bibtex @@ -239,6 +268,8 @@ endif() mark_as_advanced( LATEX_COMPILER PDFLATEX_COMPILER + XELATEX_COMPILER + LUALATEX_COMPILER BIBTEX_COMPILER BIBER_COMPILER MAKEINDEX_COMPILER http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c32f691944b6b7629de7e6c1366d269a6b54fd8d commit c32f691944b6b7629de7e6c1366d269a6b54fd8d Author: Christoph Gr?ninger AuthorDate: Sat Jan 10 12:10:03 2015 +0100 Commit: Brad King CommitDate: Sun Jan 11 15:41:37 2015 -0500 FindLATEX: Add components Biber and xindy diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake index 34a4402..96acbb9 100644 --- a/Modules/FindLATEX.cmake +++ b/Modules/FindLATEX.cmake @@ -15,7 +15,9 @@ # LATEX_COMPILER: path to the LaTeX compiler # PDFLATEX_COMPILER: path to the PdfLaTeX compiler # BIBTEX_COMPILER: path to the BibTeX compiler +# BIBER_COMPILER: path to the Biber compiler # MAKEINDEX_COMPILER: path to the MakeIndex compiler +# XINDY_COMPILER: path to the xindy compiler # DVIPS_CONVERTER: path to the DVIPS converter # DVIPDF_CONVERTER: path to the DVIPDF converter # PS2PDF_CONVERTER: path to the PS2PDF converter @@ -27,7 +29,9 @@ # # PDFLATEX # BIBTEX +# BIBER # MAKEINDEX +# XINDY # DVIPS # DVIPDF # PS2PDF @@ -117,6 +121,18 @@ else() set(LATEX_BIBTEX_FOUND FALSE) endif() +# find biber +find_program(BIBER_COMPILER + NAMES biber + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (BIBER_COMPILER) + set(LATEX_BIBER_FOUND TRUE) +else() + set(LATEX_BIBER_FOUND FALSE) +endif() + # find makeindex find_program(MAKEINDEX_COMPILER NAMES makeindex @@ -129,6 +145,18 @@ else() set(LATEX_MAKEINDEX_FOUND FALSE) endif() +# find xindy +find_program(XINDY_COMPILER + NAMES xindy + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (XINDY_COMPILER) + set(LATEX_XINDY_FOUND TRUE) +else() + set(LATEX_XINDY_FOUND FALSE) +endif() + # find dvips find_program(DVIPS_CONVERTER NAMES dvips @@ -212,7 +240,9 @@ mark_as_advanced( LATEX_COMPILER PDFLATEX_COMPILER BIBTEX_COMPILER + BIBER_COMPILER MAKEINDEX_COMPILER + XINDY_COMPILER DVIPS_CONVERTER DVIPDF_CONVERTER PS2PDF_CONVERTER http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=222ee2c05932489f6b5879e423c3f07fd7f67996 commit 222ee2c05932489f6b5879e423c3f07fd7f67996 Author: Christoph Gr?ninger AuthorDate: Sat Jan 10 10:56:35 2015 +0100 Commit: Brad King CommitDate: Sun Jan 11 15:41:06 2015 -0500 FindLATEX: Add components PDFtoPS and HTLATEX diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake index db4902f..34a4402 100644 --- a/Modules/FindLATEX.cmake +++ b/Modules/FindLATEX.cmake @@ -19,7 +19,9 @@ # DVIPS_CONVERTER: path to the DVIPS converter # DVIPDF_CONVERTER: path to the DVIPDF converter # PS2PDF_CONVERTER: path to the PS2PDF converter +# PDFTOPS_CONVERTER: path to the pdftops converter # LATEX2HTML_CONVERTER: path to the LaTeX2Html converter +# HTLATEX_COMPILER: path to the htlatex compiler # # Possible components are:: # @@ -29,7 +31,9 @@ # DVIPS # DVIPDF # PS2PDF +# PDFTOPS # LATEX2HTML +# HTLATEX # # Example Usages:: # @@ -167,6 +171,18 @@ else() set(LATEX_PS2PDF_FOUND FALSE) endif() +# find pdftops +find_program(PDFTOPS_CONVERTER + NAMES pdftops + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (PDFTOPS_CONVERTER) + set(LATEX_PDFTOPS_FOUND TRUE) +else() + set(LATEX_PDFTOPS_FOUND FALSE) +endif() + # find latex2html find_program(LATEX2HTML_CONVERTER NAMES latex2html @@ -179,6 +195,18 @@ else() set(LATEX_LATEX2HTML_FOUND FALSE) endif() +# find htlatex +find_program(HTLATEX_COMPILER + NAMES htlatex + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (HTLATEX_COMPILER) + set(LATEX_HTLATEX_FOUND TRUE) +else() + set(LATEX_HTLATEX_FOUND FALSE) +endif() + mark_as_advanced( LATEX_COMPILER @@ -188,7 +216,9 @@ mark_as_advanced( DVIPS_CONVERTER DVIPDF_CONVERTER PS2PDF_CONVERTER + PDFTOPS_CONVERTER LATEX2HTML_CONVERTER + HTLATEX_COMPILER ) # handle variables for found Latex and its components ----------------------------------------------------------------------- Summary of changes: Modules/FindLATEX.cmake | 93 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 16:47:55 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 16:47:55 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1752-g25cd19a Message-ID: <20150111214755.396C5A89A6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 25cd19afe9a109912c2af3116553833e88aca036 (commit) via 584aaa1c059bb65e72b6f692e98de1b3395f431f (commit) from 9f453984d4ec1537e9a75b8034a682e651b3b9c8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=25cd19afe9a109912c2af3116553833e88aca036 commit 25cd19afe9a109912c2af3116553833e88aca036 Merge: 9f45398 584aaa1 Author: Brad King AuthorDate: Sun Jan 11 16:47:54 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 16:47:54 2015 -0500 Merge topic 'xcode-ios-compiler-id' into next 584aaa1c Xcode: Do not require code signing for compiler id (#15329) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=584aaa1c059bb65e72b6f692e98de1b3395f431f commit 584aaa1c059bb65e72b6f692e98de1b3395f431f Author: Brad King AuthorDate: Sun Jan 11 16:41:04 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 16:46:58 2015 -0500 Xcode: Do not require code signing for compiler id (#15329) The approach in commit v3.1.0-rc1~1^2 (Xcode: Fix compiler id detection when code signing is required, 2014-10-22) still requires a code signing key when targeting a real device. Instead set CODE_SIGNING_REQUIRED to "NO" to tell Xcode not to sign at all. Drop the corresponding setting of the code signing identity. diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 6c6a914..47d351a 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -270,11 +270,6 @@ Id flags: ${testflags} else() set(id_sdkroot "") endif() - if(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY) - set(id_code_sign_identity "CODE_SIGN_IDENTITY = \"${CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}\";") - else() - set(id_code_sign_identity "") - endif() if(NOT ${XCODE_VERSION} VERSION_LESS 3) set(v 3) set(ext xcodeproj) diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index aebae27..7f686a2 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -81,7 +81,7 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; ONLY_ACTIVE_ARCH = YES; - @id_code_sign_identity@ + CODE_SIGNING_REQUIRED = NO; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)"; SYMROOT = .; @id_toolset@ ----------------------------------------------------------------------- Summary of changes: Modules/CMakeDetermineCompilerId.cmake | 5 ----- Modules/CompilerId/Xcode-3.pbxproj.in | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 11 16:51:12 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 11 Jan 2015 16:51:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1754-g1ed4ba2 Message-ID: <20150111215113.03D56A8DA4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1ed4ba2ffb51eeeecfc2696136c2372b9a265577 (commit) via 7b7209f63579f701afb665c9542ada584ee64328 (commit) from 25cd19afe9a109912c2af3116553833e88aca036 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ed4ba2ffb51eeeecfc2696136c2372b9a265577 commit 1ed4ba2ffb51eeeecfc2696136c2372b9a265577 Merge: 25cd19a 7b7209f Author: Brad King AuthorDate: Sun Jan 11 16:51:12 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 16:51:12 2015 -0500 Merge topic 'xcode-ios-compiler-id' into next 7b7209f6 Xcode: Do not require code signing for compiler id (#15214) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b7209f63579f701afb665c9542ada584ee64328 commit 7b7209f63579f701afb665c9542ada584ee64328 Author: Brad King AuthorDate: Sun Jan 11 16:41:04 2015 -0500 Commit: Brad King CommitDate: Sun Jan 11 16:50:39 2015 -0500 Xcode: Do not require code signing for compiler id (#15214) The approach in commit v3.1.0-rc1~1^2 (Xcode: Fix compiler id detection when code signing is required, 2014-10-22) still requires a code signing key when targeting a real device. Instead set CODE_SIGNING_REQUIRED to "NO" to tell Xcode not to sign at all. Drop the corresponding setting of the code signing identity. diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 6c6a914..47d351a 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -270,11 +270,6 @@ Id flags: ${testflags} else() set(id_sdkroot "") endif() - if(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY) - set(id_code_sign_identity "CODE_SIGN_IDENTITY = \"${CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}\";") - else() - set(id_code_sign_identity "") - endif() if(NOT ${XCODE_VERSION} VERSION_LESS 3) set(v 3) set(ext xcodeproj) diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index aebae27..7f686a2 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -81,7 +81,7 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; ONLY_ACTIVE_ARCH = YES; - @id_code_sign_identity@ + CODE_SIGNING_REQUIRED = NO; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)"; SYMROOT = .; @id_toolset@ ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 11 19:42:04 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 11 Jan 2015 19:42:04 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1756-gfbe01e7 Message-ID: <20150112004208.9D25B5148@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fbe01e78c7cca2d62f001687b3bf753e957557be (commit) via 9a673737163a3474c83c8100c57454318344ef1c (commit) from 1ed4ba2ffb51eeeecfc2696136c2372b9a265577 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fbe01e78c7cca2d62f001687b3bf753e957557be commit fbe01e78c7cca2d62f001687b3bf753e957557be Merge: 1ed4ba2 9a67373 Author: Stephen Kelly AuthorDate: Sun Jan 11 19:42:01 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 19:42:01 2015 -0500 Merge topic 'autouic-regression-test' into next 9a673737 QtAutoUic: Add a test for the regression in the parent commit. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a673737163a3474c83c8100c57454318344ef1c commit 9a673737163a3474c83c8100c57454318344ef1c Author: Stephen Kelly AuthorDate: Mon Jan 12 01:22:11 2015 +0100 Commit: Stephen Kelly CommitDate: Mon Jan 12 01:41:27 2015 +0100 QtAutoUic: Add a test for the regression in the parent commit. diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 3fd00b8..de4d0d2 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -73,6 +73,12 @@ if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" AND NOT CMAKE_CONFIGURATION_ add_definitions(-DTEST_DEBUG_CLASS) endif() +# The -no-protection option disables the generation of include guards. Verify +# that setting the source file property has an effect by using this and +# issue an error in the preprocessor in calwidget.cpp if the include guard +# is defined. +set_source_files_properties(calwidget.ui PROPERTIES AUTOUIC_OPTIONS "-no-protection") + add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp multiplewidgets.cpp xyz.cpp yaf.cpp gadget.cpp $ diff --git a/Tests/QtAutogen/calwidget.cpp b/Tests/QtAutogen/calwidget.cpp index defde20..5f59994 100644 --- a/Tests/QtAutogen/calwidget.cpp +++ b/Tests/QtAutogen/calwidget.cpp @@ -50,6 +50,9 @@ #include "calwidget.h" #include "ui_calwidget.h" + #ifdef UI_CALWIDGET_H + #error Definition of UI_CALWIDGET_H should be disabled by file option. + #endif Window::Window() : ui(new Ui::Window) ----------------------------------------------------------------------- Summary of changes: Tests/QtAutogen/CMakeLists.txt | 6 ++++++ Tests/QtAutogen/calwidget.cpp | 3 +++ 2 files changed, 9 insertions(+) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 11 19:45:19 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 11 Jan 2015 19:45:19 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1758-gdf37aa7 Message-ID: <20150112004527.0F0FBA6A4F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via df37aa761a8904bc228b8567e0628672c6cfada0 (commit) via 591774e3c7f1e566323d9950c0eebbd67902dd11 (commit) from fbe01e78c7cca2d62f001687b3bf753e957557be (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df37aa761a8904bc228b8567e0628672c6cfada0 commit df37aa761a8904bc228b8567e0628672c6cfada0 Merge: fbe01e7 591774e Author: Stephen Kelly AuthorDate: Sun Jan 11 19:45:16 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 11 19:45:16 2015 -0500 Merge topic 'GNU-4.6-compile-features' into next 591774e3 Revert topic http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=591774e3c7f1e566323d9950c0eebbd67902dd11 commit 591774e3c7f1e566323d9950c0eebbd67902dd11 Author: Stephen Kelly AuthorDate: Mon Jan 12 01:43:20 2015 +0100 Commit: Stephen Kelly CommitDate: Mon Jan 12 01:44:34 2015 +0100 Revert topic This topic depends on fix-COMPILE_FEATURES-genex and can be re-added after that is merged. diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake index 7e840aa..dfaeebf 100644 --- a/Modules/Compiler/GNU-C-FeatureTests.cmake +++ b/Modules/Compiler/GNU-C-FeatureTests.cmake @@ -1,12 +1,7 @@ -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") -# GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it -# to 201000L. As the former is strictly greater than the latter, test only -# for the latter. If in the future CMake learns about a C feature which was -# introduced with GNU 4.7, that should test for the correct version, similar -# to the distinction between __cplusplus and __GXX_EXPERIMENTAL_CXX0X__ tests. -set(GNU46_C11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") +set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L") set(_cmake_feature_test_c_static_assert "${GNU46_C11}") # Since 4.4 at least: set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 07200f4..db9089d 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -1,25 +1,20 @@ include(Compiler/GNU) __compiler_gnu(C) -if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99") set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99") -endif() -if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") -elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) - set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x") - set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x") endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set(CMAKE_C_STANDARD_DEFAULT 11) -else() +else(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_C_STANDARD_DEFAULT 90) endif() @@ -28,7 +23,7 @@ macro(cmake_record_c_compile_features) record_compiler_features(C "${std_version}" ${list}) endmacro() - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 35fff95..6de06dd 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -2,7 +2,7 @@ # Reference: http://gcc.gnu.org/projects/cxx0x.html # http://gcc.gnu.org/projects/cxx1y.html -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L") set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}") @@ -46,37 +46,31 @@ set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}") set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}") set(_cmake_feature_test_cxx_extended_friend_declarations "${GNU47_CXX11}") set(_cmake_feature_test_cxx_final "${GNU47_CXX11}") +set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}") set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}") set(_cmake_feature_test_cxx_override "${GNU47_CXX11}") set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") -set(_cmake_feature_test_cxx_variadic_templates "${GNU47_CXX11}") # NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor # release following that (March 2012), and the first minor release to # support -std=c++11. Prior to that, support for C++11 features is technically # experiemental and possibly incomplete (see for example the note below about # cxx_variadic_template_template_parameters) -# GNU does not define __cplusplus correctly before version 4.7. -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773 -# __GXX_EXPERIMENTAL_CXX0X__ is defined in prior versions, but may not be -# defined in the future. -set(GNU_CXX0X_DEFINED "(__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))") # TODO: Should be supported by GNU 4.6 -set(GNU46_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && ${GNU_CXX0X_DEFINED}") +set(GNU46_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}") -set(_cmake_feature_test_cxx_noexcept "${GNU46_CXX11}") set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}") set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}") # TODO: Should be supported by GNU 4.5 -set(GNU45_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU45_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}") set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}") set(_cmake_feature_test_cxx_local_type_template_args "${GNU45_CXX11}") set(_cmake_feature_test_cxx_raw_string_literals "${GNU45_CXX11}") # TODO: Should be supported by GNU 4.4 -set(GNU44_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU44_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}") set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}") set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}") @@ -87,6 +81,7 @@ set(_cmake_feature_test_cxx_strong_enums "${GNU44_CXX11}") set(_cmake_feature_test_cxx_trailing_return_types "${GNU44_CXX11}") set(_cmake_feature_test_cxx_unicode_literals "${GNU44_CXX11}") set(_cmake_feature_test_cxx_uniform_initialization "${GNU44_CXX11}") +set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}") # TODO: If features are ever recorded for GNU 4.3, there should possibly # be a new feature added like cxx_variadic_template_template_parameters, # which is implemented by GNU 4.4, but not 4.3. cxx_variadic_templates is @@ -95,7 +90,7 @@ set(_cmake_feature_test_cxx_uniform_initialization "${GNU44_CXX11}") # templates capability in CMake. See # http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf # TODO: Should be supported by GNU 4.3 -set(GNU43_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU43_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}") set(_cmake_feature_test_cxx_default_function_template_args "${GNU43_CXX11}") set(_cmake_feature_test_cxx_long_long_type "${GNU43_CXX11}") @@ -103,8 +98,8 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}") set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}") set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}") # TODO: Should be supported since GNU 3.4? -set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && __cplusplus >= 201103L") # TODO: Should be supported forever? -set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") -set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") -set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported}") +set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported} && __cplusplus >= 199711L") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index 18bcf15..4a26963 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -11,7 +11,7 @@ else() endif() endif() -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) # Supported since 4.3 set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98") @@ -20,10 +20,7 @@ endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") -elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) # 4.3 supports 0x variants - set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x") - set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x") endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) @@ -45,7 +42,7 @@ macro(cmake_record_cxx_compile_features) if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() - if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 75beaf7..9fb8d1b 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -144,12 +144,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(IfaceCompileFeatures main.cpp) target_link_libraries(IfaceCompileFeatures iface) - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" - AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) - add_definitions(-DEXPECT_OVERRIDE_CONTROL=1) - else() - add_definitions(-DEXPECT_OVERRIDE_CONTROL=0) - endif() + add_definitions(-DEXPECT_OVERRIDE_CONTROL=1) add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp index 7bf356b..8013ef5 100644 --- a/Tests/CompileFeatures/cxx_generalized_initializers.cpp +++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp @@ -8,7 +8,6 @@ namespace std { const _E* __begin_; size_t __size_; - initializer_list(const int*, long unsigned int) {} }; } diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp index a2ca268..8d97926 100644 --- a/Tests/CompileFeatures/default_dialect.cpp +++ b/Tests/CompileFeatures/default_dialect.cpp @@ -14,7 +14,7 @@ Outputter<__cplusplus> o; # if !DEFAULT_CXX98 # error Buildsystem error # endif -# if __cplusplus != 199711L && __cplusplus != 1 && !defined(__GXX_EXPERIMENTAL_CXX0X__) +# if __cplusplus != 199711L Outputter<__cplusplus> o; # endif #endif ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/GNU-C-FeatureTests.cmake | 9 ++----- Modules/Compiler/GNU-C.cmake | 11 +++----- Modules/Compiler/GNU-CXX-FeatureTests.cmake | 27 ++++++++------------ Modules/Compiler/GNU-CXX.cmake | 7 ++--- Tests/CompileFeatures/CMakeLists.txt | 7 +---- .../cxx_generalized_initializers.cpp | 1 - Tests/CompileFeatures/default_dialect.cpp | 2 +- 7 files changed, 20 insertions(+), 44 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jan 12 00:01:21 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 12 Jan 2015 00:01:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-678-g9fced51 Message-ID: <20150112050121.2A726A97BF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 9fced518582afcb0875648a278821f7b82f536f4 (commit) from 16d68daccb41ca97b42c0074f0de35a53448d8b7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9fced518582afcb0875648a278821f7b82f536f4 commit 9fced518582afcb0875648a278821f7b82f536f4 Author: Kitware Robot AuthorDate: Mon Jan 12 00:01:19 2015 -0500 Commit: Kitware Robot CommitDate: Mon Jan 12 00:01:19 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 5de792a..89ccad5 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 20150111) +set(CMake_VERSION_PATCH 20150112) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 08:57:38 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 08:57:38 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-687-g6c61ffa Message-ID: <20150112135738.94F36A9406@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 6c61ffaf9b1616e6938b78ca19f17f9a9f87f3ec (commit) via 3660d063bc005aa13e7ee4836aef842a91cc87f1 (commit) via 5c28495fba56ea488a5a1df323f3c89ff7d28a7e (commit) via ac3d38292035a470affdd0ca9df88992916bfeee (commit) via 36b8de563cab1933fb332c42bca68125dd13f35a (commit) via 6162c9194bfb416ac43f52f281db442a4d484aff (commit) via 238dd2fbab1bd4fb53a25dcd07c1ee41da46d451 (commit) via 2f7ef7e38d7aad93f5d25efb4fd7f61468cf06a2 (commit) via 4c69ec6f121f303113d2f8a158d2e53b7d93d6b4 (commit) from 9fced518582afcb0875648a278821f7b82f536f4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c61ffaf9b1616e6938b78ca19f17f9a9f87f3ec commit 6c61ffaf9b1616e6938b78ca19f17f9a9f87f3ec Merge: 9fced51 3660d06 Author: Brad King AuthorDate: Mon Jan 12 08:57:37 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 08:57:37 2015 -0500 Merge topic 'sun-better-stdlib' 3660d063 cmTarget: Use insert instead of std::copy. 5c28495f Help: Remove documented restriction on template use. ac3d3829 Help: Remove documented restriction on find in conditions. 36b8de56 Help: Remove documented restriction on insert APIs. 6162c919 Use two-iterator std::set::insert where appropriate. 238dd2fb Use insert instead of a loop in some cases. 2f7ef7e3 Revert "Misc. fixes for the Oracle / Sun compiler." 4c69ec6f SolarisStudio: Use alternative standard library to build CMake. ----------------------------------------------------------------------- Summary of changes: CompileFlags.cmake | 8 +++ Help/manual/cmake-developer.7.rst | 79 --------------------------- Source/CPack/WiX/cmCPackWIXGenerator.cxx | 7 +-- Source/CTest/cmCTestBuildHandler.cxx | 7 +-- Source/CTest/cmCTestCoverageHandler.cxx | 6 +- Source/CTest/cmCTestMultiProcessHandler.cxx | 22 ++------ Source/CTest/cmCTestP4.cxx | 6 +- Source/CTest/cmCTestSubmitCommand.cxx | 18 ++---- Source/CTest/cmCTestSubmitHandler.cxx | 18 +----- Source/CTest/cmCTestTestHandler.cxx | 6 +- Source/cmAddTestCommand.cxx | 6 +- Source/cmCommandArgumentsHelper.cxx | 9 +-- Source/cmComputeLinkDepends.cxx | 5 +- Source/cmComputeLinkInformation.cxx | 19 ++----- Source/cmConditionEvaluator.cxx | 10 +--- Source/cmCustomCommand.cxx | 13 +---- Source/cmDependsC.cxx | 6 +- Source/cmDependsFortran.cxx | 10 +--- Source/cmExportFileGenerator.cxx | 6 +- Source/cmExtraCodeBlocksGenerator.cxx | 22 ++------ Source/cmFindBase.cxx | 6 +- Source/cmFindPackageCommand.cxx | 15 ++--- Source/cmFunctionCommand.cxx | 6 +- Source/cmGeneratorExpressionDAGChecker.cxx | 4 +- Source/cmGeneratorTarget.cxx | 12 +--- Source/cmGlobalNinjaGenerator.cxx | 9 +-- Source/cmGlobalVisualStudioGenerator.cxx | 12 +--- Source/cmIncludeDirectoryCommand.cxx | 6 +- Source/cmInstallFilesCommand.cxx | 7 +-- Source/cmInstallProgramsCommand.cxx | 6 +- Source/cmLocalGenerator.cxx | 12 +--- Source/cmLocalUnixMakefileGenerator3.cxx | 9 +-- Source/cmMacroCommand.cxx | 6 +- Source/cmMakefile.cxx | 25 ++------- Source/cmMakefileTargetGenerator.cxx | 36 +++--------- Source/cmQtAutoGenerators.cxx | 45 +++------------ Source/cmRemoveCommand.cxx | 5 +- Source/cmSystemTools.cxx | 6 +- Source/cmTarget.cxx | 31 +++-------- bootstrap | 29 ++++++++++ 40 files changed, 137 insertions(+), 433 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 08:57:42 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 08:57:42 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-700-gb5a4672 Message-ID: <20150112135742.12915A941F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via b5a467262b61065ed5d1b8d545cc2ade548b9d0b (commit) via 0f7bdd61da51ea8609246fe6fd05a13235fe75db (commit) via 5e92c82655e7430bef6604c90b3389f6609c2bdf (commit) via 15e42bb27c75e90da8163b89ad8fdc0a8fd70d7a (commit) via 931e055d8c2e113b9cabb9282d9742ae78c4d802 (commit) via f194a009c8efeb6f2fd1f212dee678c54d4ef48d (commit) via 3ec1bb1537c41f58da2dc6715e4964a38d1b1043 (commit) via bb3bce706a2d41efa034f5b8e71ad701982acf5d (commit) via 28fa4923c3299f81659ad3ee644509ea3530fb14 (commit) via 837a8a6312d543f1c46efa532f7d5b5dfb334bc9 (commit) via 4030ddfda8c715601e60e8f0322554f464497807 (commit) via 17d6a6fd59efd98b1644d6f5441bbd36c19e1ffa (commit) via 26fb50114f37366c5c72ec76a1c09bfb2f94d19c (commit) from 6c61ffaf9b1616e6938b78ca19f17f9a9f87f3ec (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b5a467262b61065ed5d1b8d545cc2ade548b9d0b commit b5a467262b61065ed5d1b8d545cc2ade548b9d0b Merge: 6c61ffa 0f7bdd6 Author: Brad King AuthorDate: Mon Jan 12 08:57:39 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 08:57:39 2015 -0500 Merge topic 'drop-ancient-workarounds' 0f7bdd61 Remove VS 6 special case. 5e92c826 Remove some obsolete stuff. 15e42bb2 cmStandardIncludes: Remove obsolete cmOStringStream. 931e055d Port all cmOStringStream to std::ostringstream. f194a009 Remove unused cmIStringStream class. 3ec1bb15 cmStandardIncludes: Remove std namespace hack. bb3bce70 cmStandardIncludes: Remove ANSI_FOR_SCOPE hack. 28fa4923 cmStandardIncludes: Remove iostreams workaround for obsolete Compaq compiler. 837a8a63 cmStandardIncludes: Drop Comeau-related workaround. 4030ddfd Remove Borland-related undef. 17d6a6fd cmStandardIncludes: Remove comment about Borland. 26fb5011 Drop SGI as a CMake host compiler. ----------------------------------------------------------------------- Summary of changes: CompileFlags.cmake | 5 - Source/CMakeLists.txt | 1 - Source/CPack/IFW/cmCPackIFWInstaller.cxx | 2 +- Source/CPack/IFW/cmCPackIFWPackage.cxx | 2 +- Source/CPack/cmCPackBundleGenerator.cxx | 26 +-- Source/CPack/cmCPackDragNDropGenerator.cxx | 44 ++-- Source/CPack/cmCPackDragNDropGenerator.h | 4 +- Source/CPack/cmCPackGenerator.cxx | 2 +- Source/CPack/cmCPackGenerator.h | 2 +- Source/CPack/cmCPackLog.h | 2 +- Source/CPack/cmCPackNSISGenerator.cxx | 28 +-- Source/CPack/cmCPackNSISGenerator.h | 8 +- Source/CPack/cmCPackOSXX11Generator.cxx | 6 +- Source/CPack/cmCPackPackageMakerGenerator.cxx | 21 +- Source/CPack/cmCPackPackageMakerGenerator.h | 10 +- Source/CPack/cpack.cxx | 2 +- Source/CTest/cmCTestBuildAndTestHandler.cxx | 4 +- Source/CTest/cmCTestBuildAndTestHandler.h | 2 +- Source/CTest/cmCTestBuildCommand.cxx | 6 +- Source/CTest/cmCTestConfigureCommand.cxx | 2 +- Source/CTest/cmCTestCoverageHandler.cxx | 8 +- .../CTest/cmCTestEmptyBinaryDirectoryCommand.cxx | 2 +- Source/CTest/cmCTestGenericHandler.cxx | 4 +- Source/CTest/cmCTestHandlerCommand.cxx | 6 +- Source/CTest/cmCTestMemCheckHandler.cxx | 12 +- Source/CTest/cmCTestMultiProcessHandler.cxx | 2 +- Source/CTest/cmCTestRunScriptCommand.cxx | 2 +- Source/CTest/cmCTestRunTest.cxx | 2 +- Source/CTest/cmCTestScriptHandler.cxx | 2 +- Source/CTest/cmCTestStartCommand.cxx | 2 +- Source/CTest/cmCTestSubmitCommand.cxx | 4 +- Source/CTest/cmCTestTestCommand.cxx | 2 +- Source/CTest/cmCTestTestHandler.cxx | 4 +- Source/CTest/cmCTestUpdateHandler.cxx | 2 +- Source/CTest/cmCTestUpdateHandler.h | 8 - Source/CTest/cmCTestUploadCommand.cxx | 2 +- Source/CTest/cmCTestVC.cxx | 2 +- Source/CursesDialog/cmCursesStandardIncludes.h | 19 -- Source/cmAddCustomCommandCommand.cxx | 8 +- Source/cmAddCustomTargetCommand.cxx | 6 +- Source/cmAddDependenciesCommand.cxx | 6 +- Source/cmAddExecutableCommand.cxx | 14 +- Source/cmAddLibraryCommand.cxx | 46 ++-- Source/cmAddSubDirectoryCommand.cxx | 2 +- Source/cmAddTestCommand.cxx | 6 +- Source/cmBreakCommand.cxx | 4 +- Source/cmBuildCommand.cxx | 2 +- Source/cmCMakeMinimumRequired.cxx | 6 +- Source/cmCMakePolicyCommand.cxx | 8 +- Source/cmCPluginAPI.cxx | 2 +- Source/cmCTest.cxx | 6 +- Source/cmCTest.h | 2 +- Source/cmCommandArgumentParserHelper.cxx | 10 +- Source/cmComputeLinkDepends.cxx | 2 +- Source/cmComputeLinkInformation.cxx | 12 +- Source/cmComputeTargetDepends.cxx | 4 +- Source/cmConditionEvaluator.cxx | 6 +- Source/cmConfigure.cmake.h.in | 4 - Source/cmConfigureFileCommand.cxx | 2 +- Source/cmCoreTryCompile.cxx | 14 +- Source/cmDefinePropertyCommand.cxx | 4 +- Source/cmDepends.cxx | 8 +- Source/cmELF.cxx | 2 +- Source/cmExecuteProcessCommand.cxx | 2 +- Source/cmExportBuildFileGenerator.cxx | 6 +- Source/cmExportCommand.cxx | 26 +-- Source/cmExportFileGenerator.cxx | 14 +- Source/cmExportInstallFileGenerator.cxx | 8 +- Source/cmExprParserHelper.cxx | 2 +- Source/cmExtraCodeLiteGenerator.cxx | 4 +- Source/cmFileCommand.cxx | 98 ++++----- Source/cmFindPackageCommand.cxx | 18 +- Source/cmForEachCommand.cxx | 4 +- Source/cmFunctionCommand.cxx | 4 +- Source/cmGeneratedFileStream.h | 8 - Source/cmGeneratorExpressionDAGChecker.cxx | 6 +- Source/cmGeneratorExpressionEvaluationFile.cxx | 6 +- Source/cmGeneratorExpressionEvaluator.cxx | 14 +- Source/cmGeneratorTarget.cxx | 4 +- Source/cmGetPropertyCommand.cxx | 12 +- Source/cmGetTargetPropertyCommand.cxx | 2 +- Source/cmGlobalGenerator.cxx | 24 +-- Source/cmGlobalNinjaGenerator.cxx | 8 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 6 +- Source/cmGlobalVisualStudio10Generator.cxx | 16 +- Source/cmGlobalVisualStudio11Generator.cxx | 4 +- Source/cmGlobalVisualStudio12Generator.cxx | 4 +- Source/cmGlobalXCodeGenerator.cxx | 8 +- Source/cmGraphVizWriter.cxx | 4 +- Source/cmIncludeCommand.cxx | 2 +- Source/cmInstallCommand.cxx | 82 +++---- Source/cmInstallExportGenerator.cxx | 2 +- Source/cmInstallTargetGenerator.cxx | 8 +- Source/cmLinkDirectoriesCommand.cxx | 2 +- Source/cmListCommand.cxx | 8 +- Source/cmListFileCache.cxx | 16 +- Source/cmLoadCommandCommand.cxx | 2 +- Source/cmLocalGenerator.cxx | 30 +-- Source/cmLocalNinjaGenerator.cxx | 4 +- Source/cmLocalUnixMakefileGenerator3.cxx | 10 +- Source/cmLocalVisualStudio6Generator.cxx | 4 +- Source/cmLocalVisualStudio7Generator.cxx | 4 +- Source/cmMacroCommand.cxx | 2 +- Source/cmMakefile.cxx | 78 +++---- Source/cmMakefileExecutableTargetGenerator.cxx | 4 +- Source/cmMakefileLibraryTargetGenerator.cxx | 6 +- Source/cmMakefileTargetGenerator.cxx | 8 +- Source/cmNinjaNormalTargetGenerator.cxx | 10 +- Source/cmNinjaTargetGenerator.cxx | 4 +- Source/cmOrderDirectories.cxx | 8 +- Source/cmPolicies.cxx | 16 +- Source/cmProjectCommand.cxx | 2 +- Source/cmSeparateArgumentsCommand.cxx | 2 +- Source/cmSetPropertyCommand.cxx | 20 +- Source/cmSourceFile.cxx | 2 +- Source/cmSourceGroupCommand.cxx | 2 +- Source/cmStandardIncludes.cxx | 16 -- Source/cmStandardIncludes.h | 225 +------------------- Source/cmStandardLexer.h | 6 - Source/cmStringCommand.cxx | 14 +- Source/cmSystemTools.cxx | 6 +- Source/cmTarget.cxx | 76 +++---- Source/cmTarget.h | 2 +- Source/cmTargetCompileDefinitionsCommand.cxx | 4 +- Source/cmTargetCompileFeaturesCommand.cxx | 4 +- Source/cmTargetCompileOptionsCommand.cxx | 4 +- Source/cmTargetIncludeDirectoriesCommand.cxx | 4 +- Source/cmTargetLinkLibrariesCommand.cxx | 12 +- Source/cmTargetSourcesCommand.cxx | 4 +- Source/cmVariableWatchCommand.cxx | 6 +- Source/cmXMLParser.cxx | 2 +- Source/cmake.cxx | 26 +-- Source/cmcmd.cxx | 2 +- Tests/CMakeLib/testXMLSafe.cxx | 2 +- bootstrap | 30 --- 135 files changed, 615 insertions(+), 930 deletions(-) delete mode 100644 Source/cmStandardIncludes.cxx hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 08:57:43 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 08:57:43 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-702-g63412a8 Message-ID: <20150112135743.E7D73A9435@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 63412a85e0e2431895bf4f2122d901e17f4c51b0 (commit) via 99b13820715ff3b98c2c0cb114b38620b6da4466 (commit) from b5a467262b61065ed5d1b8d545cc2ade548b9d0b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=63412a85e0e2431895bf4f2122d901e17f4c51b0 commit 63412a85e0e2431895bf4f2122d901e17f4c51b0 Merge: b5a4672 99b1382 Author: Brad King AuthorDate: Mon Jan 12 08:57:42 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 08:57:42 2015 -0500 Merge topic 'FindOpenSSL-use-header-version' 99b13820 FindOpenSSL: Always extract version from detected header (#15075) ----------------------------------------------------------------------- Summary of changes: Modules/FindOpenSSL.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 08:57:46 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 08:57:46 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-705-gc9f3e82 Message-ID: <20150112135746.67310A94B4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via c9f3e829e70502f0cbfc9616d019950ef81ef9df (commit) via 8435088d6a387847bf58c3805424bd82ad6e09ca (commit) via b8abd25897c49aaf7461937283043f33c837031d (commit) from 63412a85e0e2431895bf4f2122d901e17f4c51b0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9f3e829e70502f0cbfc9616d019950ef81ef9df commit c9f3e829e70502f0cbfc9616d019950ef81ef9df Merge: 63412a8 8435088 Author: Brad King AuthorDate: Mon Jan 12 08:57:45 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 08:57:45 2015 -0500 Merge topic 'doc-CMAKE_FIND_PACKAGE_NAME' 8435088d Help: Document CMAKE_FIND_PACKAGE_NAME variable b8abd258 find_package: Document CMAKE_FIND_PACKAGE_NAME variable ----------------------------------------------------------------------- Summary of changes: Help/command/find_package.rst | 2 ++ Help/manual/cmake-variables.7.rst | 1 + Help/variable/CMAKE_FIND_PACKAGE_NAME.rst | 6 ++++++ 3 files changed, 9 insertions(+) create mode 100644 Help/variable/CMAKE_FIND_PACKAGE_NAME.rst hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 08:57:48 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 08:57:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-710-g7f5b494 Message-ID: <20150112135748.D05F3A94B4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 7f5b4940e1e1d1c40a37c9d9516a5df397234c21 (commit) via 89e08de8c2e7833461032c9309e1a6416ba35438 (commit) via c32f691944b6b7629de7e6c1366d269a6b54fd8d (commit) via 222ee2c05932489f6b5879e423c3f07fd7f67996 (commit) via 07a3f9ad17194eda4a8df48351f25682aab50345 (commit) from c9f3e829e70502f0cbfc9616d019950ef81ef9df (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f5b4940e1e1d1c40a37c9d9516a5df397234c21 commit 7f5b4940e1e1d1c40a37c9d9516a5df397234c21 Merge: c9f3e82 89e08de Author: Brad King AuthorDate: Mon Jan 12 08:57:47 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 08:57:47 2015 -0500 Merge topic 'FindLATEX-components' 89e08de8 FindLATEX: Add components for XeLaTeX and LuaLaTeX c32f6919 FindLATEX: Add components Biber and xindy 222ee2c0 FindLATEX: Add components PDFtoPS and HTLATEX 07a3f9ad FindLATEX: Add components handling ----------------------------------------------------------------------- Summary of changes: Help/release/dev/FindLATEX-components.rst | 4 + Modules/FindLATEX.cmake | 167 +++++++++++++++++++++++++++-- 2 files changed, 163 insertions(+), 8 deletions(-) create mode 100644 Help/release/dev/FindLATEX-components.rst hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 08:57:51 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 08:57:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-712-gaf0ee41 Message-ID: <20150112135751.1735AA9406@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via af0ee419553c501cb81f6210b9b1f724844c3dcd (commit) via 7b7209f63579f701afb665c9542ada584ee64328 (commit) from 7f5b4940e1e1d1c40a37c9d9516a5df397234c21 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af0ee419553c501cb81f6210b9b1f724844c3dcd commit af0ee419553c501cb81f6210b9b1f724844c3dcd Merge: 7f5b494 7b7209f Author: Brad King AuthorDate: Mon Jan 12 08:57:50 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 08:57:50 2015 -0500 Merge topic 'xcode-ios-compiler-id' 7b7209f6 Xcode: Do not require code signing for compiler id (#15214) ----------------------------------------------------------------------- Summary of changes: Modules/CMakeDetermineCompilerId.cmake | 5 ----- Modules/CompilerId/Xcode-3.pbxproj.in | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 08:57:53 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 08:57:53 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-715-gb4f62b8 Message-ID: <20150112135753.ACFC6A948C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via b4f62b875b135f94ccc587f1937db3347fd62198 (commit) via 9a673737163a3474c83c8100c57454318344ef1c (commit) via 7c585699304ac071cdf7c1b8d7677d38b859e70f (commit) from af0ee419553c501cb81f6210b9b1f724844c3dcd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4f62b875b135f94ccc587f1937db3347fd62198 commit b4f62b875b135f94ccc587f1937db3347fd62198 Merge: af0ee41 9a67373 Author: Brad King AuthorDate: Mon Jan 12 08:57:52 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 08:57:52 2015 -0500 Merge topic 'fix-autouic-regression' 9a673737 QtAutoUic: Add a test for the regression in the parent commit. 7c585699 QtAutoUic: Restore source file AUTOUIC_OPTIONS settings ----------------------------------------------------------------------- Summary of changes: Source/cmSourceFile.cxx | 2 +- Tests/QtAutogen/CMakeLists.txt | 6 ++++++ Tests/QtAutogen/calwidget.cpp | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 08:57:55 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 08:57:55 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-717-gc59cf4f Message-ID: <20150112135755.BC8FDA948E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via c59cf4f96ce276353263f2d06a54c4e1da1ba27d (commit) via 00f66a045144a363b497874613457fe0cf80683f (commit) from b4f62b875b135f94ccc587f1937db3347fd62198 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c59cf4f96ce276353263f2d06a54c4e1da1ba27d commit c59cf4f96ce276353263f2d06a54c4e1da1ba27d Merge: b4f62b8 00f66a0 Author: Brad King AuthorDate: Mon Jan 12 08:57:54 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 08:57:54 2015 -0500 Merge topic 'Apple-GNU-compiler-features' 00f66a04 Record compile features for GNU on Apple. ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/GNU-C.cmake | 2 +- Modules/Compiler/GNU-CXX.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 08:58:18 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 08:58:18 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1768-g2d0f1ec Message-ID: <20150112135818.BC9ECA9424@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2d0f1ec2b9b64b3100a80b1592ecc50b5d030395 (commit) via c59cf4f96ce276353263f2d06a54c4e1da1ba27d (commit) via b4f62b875b135f94ccc587f1937db3347fd62198 (commit) via af0ee419553c501cb81f6210b9b1f724844c3dcd (commit) via 7f5b4940e1e1d1c40a37c9d9516a5df397234c21 (commit) via c9f3e829e70502f0cbfc9616d019950ef81ef9df (commit) via 63412a85e0e2431895bf4f2122d901e17f4c51b0 (commit) via b5a467262b61065ed5d1b8d545cc2ade548b9d0b (commit) via 6c61ffaf9b1616e6938b78ca19f17f9a9f87f3ec (commit) via 9fced518582afcb0875648a278821f7b82f536f4 (commit) from df37aa761a8904bc228b8567e0628672c6cfada0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d0f1ec2b9b64b3100a80b1592ecc50b5d030395 commit 2d0f1ec2b9b64b3100a80b1592ecc50b5d030395 Merge: df37aa7 c59cf4f Author: Brad King AuthorDate: Mon Jan 12 08:58:07 2015 -0500 Commit: Brad King CommitDate: Mon Jan 12 08:58:07 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:02:10 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:02:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1770-g05b2bb9 Message-ID: <20150112140210.093CBA9E83@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 05b2bb94d9c908bb2c37bb9cfd74a6baa31c4b5d (commit) via 418bf735232b57a395e8965451620f77472f1087 (commit) from 2d0f1ec2b9b64b3100a80b1592ecc50b5d030395 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05b2bb94d9c908bb2c37bb9cfd74a6baa31c4b5d commit 05b2bb94d9c908bb2c37bb9cfd74a6baa31c4b5d Merge: 2d0f1ec 418bf73 Author: Brad King AuthorDate: Mon Jan 12 09:02:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 09:02:09 2015 -0500 Merge topic 'cpack-PackageMaker-OSX-10.10' into next 418bf735 CPack: Fix PackageMaker internal versioning for OS X 10.10 diff --cc Source/CPack/cmCPackPackageMakerGenerator.cxx index 8a22131,09f9e6b..f489389 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@@ -710,9 -725,9 +725,9 @@@ GenerateComponentPackage(const char *pa packageFile << std::endl); // The command that will be used to run PackageMaker - cmOStringStream pkgCmd; + std::ostringstream pkgCmd; - if (this->PackageCompatibilityVersion < 10.5 || + if (this->PackageCompatibilityVersion < getVersion(10, 5) || this->PackageMakerVersion < 3.0) { // Create Description.plist and Info.plist files for normal Mac OS http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=418bf735232b57a395e8965451620f77472f1087 commit 418bf735232b57a395e8965451620f77472f1087 Author: Calin Cascaval AuthorDate: Fri Dec 26 09:48:53 2014 -0800 Commit: Brad King CommitDate: Mon Jan 12 08:34:51 2015 -0500 CPack: Fix PackageMaker internal versioning for OS X 10.10 Avoid using a floating point value to represent the version, since "10.10" would be treated as "10.1". diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index d736948..09f9e6b 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -24,11 +24,20 @@ #include #include +#include + +static inline +unsigned int getVersion(unsigned int major, unsigned int minor) +{ + assert(major < 256 && minor < 256); + return ((major & 0xFF) << 16 | minor); +} + //---------------------------------------------------------------------- cmCPackPackageMakerGenerator::cmCPackPackageMakerGenerator() { this->PackageMakerVersion = 0.0; - this->PackageCompatibilityVersion = 10.4; + this->PackageCompatibilityVersion = getVersion(10, 4); } //---------------------------------------------------------------------- @@ -39,7 +48,7 @@ cmCPackPackageMakerGenerator::~cmCPackPackageMakerGenerator() //---------------------------------------------------------------------- bool cmCPackPackageMakerGenerator::SupportsComponentInstallation() const { - return this->PackageCompatibilityVersion >= 10.4; + return this->PackageCompatibilityVersion >= getVersion(10, 4); } //---------------------------------------------------------------------- @@ -241,7 +250,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() std::string packageFile; if (compIt->second.IsDownloaded) { - if (this->PackageCompatibilityVersion >= 10.5 && + if (this->PackageCompatibilityVersion >= getVersion(10, 5) && this->PackageMakerVersion >= 3.0) { // Build this package within the upload directory. @@ -260,7 +269,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() } else if (!warnedAboutDownloadCompatibility) { - if (this->PackageCompatibilityVersion < 10.5) + if (this->PackageCompatibilityVersion < getVersion(10, 5)) { cmCPackLogger( cmCPackLog::LOG_WARNING, @@ -520,22 +529,28 @@ int cmCPackPackageMakerGenerator::InitializeInternal() const char *packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION"); if (packageCompat && *packageCompat) { - this->PackageCompatibilityVersion = atof(packageCompat); + unsigned int majorVersion = 10; + unsigned int minorVersion = 5; + int res = sscanf(packageCompat, "%u.%u", &majorVersion, &minorVersion); + if (res == 2) + { + this->PackageCompatibilityVersion = getVersion(majorVersion, minorVersion); + } } else if (this->GetOption("CPACK_DOWNLOAD_SITE")) { this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.5"); - this->PackageCompatibilityVersion = 10.5; + this->PackageCompatibilityVersion = getVersion(10, 5); } else if (this->GetOption("CPACK_COMPONENTS_ALL")) { this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.4"); - this->PackageCompatibilityVersion = 10.4; + this->PackageCompatibilityVersion = getVersion(10, 4); } else { this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.3"); - this->PackageCompatibilityVersion = 10.3; + this->PackageCompatibilityVersion = getVersion(10, 3); } std::vector no_paths; @@ -712,7 +727,7 @@ GenerateComponentPackage(const char *packageFile, // The command that will be used to run PackageMaker cmOStringStream pkgCmd; - if (this->PackageCompatibilityVersion < 10.5 || + if (this->PackageCompatibilityVersion < getVersion(10, 5) || this->PackageMakerVersion < 3.0) { // Create Description.plist and Info.plist files for normal Mac OS diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h index e350a60..4f9e2a8 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.h +++ b/Source/CPack/cmCPackPackageMakerGenerator.h @@ -117,7 +117,7 @@ protected: cmCPackComponent PostFlightComponent; double PackageMakerVersion; - double PackageCompatibilityVersion; + unsigned int PackageCompatibilityVersion; }; #endif ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackPackageMakerGenerator.cxx | 33 ++++++++++++++++++------- Source/CPack/cmCPackPackageMakerGenerator.h | 2 +- 2 files changed, 25 insertions(+), 10 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:12:43 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:12:43 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1772-gbe4c0c9 Message-ID: <20150112141243.270E5514E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via be4c0c959ea29d10e321b4801dcb9555e1da3231 (commit) via 6414e0d35afb185d2255f7a55a859ce0ce52f474 (commit) from 05b2bb94d9c908bb2c37bb9cfd74a6baa31c4b5d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=be4c0c959ea29d10e321b4801dcb9555e1da3231 commit be4c0c959ea29d10e321b4801dcb9555e1da3231 Merge: 05b2bb9 6414e0d Author: Brad King AuthorDate: Mon Jan 12 09:12:42 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 09:12:42 2015 -0500 Merge topic 'cpack-PackageMaker-OSX-10.10' into next 6414e0d3 CPack: Fix line too long in parent commit http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6414e0d35afb185d2255f7a55a859ce0ce52f474 commit 6414e0d35afb185d2255f7a55a859ce0ce52f474 Author: Brad King AuthorDate: Mon Jan 12 09:12:26 2015 -0500 Commit: Brad King CommitDate: Mon Jan 12 09:12:26 2015 -0500 CPack: Fix line too long in parent commit diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 09f9e6b..e58415c 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -534,7 +534,8 @@ int cmCPackPackageMakerGenerator::InitializeInternal() int res = sscanf(packageCompat, "%u.%u", &majorVersion, &minorVersion); if (res == 2) { - this->PackageCompatibilityVersion = getVersion(majorVersion, minorVersion); + this->PackageCompatibilityVersion = + getVersion(majorVersion, minorVersion); } } else if (this->GetOption("CPACK_DOWNLOAD_SITE")) ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackPackageMakerGenerator.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:13:01 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:13:01 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1774-g7e8c54f Message-ID: <20150112141301.AFBBE5173@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7e8c54f2d4d98b82f16dd15d02026691e8ae052f (commit) via 70abf6e780185c9c7041593bc99aff0a26bc9265 (commit) from be4c0c959ea29d10e321b4801dcb9555e1da3231 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e8c54f2d4d98b82f16dd15d02026691e8ae052f commit 7e8c54f2d4d98b82f16dd15d02026691e8ae052f Merge: be4c0c9 70abf6e Author: Brad King AuthorDate: Mon Jan 12 09:13:01 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 09:13:01 2015 -0500 Merge topic 'cpack-PackageMaker-OSX-10.10' into next 70abf6e7 CPack: Fix PackageMaker internal versioning for OS X 10.10 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=70abf6e780185c9c7041593bc99aff0a26bc9265 commit 70abf6e780185c9c7041593bc99aff0a26bc9265 Author: Calin Cascaval AuthorDate: Fri Dec 26 09:48:53 2014 -0800 Commit: Brad King CommitDate: Mon Jan 12 09:12:50 2015 -0500 CPack: Fix PackageMaker internal versioning for OS X 10.10 Avoid using a floating point value to represent the version, since "10.10" would be treated as "10.1". diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index d736948..e58415c 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -24,11 +24,20 @@ #include #include +#include + +static inline +unsigned int getVersion(unsigned int major, unsigned int minor) +{ + assert(major < 256 && minor < 256); + return ((major & 0xFF) << 16 | minor); +} + //---------------------------------------------------------------------- cmCPackPackageMakerGenerator::cmCPackPackageMakerGenerator() { this->PackageMakerVersion = 0.0; - this->PackageCompatibilityVersion = 10.4; + this->PackageCompatibilityVersion = getVersion(10, 4); } //---------------------------------------------------------------------- @@ -39,7 +48,7 @@ cmCPackPackageMakerGenerator::~cmCPackPackageMakerGenerator() //---------------------------------------------------------------------- bool cmCPackPackageMakerGenerator::SupportsComponentInstallation() const { - return this->PackageCompatibilityVersion >= 10.4; + return this->PackageCompatibilityVersion >= getVersion(10, 4); } //---------------------------------------------------------------------- @@ -241,7 +250,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() std::string packageFile; if (compIt->second.IsDownloaded) { - if (this->PackageCompatibilityVersion >= 10.5 && + if (this->PackageCompatibilityVersion >= getVersion(10, 5) && this->PackageMakerVersion >= 3.0) { // Build this package within the upload directory. @@ -260,7 +269,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() } else if (!warnedAboutDownloadCompatibility) { - if (this->PackageCompatibilityVersion < 10.5) + if (this->PackageCompatibilityVersion < getVersion(10, 5)) { cmCPackLogger( cmCPackLog::LOG_WARNING, @@ -520,22 +529,29 @@ int cmCPackPackageMakerGenerator::InitializeInternal() const char *packageCompat = this->GetOption("CPACK_OSX_PACKAGE_VERSION"); if (packageCompat && *packageCompat) { - this->PackageCompatibilityVersion = atof(packageCompat); + unsigned int majorVersion = 10; + unsigned int minorVersion = 5; + int res = sscanf(packageCompat, "%u.%u", &majorVersion, &minorVersion); + if (res == 2) + { + this->PackageCompatibilityVersion = + getVersion(majorVersion, minorVersion); + } } else if (this->GetOption("CPACK_DOWNLOAD_SITE")) { this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.5"); - this->PackageCompatibilityVersion = 10.5; + this->PackageCompatibilityVersion = getVersion(10, 5); } else if (this->GetOption("CPACK_COMPONENTS_ALL")) { this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.4"); - this->PackageCompatibilityVersion = 10.4; + this->PackageCompatibilityVersion = getVersion(10, 4); } else { this->SetOption("CPACK_OSX_PACKAGE_VERSION", "10.3"); - this->PackageCompatibilityVersion = 10.3; + this->PackageCompatibilityVersion = getVersion(10, 3); } std::vector no_paths; @@ -712,7 +728,7 @@ GenerateComponentPackage(const char *packageFile, // The command that will be used to run PackageMaker cmOStringStream pkgCmd; - if (this->PackageCompatibilityVersion < 10.5 || + if (this->PackageCompatibilityVersion < getVersion(10, 5) || this->PackageMakerVersion < 3.0) { // Create Description.plist and Info.plist files for normal Mac OS diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h index e350a60..4f9e2a8 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.h +++ b/Source/CPack/cmCPackPackageMakerGenerator.h @@ -117,7 +117,7 @@ protected: cmCPackComponent PostFlightComponent; double PackageMakerVersion; - double PackageCompatibilityVersion; + unsigned int PackageCompatibilityVersion; }; #endif ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:14:33 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:14:33 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1776-ga97c151 Message-ID: <20150112141433.2DF2DA7C40@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a97c15173c9127b67c0c91626332878f0bce77d7 (commit) via 3515b0a40d0c96133bada09bdb2eecb2fe5ef747 (commit) from 7e8c54f2d4d98b82f16dd15d02026691e8ae052f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a97c15173c9127b67c0c91626332878f0bce77d7 commit a97c15173c9127b67c0c91626332878f0bce77d7 Merge: 7e8c54f 3515b0a Author: Brad King AuthorDate: Mon Jan 12 09:14:32 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 09:14:32 2015 -0500 Merge topic 'backport-copyright-year' into next 3515b0a4 Copyright.txt: Update year range to end in 2015 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3515b0a40d0c96133bada09bdb2eecb2fe5ef747 commit 3515b0a40d0c96133bada09bdb2eecb2fe5ef747 Author: Brad King AuthorDate: Wed Dec 31 21:09:37 2014 -0500 Commit: Brad King CommitDate: Mon Jan 12 09:14:16 2015 -0500 Copyright.txt: Update year range to end in 2015 diff --git a/Copyright.txt b/Copyright.txt index 214d7de..6c9fb09 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -1,5 +1,5 @@ CMake - Cross Platform Makefile Generator -Copyright 2000-2014 Kitware, Inc. +Copyright 2000-2015 Kitware, Inc. Copyright 2000-2011 Insight Software Consortium All rights reserved. ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:15:51 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:15:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-719-gcdc688e Message-ID: <20150112141551.A3102A8CE0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via cdc688eab0f6b1d5131b0b188c5ba1860775af1a (commit) via 3515b0a40d0c96133bada09bdb2eecb2fe5ef747 (commit) from c59cf4f96ce276353263f2d06a54c4e1da1ba27d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cdc688eab0f6b1d5131b0b188c5ba1860775af1a commit cdc688eab0f6b1d5131b0b188c5ba1860775af1a Merge: c59cf4f 3515b0a Author: Brad King AuthorDate: Mon Jan 12 09:15:50 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 09:15:50 2015 -0500 Merge topic 'backport-copyright-year' 3515b0a4 Copyright.txt: Update year range to end in 2015 ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:16:18 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:16:18 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1778-g214d354 Message-ID: <20150112141618.E6B1CA8D7D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 214d354dcb9a170500a17c2213e4dde7f903ec1d (commit) via cdc688eab0f6b1d5131b0b188c5ba1860775af1a (commit) from a97c15173c9127b67c0c91626332878f0bce77d7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=214d354dcb9a170500a17c2213e4dde7f903ec1d commit 214d354dcb9a170500a17c2213e4dde7f903ec1d Merge: a97c151 cdc688e Author: Brad King AuthorDate: Mon Jan 12 09:16:09 2015 -0500 Commit: Brad King CommitDate: Mon Jan 12 09:16:09 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From ben.boeckel at kitware.com Mon Jan 12 09:23:36 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Mon, 12 Jan 2015 09:23:36 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1780-g1839501 Message-ID: <20150112142336.70FB4A9DFA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 183950101b44830bd458201dae0e9c2c7762ed39 (commit) via bba9705e96ec3f97a25a4f7029f79150785e2003 (commit) from 214d354dcb9a170500a17c2213e4dde7f903ec1d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=183950101b44830bd458201dae0e9c2c7762ed39 commit 183950101b44830bd458201dae0e9c2c7762ed39 Merge: 214d354 bba9705 Author: Ben Boeckel AuthorDate: Mon Jan 12 09:23:35 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 09:23:35 2015 -0500 Merge topic 'safer-msmpi-checks' into next bba9705e FindMPI: handle trailing slash from $MSMPI_BIN http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bba9705e96ec3f97a25a4f7029f79150785e2003 commit bba9705e96ec3f97a25a4f7029f79150785e2003 Author: Ben Boeckel AuthorDate: Mon Jan 12 09:21:23 2015 -0500 Commit: Ben Boeckel CommitDate: Mon Jan 12 09:23:23 2015 -0500 FindMPI: handle trailing slash from $MSMPI_BIN When installing, MSMPI puts a trailing backslash in the MSMPI_BIN environment variable. This causes trouble when concatenating in CMake since the list separator is now escaped and no longer a list separator due to the trailing backslash. Instead, add in a dummy forward slash which doesn't change the path, but uses up the backslash. diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 9192054..13b9bdf 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -175,7 +175,7 @@ set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun) set(_MPI_PREFIX_PATH) if(WIN32) # MSMPI - list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_BIN}") + list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_BIN}/") list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]/Bin") list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_INC}/..") # The SDK is installed separately from the runtime # MPICH ----------------------------------------------------------------------- Summary of changes: Modules/FindMPI.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:35:47 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:35:47 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1782-g0899a48 Message-ID: <20150112143549.6B299AA0FE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0899a4839407960ec19d421ceef03a3dcae42339 (commit) via ab74553db49dba6a1d2219f8ff8545650ebfb5a5 (commit) from 183950101b44830bd458201dae0e9c2c7762ed39 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0899a4839407960ec19d421ceef03a3dcae42339 commit 0899a4839407960ec19d421ceef03a3dcae42339 Merge: 1839501 ab74553 Author: Brad King AuthorDate: Mon Jan 12 09:35:46 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 09:35:46 2015 -0500 Merge topic 'improve_cobertura' into next ab74553d ctest_coverage: Fix parsing of absolute paths in Cobertura files http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab74553db49dba6a1d2219f8ff8545650ebfb5a5 commit ab74553db49dba6a1d2219f8ff8545650ebfb5a5 Author: Zack Galbreath AuthorDate: Fri Dec 19 10:12:25 2014 -0500 Commit: Brad King CommitDate: Mon Jan 12 09:34:50 2015 -0500 ctest_coverage: Fix parsing of absolute paths in Cobertura files This commit fixes a segmentation fault I encountered when my Coverage.xml referenced a system file, eg /usr/lib/python/foo.py. Similar to other CMake coverage parsers, this one now ignores any files it finds that are not located within this project's source or binary directories. diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx index 0742be1..e19b199 100644 --- a/Source/CTest/cmParseCoberturaCoverage.cxx +++ b/Source/CTest/cmParseCoberturaCoverage.cxx @@ -12,9 +12,11 @@ public: XMLParser(cmCTest* ctest, cmCTestCoverageHandlerContainer& cont) : CTest(ctest), Coverage(cont) { - this->InSources = false; - this->InSource = false; + this->InSources = false; + this->InSource = false; + this->SkipThisClass = false; this->FilePaths.push_back(this->Coverage.SourceDir); + this->FilePaths.push_back(this->Coverage.BinaryDir); this->CurFileName = ""; } @@ -35,6 +37,10 @@ protected: { this->InSources=false; } + else if(name == "class") + { + this->SkipThisClass = false; + } } virtual void CharacterDataHandler(const char* data, int length) @@ -72,15 +78,33 @@ protected: << atts[tagCount+1]<< std::endl); std::string filename = atts[tagCount+1]; this->CurFileName = ""; + + // Check if this is an absolute path that falls within our + // source or binary directories. for(size_t i=0;i < FilePaths.size();i++) { - finalpath = FilePaths[i] + "/" + filename; - if(cmSystemTools::FileExists(finalpath.c_str())) + if (filename.find(FilePaths[i]) == 0) { - this->CurFileName = finalpath; + this->CurFileName = filename; break; } } + + if (this->CurFileName == "") + { + // Check if this is a path that is relative to our source or + // binary directories. + for(size_t i=0;i < FilePaths.size();i++) + { + finalpath = FilePaths[i] + "/" + filename; + if(cmSystemTools::FileExists(finalpath.c_str())) + { + this->CurFileName = finalpath; + break; + } + } + } + cmsys::ifstream fin(this->CurFileName.c_str()); if(this->CurFileName == "" || !fin ) { @@ -89,10 +113,11 @@ protected: fin.open(this->CurFileName.c_str()); if (!fin) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - "Python Coverage: Error opening " << this->CurFileName - << std::endl); - this->Coverage.Error++; + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Skipping system file " << filename << + std::endl); + + this->SkipThisClass = true; break; } } @@ -117,6 +142,10 @@ protected: int curHits = -1; while(true) { + if(this->SkipThisClass) + { + break; + } if(strcmp(atts[tagCount], "hits") == 0) { curHits = atoi(atts[tagCount+1]); @@ -144,6 +173,7 @@ private: bool InSources; bool InSource; + bool SkipThisClass; std::vector FilePaths; typedef cmCTestCoverageHandlerContainer::SingleFileCoverageVector FileLinesType; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:37:39 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:37:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1785-gcd42577 Message-ID: <20150112143739.4360FAA11E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via cd42577b23fbda05bc2420ffc7050b7dc1dee5d6 (commit) via 4035ef786de80d4d2fc27cd5f03c629702f54762 (commit) via d811d238abe2dcd04cebd7ee4c3f07f4b6da093f (commit) from 0899a4839407960ec19d421ceef03a3dcae42339 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd42577b23fbda05bc2420ffc7050b7dc1dee5d6 commit cd42577b23fbda05bc2420ffc7050b7dc1dee5d6 Merge: 0899a48 4035ef7 Author: Brad King AuthorDate: Mon Jan 12 09:37:38 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 09:37:38 2015 -0500 Merge topic 'add-xz-support' into next 4035ef78 cmake -E tar: error out on multiple compression formats d811d238 cmSystemTools: use an enumeration for compression formats http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4035ef786de80d4d2fc27cd5f03c629702f54762 commit 4035ef786de80d4d2fc27cd5f03c629702f54762 Author: Ben Boeckel AuthorDate: Fri Jan 9 10:33:36 2015 -0500 Commit: Brad King CommitDate: Mon Jan 12 09:36:25 2015 -0500 cmake -E tar: error out on multiple compression formats diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 91b9e94..27dd08b 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -736,17 +736,27 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) cmSystemTools::cmTarCompression compress = cmSystemTools::TarCompressNone; bool verbose = false; + int nCompress = 0; if ( flags.find_first_of('j') != flags.npos ) { compress = cmSystemTools::TarCompressBZip2; + ++nCompress; } if ( flags.find_first_of('J') != flags.npos ) { compress = cmSystemTools::TarCompressXZ; + ++nCompress; } if ( flags.find_first_of('z') != flags.npos ) { compress = cmSystemTools::TarCompressGZip; + ++nCompress; + } + if ( nCompress > 1 ) + { + cmSystemTools::Error("Can only compress a tar file one way; " + "at most one flag of z, j, or J may be used"); + return 1; } if ( flags.find_first_of('v') != flags.npos ) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d811d238abe2dcd04cebd7ee4c3f07f4b6da093f commit d811d238abe2dcd04cebd7ee4c3f07f4b6da093f Author: Ben Boeckel AuthorDate: Fri Jan 9 10:33:00 2015 -0500 Commit: Brad King CommitDate: Mon Jan 12 09:36:25 2015 -0500 cmSystemTools: use an enumeration for compression formats Juggling 3 booleans was unwieldy. diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index f02d78e..e1391a7 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1675,7 +1675,7 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file) files.push_back(file); if(!cmSystemTools::CreateTar(tarFile.c_str(), files, - true, false, false, false)) + cmSystemTools::TarCompressGZip, false)) { cmCTestLog(this, ERROR_MESSAGE, "Error creating tar while " "encoding file: " << file << std::endl); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index cd63347..963ca77 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1482,7 +1482,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, - bool gzip, bool bzip2, bool xz, + cmTarCompression compressType, bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) @@ -1497,11 +1497,24 @@ bool cmSystemTools::CreateTar(const char* outFileName, cmSystemTools::Error(e.c_str()); return false; } - cmArchiveWrite a(fout, (gzip? cmArchiveWrite::CompressGZip : - (bzip2? cmArchiveWrite::CompressBZip2 : - (xz? cmArchiveWrite::CompressXZ : - cmArchiveWrite::CompressNone))), - cmArchiveWrite::TypeTAR); + cmArchiveWrite::Compress compress = cmArchiveWrite::CompressNone; + switch (compressType) + { + case TarCompressGZip: + compress = cmArchiveWrite::CompressGZip; + break; + case TarCompressBZip2: + compress = cmArchiveWrite::CompressBZip2; + break; + case TarCompressXZ: + compress = cmArchiveWrite::CompressXZ; + break; + case TarCompressNone: + compress = cmArchiveWrite::CompressNone; + break; + } + cmArchiveWrite a(fout, compress, + cmArchiveWrite::TypeTAR); a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); i != files.end(); ++i) @@ -1526,7 +1539,6 @@ bool cmSystemTools::CreateTar(const char* outFileName, #else (void)outFileName; (void)files; - (void)gzip; (void)verbose; return false; #endif @@ -1787,7 +1799,7 @@ bool extract_tar(const char* outFileName, bool verbose, #endif bool cmSystemTools::ExtractTar(const char* outFileName, - bool , bool verbose) + bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) return extract_tar(outFileName, verbose, true); @@ -1799,7 +1811,6 @@ bool cmSystemTools::ExtractTar(const char* outFileName, } bool cmSystemTools::ListTar(const char* outFileName, - bool , bool verbose) { #if defined(CMAKE_BUILD_WITH_CMAKE) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 47d2771..09ceea6 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -383,12 +383,19 @@ public: static void EnableVSConsoleOutput(); /** Create tar */ + enum cmTarCompression + { + TarCompressGZip, + TarCompressBZip2, + TarCompressXZ, + TarCompressNone + }; static bool ListTar(const char* outFileName, - bool gzip, bool verbose); + bool verbose); static bool CreateTar(const char* outFileName, - const std::vector& files, bool gzip, - bool bzip2, bool xz, bool verbose); - static bool ExtractTar(const char* inFileName, bool gzip, + const std::vector& files, + cmTarCompression compressType, bool verbose); + static bool ExtractTar(const char* inFileName, bool verbose); // This should be called first thing in main // it will keep child processes from inheriting the diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 6b3efb5..91b9e94 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -733,21 +733,20 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) { files.push_back(args[cc]); } - bool gzip = false; - bool bzip2 = false; - bool xz = false; + cmSystemTools::cmTarCompression compress = + cmSystemTools::TarCompressNone; bool verbose = false; if ( flags.find_first_of('j') != flags.npos ) { - bzip2 = true; + compress = cmSystemTools::TarCompressBZip2; } if ( flags.find_first_of('J') != flags.npos ) { - xz = true; + compress = cmSystemTools::TarCompressXZ; } if ( flags.find_first_of('z') != flags.npos ) { - gzip = true; + compress = cmSystemTools::TarCompressGZip; } if ( flags.find_first_of('v') != flags.npos ) { @@ -756,7 +755,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) if ( flags.find_first_of('t') != flags.npos ) { - if ( !cmSystemTools::ListTar(outFile.c_str(), gzip, verbose) ) + if ( !cmSystemTools::ListTar(outFile.c_str(), verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; @@ -765,7 +764,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) else if ( flags.find_first_of('c') != flags.npos ) { if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, gzip, bzip2, xz, verbose) ) + outFile.c_str(), files, compress, verbose) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; @@ -774,7 +773,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) else if ( flags.find_first_of('x') != flags.npos ) { if ( !cmSystemTools::ExtractTar( - outFile.c_str(), gzip, verbose) ) + outFile.c_str(), verbose) ) { cmSystemTools::Error("Problem extracting tar: ", outFile.c_str()); return 1; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:39:39 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:39:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-721-g212bf1f Message-ID: <20150112143939.9A5792199@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 212bf1f82a522b7ee779b008a14c2e51fd104e5b (commit) via ab74553db49dba6a1d2219f8ff8545650ebfb5a5 (commit) from cdc688eab0f6b1d5131b0b188c5ba1860775af1a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=212bf1f82a522b7ee779b008a14c2e51fd104e5b commit 212bf1f82a522b7ee779b008a14c2e51fd104e5b Merge: cdc688e ab74553 Author: Brad King AuthorDate: Mon Jan 12 09:39:38 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 09:39:38 2015 -0500 Merge topic 'improve_cobertura' ab74553d ctest_coverage: Fix parsing of absolute paths in Cobertura files ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmParseCoberturaCoverage.cxx | 48 +++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 9 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:39:41 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:39:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-726-gd9a6ea4 Message-ID: <20150112143941.DA5E5247F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via d9a6ea4599eb3b736b4e695a9ffd5d8a51eac059 (commit) via 4035ef786de80d4d2fc27cd5f03c629702f54762 (commit) via d811d238abe2dcd04cebd7ee4c3f07f4b6da093f (commit) via df16dcfb4478bb05932a1abb0e42433e60f1a565 (commit) via b0a5d3932d2a6633d05eca3eb7fd632f433dca05 (commit) from 212bf1f82a522b7ee779b008a14c2e51fd104e5b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9a6ea4599eb3b736b4e695a9ffd5d8a51eac059 commit d9a6ea4599eb3b736b4e695a9ffd5d8a51eac059 Merge: 212bf1f 4035ef7 Author: Brad King AuthorDate: Mon Jan 12 09:39:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 09:39:40 2015 -0500 Merge topic 'add-xz-support' 4035ef78 cmake -E tar: error out on multiple compression formats d811d238 cmSystemTools: use an enumeration for compression formats df16dcfb cmake -E tar: add support for .xz files with 'J' b0a5d393 cmake -E tar: clean up flag documentation diff --cc Source/cmcmd.cxx index d3d85a5,27dd08b..70d98d2 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@@ -751,9 -765,9 +765,9 @@@ int cmcmd::ExecuteCMakeCommand(std::vec if ( flags.find_first_of('t') != flags.npos ) { - if ( !cmSystemTools::ListTar(outFile.c_str(), gzip, verbose) ) + if ( !cmSystemTools::ListTar(outFile.c_str(), verbose) ) { - cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); + cmSystemTools::Error("Problem listing tar: ", outFile.c_str()); return 1; } } ----------------------------------------------------------------------- Summary of changes: Help/release/dev/add-xz-support.rst | 5 +++++ Source/cmCTest.cxx | 3 ++- Source/cmSystemTools.cxx | 29 +++++++++++++++++++++-------- Source/cmSystemTools.h | 15 +++++++++++---- Source/cmcmd.cxx | 30 ++++++++++++++++++++++-------- 5 files changed, 61 insertions(+), 21 deletions(-) create mode 100644 Help/release/dev/add-xz-support.rst hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:41:04 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:41:04 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-730-gdd6c596 Message-ID: <20150112144104.BDC485124@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via dd6c596c12070c0fdc71cb11ac154e99111fb6e0 (commit) via 55a73e6b1f70b3c8a783b130dff4c4689cea5ba2 (commit) via 8dc8d756bc278cd02f329b31218c2459908dc0bb (commit) via b5813ceeb5b5f78351dd9f9c6af904db2f4451c9 (commit) from d9a6ea4599eb3b736b4e695a9ffd5d8a51eac059 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd6c596c12070c0fdc71cb11ac154e99111fb6e0 commit dd6c596c12070c0fdc71cb11ac154e99111fb6e0 Merge: d9a6ea4 55a73e6 Author: Brad King AuthorDate: Mon Jan 12 09:41:02 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 09:41:02 2015 -0500 Merge topic 'join-algorithm' 55a73e6b Use the cmJoin algorithm where possible. 8dc8d756 cmStandardIncludes: Add a join algorithm for string containers. b5813cee cmInstallCommand: Remove unused variable. ----------------------------------------------------------------------- Summary of changes: Source/cmComputeLinkInformation.cxx | 26 ++------------- Source/cmGeneratorExpressionEvaluator.cxx | 11 +------ Source/cmInstallCommand.cxx | 15 ++------- Source/cmListCommand.cxx | 30 ++---------------- Source/cmMakefile.cxx | 12 +------ Source/cmQtAutoGenerators.cxx | 44 +++----------------------- Source/cmRST.cxx | 9 +----- Source/cmStandardIncludes.h | 27 ++++++++++++++++ Source/cmSystemTools.cxx | 18 ++++------- Source/cmTarget.cxx | 31 ++---------------- Source/cmTargetCompileFeaturesCommand.cxx | 10 +----- Source/cmTargetCompileOptionsCommand.cxx | 10 +----- Source/cmTargetIncludeDirectoriesCommand.cxx | 10 +----- Source/cmTargetSourcesCommand.cxx | 10 +----- Source/cmake.cxx | 9 +----- 15 files changed, 56 insertions(+), 216 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 09:41:25 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 09:41:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1789-g100bc57 Message-ID: <20150112144125.CC230512D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 100bc579214d7775414504a9fd4d1de76ee83b41 (commit) via dd6c596c12070c0fdc71cb11ac154e99111fb6e0 (commit) via d9a6ea4599eb3b736b4e695a9ffd5d8a51eac059 (commit) via 212bf1f82a522b7ee779b008a14c2e51fd104e5b (commit) from cd42577b23fbda05bc2420ffc7050b7dc1dee5d6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=100bc579214d7775414504a9fd4d1de76ee83b41 commit 100bc579214d7775414504a9fd4d1de76ee83b41 Merge: cd42577 dd6c596 Author: Brad King AuthorDate: Mon Jan 12 09:41:15 2015 -0500 Commit: Brad King CommitDate: Mon Jan 12 09:41:15 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 10:30:33 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 10:30:33 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1791-g370dc75 Message-ID: <20150112153033.5295AAA012@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 370dc75e6eaceb724ff5b1a83c832b41f837bfbc (commit) via 88b6e4ba51e263de41888e9b4bc1189462ffe0a8 (commit) from 100bc579214d7775414504a9fd4d1de76ee83b41 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=370dc75e6eaceb724ff5b1a83c832b41f837bfbc commit 370dc75e6eaceb724ff5b1a83c832b41f837bfbc Merge: 100bc57 88b6e4b Author: Brad King AuthorDate: Mon Jan 12 10:30:32 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 10:30:32 2015 -0500 Merge topic 'fix-COMPILE_FEATURES-genex' into next 88b6e4ba cmMakefile: Wrap long line http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=88b6e4ba51e263de41888e9b4bc1189462ffe0a8 commit 88b6e4ba51e263de41888e9b4bc1189462ffe0a8 Author: Brad King AuthorDate: Mon Jan 12 10:28:05 2015 -0500 Commit: Brad King CommitDate: Mon Jan 12 10:28:05 2015 -0500 cmMakefile: Wrap long line diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e15a1c1..ab77e4a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -5141,7 +5141,8 @@ bool cmMakefile::HaveStandardAvailable(cmTarget const* target, //---------------------------------------------------------------------------- bool cmMakefile:: -HaveCStandardAvailable(cmTarget const* target, const std::string& feature) const +HaveCStandardAvailable(cmTarget const* target, + const std::string& feature) const { bool needC90 = false; bool needC99 = false; ----------------------------------------------------------------------- Summary of changes: Source/cmMakefile.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 10:31:13 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 10:31:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1794-g3bc2cac Message-ID: <20150112153113.0CAE1AA031@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3bc2cacc230c3270883eb05d7398f27036ef33ac (commit) via 45ec182d27dc27412c94ccb49632e22a55d5fbe4 (commit) via 2bead0eb1b605cc5d0db23d9af00087277157921 (commit) from 370dc75e6eaceb724ff5b1a83c832b41f837bfbc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3bc2cacc230c3270883eb05d7398f27036ef33ac commit 3bc2cacc230c3270883eb05d7398f27036ef33ac Merge: 370dc75 45ec182 Author: Brad King AuthorDate: Mon Jan 12 10:31:12 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 10:31:12 2015 -0500 Merge topic 'fix-COMPILE_FEATURES-genex' into next 45ec182d Features: Fix the COMPILE_FEATURES genex for unavailable features. 2bead0eb cmMakefile: Rename a method to what it really does. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=45ec182d27dc27412c94ccb49632e22a55d5fbe4 commit 45ec182d27dc27412c94ccb49632e22a55d5fbe4 Author: Stephen Kelly AuthorDate: Sun Jan 11 17:53:37 2015 +0100 Commit: Brad King CommitDate: Mon Jan 12 10:30:43 2015 -0500 Features: Fix the COMPILE_FEATURES genex for unavailable features. Previously, the genex tested only for CMake knowledge of the feature, but not compiler knowledge of the feature. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 9ffe9f2..d5d78d5 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1373,9 +1373,16 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode for (LangMap::const_iterator lit = testedFeatures.begin(); lit != testedFeatures.end(); ++lit) { + std::vector const& langAvailable + = availableFeatures[lit->first]; for (std::vector::const_iterator it = lit->second.begin(); it != lit->second.end(); ++it) { + if (std::find(langAvailable.begin(), langAvailable.end(), *it) + == langAvailable.end()) + { + return "0"; + } if (!context->Makefile->HaveStandardAvailable(target, lit->first, *it)) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2bead0eb1b605cc5d0db23d9af00087277157921 commit 2bead0eb1b605cc5d0db23d9af00087277157921 Author: Stephen Kelly AuthorDate: Sun Jan 11 17:43:44 2015 +0100 Commit: Brad King CommitDate: Mon Jan 12 10:30:43 2015 -0500 cmMakefile: Rename a method to what it really does. The method does not test availability of compile features. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 84a4daa..9ffe9f2 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1376,7 +1376,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode for (std::vector::const_iterator it = lit->second.begin(); it != lit->second.end(); ++it) { - if (!context->Makefile->HaveFeatureAvailable(target, + if (!context->Makefile->HaveStandardAvailable(target, lit->first, *it)) { if (evalLL) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b7e89b8..ab77e4a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -5130,18 +5130,19 @@ CompileFeaturesAvailable(const std::string& lang, std::string *error) const } //---------------------------------------------------------------------------- -bool cmMakefile::HaveFeatureAvailable(cmTarget const* target, +bool cmMakefile::HaveStandardAvailable(cmTarget const* target, std::string const& lang, const std::string& feature) const { return lang == "C" - ? this->HaveCFeatureAvailable(target, feature) - : this->HaveCxxFeatureAvailable(target, feature); + ? this->HaveCStandardAvailable(target, feature) + : this->HaveCxxStandardAvailable(target, feature); } //---------------------------------------------------------------------------- bool cmMakefile:: -HaveCFeatureAvailable(cmTarget const* target, const std::string& feature) const +HaveCStandardAvailable(cmTarget const* target, + const std::string& feature) const { bool needC90 = false; bool needC99 = false; @@ -5218,7 +5219,7 @@ bool cmMakefile::IsLaterStandard(std::string const& lang, } //---------------------------------------------------------------------------- -bool cmMakefile::HaveCxxFeatureAvailable(cmTarget const* target, +bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const { bool needCxx98 = false; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 28f8686..24a4f00 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -935,7 +935,7 @@ public: const char* CompileFeaturesAvailable(const std::string& lang, std::string *error) const; - bool HaveFeatureAvailable(cmTarget const* target, std::string const& lang, + bool HaveStandardAvailable(cmTarget const* target, std::string const& lang, const std::string& feature) const; bool IsLaterStandard(std::string const& lang, @@ -1158,9 +1158,9 @@ private: void CheckNeededCxxLanguage(const std::string& feature, bool& needCxx98, bool& needCxx11, bool& needCxx14) const; - bool HaveCFeatureAvailable(cmTarget const* target, + bool HaveCStandardAvailable(cmTarget const* target, const std::string& feature) const; - bool HaveCxxFeatureAvailable(cmTarget const* target, + bool HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const; mutable bool SuppressWatches; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From ben.boeckel at kitware.com Mon Jan 12 10:52:49 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Mon, 12 Jan 2015 10:52:49 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1796-gfbecece Message-ID: <20150112155249.D5F5DA90B2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fbecece01a35c39504d190af3976b2e861745862 (commit) via 1cc5d81139a9ee92dfbea04eb91cad9abcbe622c (commit) from 3bc2cacc230c3270883eb05d7398f27036ef33ac (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fbecece01a35c39504d190af3976b2e861745862 commit fbecece01a35c39504d190af3976b2e861745862 Merge: 3bc2cac 1cc5d81 Author: Ben Boeckel AuthorDate: Mon Jan 12 10:52:49 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 10:52:49 2015 -0500 Merge topic 'safer-msmpi-checks' into next 1cc5d811 FindMPI: use file(TO_CMAKE_PATH) to remove '\' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1cc5d81139a9ee92dfbea04eb91cad9abcbe622c commit 1cc5d81139a9ee92dfbea04eb91cad9abcbe622c Author: Ben Boeckel AuthorDate: Mon Jan 12 10:52:27 2015 -0500 Commit: Ben Boeckel CommitDate: Mon Jan 12 10:52:27 2015 -0500 FindMPI: use file(TO_CMAKE_PATH) to remove '\' diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 13b9bdf..62272f8 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -175,7 +175,8 @@ set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun) set(_MPI_PREFIX_PATH) if(WIN32) # MSMPI - list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_BIN}/") + file(TO_CMAKE_PATH "$ENV{MSMPI_BIN}" msmpi_bin_path) # The default path ends with a '\' and doesn't mix with ';' when appending. + list(APPEND _MPI_PREFIX_PATH "${msmpi_bin_path}") list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]/Bin") list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_INC}/..") # The SDK is installed separately from the runtime # MPICH ----------------------------------------------------------------------- Summary of changes: Modules/FindMPI.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 13:00:09 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 13:00:09 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1798-gedb26a9 Message-ID: <20150112180009.2FFBEA9F3B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via edb26a9f31cd65f210291d8c230ac05aabfae2d9 (commit) via ac5922317f4f2229c5dc79b29d913275fa55f021 (commit) from fbecece01a35c39504d190af3976b2e861745862 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=edb26a9f31cd65f210291d8c230ac05aabfae2d9 commit edb26a9f31cd65f210291d8c230ac05aabfae2d9 Merge: fbecece ac59223 Author: Brad King AuthorDate: Mon Jan 12 13:00:08 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 13:00:08 2015 -0500 Merge topic 'linux-XL-fortran' into next ac592231 XL: Fix link flags for executables on Linux with XL compilers http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ac5922317f4f2229c5dc79b29d913275fa55f021 commit ac5922317f4f2229c5dc79b29d913275fa55f021 Author: Brad King AuthorDate: Sat Jan 10 12:00:56 2015 -0500 Commit: Brad King CommitDate: Mon Jan 12 12:59:52 2015 -0500 XL: Fix link flags for executables on Linux with XL compilers Use "-Wl,-export-dynamic" with XL to match the "-rdynamic" flag used with GNU-like compilers. diff --git a/Modules/Platform/Linux-XL-C.cmake b/Modules/Platform/Linux-XL-C.cmake index f1c584c..d595e44 100644 --- a/Modules/Platform/Linux-XL-C.cmake +++ b/Modules/Platform/Linux-XL-C.cmake @@ -1 +1,2 @@ set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj") +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-export-dynamic") diff --git a/Modules/Platform/Linux-XL-CXX.cmake b/Modules/Platform/Linux-XL-CXX.cmake index abd3fa4..5ceb255 100644 --- a/Modules/Platform/Linux-XL-CXX.cmake +++ b/Modules/Platform/Linux-XL-CXX.cmake @@ -1 +1,2 @@ set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj") +set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-export-dynamic") diff --git a/Modules/Platform/Linux-XL-Fortran.cmake b/Modules/Platform/Linux-XL-Fortran.cmake index cdd1f70..a878991 100644 --- a/Modules/Platform/Linux-XL-Fortran.cmake +++ b/Modules/Platform/Linux-XL-Fortran.cmake @@ -1 +1,2 @@ set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-qmkshrobj") +set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-export-dynamic") ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 13:08:59 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 13:08:59 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-732-g3dec4a2 Message-ID: <20150112180859.B82F0AA161@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 3dec4a2bfbad7b519cb1e7c9aa72dd2ee3c4e669 (commit) via ac5922317f4f2229c5dc79b29d913275fa55f021 (commit) from dd6c596c12070c0fdc71cb11ac154e99111fb6e0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3dec4a2bfbad7b519cb1e7c9aa72dd2ee3c4e669 commit 3dec4a2bfbad7b519cb1e7c9aa72dd2ee3c4e669 Merge: dd6c596 ac59223 Author: Brad King AuthorDate: Mon Jan 12 13:08:58 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 13:08:58 2015 -0500 Merge topic 'linux-XL-fortran' ac592231 XL: Fix link flags for executables on Linux with XL compilers ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 12 13:09:13 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 12 Jan 2015 13:09:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1800-gf62af7f Message-ID: <20150112180913.A8056219A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f62af7fd49da2d17954013cc9a6c6f6365e0db8c (commit) via 3dec4a2bfbad7b519cb1e7c9aa72dd2ee3c4e669 (commit) from edb26a9f31cd65f210291d8c230ac05aabfae2d9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f62af7fd49da2d17954013cc9a6c6f6365e0db8c commit f62af7fd49da2d17954013cc9a6c6f6365e0db8c Merge: edb26a9 3dec4a2 Author: Brad King AuthorDate: Mon Jan 12 13:09:06 2015 -0500 Commit: Brad King CommitDate: Mon Jan 12 13:09:06 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From eike at sf-mail.de Mon Jan 12 13:29:51 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Mon, 12 Jan 2015 13:29:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1802-g6de9d59 Message-ID: <20150112182951.12983A9F0A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 6de9d59f46094043c358d0cc5aa5a7b532bbecf6 (commit) via dd5d2eb156b7e45ded53f694a12a1e00d19f6cd6 (commit) from f62af7fd49da2d17954013cc9a6c6f6365e0db8c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6de9d59f46094043c358d0cc5aa5a7b532bbecf6 commit 6de9d59f46094043c358d0cc5aa5a7b532bbecf6 Merge: f62af7f dd5d2eb Author: Rolf Eike Beer AuthorDate: Mon Jan 12 13:29:50 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 13:29:50 2015 -0500 Merge topic 'FindRuby-zero-version' into next dd5d2eb1 FindRuby: fix selection of version x.0 (#15345) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd5d2eb156b7e45ded53f694a12a1e00d19f6cd6 commit dd5d2eb156b7e45ded53f694a12a1e00d19f6cd6 Author: David Coppa AuthorDate: Mon Jan 12 19:28:02 2015 +0100 Commit: Rolf Eike Beer CommitDate: Mon Jan 12 19:28:02 2015 +0100 FindRuby: fix selection of version x.0 (#15345) When "Ruby_FIND_VERSION_MINOR" is 0, the "if(Ruby_FIND_VERSION_MAJOR AND Ruby_FIND_VERSION_MINOR)" check evaluated to false. diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index b5ac703..61858aa 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -58,7 +58,7 @@ set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ruby) # if 1.9 is required, don't look for ruby18 and ruby1.8, default to version 1.8 -if(Ruby_FIND_VERSION_MAJOR AND Ruby_FIND_VERSION_MINOR) +if(DEFINED Ruby_FIND_VERSION_MAJOR AND DEFINED Ruby_FIND_VERSION_MINOR) set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${RUBY_FIND_VERSION_MINOR}") # we can't construct that if only major version is given set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ----------------------------------------------------------------------- Summary of changes: Modules/FindRuby.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From ben.boeckel at kitware.com Mon Jan 12 13:31:48 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Mon, 12 Jan 2015 13:31:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1804-g5ae1335 Message-ID: <20150112183148.8158DA9FC1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5ae13355efec27b1acb6e65bd411bb2c012fb952 (commit) via eda08400439811a938f10bd7a9f662166e78dad6 (commit) from 6de9d59f46094043c358d0cc5aa5a7b532bbecf6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5ae13355efec27b1acb6e65bd411bb2c012fb952 commit 5ae13355efec27b1acb6e65bd411bb2c012fb952 Merge: 6de9d59 eda0840 Author: Ben Boeckel AuthorDate: Mon Jan 12 13:31:47 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 13:31:47 2015 -0500 Merge topic 'safer-msmpi-checks' into next eda08400 FindMPI: drop local variable http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eda08400439811a938f10bd7a9f662166e78dad6 commit eda08400439811a938f10bd7a9f662166e78dad6 Author: Ben Boeckel AuthorDate: Mon Jan 12 13:31:38 2015 -0500 Commit: Ben Boeckel CommitDate: Mon Jan 12 13:31:38 2015 -0500 FindMPI: drop local variable diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 62272f8..545b077 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -177,6 +177,7 @@ if(WIN32) # MSMPI file(TO_CMAKE_PATH "$ENV{MSMPI_BIN}" msmpi_bin_path) # The default path ends with a '\' and doesn't mix with ';' when appending. list(APPEND _MPI_PREFIX_PATH "${msmpi_bin_path}") + unset(msmpi_bin_path) list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]/Bin") list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_INC}/..") # The SDK is installed separately from the runtime # MPICH ----------------------------------------------------------------------- Summary of changes: Modules/FindMPI.cmake | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From steveire at gmail.com Mon Jan 12 14:06:30 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 12 Jan 2015 14:06:30 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1807-g258b54b Message-ID: <20150112190630.A7B78AA08E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 258b54be2e083734d08962b84ee30b4e83f02e9f (commit) via 4eb34e13fe4c24ac34330b1926fa045078389070 (commit) via 6f6d630f4aadffa5320381e92fb79a0ed52e177b (commit) from 5ae13355efec27b1acb6e65bd411bb2c012fb952 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=258b54be2e083734d08962b84ee30b4e83f02e9f commit 258b54be2e083734d08962b84ee30b4e83f02e9f Merge: 5ae1335 4eb34e1 Author: Stephen Kelly AuthorDate: Mon Jan 12 14:06:29 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 14:06:29 2015 -0500 Merge topic 'extend-COMPILE_FEATURES-test' into next 4eb34e13 Features: Extend the tests for the COMPILE_FEATURES genex. 6f6d630f Merge remote-tracking branch 'origin/fix-COMPILE_FEATURES-genex' into HEAD diff --cc Tests/CompileFeatures/CMakeLists.txt index f0a4e74,80f16d6..58a5f2a --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -218,6 -223,8 +273,9 @@@ if (CMAKE_CXX_COMPILE_FEATURES target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ + HAVE_THREAD_LOCAL=$ + HAVE_FINAL=$ + HAVE_THREAD_LOCAL_AND_FINAL=$ ) + endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4eb34e13fe4c24ac34330b1926fa045078389070 commit 4eb34e13fe4c24ac34330b1926fa045078389070 Author: Stephen Kelly AuthorDate: Mon Jan 12 20:02:17 2015 +0100 Commit: Stephen Kelly CommitDate: Mon Jan 12 20:04:06 2015 +0100 Features: Extend the tests for the COMPILE_FEATURES genex. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9fb8d1b..80f16d6 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -146,12 +146,64 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_definitions(-DEXPECT_OVERRIDE_CONTROL=1) + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + add_definitions( + -DEXPECT_THREAD_LOCAL=1 + -DEXPECT_FINAL=1 + -DEXPECT_THREAD_LOCAL_AND_FINAL=1 + ) + elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + add_definitions( + -DEXPECT_THREAD_LOCAL=0 + -DEXPECT_FINAL=1 + -DEXPECT_THREAD_LOCAL_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_THREAD_LOCAL=0 + -DEXPECT_FINAL=0 + -DEXPECT_THREAD_LOCAL_AND_FINAL=0 + ) + endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" ) + add_definitions( + -DEXPECT_THREAD_LOCAL=1 + -DEXPECT_FINAL=1 + -DEXPECT_THREAD_LOCAL_AND_FINAL=1 + ) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 1900) + add_definitions( + -DEXPECT_THREAD_LOCAL=1 + -DEXPECT_FINAL=1 + -DEXPECT_THREAD_LOCAL_AND_FINAL=1 + ) + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 1700) + add_definitions( + -DEXPECT_THREAD_LOCAL=0 + -DEXPECT_FINAL=1 + -DEXPECT_THREAD_LOCAL_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_THREAD_LOCAL=0 + -DEXPECT_FINAL=0 + -DEXPECT_THREAD_LOCAL_AND_FINAL=0 + ) + endif() + endif() + add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ + HAVE_THREAD_LOCAL=$ + HAVE_FINAL=$ + HAVE_THREAD_LOCAL_AND_FINAL=$ ) add_executable(CompileFeaturesGenex2 genex_test.cpp) @@ -159,6 +211,9 @@ if (CMAKE_CXX_COMPILE_FEATURES) target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ + HAVE_THREAD_LOCAL=$ + HAVE_FINAL=$ + HAVE_THREAD_LOCAL_AND_FINAL=$ ) add_library(static_assert_iface INTERFACE) @@ -168,5 +223,8 @@ if (CMAKE_CXX_COMPILE_FEATURES) target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ + HAVE_THREAD_LOCAL=$ + HAVE_FINAL=$ + HAVE_THREAD_LOCAL_AND_FINAL=$ ) endif() diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index 4412569..c56d764 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -21,6 +21,36 @@ struct B : A #error "Expect nullptr feature" #else +#if !HAVE_THREAD_LOCAL +# if EXPECT_THREAD_LOCAL +# error Expect cxx_thread_local support +# endif +#else +# if !EXPECT_THREAD_LOCAL +# error Expect no cxx_thread_local support +# endif +#endif + +#if !HAVE_FINAL +# if EXPECT_FINAL +# error Expect cxx_final support +# endif +#else +# if !EXPECT_FINAL +# error Expect no cxx_final support +# endif +#endif + +#if !HAVE_THREAD_LOCAL_AND_FINAL +# if EXPECT_THREAD_LOCAL_AND_FINAL +# error Expect cxx_thread_local and cxx_final support +# endif +#else +# if !EXPECT_THREAD_LOCAL_AND_FINAL +# error Expect no combined cxx_thread_local and cxx_final support +# endif +#endif + const char* getString() { return nullptr; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f6d630f4aadffa5320381e92fb79a0ed52e177b commit 6f6d630f4aadffa5320381e92fb79a0ed52e177b Merge: 3dec4a2 45ec182 Author: Stephen Kelly AuthorDate: Mon Jan 12 20:03:47 2015 +0100 Commit: Stephen Kelly CommitDate: Mon Jan 12 20:03:47 2015 +0100 Merge remote-tracking branch 'origin/fix-COMPILE_FEATURES-genex' into HEAD ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 58 ++++++++++++++++++++++++++++++++++ Tests/CompileFeatures/genex_test.cpp | 30 ++++++++++++++++++ 2 files changed, 88 insertions(+) hooks/post-receive -- CMake From steveire at gmail.com Mon Jan 12 14:13:05 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 12 Jan 2015 14:13:05 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1809-g3a9a73e Message-ID: <20150112191305.D0C65147EF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3a9a73e5844742fbe269e682723c39a15497b740 (commit) via ec86e2d16bae7fb7e7398f6d5b9d660995cfbb10 (commit) from 258b54be2e083734d08962b84ee30b4e83f02e9f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a9a73e5844742fbe269e682723c39a15497b740 commit 3a9a73e5844742fbe269e682723c39a15497b740 Merge: 258b54b ec86e2d Author: Stephen Kelly AuthorDate: Mon Jan 12 14:13:05 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 14:13:05 2015 -0500 Merge topic 'Apple-compiler-selection' into next ec86e2d1 Fix incorrect cache setting. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ec86e2d16bae7fb7e7398f6d5b9d660995cfbb10 commit ec86e2d16bae7fb7e7398f6d5b9d660995cfbb10 Author: Stephen Kelly AuthorDate: Mon Jan 12 20:12:00 2015 +0100 Commit: Stephen Kelly CommitDate: Mon Jan 12 20:12:43 2015 +0100 Fix incorrect cache setting. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 01e91f2..7b21dcf 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -79,7 +79,7 @@ macro(_cmake_find_compiler lang) OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE _xcrun_err) if(_xcrun_out) - set(CMAKE_${lang}_COMPILER "${_xcrun_out}" CACHE PATH "${lang} compiler") + set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_out}") break() endif() endforeach() ----------------------------------------------------------------------- Summary of changes: Modules/CMakeDetermineCompiler.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From bill.hoffman at kitware.com Mon Jan 12 17:02:07 2015 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Mon, 12 Jan 2015 17:02:07 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1811-g3f42120 Message-ID: <20150112220207.AA17DA9FDE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3f421206324fc57cfda97ef50e57e0c8c3ce1a40 (commit) via e571ca8dbfc6f8462e3d9a79b90a3546349b5cde (commit) from 3a9a73e5844742fbe269e682723c39a15497b740 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f421206324fc57cfda97ef50e57e0c8c3ce1a40 commit 3f421206324fc57cfda97ef50e57e0c8c3ce1a40 Merge: 3a9a73e e571ca8 Author: Bill Hoffman AuthorDate: Mon Jan 12 17:02:05 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 17:02:05 2015 -0500 Merge topic 'cdash_upload_file_mode' into next e571ca8d Add support to ctest_submit to upload files to cdash with CDASH_UPLOAD. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e571ca8dbfc6f8462e3d9a79b90a3546349b5cde commit e571ca8dbfc6f8462e3d9a79b90a3546349b5cde Author: Bill Hoffman AuthorDate: Tue Dec 23 11:03:14 2014 -0500 Commit: Bill Hoffman CommitDate: Mon Jan 12 16:56:05 2015 -0500 Add support to ctest_submit to upload files to cdash with CDASH_UPLOAD. This adds support for the new cdash API where arbitrary files can be uploaded to the CDash server. This CDash API communicates via json files so the json parser jsoncpp was added to the Utilities directory. In addition since CDash tracks the md5 sum of the files uploaded the --mtime option was added to cmake -E tar so that tar files could be created that would have the same md5sum with the same content. The first supported file upload type to CDash is a GCOV with branches coverage tar file. To support this a Modules/CTestGCOV.cmake was added to run gcov for a project via a CMake function. diff --git a/CMakeLists.txt b/CMakeLists.txt index 1812b27..4b57951 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 LIBARCHIVE LIBLZMA ZLIB JSONCPP) foreach(util ${UTILITIES}) if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util} AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES) @@ -372,6 +372,17 @@ macro (CMAKE_BUILD_UTILITIES) endif() #--------------------------------------------------------------------- + # Build expat library for CMake and CTest. + if(CMAKE_USE_SYSTEM_JSONCPP) + message(FATAL_ERROR "System JSONCPP not implemented") + else() + set(CMAKE_JSONCPP_INCLUDES ${CMake_SOURCE_DIR}/Utilities/cmjsoncpp) + set(CMAKE_JSONCPP_LIBRARIES cmjsoncpp) + add_subdirectory(Utilities/cmjsoncpp) + CMAKE_SET_TARGET_FOLDER(jsoncpp "Utilities/3rdParty") + endif() + + #--------------------------------------------------------------------- # Build XMLRPC library for CMake and CTest. if(CTEST_USE_XMLRPC) find_package(XMLRPC QUIET REQUIRED libwww-client) diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index d9b0b78..316a43d 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -37,3 +37,14 @@ timed-out submission before attempting to re-submit. The RETRY_COUNT option specifies how many times to retry a timed-out submission. + +:: + + ctest_submit([CDASH_UPLOAD file] + [CDASH_UPLOAD_TYPE type_string]) + +This second signature is used to upload files to CDash via the CDash +file upload API. The api first sends a request to upload to CDash along +with the md5 sum of the file. If CDash does not already have the file, +then it is uploaded. Along with the file, a CDash type string is specified +to tell CDash which handler to use to process the data. diff --git a/Modules/CTestGCOV.cmake b/Modules/CTestGCOV.cmake new file mode 100644 index 0000000..0e3a1a8 --- /dev/null +++ b/Modules/CTestGCOV.cmake @@ -0,0 +1,72 @@ +#.rst: +# CTestGCOV +# ----------------------------- +# +# CTestGCOV.cmake +# +# This module provides the function run_gcov_and_package_for_cdash. The +# function will run gcov on the .gcda files in a binary tree and then +# package all of the .gcov files into a tar file with a data.json. This +# file can be sent to a CDash server for display with ctest_submit +# CDASH_UPLOAD. +# +# :: +# +# run_gcov_and_package_for_cdash( +# ) +# +# Run gcov and package a tar gz file for cdash. tarfile is the name +# of the tarfile that is created and it will be placed in binary_dir. +# source_dir is the source directory for the build and binary_dir is +# the binary directory for the build. The gcov_command is a full path +# to gcov for the machine. + +#============================================================================= +# Copyright 2008-2009 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.) + +function(run_gcov_and_package_for_cdash tarfile source_dir binary_dir + gcov_command) + # run gcov on each gcda file in the binary tree + file(GLOB_RECURSE GCDA_FILES RELATIVE ${binary_dir} "*.gcda") + + # return early if no coverage files were found + list(LENGTH GCDA_FILES len) + if(len EQUAL 0) + message("CTestGCOV: No .gcda files found, ignoring coverage request.") + return() + endif() + + foreach (gcda_file ${GCDA_FILES}) + # get the directory of the gcda file + get_filename_component(gcov_dir ${gcda_file} DIRECTORY) + # run gcov + execute_process(COMMAND + ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${binary_dir}) + endforeach() + # create json file with project information + file(WRITE ${binary_dir}/data.json + "{ + \"Source\": \"${source_dir}\", + \"Binary\": \"${binary_dir}\" +}" + ) + # collect the gcov files + file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "*.gcov") + # tar up the coverage info + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar cvf ${tarfile} + --mtime=1970-01-01\ 0:0:0\ UTC ${gcov_files} data.json + WORKING_DIRECTORY ${binary_dir}) +endfunction() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 96f4709..5f08223 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -74,6 +74,7 @@ configure_file( include_directories( "${CMake_BINARY_DIR}/Source" "${CMake_SOURCE_DIR}/Source" + ${CMAKE_JSONCPP_INCLUDES} ${CMAKE_ZLIB_INCLUDES} ${CMAKE_EXPAT_INCLUDES} ${CMAKE_TAR_INCLUDES} @@ -533,6 +534,7 @@ set(CTEST_SRCS cmCTest.cxx CTest/cmCTestConfigureHandler.cxx CTest/cmCTestCoverageCommand.cxx CTest/cmCTestCoverageHandler.cxx + CTest/cmCTestCurl.cxx CTest/cmParseMumpsCoverage.cxx CTest/cmParseCacheCoverage.cxx CTest/cmParseGTMCoverage.cxx @@ -583,7 +585,7 @@ set(CTEST_SRCS cmCTest.cxx # Build CTestLib add_library(CTestLib ${CTEST_SRCS}) -target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) +target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES} ${CMAKE_JSONCPP_LIBRARIES}) # # Sources for CPack diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx new file mode 100644 index 0000000..b354592 --- /dev/null +++ b/Source/CTest/cmCTestCurl.cxx @@ -0,0 +1,258 @@ +#include "cmCTestCurl.h" +#include "cmSystemTools.h" +#include "cmCTest.h" + +cmCTestCurl::cmCTestCurl(cmCTest* ctest) +{ + this->CTest = ctest; + this->SetProxyType(); + this->UseHttp10 = false; + // In windows, this will init the winsock stuff + ::curl_global_init(CURL_GLOBAL_ALL); + // default is to verify https + this->VerifyPeerOff = false; + this->VerifyHostOff = false; + this->TimeOutSeconds = 0; +} + +namespace +{ +static size_t +curlWriteMemoryCallback(void *ptr, size_t size, size_t nmemb, + void *data) +{ + int realsize = (int)(size * nmemb); + + std::vector *vec + = static_cast* >(data); + const char* chPtr = static_cast(ptr); + vec->insert(vec->end(), chPtr, chPtr + realsize); + return realsize; +} + +static size_t +curlDebugCallback(CURL *, curl_infotype, char *chPtr, + size_t size, void *data) +{ + std::vector *vec + = static_cast* >(data); + vec->insert(vec->end(), chPtr, chPtr + size); + + return size; +} + +} +void cmCTestCurl::SetCurlOptions(std::vector const& args) +{ + for( std::vector::const_iterator i = args.begin(); + i != args.end(); ++i) + { + if(*i == "CURLOPT_SSL_VERIFYPEER_OFF") + { + this->VerifyPeerOff = true; + } + if(*i == "CURLOPT_SSL_VERIFYHOST_OFF") + { + this->VerifyHostOff = true; + } + } +} + +bool cmCTestCurl::InitCurl() +{ + this->Curl = curl_easy_init(); + if(!this->Curl) + { + return false; + } + if(this->VerifyPeerOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYPEER, 0); + } + if(this->VerifyHostOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYHOST, 0); + } + if(this->HTTPProxy.size()) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXY, this->HTTPProxy.c_str()); + curl_easy_setopt(this->Curl, CURLOPT_PROXYTYPE, this->HTTPProxyType); + if (this->HTTPProxyAuth.size() > 0) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXYUSERPWD, + this->HTTPProxyAuth.c_str()); + } + } + if(this->UseHttp10) + { + curl_easy_setopt(this->Curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + } + // enable HTTP ERROR parsing + curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + return true; +} + + +bool cmCTestCurl::UploadFile(std::string const& local_file, + std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + /* enable uploading */ + curl_easy_setopt(this->Curl, CURLOPT_UPLOAD, 1); + // if there is little to no activity for too long stop submitting + if(this->TimeOutSeconds) + { + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_LIMIT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_TIME, + this->TimeOutSeconds); + } + /* HTTP PUT please */ + ::curl_easy_setopt(this->Curl, CURLOPT_PUT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_VERBOSE, 1); + + FILE* ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); + if(!ftpfile) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not open file for upload: " << local_file << "\n"); + return false; + } + // set the url + std::string upload_url = url; + upload_url += "?"; + upload_url += fields; + ::curl_easy_setopt(this->Curl, CURLOPT_URL, upload_url.c_str()); + // now specify which file to upload + ::curl_easy_setopt(this->Curl, CURLOPT_INFILE, ftpfile); + unsigned long filelen = cmSystemTools::FileLength(local_file); + // and give the size of the upload (optional) + ::curl_easy_setopt(this->Curl, CURLOPT_INFILESIZE, + static_cast(filelen)); + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + // Now run off and do what you've been told! + ::curl_easy_perform(this->Curl); + ::fclose(ftpfile); + ::curl_global_cleanup(); + + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Curl response: [" << response << "]\n"); + } + std::string curlDebug; + if ( debugData.size() > 0 ) + { + curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + if(response.size() == 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "No response from server.\n" << + curlDebug); + return false; + } + return true; +} + +bool cmCTestCurl::HttpRequest(std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + cmCTestLog(this->CTest, DEBUG, "HttpRequest\n" + << "url: " << url << "\n" + << "fields " << fields << "\n"); + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + curl_easy_setopt(this->Curl, CURLOPT_POST, 1); + curl_easy_setopt(this->Curl, CURLOPT_POSTFIELDS, fields.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_URL, url.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_FOLLOWLOCATION, 1); + //set response options + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + + CURLcode res = ::curl_easy_perform(this->Curl); + + ::curl_easy_cleanup(this->Curl); + ::curl_global_cleanup(); + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl response: [" << response << "]\n"); + } + if ( debugData.size() > 0 ) + { + std::string curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + cmCTestLog(this->CTest, DEBUG, "Curl res: " << res << "\n"); + return (res == 0); +} + +void cmCTestCurl::SetProxyType() +{ + if ( cmSystemTools::GetEnv("HTTP_PROXY") ) + { + this->HTTPProxy = cmSystemTools::GetEnv("HTTP_PROXY"); + if ( cmSystemTools::GetEnv("HTTP_PROXY_PORT") ) + { + this->HTTPProxy += ":"; + this->HTTPProxy += cmSystemTools::GetEnv("HTTP_PROXY_PORT"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_TYPE") ) + { + // this is the default + this->HTTPProxyType = CURLPROXY_HTTP; + std::string type = cmSystemTools::GetEnv("HTTP_PROXY_TYPE"); + // HTTP/SOCKS4/SOCKS5 + if ( type == "HTTP" ) + { + this->HTTPProxyType = CURLPROXY_HTTP; + } + else if ( type == "SOCKS4" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS4; + } + else if ( type == "SOCKS5" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS5; + } + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_USER") ) + { + this->HTTPProxyAuth = cmSystemTools::GetEnv("HTTP_PROXY_USER"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_PASSWD") ) + { + this->HTTPProxyAuth += ":"; + this->HTTPProxyAuth += cmSystemTools::GetEnv("HTTP_PROXY_PASSWD"); + } + } +} diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h new file mode 100644 index 0000000..bb5c74a --- /dev/null +++ b/Source/CTest/cmCTestCurl.h @@ -0,0 +1,50 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 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 cmCTestCurl_h +#define cmCTestCurl_h +#include "cm_curl.h" +#include "cmStandardIncludes.h" +class cmCTest; + +class cmCTestCurl +{ +public: + cmCTestCurl(cmCTest*); + bool UploadFile(std::string const& url, + std::string const& file, + std::string const& fields, + std::string& response); + bool HttpRequest(std::string const& url, + std::string const& fields, + std::string& response); + // currently only supports CURLOPT_SSL_VERIFYPEER_OFF + // and CURLOPT_SSL_VERIFYHOST_OFF + void SetCurlOptions(std::vector const& args); + void SetUseHttp10On() { this->UseHttp10 = true;} + void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s;} +protected: + void SetProxyType(); + bool InitCurl(); +private: + cmCTest* CTest; + CURL* Curl; + std::string HTTPProxyAuth; + std::string HTTPProxy; + curl_proxytype HTTPProxyType; + bool VerifyHostOff; + bool VerifyPeerOff; + bool UseHttp10; + int TimeOutSeconds; +}; + + +#endif diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 4005a63..c608034 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -27,7 +27,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() = this->Makefile->GetDefinition("CTEST_TRIGGER_SITE"); bool ctestDropSiteCDash = this->Makefile->IsOn("CTEST_DROP_SITE_CDASH"); - + const char* ctestProjectName + = this->Makefile->GetDefinition("CTEST_PROJECT_NAME"); if ( !ctestDropMethod ) { ctestDropMethod = "http"; @@ -43,7 +44,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() // error: CDash requires CTEST_DROP_LOCATION definition // in CTestConfig.cmake } - + this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName); this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod); this->CTest->SetCTestConfiguration("DropSite", ctestDropSite); this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation); @@ -144,6 +145,10 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() static_cast(handler)->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF"); + static_cast(handler)-> + SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); + static_cast(handler)-> + SetOption("CDashUploadType", this->CDashUploadType.c_str()); return handler; } @@ -178,6 +183,16 @@ bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg) return true; } + if(arg == "CDASH_UPLOAD") + { + this->ArgumentDoing = ArgumentDoingCDashUpload; + return true; + } + if(arg == "CDASH_UPLOAD_TYPE") + { + this->ArgumentDoing = ArgumentDoingCDashUploadType; + return true; + } if(arg == "INTERNAL_TEST_CHECKSUM") { this->InternalTest = true; @@ -240,6 +255,17 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) return true; } + if(this->ArgumentDoing == ArgumentDoingCDashUpload) + { + this->CDashUploadFile = arg; + return true; + } + if(this->ArgumentDoing == ArgumentDoingCDashUploadType) + { + this->CDashUploadType = arg; + return true; + } + // Look for other arguments. return this->Superclass::CheckArgumentValue(arg); } diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index 3673fbd..cb0ac61 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -64,6 +64,8 @@ protected: ArgumentDoingFiles, ArgumentDoingRetryDelay, ArgumentDoingRetryCount, + ArgumentDoingCDashUpload, + ArgumentDoingCDashUploadType, ArgumentDoingLast2 }; @@ -74,6 +76,8 @@ protected: cmCTest::SetOfStrings Files; std::string RetryCount; std::string RetryDelay; + std::string CDashUploadFile; + std::string CDashUploadType; }; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index fea94ba..71491d8 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -10,7 +10,8 @@ See the License for more information. ============================================================================*/ #include "cmCTestSubmitHandler.h" - +#include "cmCTestScriptHandler.h" +#include "cmake.h" #include "cmSystemTools.h" #include "cmVersion.h" #include "cmGeneratedFileStream.h" @@ -23,8 +24,10 @@ // For XML-RPC submission #include "cm_xmlrpc.h" +#include // For curl submission #include "cm_curl.h" +#include "cmCTestCurl.h" #include @@ -1055,9 +1058,163 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(std::string const&, } #endif +void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod, + std::string& url) +{ + dropMethod = this->CTest->GetCTestConfiguration("DropMethod"); + url = dropMethod; + url += "://"; + if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 ) + { + url += this->CTest->GetCTestConfiguration("DropSiteUser"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + this->CTest->GetCTestConfiguration("DropSiteUser").c_str()); + if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 ) + { + url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******"); + } + url += "@"; + } + url += this->CTest->GetCTestConfiguration("DropSite") + + this->CTest->GetCTestConfiguration("DropLocation"); +} + + +int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, + std::string const& typeString) +{ + if(!cmSystemTools::FileExists(file)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Upload file not found: " << file << "\n"); + } + cmCTestCurl curl(this->CTest); + std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); + std::vector args; + cmSystemTools::ExpandListArgument(curlopt, args); + curl.SetCurlOptions(args); + curl.SetTimeOutSeconds(SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT); + std::string dropMethod; + std::string url; + this->ConstructCDashURL(dropMethod, url); + std::string::size_type pos = url.find("submit.php?"); + url = url.substr(0, pos+10); + if ( ! (dropMethod == "http" || dropMethod == "https" ) ) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Only http and https are supported for CDASH_UPLOAD\n"); + return -1; + } + char md5sum[33]; + md5sum[32] = 0; + cmSystemTools::ComputeFileMD5(file, md5sum); + // 1. request the buildid and check to see if the file + // has already been uploaded + // TODO I added support for subproject. You would need to add + // a "&subproject=subprojectname" to the first POST. + cmCTestScriptHandler* ch = + static_cast(this->CTest->GetHandler("script")); + cmake* cm = ch->GetCMake(); + const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + std::ostringstream str; + str << "project=" + << this->CTest->GetCTestConfiguration("ProjectName") << "&"; + if(subproject) + { + str << "subproject=" << subproject << "&"; + } + str << "stamp=" << this->CTest->GetCurrentTag() << "-" + << this->CTest->GetTestModelString() << "&" + << "model=" << this->CTest->GetTestModelString() << "&" + << "build=" << this->CTest->GetCTestConfiguration("BuildName") << "&" + << "site=" << this->CTest->GetCTestConfiguration("Site") << "&" + << "track=" << this->CTest->GetTestModelString() << "&" + << "starttime=" << (int)cmSystemTools::GetTime() << "&" + << "endtime=" << (int)cmSystemTools::GetTime() << "&" + << "datafilesmd5[0]=" << md5sum << "&" + << "type=" << typeString; + std::string fields = str.str(); + cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:" + << url << "\nfile: " << file << "\n"); + std::string response; + if(!curl.HttpRequest(url, fields, response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error in HttpRequest\n" << response); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Request upload response: [" << response << "]\n"); + Json::Value json; + Json::Reader reader; + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + if(json["status"].asInt() != 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Bad status returned from CDash: " + << json["status"].asInt()); + return -1; + } + if(json["datafilesmd5"].isArray()) + { + int datares = json["datafilesmd5"][0].asInt(); + if(datares == 1) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "File already exists on CDash, skip upload " + << file << "\n"); + return 0; + } + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "bad datafilesmd5 value in response " + << response << "\n"); + return -1; + } + + std::string upload_as = cmSystemTools::GetFilenameName(file); + std::ostringstream fstr; + fstr << "type=" << typeString << "&" + << "md5=" << md5sum << "&" + << "filename=" << upload_as << "&" + << "buildid=" << json["buildid"].asString(); + if(!curl.UploadFile(file, url, fstr.str(), response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error uploading to CDash. " + << file << " " << url << " " << fstr.str()); + return -1; + } + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Upload file response: [" << response << "]\n"); + return 0; +} + //---------------------------------------------------------------------------- int cmCTestSubmitHandler::ProcessHandler() { + std::string cdashUploadFile = this->GetOption("CDashUploadFile"); + std::string cdashUploadType = this->GetOption("CDashUploadType"); + if(cdashUploadFile.size()) + { + return this->HandleCDashUploadFile(cdashUploadFile, cdashUploadType); + } std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); // cdash does not need to trigger so just return true if(iscdash.size()) diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index accabd1..f9cd894 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -41,6 +41,11 @@ public: /** Specify a set of files to submit. */ void SelectFiles(cmCTest::SetOfStrings const& files); + // handle the cdash file upload protocol + int HandleCDashUploadFile(std::string const& file, std::string const& type); + + void ConstructCDashURL(std::string& dropMethod, std::string& url); + private: void SetLogFile(std::ostream* ost) { this->LogFile = ost; } diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index a2aecac..fc4c40d 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -247,6 +247,11 @@ bool cmArchiveWrite::AddPath(const char* path, return true; } +// function from libarchive +extern "C" +{ + time_t __archive_get_date(time_t, const char*); +} //---------------------------------------------------------------------------- bool cmArchiveWrite::AddFile(const char* file, size_t skip, const char* prefix) @@ -275,6 +280,17 @@ bool cmArchiveWrite::AddFile(const char* file, this->Error += cm_archive_error_string(this->Disk); return false; } + if(this->MTime.size()) + { + time_t t = __archive_get_date(0, this->MTime.c_str()); + if (t == -1) + { + this->Error = "__archive_get_date: Unable to parse mtime: "; + this->Error += "[" + this->MTime + "]"; + 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..987e95c 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(const char* t) { if(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/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c769154..372d41c 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1469,7 +1469,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, - bool verbose) + bool verbose, const char* mtime) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); @@ -1501,6 +1501,10 @@ bool cmSystemTools::CreateTar(const char* outFileName, } cmArchiveWrite a(fout, compress, cmArchiveWrite::TypeTAR); + if(mtime) + { + a.SetMTime(mtime); + } a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); i != files.end(); ++i) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 09ceea6..1c7208f 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& files, - cmTarCompression compressType, bool verbose); - static bool ExtractTar(const char* inFileName, - bool verbose); + cmTarCompression compressType, bool verbose, + const char* mtime=0); + 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/cmcmd.cxx b/Source/cmcmd.cxx index 70d98d2..3465e55 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -729,9 +729,21 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) std::string flags = args[2]; std::string outFile = args[3]; std::vector files; + std::string mtime; for (std::string::size_type cc = 4; cc < args.size(); cc ++) { - files.push_back(args[cc]); + // if the first 8 chars of an arg are --mtime= and that arg + // is not a file on disk, treat it is the --mtime= flag and + // not a file + if( (args[cc].substr(0, 8) == "--mtime=") && + !cmSystemTools::FileExists(args[cc])) + { + mtime = args[cc].substr(8); + } + else + { + files.push_back(args[cc]); + } } cmSystemTools::cmTarCompression compress = cmSystemTools::TarCompressNone; @@ -773,8 +785,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) } else if ( flags.find_first_of('c') != flags.npos ) { + const char* mtimestr = 0; + if(mtime.size()) + { + mtimestr = mtime.c_str(); + } if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, compress, verbose) ) + outFile.c_str(), files, compress, verbose, mtimestr) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt new file mode 100644 index 0000000..fb2236f --- /dev/null +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -0,0 +1,14 @@ +project(JsonCpp) + +set(JSONCPP_SOURCES + json_tool.h + json_reader.cpp + json_batchallocator.h + json_valueiterator.inl + json_value.cpp + json_writer.cpp +) + +include_directories(${JsonCpp_SOURCE_DIR}) + +add_library(cmjsoncpp ${JSONCPP_SOURCES}) diff --git a/Utilities/cmjsoncpp/json/assertions.h b/Utilities/cmjsoncpp/json/assertions.h new file mode 100644 index 0000000..5ef7e7b --- /dev/null +++ b/Utilities/cmjsoncpp/json/assertions.h @@ -0,0 +1,41 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED +#define CPPTL_JSON_ASSERTIONS_H_INCLUDED + +#include + +#if !defined(JSON_IS_AMALGAMATION) +#include "config.h" +#endif // if !defined(JSON_IS_AMALGAMATION) + +#if JSON_USE_EXCEPTION +#include +#define JSON_ASSERT(condition) \ + assert(condition); // @todo <= change this into an exception throw +#define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message); +#else // JSON_USE_EXCEPTION +#define JSON_ASSERT(condition) assert(condition); + +// The call to assert() will show the failure message in debug builds. In +// release bugs we write to invalid memory in order to crash hard, so that a +// debugger or crash reporter gets the chance to take over. We still call exit() +// afterward in order to tell the compiler that this macro doesn't return. +#define JSON_FAIL_MESSAGE(message) \ + { \ + assert(false&& message); \ + strcpy(reinterpret_cast(666), message); \ + exit(123); \ + } + +#endif + +#define JSON_ASSERT_MESSAGE(condition, message) \ + if (!(condition)) { \ + JSON_FAIL_MESSAGE(message) \ + } + +#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED diff --git a/Utilities/cmjsoncpp/json/config.h b/Utilities/cmjsoncpp/json/config.h new file mode 100644 index 0000000..afd3a45 --- /dev/null +++ b/Utilities/cmjsoncpp/json/config.h @@ -0,0 +1,112 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_CONFIG_H_INCLUDED +#define JSON_CONFIG_H_INCLUDED + +/// If defined, indicates that json library is embedded in CppTL library. +//# define JSON_IN_CPPTL 1 + +/// If defined, indicates that json may leverage CppTL library +//# define JSON_USE_CPPTL 1 +/// If defined, indicates that cpptl vector based map should be used instead of +/// std::map +/// as Value container. +//# define JSON_USE_CPPTL_SMALLMAP 1 +/// If defined, indicates that Json specific container should be used +/// (hash table & simple deque container with customizable allocator). +/// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332 +//# define JSON_VALUE_USE_INTERNAL_MAP 1 +/// Force usage of standard new/malloc based allocator instead of memory pool +/// based allocator. +/// The memory pools allocator used optimization (initializing Value and +/// ValueInternalLink +/// as if it was a POD) that may cause some validation tool to report errors. +/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. +//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 + +// If non-zero, the library uses exceptions to report bad input instead of C +// assertion macros. The default is to use exceptions. +#ifndef JSON_USE_EXCEPTION +#define JSON_USE_EXCEPTION 1 +#endif + +/// If defined, indicates that the source file is amalgated +/// to prevent private header inclusion. +/// Remarks: it is automatically defined in the generated amalgated header. +// #define JSON_IS_AMALGAMATION + +#ifdef JSON_IN_CPPTL +#include +#ifndef JSON_USE_CPPTL +#define JSON_USE_CPPTL 1 +#endif +#endif + +#ifdef JSON_IN_CPPTL +#define JSON_API CPPTL_API +#elif defined(JSON_DLL_BUILD) +#if defined(_MSC_VER) +#define JSON_API __declspec(dllexport) +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING +#endif // if defined(_MSC_VER) +#elif defined(JSON_DLL) +#if defined(_MSC_VER) +#define JSON_API __declspec(dllimport) +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING +#endif // if defined(_MSC_VER) +#endif // ifdef JSON_IN_CPPTL +#if !defined(JSON_API) +#define JSON_API +#endif + +// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for +// integer +// Storages, and 64 bits integer support is disabled. +// #define JSON_NO_INT64 1 + +#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 +// Microsoft Visual Studio 6 only support conversion from __int64 to double +// (no conversion from unsigned __int64). +#define JSON_USE_INT64_DOUBLE_CONVERSION 1 +// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' +// characters in the debug information) +// All projects I've ever seen with VS6 were using this globally (not bothering +// with pragma push/pop). +#pragma warning(disable : 4786) +#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 + +#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 +/// Indicates that the following function is deprecated. +#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) +#endif + +#if !defined(JSONCPP_DEPRECATED) +#define JSONCPP_DEPRECATED(message) +#endif // if !defined(JSONCPP_DEPRECATED) + +namespace Json { +typedef int Int; +typedef unsigned int UInt; +#if defined(JSON_NO_INT64) +typedef int LargestInt; +typedef unsigned int LargestUInt; +#undef JSON_HAS_INT64 +#else // if defined(JSON_NO_INT64) +// For Microsoft Visual use specific types as long long is not supported +#if defined(_MSC_VER) // Microsoft Visual Studio +typedef __int64 Int64; +typedef unsigned __int64 UInt64; +#else // if defined(_MSC_VER) // Other platforms, use long long +typedef long long int Int64; +typedef unsigned long long int UInt64; +#endif // if defined(_MSC_VER) +typedef Int64 LargestInt; +typedef UInt64 LargestUInt; +#define JSON_HAS_INT64 +#endif // if defined(JSON_NO_INT64) +} // end namespace Json + +#endif // JSON_CONFIG_H_INCLUDED diff --git a/Utilities/cmjsoncpp/json/features.h b/Utilities/cmjsoncpp/json/features.h new file mode 100644 index 0000000..1bb7bb6 --- /dev/null +++ b/Utilities/cmjsoncpp/json/features.h @@ -0,0 +1,57 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_FEATURES_H_INCLUDED +#define CPPTL_JSON_FEATURES_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "forwards.h" +#endif // if !defined(JSON_IS_AMALGAMATION) + +namespace Json { + +/** \brief Configuration passed to reader and writer. + * This configuration object can be used to force the Reader or Writer + * to behave in a standard conforming way. + */ +class JSON_API Features { +public: + /** \brief A configuration that allows all features and assumes all strings + * are UTF-8. + * - C & C++ comments are allowed + * - Root object can be any JSON value + * - Assumes Value strings are encoded in UTF-8 + */ + static Features all(); + + /** \brief A configuration that is strictly compatible with the JSON + * specification. + * - Comments are forbidden. + * - Root object must be either an array or an object value. + * - Assumes Value strings are encoded in UTF-8 + */ + static Features strictMode(); + + /** \brief Initialize the configuration like JsonConfig::allFeatures; + */ + Features(); + + /// \c true if comments are allowed. Default: \c true. + bool allowComments_; + + /// \c true if root must be either an array or an object value. Default: \c + /// false. + bool strictRoot_; + + /// \c true if dropped null placeholders are allowed. Default: \c false. + bool allowDroppedNullPlaceholders_; + + /// \c true if numeric object key are allowed. Default: \c false. + bool allowNumericKeys_; +}; + +} // namespace Json + +#endif // CPPTL_JSON_FEATURES_H_INCLUDED diff --git a/Utilities/cmjsoncpp/json/forwards.h b/Utilities/cmjsoncpp/json/forwards.h new file mode 100644 index 0000000..84a26cd --- /dev/null +++ b/Utilities/cmjsoncpp/json/forwards.h @@ -0,0 +1,43 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_FORWARDS_H_INCLUDED +#define JSON_FORWARDS_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "config.h" +#endif // if !defined(JSON_IS_AMALGAMATION) + +namespace Json { + +// writer.h +class FastWriter; +class StyledWriter; + +// reader.h +class Reader; + +// features.h +class Features; + +// value.h +typedef unsigned int ArrayIndex; +class StaticString; +class Path; +class PathArgument; +class Value; +class ValueIteratorBase; +class ValueIterator; +class ValueConstIterator; +#ifdef JSON_VALUE_USE_INTERNAL_MAP +class ValueMapAllocator; +class ValueInternalLink; +class ValueInternalArray; +class ValueInternalMap; +#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP + +} // namespace Json + +#endif // JSON_FORWARDS_H_INCLUDED diff --git a/Utilities/cmjsoncpp/json/json.h b/Utilities/cmjsoncpp/json/json.h new file mode 100644 index 0000000..f89bc62 --- /dev/null +++ b/Utilities/cmjsoncpp/json/json.h @@ -0,0 +1,14 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_JSON_H_INCLUDED +#define JSON_JSON_H_INCLUDED + +#include "value.h" +#include "reader.h" +#include "writer.h" +#include "features.h" + +#endif // JSON_JSON_H_INCLUDED diff --git a/Utilities/cmjsoncpp/json/reader.h b/Utilities/cmjsoncpp/json/reader.h new file mode 100644 index 0000000..e99dbc0 --- /dev/null +++ b/Utilities/cmjsoncpp/json/reader.h @@ -0,0 +1,253 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_READER_H_INCLUDED +#define CPPTL_JSON_READER_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "features.h" +#include "value.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include + +// Disable warning C4251: : needs to have dll-interface to +// be used by... +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(push) +#pragma warning(disable : 4251) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +namespace Json { + +/** \brief Unserialize a JSON document into a + *Value. + * + */ +class JSON_API Reader { +public: + typedef char Char; + typedef const Char* Location; + + /** \brief An error tagged with where in the JSON text it was encountered. + * + * The offsets give the [start, limit) range of bytes within the text. Note + * that this is bytes, not codepoints. + * + */ + struct StructuredError { + size_t offset_start; + size_t offset_limit; + std::string message; + }; + + /** \brief Constructs a Reader allowing all features + * for parsing. + */ + Reader(); + + /** \brief Constructs a Reader allowing the specified feature set + * for parsing. + */ + Reader(const Features& features); + + /** \brief Read a Value from a JSON + * document. + * \param document UTF-8 encoded string containing the document to read. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them + * back during + * serialization, \c false to discard comments. + * This parameter is ignored if + * Features::allowComments_ + * is \c false. + * \return \c true if the document was successfully parsed, \c false if an + * error occurred. + */ + bool + parse(const std::string& document, Value& root, bool collectComments = true); + + /** \brief Read a Value from a JSON + document. + * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the + document to read. + * \param endDoc Pointer on the end of the UTF-8 encoded string of the + document to read. + \ Must be >= beginDoc. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them + back during + * serialization, \c false to discard comments. + * This parameter is ignored if + Features::allowComments_ + * is \c false. + * \return \c true if the document was successfully parsed, \c false if an + error occurred. + */ + bool parse(const char* beginDoc, + const char* endDoc, + Value& root, + bool collectComments = true); + + /// \brief Parse from input stream. + /// \see Json::operator>>(std::istream&, Json::Value&). + bool parse(std::istream& is, Value& root, bool collectComments = true); + + /** \brief Returns a user friendly string that list errors in the parsed + * document. + * \return Formatted error message with the list of errors with their location + * in + * 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 + * document. + * \return Formatted error message with the list of errors with their location + * in + * the parsed document. An empty string is returned if no error + * occurred + * during parsing. + */ + std::string getFormattedErrorMessages() const; + + /** \brief Returns a vector of structured erros encounted while parsing. + * \return A (possibly empty) vector of StructuredError objects. Currently + * only one error can be returned, but the caller should tolerate + * multiple + * errors. This can occur if the parser recovers from a non-fatal + * parse error and then encounters additional errors. + */ + std::vector getStructuredErrors() const; + +private: + enum TokenType { + tokenEndOfStream = 0, + tokenObjectBegin, + tokenObjectEnd, + tokenArrayBegin, + tokenArrayEnd, + tokenString, + tokenNumber, + tokenTrue, + tokenFalse, + tokenNull, + tokenArraySeparator, + tokenMemberSeparator, + tokenComment, + tokenError + }; + + class Token { + public: + TokenType type_; + Location start_; + Location end_; + }; + + class ErrorInfo { + public: + Token token_; + std::string message_; + Location extra_; + }; + + typedef std::deque Errors; + + bool expectToken(TokenType type, Token& token, const char* message); + bool readToken(Token& token); + void skipSpaces(); + bool match(Location pattern, int patternLength); + bool readComment(); + bool readCStyleComment(); + bool readCppStyleComment(); + bool readString(); + void readNumber(); + bool readValue(); + bool readObject(Token& token); + bool readArray(Token& token); + bool decodeNumber(Token& token); + bool decodeNumber(Token& token, Value& decoded); + bool decodeString(Token& token); + bool decodeString(Token& token, std::string& decoded); + bool decodeDouble(Token& token); + bool decodeDouble(Token& token, Value& decoded); + bool decodeUnicodeCodePoint(Token& token, + Location& current, + Location end, + unsigned int& unicode); + bool decodeUnicodeEscapeSequence(Token& token, + Location& current, + Location end, + unsigned int& unicode); + bool addError(const std::string& message, Token& token, Location extra = 0); + bool recoverFromError(TokenType skipUntilToken); + bool addErrorAndRecover(const std::string& message, + Token& token, + TokenType skipUntilToken); + void skipUntilSpace(); + Value& currentValue(); + Char getNextChar(); + void + getLocationLineAndColumn(Location location, int& line, int& column) const; + std::string getLocationLineAndColumn(Location location) const; + void addComment(Location begin, Location end, CommentPlacement placement); + void skipCommentTokens(Token& token); + + typedef std::stack Nodes; + Nodes nodes_; + Errors errors_; + std::string document_; + Location begin_; + Location end_; + Location current_; + Location lastValueEnd_; + Value* lastValue_; + std::string commentsBefore_; + Features features_; + bool collectComments_; +}; + +/** \brief Read from 'sin' into 'root'. + + Always keep comments from the input JSON. + + This can be used to read a file into a particular sub-object. + For example: + \code + Json::Value root; + cin >> root["dir"]["file"]; + cout << root; + \endcode + Result: + \verbatim + { + "dir": { + "file": { + // The input stream JSON would be nested here. + } + } + } + \endverbatim + \throw std::exception on parse error. + \see Json::operator<<() +*/ +JSON_API std::istream& operator>>(std::istream&, Value&); + +} // namespace Json + +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(pop) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +#endif // CPPTL_JSON_READER_H_INCLUDED diff --git a/Utilities/cmjsoncpp/json/value.h b/Utilities/cmjsoncpp/json/value.h new file mode 100644 index 0000000..a60ca8f --- /dev/null +++ b/Utilities/cmjsoncpp/json/value.h @@ -0,0 +1,1086 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_H_INCLUDED +#define CPPTL_JSON_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "forwards.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include + +#ifndef JSON_USE_CPPTL_SMALLMAP +#include +#else +#include +#endif +#ifdef JSON_USE_CPPTL +#include +#endif + +// Disable warning C4251: : needs to have dll-interface to +// be used by... +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(push) +#pragma warning(disable : 4251) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +/** \brief JSON (JavaScript Object Notation). + */ +namespace Json { + +/** \brief Type of the value held by a Value object. + */ +enum ValueType { + nullValue = 0, ///< 'null' value + intValue, ///< signed integer value + uintValue, ///< unsigned integer value + realValue, ///< double value + stringValue, ///< UTF-8 string value + booleanValue, ///< bool value + arrayValue, ///< array value (ordered list) + objectValue ///< object value (collection of name/value pairs). +}; + +enum CommentPlacement { + commentBefore = 0, ///< a comment placed on the line before a value + commentAfterOnSameLine, ///< a comment just after a value on the same line + commentAfter, ///< a comment on the line after a value (only make sense for + /// root value) + numberOfCommentPlacement +}; + +//# ifdef JSON_USE_CPPTL +// typedef CppTL::AnyEnumerator EnumMemberNames; +// typedef CppTL::AnyEnumerator EnumValues; +//# endif + +/** \brief Lightweight wrapper to tag static string. + * + * Value constructor and objectValue member assignement takes advantage of the + * StaticString and avoid the cost of string duplication when storing the + * string or the member name. + * + * Example of usage: + * \code + * Json::Value aValue( StaticString("some text") ); + * Json::Value object; + * static const StaticString code("code"); + * object[code] = 1234; + * \endcode + */ +class JSON_API StaticString { +public: + explicit StaticString(const char* czstring) : str_(czstring) {} + + operator const char*() const { return str_; } + + const char* c_str() const { return str_; } + +private: + const char* str_; +}; + +/** \brief Represents a JSON value. + * + * This class is a discriminated union wrapper that can represents a: + * - signed integer [range: Value::minInt - Value::maxInt] + * - unsigned integer (range: 0 - Value::maxUInt) + * - double + * - UTF-8 string + * - boolean + * - 'null' + * - an ordered list of Value + * - collection of name/value pairs (javascript object) + * + * The type of the held value is represented by a #ValueType and + * can be obtained using type(). + * + * values of an #objectValue or #arrayValue can be accessed using operator[]() + *methods. + * Non const methods will automatically create the a #nullValue element + * if it does not exist. + * The sequence of an #arrayValue will be automatically resize and initialized + * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. + * + * The get() methods can be used to obtanis default value in the case the + *required element + * does not exist. + * + * It is possible to iterate over the list of a #objectValue values using + * the getMemberNames() method. + */ +class JSON_API Value { + friend class ValueIteratorBase; +#ifdef JSON_VALUE_USE_INTERNAL_MAP + friend class ValueInternalLink; + friend class ValueInternalMap; +#endif +public: + typedef std::vector Members; + typedef ValueIterator iterator; + typedef ValueConstIterator const_iterator; + typedef Json::UInt UInt; + typedef Json::Int Int; +#if defined(JSON_HAS_INT64) + typedef Json::UInt64 UInt64; + typedef Json::Int64 Int64; +#endif // defined(JSON_HAS_INT64) + typedef Json::LargestInt LargestInt; + typedef Json::LargestUInt LargestUInt; + typedef Json::ArrayIndex ArrayIndex; + + static const Value& null; + /// Minimum signed integer value that can be stored in a Json::Value. + static const LargestInt minLargestInt; + /// Maximum signed integer value that can be stored in a Json::Value. + static const LargestInt maxLargestInt; + /// Maximum unsigned integer value that can be stored in a Json::Value. + static const LargestUInt maxLargestUInt; + + /// Minimum signed int value that can be stored in a Json::Value. + static const Int minInt; + /// Maximum signed int value that can be stored in a Json::Value. + static const Int maxInt; + /// Maximum unsigned int value that can be stored in a Json::Value. + static const UInt maxUInt; + +#if defined(JSON_HAS_INT64) + /// Minimum signed 64 bits int value that can be stored in a Json::Value. + static const Int64 minInt64; + /// Maximum signed 64 bits int value that can be stored in a Json::Value. + static const Int64 maxInt64; + /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. + static const UInt64 maxUInt64; +#endif // defined(JSON_HAS_INT64) + +private: +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION +#ifndef JSON_VALUE_USE_INTERNAL_MAP + class CZString { + public: + enum DuplicationPolicy { + noDuplication = 0, + duplicate, + duplicateOnCopy + }; + CZString(ArrayIndex index); + CZString(const char* cstr, DuplicationPolicy allocate); + CZString(const CZString& other); + ~CZString(); + CZString& operator=(CZString other); + bool operator<(const CZString& other) const; + bool operator==(const CZString& other) const; + ArrayIndex index() const; + const char* c_str() const; + bool isStaticString() const; + + private: + void swap(CZString& other); + const char* cstr_; + ArrayIndex index_; + }; + +public: +#ifndef JSON_USE_CPPTL_SMALLMAP + typedef std::map ObjectValues; +#else + typedef CppTL::SmallMap ObjectValues; +#endif // ifndef JSON_USE_CPPTL_SMALLMAP +#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP +#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + +public: + /** \brief Create a default Value of the given type. + + This is a very useful constructor. + To create an empty array, pass arrayValue. + To create an empty object, pass objectValue. + Another Value can then be set to this one by assignment. +This is useful since clear() and resize() will not alter types. + + Examples: +\code +Json::Value null_value; // null +Json::Value arr_value(Json::arrayValue); // [] +Json::Value obj_value(Json::objectValue); // {} +\endcode + */ + Value(ValueType type = nullValue); + Value(Int value); + Value(UInt value); +#if defined(JSON_HAS_INT64) + Value(Int64 value); + Value(UInt64 value); +#endif // if defined(JSON_HAS_INT64) + Value(double value); + Value(const char* value); + Value(const char* beginValue, const char* endValue); + /** \brief Constructs a value from a static string. + + * Like other value string constructor but do not duplicate the string for + * internal storage. The given string must remain alive after the call to this + * constructor. + * Example of usage: + * \code + * Json::Value aValue( StaticString("some text") ); + * \endcode + */ + Value(const StaticString& value); + Value(const std::string& value); +#ifdef JSON_USE_CPPTL + Value(const CppTL::ConstString& value); +#endif + Value(bool value); + Value(const Value& other); + ~Value(); + + Value& operator=(Value other); + /// Swap values. + /// \note Currently, comments are intentionally not swapped, for + /// both logic and efficiency. + void swap(Value& other); + + ValueType type() const; + + bool operator<(const Value& other) const; + bool operator<=(const Value& other) const; + bool operator>=(const Value& other) const; + bool operator>(const Value& other) const; + + bool operator==(const Value& other) const; + bool operator!=(const Value& other) const; + + int compare(const Value& other) const; + + const char* asCString() const; + std::string asString() const; +#ifdef JSON_USE_CPPTL + CppTL::ConstString asConstString() const; +#endif + Int asInt() const; + UInt asUInt() const; +#if defined(JSON_HAS_INT64) + Int64 asInt64() const; + UInt64 asUInt64() const; +#endif // if defined(JSON_HAS_INT64) + LargestInt asLargestInt() const; + LargestUInt asLargestUInt() const; + float asFloat() const; + double asDouble() const; + bool asBool() const; + + bool isNull() const; + bool isBool() const; + bool isInt() const; + bool isInt64() const; + bool isUInt() const; + bool isUInt64() const; + bool isIntegral() const; + bool isDouble() const; + bool isNumeric() const; + bool isString() const; + bool isArray() const; + bool isObject() const; + + bool isConvertibleTo(ValueType other) const; + + /// Number of values in array or object + ArrayIndex size() const; + + /// \brief Return true if empty array, empty object, or null; + /// otherwise, false. + bool empty() const; + + /// Return isNull() + bool operator!() const; + + /// Remove all object members and array elements. + /// \pre type() is arrayValue, objectValue, or nullValue + /// \post type() is unchanged + void clear(); + + /// Resize the array to size elements. + /// New elements are initialized to null. + /// May only be called on nullValue or arrayValue. + /// \pre type() is arrayValue or nullValue + /// \post type() is arrayValue + void resize(ArrayIndex size); + + /// Access an array element (zero based index ). + /// If the array contains less than index element, then null value are + /// inserted + /// in the array so that its size is index+1. + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + Value& operator[](ArrayIndex index); + + /// Access an array element (zero based index ). + /// If the array contains less than index element, then null value are + /// inserted + /// in the array so that its size is index+1. + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + Value& operator[](int index); + + /// Access an array element (zero based index ) + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + const Value& operator[](ArrayIndex index) const; + + /// Access an array element (zero based index ) + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + const Value& operator[](int index) const; + + /// If the array contains at least index+1 elements, returns the element + /// value, + /// otherwise returns defaultValue. + Value get(ArrayIndex index, const Value& defaultValue) const; + /// Return true if index < size(). + bool isValidIndex(ArrayIndex index) const; + /// \brief Append value to array at the end. + /// + /// Equivalent to jsonvalue[jsonvalue.size()] = value; + Value& append(const Value& value); + + /// Access an object value by name, create a null member if it does not exist. + Value& operator[](const char* key); + /// Access an object value by name, returns null if there is no member with + /// that name. + const Value& operator[](const char* key) const; + /// Access an object value by name, create a null member if it does not exist. + Value& operator[](const std::string& key); + /// Access an object value by name, returns null if there is no member with + /// that name. + const Value& operator[](const std::string& key) const; + /** \brief Access an object value by name, create a null member if it does not + exist. + + * If the object as no entry for that name, then the member name used to store + * the new entry is not duplicated. + * Example of use: + * \code + * Json::Value object; + * static const StaticString code("code"); + * object[code] = 1234; + * \endcode + */ + Value& operator[](const StaticString& key); +#ifdef JSON_USE_CPPTL + /// Access an object value by name, create a null member if it does not exist. + Value& operator[](const CppTL::ConstString& key); + /// Access an object value by name, returns null if there is no member with + /// that name. + const Value& operator[](const CppTL::ConstString& key) const; +#endif + /// Return the member named key if it exist, defaultValue otherwise. + Value get(const char* key, const Value& defaultValue) const; + /// Return the member named key if it exist, defaultValue otherwise. + Value get(const std::string& key, const Value& defaultValue) const; +#ifdef JSON_USE_CPPTL + /// Return the member named key if it exist, defaultValue otherwise. + Value get(const CppTL::ConstString& key, const Value& defaultValue) const; +#endif + /// \brief Remove and return the named member. + /// + /// Do nothing if it did not exist. + /// \return the removed Value, or null. + /// \pre type() is objectValue or nullValue + /// \post type() is unchanged + Value removeMember(const char* key); + /// Same as removeMember(const char*) + Value removeMember(const std::string& key); + + /// Return true if the object has a member named key. + bool isMember(const char* key) const; + /// Return true if the object has a member named key. + bool isMember(const std::string& key) const; +#ifdef JSON_USE_CPPTL + /// Return true if the object has a member named key. + bool isMember(const CppTL::ConstString& key) const; +#endif + + /// \brief Return a list of the member names. + /// + /// If null, return an empty list. + /// \pre type() is objectValue or nullValue + /// \post if type() was nullValue, it remains nullValue + Members getMemberNames() const; + + //# ifdef JSON_USE_CPPTL + // EnumMemberNames enumMemberNames() const; + // EnumValues enumValues() const; + //# endif + + /// Comments must be //... or /* ... */ + void setComment(const char* comment, CommentPlacement placement); + /// Comments must be //... or /* ... */ + void setComment(const std::string& comment, CommentPlacement placement); + bool hasComment(CommentPlacement placement) const; + /// Include delimiters and embedded newlines. + std::string getComment(CommentPlacement placement) const; + + std::string toStyledString() const; + + const_iterator begin() const; + const_iterator end() const; + + iterator begin(); + iterator end(); + + // Accessors for the [start, limit) range of bytes within the JSON text from + // which this value was parsed, if any. + void setOffsetStart(size_t start); + void setOffsetLimit(size_t limit); + size_t getOffsetStart() const; + size_t getOffsetLimit() const; + +private: + Value& resolveReference(const char* key, bool isStatic); + +#ifdef JSON_VALUE_USE_INTERNAL_MAP + inline bool isItemAvailable() const { return itemIsUsed_ == 0; } + + inline void setItemUsed(bool isUsed = true) { itemIsUsed_ = isUsed ? 1 : 0; } + + inline bool isMemberNameStatic() const { return memberNameIsStatic_ == 0; } + + inline void setMemberNameIsStatic(bool isStatic) { + memberNameIsStatic_ = isStatic ? 1 : 0; + } +#endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP + +private: + struct CommentInfo { + CommentInfo(); + ~CommentInfo(); + + void setComment(const char* text); + + char* comment_; + }; + + // struct MemberNamesTransform + //{ + // typedef const char *result_type; + // const char *operator()( const CZString &name ) const + // { + // return name.c_str(); + // } + //}; + + union ValueHolder { + LargestInt int_; + LargestUInt uint_; + double real_; + bool bool_; + char* string_; +#ifdef JSON_VALUE_USE_INTERNAL_MAP + ValueInternalArray* array_; + ValueInternalMap* map_; +#else + ObjectValues* map_; +#endif + } value_; + ValueType type_ : 8; + int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. +#ifdef JSON_VALUE_USE_INTERNAL_MAP + unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. + int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. +#endif + CommentInfo* comments_; + + // [start, limit) byte offsets in the source JSON text from which this Value + // was extracted. + size_t start_; + size_t limit_; +}; + +/** \brief Experimental and untested: represents an element of the "path" to + * access a node. + */ +class JSON_API PathArgument { +public: + friend class Path; + + PathArgument(); + PathArgument(ArrayIndex index); + PathArgument(const char* key); + PathArgument(const std::string& key); + +private: + enum Kind { + kindNone = 0, + kindIndex, + kindKey + }; + std::string key_; + ArrayIndex index_; + Kind kind_; +}; + +/** \brief Experimental and untested: represents a "path" to access a node. + * + * Syntax: + * - "." => root node + * - ".[n]" => elements at index 'n' of root node (an array value) + * - ".name" => member named 'name' of root node (an object value) + * - ".name1.name2.name3" + * - ".[0][1][2].name1[3]" + * - ".%" => member name is provided as parameter + * - ".[%]" => index is provied as parameter + */ +class JSON_API Path { +public: + Path(const std::string& path, + const PathArgument& a1 = PathArgument(), + const PathArgument& a2 = PathArgument(), + const PathArgument& a3 = PathArgument(), + const PathArgument& a4 = PathArgument(), + const PathArgument& a5 = PathArgument()); + + const Value& resolve(const Value& root) const; + Value resolve(const Value& root, const Value& defaultValue) const; + /// Creates the "path" to access the specified node and returns a reference on + /// the node. + Value& make(Value& root) const; + +private: + typedef std::vector InArgs; + typedef std::vector Args; + + void makePath(const std::string& path, const InArgs& in); + void addPathInArg(const std::string& path, + const InArgs& in, + InArgs::const_iterator& itInArg, + PathArgument::Kind kind); + void invalidPath(const std::string& path, int location); + + Args args_; +}; + +#ifdef JSON_VALUE_USE_INTERNAL_MAP +/** \brief Allocator to customize Value internal map. + * Below is an example of a simple implementation (default implementation + actually + * use memory pool for speed). + * \code + class DefaultValueMapAllocator : public ValueMapAllocator + { + public: // overridden from ValueMapAllocator + virtual ValueInternalMap *newMap() + { + return new ValueInternalMap(); + } + + virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) + { + return new ValueInternalMap( other ); + } + + virtual void destructMap( ValueInternalMap *map ) + { + delete map; + } + + virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) + { + return new ValueInternalLink[size]; + } + + virtual void releaseMapBuckets( ValueInternalLink *links ) + { + delete [] links; + } + + virtual ValueInternalLink *allocateMapLink() + { + return new ValueInternalLink(); + } + + virtual void releaseMapLink( ValueInternalLink *link ) + { + delete link; + } + }; + * \endcode + */ +class JSON_API ValueMapAllocator { +public: + virtual ~ValueMapAllocator(); + virtual ValueInternalMap* newMap() = 0; + virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) = 0; + virtual void destructMap(ValueInternalMap* map) = 0; + virtual ValueInternalLink* allocateMapBuckets(unsigned int size) = 0; + virtual void releaseMapBuckets(ValueInternalLink* links) = 0; + virtual ValueInternalLink* allocateMapLink() = 0; + virtual void releaseMapLink(ValueInternalLink* link) = 0; +}; + +/** \brief ValueInternalMap hash-map bucket chain link (for internal use only). + * \internal previous_ & next_ allows for bidirectional traversal. + */ +class JSON_API ValueInternalLink { +public: + enum { + itemPerLink = 6 + }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. + enum InternalFlags { + flagAvailable = 0, + flagUsed = 1 + }; + + ValueInternalLink(); + + ~ValueInternalLink(); + + Value items_[itemPerLink]; + char* keys_[itemPerLink]; + ValueInternalLink* previous_; + ValueInternalLink* next_; +}; + +/** \brief A linked page based hash-table implementation used internally by + *Value. + * \internal ValueInternalMap is a tradional bucket based hash-table, with a + *linked + * list in each bucket to handle collision. There is an addional twist in that + * each node of the collision linked list is a page containing a fixed amount of + * value. This provides a better compromise between memory usage and speed. + * + * Each bucket is made up of a chained list of ValueInternalLink. The last + * link of a given bucket can be found in the 'previous_' field of the following + *bucket. + * The last link of the last bucket is stored in tailLink_ as it has no + *following bucket. + * Only the last link of a bucket may contains 'available' item. The last link + *always + * contains at least one element unless is it the bucket one very first link. + */ +class JSON_API ValueInternalMap { + friend class ValueIteratorBase; + friend class Value; + +public: + typedef unsigned int HashKey; + typedef unsigned int BucketIndex; + +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + struct IteratorState { + IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {} + ValueInternalMap* map_; + ValueInternalLink* link_; + BucketIndex itemIndex_; + BucketIndex bucketIndex_; + }; +#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + + ValueInternalMap(); + ValueInternalMap(const ValueInternalMap& other); + ValueInternalMap& operator=(ValueInternalMap other); + ~ValueInternalMap(); + + void swap(ValueInternalMap& other); + + BucketIndex size() const; + + void clear(); + + bool reserveDelta(BucketIndex growth); + + bool reserve(BucketIndex newItemCount); + + const Value* find(const char* key) const; + + Value* find(const char* key); + + Value& resolveReference(const char* key, bool isStatic); + + void remove(const char* key); + + void doActualRemove(ValueInternalLink* link, + BucketIndex index, + BucketIndex bucketIndex); + + ValueInternalLink*& getLastLinkInBucket(BucketIndex bucketIndex); + + Value& setNewItem(const char* key, + bool isStatic, + ValueInternalLink* link, + BucketIndex index); + + Value& unsafeAdd(const char* key, bool isStatic, HashKey hashedKey); + + HashKey hash(const char* key) const; + + int compare(const ValueInternalMap& other) const; + +private: + void makeBeginIterator(IteratorState& it) const; + void makeEndIterator(IteratorState& it) const; + static bool equals(const IteratorState& x, const IteratorState& other); + static void increment(IteratorState& iterator); + static void incrementBucket(IteratorState& iterator); + static void decrement(IteratorState& iterator); + static const char* key(const IteratorState& iterator); + static const char* key(const IteratorState& iterator, bool& isStatic); + static Value& value(const IteratorState& iterator); + static int distance(const IteratorState& x, const IteratorState& y); + +private: + ValueInternalLink* buckets_; + ValueInternalLink* tailLink_; + BucketIndex bucketsSize_; + BucketIndex itemCount_; +}; + +/** \brief A simplified deque implementation used internally by Value. +* \internal +* It is based on a list of fixed "page", each page contains a fixed number of +*items. +* Instead of using a linked-list, a array of pointer is used for fast item +*look-up. +* Look-up for an element is as follow: +* - compute page index: pageIndex = itemIndex / itemsPerPage +* - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] +* +* Insertion is amortized constant time (only the array containing the index of +*pointers +* need to be reallocated when items are appended). +*/ +class JSON_API ValueInternalArray { + friend class Value; + friend class ValueIteratorBase; + +public: + enum { + itemsPerPage = 8 + }; // should be a power of 2 for fast divide and modulo. + typedef Value::ArrayIndex ArrayIndex; + typedef unsigned int PageIndex; + +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + struct IteratorState // Must be a POD + { + IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {} + ValueInternalArray* array_; + Value** currentPageIndex_; + unsigned int currentItemIndex_; + }; +#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + + ValueInternalArray(); + ValueInternalArray(const ValueInternalArray& other); + ValueInternalArray& operator=(ValueInternalArray other); + ~ValueInternalArray(); + void swap(ValueInternalArray& other); + + void clear(); + void resize(ArrayIndex newSize); + + Value& resolveReference(ArrayIndex index); + + Value* find(ArrayIndex index) const; + + ArrayIndex size() const; + + int compare(const ValueInternalArray& other) const; + +private: + static bool equals(const IteratorState& x, const IteratorState& other); + static void increment(IteratorState& iterator); + static void decrement(IteratorState& iterator); + static Value& dereference(const IteratorState& iterator); + static Value& unsafeDereference(const IteratorState& iterator); + static int distance(const IteratorState& x, const IteratorState& y); + static ArrayIndex indexOf(const IteratorState& iterator); + void makeBeginIterator(IteratorState& it) const; + void makeEndIterator(IteratorState& it) const; + void makeIterator(IteratorState& it, ArrayIndex index) const; + + void makeIndexValid(ArrayIndex index); + + Value** pages_; + ArrayIndex size_; + PageIndex pageCount_; +}; + +/** \brief Experimental: do not use. Allocator to customize Value internal +array. + * Below is an example of a simple implementation (actual implementation use + * memory pool). + \code +class DefaultValueArrayAllocator : public ValueArrayAllocator +{ +public: // overridden from ValueArrayAllocator +virtual ~DefaultValueArrayAllocator() +{ +} + +virtual ValueInternalArray *newArray() +{ + return new ValueInternalArray(); +} + +virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) +{ + return new ValueInternalArray( other ); +} + +virtual void destruct( ValueInternalArray *array ) +{ + delete array; +} + +virtual void reallocateArrayPageIndex( Value **&indexes, + ValueInternalArray::PageIndex +&indexCount, + ValueInternalArray::PageIndex +minNewIndexCount ) +{ + ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; + if ( minNewIndexCount > newIndexCount ) + newIndexCount = minNewIndexCount; + void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); + if ( !newIndexes ) + throw std::bad_alloc(); + indexCount = newIndexCount; + indexes = static_cast( newIndexes ); +} +virtual void releaseArrayPageIndex( Value **indexes, + ValueInternalArray::PageIndex indexCount ) +{ + if ( indexes ) + free( indexes ); +} + +virtual Value *allocateArrayPage() +{ + return static_cast( malloc( sizeof(Value) * +ValueInternalArray::itemsPerPage ) ); +} + +virtual void releaseArrayPage( Value *value ) +{ + if ( value ) + free( value ); +} +}; + \endcode + */ +class JSON_API ValueArrayAllocator { +public: + virtual ~ValueArrayAllocator(); + virtual ValueInternalArray* newArray() = 0; + virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) = 0; + virtual void destructArray(ValueInternalArray* array) = 0; + /** \brief Reallocate array page index. + * Reallocates an array of pointer on each page. + * \param indexes [input] pointer on the current index. May be \c NULL. + * [output] pointer on the new index of at least + * \a minNewIndexCount pages. + * \param indexCount [input] current number of pages in the index. + * [output] number of page the reallocated index can handle. + * \b MUST be >= \a minNewIndexCount. + * \param minNewIndexCount Minimum number of page the new index must be able + * to + * handle. + */ + virtual void + reallocateArrayPageIndex(Value**& indexes, + ValueInternalArray::PageIndex& indexCount, + ValueInternalArray::PageIndex minNewIndexCount) = 0; + virtual void + releaseArrayPageIndex(Value** indexes, + ValueInternalArray::PageIndex indexCount) = 0; + virtual Value* allocateArrayPage() = 0; + virtual void releaseArrayPage(Value* value) = 0; +}; +#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP + +/** \brief base class for Value iterators. + * + */ +class JSON_API ValueIteratorBase { +public: + typedef std::bidirectional_iterator_tag iterator_category; + typedef unsigned int size_t; + typedef int difference_type; + typedef ValueIteratorBase SelfType; + + ValueIteratorBase(); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + explicit ValueIteratorBase(const Value::ObjectValues::iterator& current); +#else + ValueIteratorBase(const ValueInternalArray::IteratorState& state); + ValueIteratorBase(const ValueInternalMap::IteratorState& state); +#endif + + bool operator==(const SelfType& other) const { return isEqual(other); } + + bool operator!=(const SelfType& other) const { return !isEqual(other); } + + difference_type operator-(const SelfType& other) const { + return computeDistance(other); + } + + /// Return either the index or the member name of the referenced value as a + /// Value. + Value key() const; + + /// Return the index of the referenced Value. -1 if it is not an arrayValue. + UInt index() const; + + /// Return the member name of the referenced Value. "" if it is not an + /// objectValue. + const char* memberName() const; + +protected: + Value& deref() const; + + void increment(); + + void decrement(); + + difference_type computeDistance(const SelfType& other) const; + + bool isEqual(const SelfType& other) const; + + void copy(const SelfType& other); + +private: +#ifndef JSON_VALUE_USE_INTERNAL_MAP + Value::ObjectValues::iterator current_; + // Indicates that iterator is for a null value. + bool isNull_; +#else + union { + ValueInternalArray::IteratorState array_; + ValueInternalMap::IteratorState map_; + } iterator_; + bool isArray_; +#endif +}; + +/** \brief const iterator for object and array value. + * + */ +class JSON_API ValueConstIterator : public ValueIteratorBase { + friend class Value; + +public: + typedef const Value value_type; + typedef unsigned int size_t; + typedef int difference_type; + typedef const Value& reference; + typedef const Value* pointer; + typedef ValueConstIterator SelfType; + + ValueConstIterator(); + +private: +/*! \internal Use by Value to create an iterator. + */ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + explicit ValueConstIterator(const Value::ObjectValues::iterator& current); +#else + ValueConstIterator(const ValueInternalArray::IteratorState& state); + ValueConstIterator(const ValueInternalMap::IteratorState& state); +#endif +public: + SelfType& operator=(const ValueIteratorBase& other); + + SelfType operator++(int) { + SelfType temp(*this); + ++*this; + return temp; + } + + SelfType operator--(int) { + SelfType temp(*this); + --*this; + return temp; + } + + SelfType& operator--() { + decrement(); + return *this; + } + + SelfType& operator++() { + increment(); + return *this; + } + + reference operator*() const { return deref(); } + + pointer operator->() const { return &deref(); } +}; + +/** \brief Iterator for object and array value. + */ +class JSON_API ValueIterator : public ValueIteratorBase { + friend class Value; + +public: + typedef Value value_type; + typedef unsigned int size_t; + typedef int difference_type; + typedef Value& reference; + typedef Value* pointer; + typedef ValueIterator SelfType; + + ValueIterator(); + ValueIterator(const ValueConstIterator& other); + ValueIterator(const ValueIterator& other); + +private: +/*! \internal Use by Value to create an iterator. + */ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + explicit ValueIterator(const Value::ObjectValues::iterator& current); +#else + ValueIterator(const ValueInternalArray::IteratorState& state); + ValueIterator(const ValueInternalMap::IteratorState& state); +#endif +public: + SelfType& operator=(const SelfType& other); + + SelfType operator++(int) { + SelfType temp(*this); + ++*this; + return temp; + } + + SelfType operator--(int) { + SelfType temp(*this); + --*this; + return temp; + } + + SelfType& operator--() { + decrement(); + return *this; + } + + SelfType& operator++() { + increment(); + return *this; + } + + reference operator*() const { return deref(); } + + pointer operator->() const { return &deref(); } +}; + +} // namespace Json + +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(pop) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +#endif // CPPTL_JSON_H_INCLUDED diff --git a/Utilities/cmjsoncpp/json/version.h b/Utilities/cmjsoncpp/json/version.h new file mode 100644 index 0000000..380827e --- /dev/null +++ b/Utilities/cmjsoncpp/json/version.h @@ -0,0 +1,16 @@ +// DO NOT EDIT. This file is generated by CMake from "version" +// and "version.h.in" files. +// Run CMake configure step to update it. +#ifndef JSON_VERSION_H_INCLUDED +#define JSON_VERSION_H_INCLUDED + +#define JSONCPP_VERSION_STRING "0.7.0" +#define JSONCPP_VERSION_MAJOR 0 +#define JSONCPP_VERSION_MINOR 7 +#define JSONCPP_VERSION_PATCH 0 +#define JSONCPP_VERSION_QUALIFIER +#define JSONCPP_VERSION_HEXA \ + ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \ + (JSONCPP_VERSION_PATCH << 8)) + +#endif // JSON_VERSION_H_INCLUDED diff --git a/Utilities/cmjsoncpp/json/writer.h b/Utilities/cmjsoncpp/json/writer.h new file mode 100644 index 0000000..dc9e46f --- /dev/null +++ b/Utilities/cmjsoncpp/json/writer.h @@ -0,0 +1,213 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_WRITER_H_INCLUDED +#define JSON_WRITER_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "value.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include + +// Disable warning C4251: : needs to have dll-interface to +// be used by... +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(push) +#pragma warning(disable : 4251) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +namespace Json { + +class Value; + +/** \brief Abstract class for writers. + */ +class JSON_API Writer { +public: + virtual ~Writer(); + + virtual std::string write(const Value& root) = 0; +}; + +/** \brief Outputs a Value in JSON format + *without formatting (not human friendly). + * + * The JSON document is written in a single line. It is not intended for 'human' + *consumption, + * but may be usefull to support feature such as RPC where bandwith is limited. + * \sa Reader, Value + */ +class JSON_API FastWriter : public Writer { +public: + FastWriter(); + virtual ~FastWriter() {} + + void enableYAMLCompatibility(); + + /** \brief Drop the "null" string from the writer's output for nullValues. + * Strictly speaking, this is not valid JSON. But when the output is being + * fed to a browser's Javascript, it makes for smaller output and the + * browser can handle the output just fine. + */ + void dropNullPlaceholders(); + + void omitEndingLineFeed(); + +public: // overridden from Writer + virtual std::string write(const Value& root); + +private: + void writeValue(const Value& value); + + std::string document_; + bool yamlCompatiblityEnabled_; + bool dropNullPlaceholders_; + bool omitEndingLineFeed_; +}; + +/** \brief Writes a Value in JSON format in a + *human friendly way. + * + * The rules for line break and indent are as follow: + * - Object value: + * - if empty then print {} without indent and line break + * - if not empty the print '{', line break & indent, print one value per + *line + * and then unindent and line break and print '}'. + * - Array value: + * - if empty then print [] without indent and line break + * - if the array contains no object value, empty array or some other value + *types, + * and all the values fit on one lines, then print the array on a single + *line. + * - otherwise, it the values do not fit on one line, or the array contains + * object or non empty array, then print one value per line. + * + * If the Value have comments then they are outputed according to their + *#CommentPlacement. + * + * \sa Reader, Value, Value::setComment() + */ +class JSON_API StyledWriter : public Writer { +public: + StyledWriter(); + virtual ~StyledWriter() {} + +public: // overridden from Writer + /** \brief Serialize a Value in JSON format. + * \param root Value to serialize. + * \return String containing the JSON document that represents the root value. + */ + virtual std::string write(const Value& root); + +private: + void writeValue(const Value& value); + void writeArrayValue(const Value& value); + bool isMultineArray(const Value& value); + void pushValue(const std::string& value); + void writeIndent(); + void writeWithIndent(const std::string& value); + void indent(); + void unindent(); + void writeCommentBeforeValue(const Value& root); + void writeCommentAfterValueOnSameLine(const Value& root); + bool hasCommentForValue(const Value& value); + static std::string normalizeEOL(const std::string& text); + + typedef std::vector ChildValues; + + ChildValues childValues_; + std::string document_; + std::string indentString_; + int rightMargin_; + int indentSize_; + bool addChildValues_; +}; + +/** \brief Writes a Value in JSON format in a + human friendly way, + to a stream rather than to a string. + * + * The rules for line break and indent are as follow: + * - Object value: + * - if empty then print {} without indent and line break + * - if not empty the print '{', line break & indent, print one value per + line + * and then unindent and line break and print '}'. + * - Array value: + * - if empty then print [] without indent and line break + * - if the array contains no object value, empty array or some other value + types, + * and all the values fit on one lines, then print the array on a single + line. + * - otherwise, it the values do not fit on one line, or the array contains + * object or non empty array, then print one value per line. + * + * 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 { +public: + StyledStreamWriter(std::string indentation = "\t"); + ~StyledStreamWriter() {} + +public: + /** \brief Serialize a Value in JSON format. + * \param out Stream to write to. (Can be ostringstream, e.g.) + * \param root Value to serialize. + * \note There is no point in deriving from Writer, since write() should not + * return a value. + */ + void write(std::ostream& out, const Value& root); + +private: + void writeValue(const Value& value); + void writeArrayValue(const Value& value); + bool isMultineArray(const Value& value); + void pushValue(const std::string& value); + void writeIndent(); + void writeWithIndent(const std::string& value); + void indent(); + void unindent(); + void writeCommentBeforeValue(const Value& root); + void writeCommentAfterValueOnSameLine(const Value& root); + bool hasCommentForValue(const Value& value); + static std::string normalizeEOL(const std::string& text); + + typedef std::vector ChildValues; + + ChildValues childValues_; + std::ostream* document_; + std::string indentString_; + int rightMargin_; + std::string indentation_; + bool addChildValues_; +}; + +#if defined(JSON_HAS_INT64) +std::string JSON_API valueToString(Int value); +std::string JSON_API valueToString(UInt value); +#endif // if defined(JSON_HAS_INT64) +std::string JSON_API valueToString(LargestInt value); +std::string JSON_API valueToString(LargestUInt value); +std::string JSON_API valueToString(double value); +std::string JSON_API valueToString(bool value); +std::string JSON_API valueToQuotedString(const char* value); + +/// \brief Output using the StyledStreamWriter. +/// \see Json::operator>>() +JSON_API std::ostream& operator<<(std::ostream&, const Value& root); + +} // namespace Json + +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(pop) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +#endif // JSON_WRITER_H_INCLUDED diff --git a/Utilities/cmjsoncpp/json_batchallocator.h b/Utilities/cmjsoncpp/json_batchallocator.h new file mode 100644 index 0000000..3705c20 --- /dev/null +++ b/Utilities/cmjsoncpp/json_batchallocator.h @@ -0,0 +1,122 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED +#define JSONCPP_BATCHALLOCATOR_H_INCLUDED + +#include +#include + +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + +namespace Json { + +/* Fast memory allocator. + * + * This memory allocator allocates memory for a batch of object (specified by + * the page size, the number of object in each page). + * + * It does not allow the destruction of a single object. All the allocated + * objects can be destroyed at once. The memory can be either released or reused + * for future allocation. + * + * The in-place new operator must be used to construct the object using the + * pointer returned by allocate. + */ +template +class BatchAllocator { +public: + BatchAllocator(unsigned int objectsPerPage = 255) + : freeHead_(0), objectsPerPage_(objectsPerPage) { + // printf( "Size: %d => %s\n", sizeof(AllocatedType), + // typeid(AllocatedType).name() ); + assert(sizeof(AllocatedType) * objectPerAllocation >= + sizeof(AllocatedType*)); // We must be able to store a slist in the + // object free space. + assert(objectsPerPage >= 16); + batches_ = allocateBatch(0); // allocated a dummy page + currentBatch_ = batches_; + } + + ~BatchAllocator() { + for (BatchInfo* batch = batches_; batch;) { + BatchInfo* nextBatch = batch->next_; + free(batch); + batch = nextBatch; + } + } + + /// allocate space for an array of objectPerAllocation object. + /// @warning it is the responsability of the caller to call objects + /// constructors. + AllocatedType* allocate() { + if (freeHead_) // returns node from free list. + { + AllocatedType* object = freeHead_; + freeHead_ = *(AllocatedType**)object; + return object; + } + if (currentBatch_->used_ == currentBatch_->end_) { + currentBatch_ = currentBatch_->next_; + while (currentBatch_ && currentBatch_->used_ == currentBatch_->end_) + currentBatch_ = currentBatch_->next_; + + if (!currentBatch_) // no free batch found, allocate a new one + { + currentBatch_ = allocateBatch(objectsPerPage_); + currentBatch_->next_ = batches_; // insert at the head of the list + batches_ = currentBatch_; + } + } + AllocatedType* allocated = currentBatch_->used_; + currentBatch_->used_ += objectPerAllocation; + return allocated; + } + + /// Release the object. + /// @warning it is the responsability of the caller to actually destruct the + /// object. + void release(AllocatedType* object) { + assert(object != 0); + *(AllocatedType**)object = freeHead_; + freeHead_ = object; + } + +private: + struct BatchInfo { + BatchInfo* next_; + AllocatedType* used_; + AllocatedType* end_; + AllocatedType buffer_[objectPerAllocation]; + }; + + // disabled copy constructor and assignement operator. + BatchAllocator(const BatchAllocator&); + void operator=(const BatchAllocator&); + + static BatchInfo* allocateBatch(unsigned int objectsPerPage) { + const unsigned int mallocSize = + sizeof(BatchInfo) - sizeof(AllocatedType) * objectPerAllocation + + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage; + BatchInfo* batch = static_cast(malloc(mallocSize)); + batch->next_ = 0; + batch->used_ = batch->buffer_; + batch->end_ = batch->buffer_ + objectsPerPage; + return batch; + } + + BatchInfo* batches_; + BatchInfo* currentBatch_; + /// Head of a single linked list within the allocated space of freeed object + AllocatedType* freeHead_; + unsigned int objectsPerPage_; +}; + +} // namespace Json + +#endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION + +#endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED +// vim: et ts=2 sts=2 sw=2 tw=0 diff --git a/Utilities/cmjsoncpp/json_reader.cpp b/Utilities/cmjsoncpp/json_reader.cpp new file mode 100644 index 0000000..c6a35bf --- /dev/null +++ b/Utilities/cmjsoncpp/json_reader.cpp @@ -0,0 +1,846 @@ +// Copyright 2007-2011 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include "json_tool.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below +#define snprintf _snprintf +#endif + +#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 +// Disable warning about strdup being deprecated. +#pragma warning(disable : 4996) +#endif + +namespace Json { + +// Implementation of class Features +// //////////////////////////////// + +Features::Features() + : allowComments_(true), strictRoot_(false), + allowDroppedNullPlaceholders_(false), allowNumericKeys_(false) {} + +Features Features::all() { return Features(); } + +Features Features::strictMode() { + Features features; + features.allowComments_ = false; + features.strictRoot_ = true; + features.allowDroppedNullPlaceholders_ = false; + features.allowNumericKeys_ = false; + return features; +} + +// Implementation of class Reader +// //////////////////////////////// + +static inline bool in(Reader::Char c, + Reader::Char c1, + Reader::Char c2, + Reader::Char c3, + Reader::Char c4) { + return c == c1 || c == c2 || c == c3 || c == c4; +} + +static inline bool in(Reader::Char c, + Reader::Char c1, + Reader::Char c2, + Reader::Char c3, + Reader::Char c4, + Reader::Char c5) { + return c == c1 || c == c2 || c == c3 || c == c4 || c == c5; +} + +static bool containsNewLine(Reader::Location begin, Reader::Location end) { + for (; begin < end; ++begin) + if (*begin == '\n' || *begin == '\r') + return true; + return false; +} + +// Class Reader +// ////////////////////////////////////////////////////////////////// + +Reader::Reader() + : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), + lastValue_(), commentsBefore_(), features_(Features::all()), + collectComments_() {} + +Reader::Reader(const Features& features) + : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), + lastValue_(), commentsBefore_(), features_(features), collectComments_() { +} + +bool +Reader::parse(const std::string& document, Value& root, bool collectComments) { + document_ = document; + const char* begin = document_.c_str(); + const char* end = begin + document_.length(); + return parse(begin, end, root, collectComments); +} + +bool Reader::parse(std::istream& sin, Value& root, bool collectComments) { + // std::istream_iterator begin(sin); + // std::istream_iterator end; + // Those would allow streamed input from a file, if parse() were a + // template function. + + // Since std::string is reference-counted, this at least does not + // create an extra copy. + std::string doc; + std::getline(sin, doc, (char)EOF); + return parse(doc, root, collectComments); +} + +bool Reader::parse(const char* beginDoc, + const char* endDoc, + Value& root, + bool collectComments) { + if (!features_.allowComments_) { + collectComments = false; + } + + begin_ = beginDoc; + end_ = endDoc; + collectComments_ = collectComments; + current_ = begin_; + lastValueEnd_ = 0; + lastValue_ = 0; + commentsBefore_ = ""; + errors_.clear(); + while (!nodes_.empty()) + nodes_.pop(); + nodes_.push(&root); + + bool successful = readValue(); + Token token; + skipCommentTokens(token); + if (collectComments_ && !commentsBefore_.empty()) + root.setComment(commentsBefore_, commentAfter); + if (features_.strictRoot_) { + if (!root.isArray() && !root.isObject()) { + // Set error location to start of doc, ideally should be first token found + // in doc + token.type_ = tokenError; + token.start_ = beginDoc; + token.end_ = endDoc; + addError( + "A valid JSON document must be either an array or an object value.", + token); + return false; + } + } + return successful; +} + +bool Reader::readValue() { + Token token; + skipCommentTokens(token); + bool successful = true; + + if (collectComments_ && !commentsBefore_.empty()) { + // Remove newline characters at the end of the comments + size_t lastNonNewline = commentsBefore_.find_last_not_of("\r\n"); + if (lastNonNewline != std::string::npos) { + commentsBefore_.erase(lastNonNewline + 1); + } else { + commentsBefore_.clear(); + } + + currentValue().setComment(commentsBefore_, commentBefore); + commentsBefore_ = ""; + } + + switch (token.type_) { + case tokenObjectBegin: + successful = readObject(token); + currentValue().setOffsetLimit(current_ - begin_); + break; + case tokenArrayBegin: + successful = readArray(token); + currentValue().setOffsetLimit(current_ - begin_); + break; + case tokenNumber: + successful = decodeNumber(token); + break; + case tokenString: + successful = decodeString(token); + break; + case tokenTrue: + currentValue() = true; + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + break; + case tokenFalse: + currentValue() = false; + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + break; + case tokenNull: + currentValue() = Value(); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + break; + case tokenArraySeparator: + if (features_.allowDroppedNullPlaceholders_) { + // "Un-read" the current token and mark the current value as a null + // token. + current_--; + currentValue() = Value(); + currentValue().setOffsetStart(current_ - begin_ - 1); + currentValue().setOffsetLimit(current_ - begin_); + break; + } + // Else, fall through... + default: + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return addError("Syntax error: value, object or array expected.", token); + } + + if (collectComments_) { + lastValueEnd_ = current_; + lastValue_ = ¤tValue(); + } + + return successful; +} + +void Reader::skipCommentTokens(Token& token) { + if (features_.allowComments_) { + do { + readToken(token); + } while (token.type_ == tokenComment); + } else { + readToken(token); + } +} + +bool Reader::expectToken(TokenType type, Token& token, const char* message) { + readToken(token); + if (token.type_ != type) + return addError(message, token); + return true; +} + +bool Reader::readToken(Token& token) { + skipSpaces(); + token.start_ = current_; + Char c = getNextChar(); + bool ok = true; + switch (c) { + case '{': + token.type_ = tokenObjectBegin; + break; + case '}': + token.type_ = tokenObjectEnd; + break; + case '[': + token.type_ = tokenArrayBegin; + break; + case ']': + token.type_ = tokenArrayEnd; + break; + case '"': + token.type_ = tokenString; + ok = readString(); + break; + case '/': + token.type_ = tokenComment; + ok = readComment(); + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + token.type_ = tokenNumber; + readNumber(); + break; + case 't': + token.type_ = tokenTrue; + ok = match("rue", 3); + break; + case 'f': + token.type_ = tokenFalse; + ok = match("alse", 4); + break; + case 'n': + token.type_ = tokenNull; + ok = match("ull", 3); + break; + case ',': + token.type_ = tokenArraySeparator; + break; + case ':': + token.type_ = tokenMemberSeparator; + break; + case 0: + token.type_ = tokenEndOfStream; + break; + default: + ok = false; + break; + } + if (!ok) + token.type_ = tokenError; + token.end_ = current_; + return true; +} + +void Reader::skipSpaces() { + while (current_ != end_) { + Char c = *current_; + if (c == ' ' || c == '\t' || c == '\r' || c == '\n') + ++current_; + else + break; + } +} + +bool Reader::match(Location pattern, int patternLength) { + if (end_ - current_ < patternLength) + return false; + int index = patternLength; + while (index--) + if (current_[index] != pattern[index]) + return false; + current_ += patternLength; + return true; +} + +bool Reader::readComment() { + Location commentBegin = current_ - 1; + Char c = getNextChar(); + bool successful = false; + if (c == '*') + successful = readCStyleComment(); + else if (c == '/') + successful = readCppStyleComment(); + if (!successful) + return false; + + if (collectComments_) { + CommentPlacement placement = commentBefore; + if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) { + if (c != '*' || !containsNewLine(commentBegin, current_)) + placement = commentAfterOnSameLine; + } + + addComment(commentBegin, current_, placement); + } + return true; +} + +void +Reader::addComment(Location begin, Location end, CommentPlacement placement) { + assert(collectComments_); + if (placement == commentAfterOnSameLine) { + assert(lastValue_ != 0); + lastValue_->setComment(std::string(begin, end), placement); + } else { + commentsBefore_ += std::string(begin, end); + } +} + +bool Reader::readCStyleComment() { + while (current_ != end_) { + Char c = getNextChar(); + if (c == '*' && *current_ == '/') + break; + } + return getNextChar() == '/'; +} + +bool Reader::readCppStyleComment() { + while (current_ != end_) { + Char c = getNextChar(); + if (c == '\r' || c == '\n') + break; + } + return true; +} + +void Reader::readNumber() { + while (current_ != end_) { + if (!(*current_ >= '0' && *current_ <= '9') && + !in(*current_, '.', 'e', 'E', '+', '-')) + break; + ++current_; + } +} + +bool Reader::readString() { + Char c = 0; + while (current_ != end_) { + c = getNextChar(); + if (c == '\\') + getNextChar(); + else if (c == '"') + break; + } + return c == '"'; +} + +bool Reader::readObject(Token& tokenStart) { + Token tokenName; + std::string name; + currentValue() = Value(objectValue); + currentValue().setOffsetStart(tokenStart.start_ - begin_); + while (readToken(tokenName)) { + bool initialTokenOk = true; + while (tokenName.type_ == tokenComment && initialTokenOk) + initialTokenOk = readToken(tokenName); + if (!initialTokenOk) + break; + if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object + return true; + name = ""; + if (tokenName.type_ == tokenString) { + if (!decodeString(tokenName, name)) + return recoverFromError(tokenObjectEnd); + } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) { + Value numberName; + if (!decodeNumber(tokenName, numberName)) + return recoverFromError(tokenObjectEnd); + name = numberName.asString(); + } else { + break; + } + + Token colon; + if (!readToken(colon) || colon.type_ != tokenMemberSeparator) { + return addErrorAndRecover( + "Missing ':' after object member name", colon, tokenObjectEnd); + } + Value& value = currentValue()[name]; + nodes_.push(&value); + bool ok = readValue(); + nodes_.pop(); + if (!ok) // error already set + return recoverFromError(tokenObjectEnd); + + Token comma; + if (!readToken(comma) || + (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator && + comma.type_ != tokenComment)) { + return addErrorAndRecover( + "Missing ',' or '}' in object declaration", comma, tokenObjectEnd); + } + bool finalizeTokenOk = true; + while (comma.type_ == tokenComment && finalizeTokenOk) + finalizeTokenOk = readToken(comma); + if (comma.type_ == tokenObjectEnd) + return true; + } + return addErrorAndRecover( + "Missing '}' or object member name", tokenName, tokenObjectEnd); +} + +bool Reader::readArray(Token& tokenStart) { + currentValue() = Value(arrayValue); + currentValue().setOffsetStart(tokenStart.start_ - begin_); + skipSpaces(); + if (*current_ == ']') // empty array + { + Token endArray; + readToken(endArray); + return true; + } + int index = 0; + for (;;) { + Value& value = currentValue()[index++]; + nodes_.push(&value); + bool ok = readValue(); + nodes_.pop(); + if (!ok) // error already set + return recoverFromError(tokenArrayEnd); + + Token token; + // Accept Comment after last item in the array. + ok = readToken(token); + while (token.type_ == tokenComment && ok) { + ok = readToken(token); + } + bool badTokenType = + (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd); + if (!ok || badTokenType) { + return addErrorAndRecover( + "Missing ',' or ']' in array declaration", token, tokenArrayEnd); + } + if (token.type_ == tokenArrayEnd) + break; + } + return true; +} + +bool Reader::decodeNumber(Token& token) { + Value decoded; + if (!decodeNumber(token, decoded)) + return false; + currentValue() = decoded; + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool Reader::decodeNumber(Token& token, Value& decoded) { + bool isDouble = false; + for (Location inspect = token.start_; inspect != token.end_; ++inspect) { + isDouble = isDouble || in(*inspect, '.', 'e', 'E', '+') || + (*inspect == '-' && inspect != token.start_); + } + if (isDouble) + return decodeDouble(token, decoded); + // Attempts to parse the number as an integer. If the number is + // larger than the maximum supported value of an integer then + // we decode the number as a double. + Location current = token.start_; + bool isNegative = *current == '-'; + if (isNegative) + ++current; + Value::LargestUInt maxIntegerValue = + isNegative ? Value::LargestUInt(-Value::minLargestInt) + : Value::maxLargestUInt; + Value::LargestUInt threshold = maxIntegerValue / 10; + Value::LargestUInt value = 0; + while (current < token.end_) { + Char c = *current++; + if (c < '0' || c > '9') + return addError("'" + std::string(token.start_, token.end_) + + "' is not a number.", + token); + Value::UInt digit(c - '0'); + if (value >= threshold) { + // We've hit or exceeded the max value divided by 10 (rounded down). If + // a) we've only just touched the limit, b) this is the last digit, and + // c) it's small enough to fit in that rounding delta, we're okay. + // Otherwise treat this number as a double to avoid overflow. + if (value > threshold || current != token.end_ || + digit > maxIntegerValue % 10) { + return decodeDouble(token, decoded); + } + } + value = value * 10 + digit; + } + if (isNegative) + decoded = -Value::LargestInt(value); + else if (value <= Value::LargestUInt(Value::maxInt)) + decoded = Value::LargestInt(value); + else + decoded = value; + return true; +} + +bool Reader::decodeDouble(Token& token) { + Value decoded; + if (!decodeDouble(token, decoded)) + return false; + currentValue() = decoded; + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool Reader::decodeDouble(Token& token, Value& decoded) { + double value = 0; + const int bufferSize = 32; + int count; + int length = int(token.end_ - token.start_); + + // Sanity check to avoid buffer overflow exploits. + if (length < 0) { + return addError("Unable to parse token length", token); + } + + // Avoid using a string constant for the format control string given to + // sscanf, as this can cause hard to debug crashes on OS X. See here for more + // info: + // + // http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html + char format[] = "%lf"; + + if (length <= bufferSize) { + Char buffer[bufferSize + 1]; + memcpy(buffer, token.start_, length); + buffer[length] = 0; + count = sscanf(buffer, format, &value); + } else { + std::string buffer(token.start_, token.end_); + count = sscanf(buffer.c_str(), format, &value); + } + + if (count != 1) + return addError("'" + std::string(token.start_, token.end_) + + "' is not a number.", + token); + decoded = value; + return true; +} + +bool Reader::decodeString(Token& token) { + std::string decoded; + if (!decodeString(token, decoded)) + return false; + currentValue() = decoded; + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool Reader::decodeString(Token& token, std::string& decoded) { + decoded.reserve(token.end_ - token.start_ - 2); + Location current = token.start_ + 1; // skip '"' + Location end = token.end_ - 1; // do not include '"' + while (current != end) { + Char c = *current++; + if (c == '"') + break; + else if (c == '\\') { + if (current == end) + return addError("Empty escape sequence in string", token, current); + Char escape = *current++; + switch (escape) { + case '"': + decoded += '"'; + break; + case '/': + decoded += '/'; + break; + case '\\': + decoded += '\\'; + break; + case 'b': + decoded += '\b'; + break; + case 'f': + decoded += '\f'; + break; + case 'n': + decoded += '\n'; + break; + case 'r': + decoded += '\r'; + break; + case 't': + decoded += '\t'; + break; + case 'u': { + unsigned int unicode; + if (!decodeUnicodeCodePoint(token, current, end, unicode)) + return false; + decoded += codePointToUTF8(unicode); + } break; + default: + return addError("Bad escape sequence in string", token, current); + } + } else { + decoded += c; + } + } + return true; +} + +bool Reader::decodeUnicodeCodePoint(Token& token, + Location& current, + Location end, + unsigned int& unicode) { + + if (!decodeUnicodeEscapeSequence(token, current, end, unicode)) + return false; + if (unicode >= 0xD800 && unicode <= 0xDBFF) { + // surrogate pairs + if (end - current < 6) + return addError( + "additional six characters expected to parse unicode surrogate pair.", + token, + current); + unsigned int surrogatePair; + if (*(current++) == '\\' && *(current++) == 'u') { + if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) { + unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF); + } else + return false; + } else + return addError("expecting another \\u token to begin the second half of " + "a unicode surrogate pair", + token, + current); + } + return true; +} + +bool Reader::decodeUnicodeEscapeSequence(Token& token, + Location& current, + Location end, + unsigned int& unicode) { + if (end - current < 4) + return addError( + "Bad unicode escape sequence in string: four digits expected.", + token, + current); + unicode = 0; + for (int index = 0; index < 4; ++index) { + Char c = *current++; + unicode *= 16; + if (c >= '0' && c <= '9') + unicode += c - '0'; + else if (c >= 'a' && c <= 'f') + unicode += c - 'a' + 10; + else if (c >= 'A' && c <= 'F') + unicode += c - 'A' + 10; + else + return addError( + "Bad unicode escape sequence in string: hexadecimal digit expected.", + token, + current); + } + return true; +} + +bool +Reader::addError(const std::string& message, Token& token, Location extra) { + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = extra; + errors_.push_back(info); + return false; +} + +bool Reader::recoverFromError(TokenType skipUntilToken) { + int errorCount = int(errors_.size()); + Token skip; + for (;;) { + if (!readToken(skip)) + errors_.resize(errorCount); // discard errors caused by recovery + if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream) + break; + } + errors_.resize(errorCount); + return false; +} + +bool Reader::addErrorAndRecover(const std::string& message, + Token& token, + TokenType skipUntilToken) { + addError(message, token); + return recoverFromError(skipUntilToken); +} + +Value& Reader::currentValue() { return *(nodes_.top()); } + +Reader::Char Reader::getNextChar() { + if (current_ == end_) + return 0; + return *current_++; +} + +void Reader::getLocationLineAndColumn(Location location, + int& line, + int& column) const { + Location current = begin_; + Location lastLineStart = current; + line = 0; + while (current < location && current != end_) { + Char c = *current++; + if (c == '\r') { + if (*current == '\n') + ++current; + lastLineStart = current; + ++line; + } else if (c == '\n') { + lastLineStart = current; + ++line; + } + } + // column & line start at 1 + column = int(location - lastLineStart) + 1; + ++line; +} + +std::string Reader::getLocationLineAndColumn(Location location) const { + int line, column; + getLocationLineAndColumn(location, line, column); + char buffer[18 + 16 + 16 + 1]; +#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) +#if defined(WINCE) + _snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#else + sprintf_s(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#endif +#else + snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#endif + return buffer; +} + +// Deprecated. Preserved for backward compatibility +std::string Reader::getFormatedErrorMessages() const { + return getFormattedErrorMessages(); +} + +std::string Reader::getFormattedErrorMessages() const { + std::string formattedMessage; + for (Errors::const_iterator itError = errors_.begin(); + itError != errors_.end(); + ++itError) { + const ErrorInfo& error = *itError; + formattedMessage += + "* " + getLocationLineAndColumn(error.token_.start_) + "\n"; + formattedMessage += " " + error.message_ + "\n"; + if (error.extra_) + formattedMessage += + "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n"; + } + return formattedMessage; +} + +std::vector Reader::getStructuredErrors() const { + std::vector allErrors; + for (Errors::const_iterator itError = errors_.begin(); + itError != errors_.end(); + ++itError) { + const ErrorInfo& error = *itError; + Reader::StructuredError structured; + structured.offset_start = error.token_.start_ - begin_; + structured.offset_limit = error.token_.end_ - begin_; + structured.message = error.message_; + allErrors.push_back(structured); + } + return allErrors; +} + +std::istream& operator>>(std::istream& sin, Value& root) { + Json::Reader reader; + bool ok = reader.parse(sin, root, true); + if (!ok) { + fprintf(stderr, + "Error from reader: %s", + reader.getFormattedErrorMessages().c_str()); + + JSON_FAIL_MESSAGE("reader error"); + } + return sin; +} + +} // namespace Json diff --git a/Utilities/cmjsoncpp/json_tool.h b/Utilities/cmjsoncpp/json_tool.h new file mode 100644 index 0000000..306a87a --- /dev/null +++ b/Utilities/cmjsoncpp/json_tool.h @@ -0,0 +1,88 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED +#define LIB_JSONCPP_JSON_TOOL_H_INCLUDED + +/* This header provides common string manipulation support, such as UTF-8, + * portable conversion from/to string... + * + * It is an internal header that must not be exposed. + */ + +namespace Json { + +/// Converts a unicode code-point to UTF-8. +static inline std::string codePointToUTF8(unsigned int cp) { + std::string result; + + // based on description from http://en.wikipedia.org/wiki/UTF-8 + + if (cp <= 0x7f) { + result.resize(1); + result[0] = static_cast(cp); + } else if (cp <= 0x7FF) { + result.resize(2); + result[1] = static_cast(0x80 | (0x3f & cp)); + result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); + } else if (cp <= 0xFFFF) { + result.resize(3); + result[2] = static_cast(0x80 | (0x3f & cp)); + result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); + result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); + } else if (cp <= 0x10FFFF) { + result.resize(4); + result[3] = static_cast(0x80 | (0x3f & cp)); + result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); + result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); + result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); + } + + return result; +} + +/// Returns true if ch is a control character (in range [0,32[). +static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; } + +enum { + /// Constant that specify the size of the buffer that must be passed to + /// uintToString. + uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 +}; + +// Defines a char buffer for use with uintToString(). +typedef char UIntToStringBuffer[uintToStringBufferSize]; + +/** Converts an unsigned integer to string. + * @param value Unsigned interger to convert to string + * @param current Input/Output string buffer. + * Must have at least uintToStringBufferSize chars free. + */ +static inline void uintToString(LargestUInt value, char*& current) { + *--current = 0; + do { + *--current = char(value % 10) + '0'; + value /= 10; + } while (value != 0); +} + +/** Change ',' to '.' everywhere in buffer. + * + * We had a sophisticated way, but it did not work in WinCE. + * @see https://github.com/open-source-parsers/jsoncpp/pull/9 + */ +static inline void fixNumericLocale(char* begin, char* end) { + while (begin < end) { + if (*begin == ',') { + *begin = '.'; + } + ++begin; + } +} + +} // namespace Json { + +#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED +// vim: et ts=2 sts=2 sw=2 tw=0 diff --git a/Utilities/cmjsoncpp/json_value.cpp b/Utilities/cmjsoncpp/json_value.cpp new file mode 100644 index 0000000..a656cce --- /dev/null +++ b/Utilities/cmjsoncpp/json_value.cpp @@ -0,0 +1,1541 @@ +// Copyright 2011 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +#include "json_batchallocator.h" +#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include +#include +#ifdef JSON_USE_CPPTL +#include +#endif +#include // size_t + +#define JSON_ASSERT_UNREACHABLE assert(false) + +namespace Json { + +// This is a walkaround to avoid the static initialization of Value::null. +// kNull must be word-aligned to avoid crashing on ARM. We use an alignment of +// 8 (instead of 4) as a bit of future-proofing. +#if defined(__ARMEL__) +#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment))) +#else +#define ALIGNAS(byte_alignment) +#endif +static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 }; +const unsigned char& kNullRef = kNull[0]; +const Value& Value::null = reinterpret_cast(kNullRef); + +const Int Value::minInt = Int(~(UInt(-1) / 2)); +const Int Value::maxInt = Int(UInt(-1) / 2); +const UInt Value::maxUInt = UInt(-1); +#if defined(JSON_HAS_INT64) +const Int64 Value::minInt64 = Int64(~(UInt64(-1) / 2)); +const Int64 Value::maxInt64 = Int64(UInt64(-1) / 2); +const UInt64 Value::maxUInt64 = UInt64(-1); +// The constant is hard-coded because some compiler have trouble +// converting Value::maxUInt64 to a double correctly (AIX/xlC). +// Assumes that UInt64 is a 64 bits integer. +static const double maxUInt64AsDouble = 18446744073709551615.0; +#endif // defined(JSON_HAS_INT64) +const LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2)); +const LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2); +const LargestUInt Value::maxLargestUInt = LargestUInt(-1); + +/// Unknown size marker +static const unsigned int unknown = (unsigned)-1; + +#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) +template +static inline bool InRange(double d, T min, U max) { + return d >= min && d <= max; +} +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) +static inline double integerToDouble(Json::UInt64 value) { + return static_cast(Int64(value / 2)) * 2.0 + Int64(value & 1); +} + +template static inline double integerToDouble(T value) { + return static_cast(value); +} + +template +static inline bool InRange(double d, T min, U max) { + return d >= integerToDouble(min) && d <= integerToDouble(max); +} +#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + +/** Duplicates the specified string value. + * @param value Pointer to the string to duplicate. Must be zero-terminated if + * length is "unknown". + * @param length Length of the value. if equals to unknown, then it will be + * computed using strlen(value). + * @return Pointer on the duplicate instance of string. + */ +static inline char* duplicateStringValue(const char* value, + unsigned int length = unknown) { + if (length == unknown) + length = (unsigned int)strlen(value); + + // Avoid an integer overflow in the call to malloc below by limiting length + // to a sane value. + if (length >= (unsigned)Value::maxInt) + length = Value::maxInt - 1; + + char* newString = static_cast(malloc(length + 1)); + JSON_ASSERT_MESSAGE(newString != 0, + "in Json::Value::duplicateStringValue(): " + "Failed to allocate string value buffer"); + memcpy(newString, value, length); + newString[length] = 0; + return newString; +} + +/** Free the string duplicated by duplicateStringValue(). + */ +static inline void releaseStringValue(char* value) { free(value); } + +} // namespace Json + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ValueInternals... +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +#if !defined(JSON_IS_AMALGAMATION) +#ifdef JSON_VALUE_USE_INTERNAL_MAP +#include "json_internalarray.inl" +#include "json_internalmap.inl" +#endif // JSON_VALUE_USE_INTERNAL_MAP + +#include "json_valueiterator.inl" +#endif // if !defined(JSON_IS_AMALGAMATION) + +namespace Json { + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::CommentInfo +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +Value::CommentInfo::CommentInfo() : comment_(0) {} + +Value::CommentInfo::~CommentInfo() { + if (comment_) + releaseStringValue(comment_); +} + +void Value::CommentInfo::setComment(const char* text) { + if (comment_) + releaseStringValue(comment_); + JSON_ASSERT(text != 0); + JSON_ASSERT_MESSAGE( + text[0] == '\0' || text[0] == '/', + "in Json::Value::setComment(): Comments must start with /"); + // It seems that /**/ style comments are acceptable as well. + comment_ = duplicateStringValue(text); +} + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::CZString +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +#ifndef JSON_VALUE_USE_INTERNAL_MAP + +// Notes: index_ indicates if the string was allocated when +// a string is stored. + +Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {} + +Value::CZString::CZString(const char* cstr, DuplicationPolicy allocate) + : cstr_(allocate == duplicate ? duplicateStringValue(cstr) : cstr), + index_(allocate) {} + +Value::CZString::CZString(const CZString& other) + : cstr_(other.index_ != noDuplication && other.cstr_ != 0 + ? duplicateStringValue(other.cstr_) + : other.cstr_), + index_(other.cstr_ + ? (other.index_ == noDuplication ? noDuplication : duplicate) + : other.index_) {} + +Value::CZString::~CZString() { + if (cstr_ && index_ == duplicate) + releaseStringValue(const_cast(cstr_)); +} + +void Value::CZString::swap(CZString& other) { + std::swap(cstr_, other.cstr_); + std::swap(index_, other.index_); +} + +Value::CZString& Value::CZString::operator=(CZString other) { + swap(other); + return *this; +} + +bool Value::CZString::operator<(const CZString& other) const { + if (cstr_) + return strcmp(cstr_, other.cstr_) < 0; + return index_ < other.index_; +} + +bool Value::CZString::operator==(const CZString& other) const { + if (cstr_) + return strcmp(cstr_, other.cstr_) == 0; + return index_ == other.index_; +} + +ArrayIndex Value::CZString::index() const { return index_; } + +const char* Value::CZString::c_str() const { return cstr_; } + +bool Value::CZString::isStaticString() const { return index_ == noDuplication; } + +#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::Value +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +/*! \internal Default constructor initialization must be equivalent to: + * memset( this, 0, sizeof(Value) ) + * This optimization is used in ValueInternalMap fast allocator. + */ +Value::Value(ValueType type) + : type_(type), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + switch (type) { + case nullValue: + break; + case intValue: + case uintValue: + value_.int_ = 0; + break; + case realValue: + value_.real_ = 0.0; + break; + case stringValue: + value_.string_ = 0; + break; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + value_.map_ = new ObjectValues(); + break; +#else + case arrayValue: + value_.array_ = arrayAllocator()->newArray(); + break; + case objectValue: + value_.map_ = mapAllocator()->newMap(); + break; +#endif + case booleanValue: + value_.bool_ = false; + break; + default: + JSON_ASSERT_UNREACHABLE; + } +} + +Value::Value(UInt value) + : type_(uintValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + value_.uint_ = value; +} + +Value::Value(Int value) + : type_(intValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + value_.int_ = value; +} + +#if defined(JSON_HAS_INT64) +Value::Value(Int64 value) + : type_(intValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + value_.int_ = value; +} + +Value::Value(UInt64 value) + : type_(uintValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + value_.uint_ = value; +} +#endif // defined(JSON_HAS_INT64) + +Value::Value(double value) + : type_(realValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + value_.real_ = value; +} + +Value::Value(const char* value) + : type_(stringValue), allocated_(true) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + value_.string_ = duplicateStringValue(value); +} + +Value::Value(const char* beginValue, const char* endValue) + : type_(stringValue), allocated_(true) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + value_.string_ = + duplicateStringValue(beginValue, (unsigned int)(endValue - beginValue)); +} + +Value::Value(const std::string& value) + : type_(stringValue), allocated_(true) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + value_.string_ = + duplicateStringValue(value.c_str(), (unsigned int)value.length()); +} + +Value::Value(const StaticString& value) + : type_(stringValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + value_.string_ = const_cast(value.c_str()); +} + +#ifdef JSON_USE_CPPTL +Value::Value(const CppTL::ConstString& value) + : type_(stringValue), allocated_(true) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + value_.string_ = duplicateStringValue(value, value.length()); +} +#endif + +Value::Value(bool value) + : type_(booleanValue), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(0), limit_(0) { + value_.bool_ = value; +} + +Value::Value(const Value& other) + : type_(other.type_), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(other.start_), limit_(other.limit_) { + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + value_ = other.value_; + break; + case stringValue: + if (other.value_.string_) { + value_.string_ = duplicateStringValue(other.value_.string_); + allocated_ = true; + } else { + value_.string_ = 0; + allocated_ = false; + } + break; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + value_.map_ = new ObjectValues(*other.value_.map_); + break; +#else + case arrayValue: + value_.array_ = arrayAllocator()->newArrayCopy(*other.value_.array_); + break; + case objectValue: + value_.map_ = mapAllocator()->newMapCopy(*other.value_.map_); + break; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + if (other.comments_) { + comments_ = new CommentInfo[numberOfCommentPlacement]; + for (int comment = 0; comment < numberOfCommentPlacement; ++comment) { + const CommentInfo& otherComment = other.comments_[comment]; + if (otherComment.comment_) + comments_[comment].setComment(otherComment.comment_); + } + } +} + +Value::~Value() { + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + break; + case stringValue: + if (allocated_) + releaseStringValue(value_.string_); + break; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + delete value_.map_; + break; +#else + case arrayValue: + arrayAllocator()->destructArray(value_.array_); + break; + case objectValue: + mapAllocator()->destructMap(value_.map_); + break; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + + if (comments_) + delete[] comments_; +} + +Value& Value::operator=(Value other) { + swap(other); + return *this; +} + +void Value::swap(Value& other) { + ValueType temp = type_; + type_ = other.type_; + other.type_ = temp; + std::swap(value_, other.value_); + int temp2 = allocated_; + allocated_ = other.allocated_; + other.allocated_ = temp2; + std::swap(start_, other.start_); + std::swap(limit_, other.limit_); +} + +ValueType Value::type() const { return type_; } + +int Value::compare(const Value& other) const { + if (*this < other) + return -1; + if (*this > other) + return 1; + return 0; +} + +bool Value::operator<(const Value& other) const { + int typeDelta = type_ - other.type_; + if (typeDelta) + return typeDelta < 0 ? true : false; + switch (type_) { + case nullValue: + return false; + case intValue: + return value_.int_ < other.value_.int_; + case uintValue: + return value_.uint_ < other.value_.uint_; + case realValue: + return value_.real_ < other.value_.real_; + case booleanValue: + return value_.bool_ < other.value_.bool_; + case stringValue: + return (value_.string_ == 0 && other.value_.string_) || + (other.value_.string_ && value_.string_ && + strcmp(value_.string_, other.value_.string_) < 0); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: { + int delta = int(value_.map_->size() - other.value_.map_->size()); + if (delta) + return delta < 0; + return (*value_.map_) < (*other.value_.map_); + } +#else + case arrayValue: + return value_.array_->compare(*(other.value_.array_)) < 0; + case objectValue: + return value_.map_->compare(*(other.value_.map_)) < 0; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + return false; // unreachable +} + +bool Value::operator<=(const Value& other) const { return !(other < *this); } + +bool Value::operator>=(const Value& other) const { return !(*this < other); } + +bool Value::operator>(const Value& other) const { return other < *this; } + +bool Value::operator==(const Value& other) const { + // if ( type_ != other.type_ ) + // GCC 2.95.3 says: + // attempt to take address of bit-field structure member `Json::Value::type_' + // Beats me, but a temp solves the problem. + int temp = other.type_; + if (type_ != temp) + return false; + switch (type_) { + case nullValue: + return true; + case intValue: + return value_.int_ == other.value_.int_; + case uintValue: + return value_.uint_ == other.value_.uint_; + case realValue: + return value_.real_ == other.value_.real_; + case booleanValue: + return value_.bool_ == other.value_.bool_; + case stringValue: + return (value_.string_ == other.value_.string_) || + (other.value_.string_ && value_.string_ && + strcmp(value_.string_, other.value_.string_) == 0); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + return value_.map_->size() == other.value_.map_->size() && + (*value_.map_) == (*other.value_.map_); +#else + case arrayValue: + return value_.array_->compare(*(other.value_.array_)) == 0; + case objectValue: + return value_.map_->compare(*(other.value_.map_)) == 0; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + return false; // unreachable +} + +bool Value::operator!=(const Value& other) const { return !(*this == other); } + +const char* Value::asCString() const { + JSON_ASSERT_MESSAGE(type_ == stringValue, + "in Json::Value::asCString(): requires stringValue"); + return value_.string_; +} + +std::string Value::asString() const { + switch (type_) { + case nullValue: + return ""; + case stringValue: + return value_.string_ ? value_.string_ : ""; + case booleanValue: + return value_.bool_ ? "true" : "false"; + case intValue: + return valueToString(value_.int_); + case uintValue: + return valueToString(value_.uint_); + case realValue: + return valueToString(value_.real_); + default: + JSON_FAIL_MESSAGE("Type is not convertible to string"); + } +} + +#ifdef JSON_USE_CPPTL +CppTL::ConstString Value::asConstString() const { + return CppTL::ConstString(asString().c_str()); +} +#endif + +Value::Int Value::asInt() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isInt(), "LargestInt out of Int range"); + return Int(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isInt(), "LargestUInt out of Int range"); + return Int(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt), + "double out of Int range"); + return Int(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to Int."); +} + +Value::UInt Value::asUInt() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range"); + return UInt(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range"); + return UInt(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt), + "double out of UInt range"); + return UInt(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to UInt."); +} + +#if defined(JSON_HAS_INT64) + +Value::Int64 Value::asInt64() const { + switch (type_) { + case intValue: + return Int64(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range"); + return Int64(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64), + "double out of Int64 range"); + return Int64(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to Int64."); +} + +Value::UInt64 Value::asUInt64() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range"); + return UInt64(value_.int_); + case uintValue: + return UInt64(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64), + "double out of UInt64 range"); + return UInt64(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to UInt64."); +} +#endif // if defined(JSON_HAS_INT64) + +LargestInt Value::asLargestInt() const { +#if defined(JSON_NO_INT64) + return asInt(); +#else + return asInt64(); +#endif +} + +LargestUInt Value::asLargestUInt() const { +#if defined(JSON_NO_INT64) + return asUInt(); +#else + return asUInt64(); +#endif +} + +double Value::asDouble() const { + switch (type_) { + case intValue: + return static_cast(value_.int_); + case uintValue: +#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return static_cast(value_.uint_); +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return integerToDouble(value_.uint_); +#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + case realValue: + return value_.real_; + case nullValue: + return 0.0; + case booleanValue: + return value_.bool_ ? 1.0 : 0.0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to double."); +} + +float Value::asFloat() const { + switch (type_) { + case intValue: + return static_cast(value_.int_); + case uintValue: +#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return static_cast(value_.uint_); +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return integerToDouble(value_.uint_); +#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + case realValue: + return static_cast(value_.real_); + case nullValue: + return 0.0; + case booleanValue: + return value_.bool_ ? 1.0f : 0.0f; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to float."); +} + +bool Value::asBool() const { + switch (type_) { + case booleanValue: + return value_.bool_; + case nullValue: + return false; + case intValue: + return value_.int_ ? true : false; + case uintValue: + return value_.uint_ ? true : false; + case realValue: + return value_.real_ ? true : false; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to bool."); +} + +bool Value::isConvertibleTo(ValueType other) const { + switch (other) { + case nullValue: + return (isNumeric() && asDouble() == 0.0) || + (type_ == booleanValue && value_.bool_ == false) || + (type_ == stringValue && asString() == "") || + (type_ == arrayValue && value_.map_->size() == 0) || + (type_ == objectValue && value_.map_->size() == 0) || + type_ == nullValue; + case intValue: + return isInt() || + (type_ == realValue && InRange(value_.real_, minInt, maxInt)) || + type_ == booleanValue || type_ == nullValue; + case uintValue: + return isUInt() || + (type_ == realValue && InRange(value_.real_, 0, maxUInt)) || + type_ == booleanValue || type_ == nullValue; + case realValue: + return isNumeric() || type_ == booleanValue || type_ == nullValue; + case booleanValue: + return isNumeric() || type_ == booleanValue || type_ == nullValue; + case stringValue: + return isNumeric() || type_ == booleanValue || type_ == stringValue || + type_ == nullValue; + case arrayValue: + return type_ == arrayValue || type_ == nullValue; + case objectValue: + return type_ == objectValue || type_ == nullValue; + } + JSON_ASSERT_UNREACHABLE; + return false; +} + +/// Number of values in array or object +ArrayIndex Value::size() const { + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + case stringValue: + return 0; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: // size of the array is highest index + 1 + if (!value_.map_->empty()) { + ObjectValues::const_iterator itLast = value_.map_->end(); + --itLast; + return (*itLast).first.index() + 1; + } + return 0; + case objectValue: + return ArrayIndex(value_.map_->size()); +#else + case arrayValue: + return Int(value_.array_->size()); + case objectValue: + return Int(value_.map_->size()); +#endif + } + JSON_ASSERT_UNREACHABLE; + return 0; // unreachable; +} + +bool Value::empty() const { + if (isNull() || isArray() || isObject()) + return size() == 0u; + else + return false; +} + +bool Value::operator!() const { return isNull(); } + +void Value::clear() { + JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue || + type_ == objectValue, + "in Json::Value::clear(): requires complex value"); + start_ = 0; + limit_ = 0; + switch (type_) { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + value_.map_->clear(); + break; +#else + case arrayValue: + value_.array_->clear(); + break; + case objectValue: + value_.map_->clear(); + break; +#endif + default: + break; + } +} + +void Value::resize(ArrayIndex newSize) { + JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue, + "in Json::Value::resize(): requires arrayValue"); + if (type_ == nullValue) + *this = Value(arrayValue); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + ArrayIndex oldSize = size(); + if (newSize == 0) + clear(); + else if (newSize > oldSize) + (*this)[newSize - 1]; + else { + for (ArrayIndex index = newSize; index < oldSize; ++index) { + value_.map_->erase(index); + } + assert(size() == newSize); + } +#else + value_.array_->resize(newSize); +#endif +} + +Value& Value::operator[](ArrayIndex index) { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == arrayValue, + "in Json::Value::operator[](ArrayIndex): requires arrayValue"); + if (type_ == nullValue) + *this = Value(arrayValue); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString key(index); + ObjectValues::iterator it = value_.map_->lower_bound(key); + if (it != value_.map_->end() && (*it).first == key) + return (*it).second; + + ObjectValues::value_type defaultValue(key, null); + it = value_.map_->insert(it, defaultValue); + return (*it).second; +#else + return value_.array_->resolveReference(index); +#endif +} + +Value& Value::operator[](int index) { + JSON_ASSERT_MESSAGE( + index >= 0, + "in Json::Value::operator[](int index): index cannot be negative"); + return (*this)[ArrayIndex(index)]; +} + +const Value& Value::operator[](ArrayIndex index) const { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == arrayValue, + "in Json::Value::operator[](ArrayIndex)const: requires arrayValue"); + if (type_ == nullValue) + return null; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString key(index); + ObjectValues::const_iterator it = value_.map_->find(key); + if (it == value_.map_->end()) + return null; + return (*it).second; +#else + Value* value = value_.array_->find(index); + return value ? *value : null; +#endif +} + +const Value& Value::operator[](int index) const { + JSON_ASSERT_MESSAGE( + index >= 0, + "in Json::Value::operator[](int index) const: index cannot be negative"); + return (*this)[ArrayIndex(index)]; +} + +Value& Value::operator[](const char* key) { + return resolveReference(key, false); +} + +Value& Value::resolveReference(const char* key, bool isStatic) { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == objectValue, + "in Json::Value::resolveReference(): requires objectValue"); + if (type_ == nullValue) + *this = Value(objectValue); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString actualKey( + key, isStatic ? CZString::noDuplication : CZString::duplicateOnCopy); + ObjectValues::iterator it = value_.map_->lower_bound(actualKey); + if (it != value_.map_->end() && (*it).first == actualKey) + return (*it).second; + + ObjectValues::value_type defaultValue(actualKey, null); + it = value_.map_->insert(it, defaultValue); + Value& value = (*it).second; + return value; +#else + return value_.map_->resolveReference(key, isStatic); +#endif +} + +Value Value::get(ArrayIndex index, const Value& defaultValue) const { + const Value* value = &((*this)[index]); + return value == &null ? defaultValue : *value; +} + +bool Value::isValidIndex(ArrayIndex index) const { return index < size(); } + +const Value& Value::operator[](const char* key) const { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == objectValue, + "in Json::Value::operator[](char const*)const: requires objectValue"); + if (type_ == nullValue) + return null; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString actualKey(key, CZString::noDuplication); + ObjectValues::const_iterator it = value_.map_->find(actualKey); + if (it == value_.map_->end()) + return null; + return (*it).second; +#else + const Value* value = value_.map_->find(key); + return value ? *value : null; +#endif +} + +Value& Value::operator[](const std::string& key) { + return (*this)[key.c_str()]; +} + +const Value& Value::operator[](const std::string& key) const { + return (*this)[key.c_str()]; +} + +Value& Value::operator[](const StaticString& key) { + return resolveReference(key, true); +} + +#ifdef JSON_USE_CPPTL +Value& Value::operator[](const CppTL::ConstString& key) { + return (*this)[key.c_str()]; +} + +const Value& Value::operator[](const CppTL::ConstString& key) const { + return (*this)[key.c_str()]; +} +#endif + +Value& Value::append(const Value& value) { return (*this)[size()] = value; } + +Value Value::get(const char* key, const Value& defaultValue) const { + const Value* value = &((*this)[key]); + return value == &null ? defaultValue : *value; +} + +Value Value::get(const std::string& key, const Value& defaultValue) const { + return get(key.c_str(), defaultValue); +} + +Value Value::removeMember(const char* key) { + JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue, + "in Json::Value::removeMember(): requires objectValue"); + if (type_ == nullValue) + return null; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString actualKey(key, CZString::noDuplication); + ObjectValues::iterator it = value_.map_->find(actualKey); + if (it == value_.map_->end()) + return null; + Value old(it->second); + value_.map_->erase(it); + return old; +#else + Value* value = value_.map_->find(key); + if (value) { + Value old(*value); + value_.map_.remove(key); + return old; + } else { + return null; + } +#endif +} + +Value Value::removeMember(const std::string& key) { + return removeMember(key.c_str()); +} + +#ifdef JSON_USE_CPPTL +Value Value::get(const CppTL::ConstString& key, + const Value& defaultValue) const { + return get(key.c_str(), defaultValue); +} +#endif + +bool Value::isMember(const char* key) const { + const Value* value = &((*this)[key]); + return value != &null; +} + +bool Value::isMember(const std::string& key) const { + return isMember(key.c_str()); +} + +#ifdef JSON_USE_CPPTL +bool Value::isMember(const CppTL::ConstString& key) const { + return isMember(key.c_str()); +} +#endif + +Value::Members Value::getMemberNames() const { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == objectValue, + "in Json::Value::getMemberNames(), value must be objectValue"); + if (type_ == nullValue) + return Value::Members(); + Members members; + members.reserve(value_.map_->size()); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + ObjectValues::const_iterator it = value_.map_->begin(); + ObjectValues::const_iterator itEnd = value_.map_->end(); + for (; it != itEnd; ++it) + members.push_back(std::string((*it).first.c_str())); +#else + ValueInternalMap::IteratorState it; + ValueInternalMap::IteratorState itEnd; + value_.map_->makeBeginIterator(it); + value_.map_->makeEndIterator(itEnd); + for (; !ValueInternalMap::equals(it, itEnd); ValueInternalMap::increment(it)) + members.push_back(std::string(ValueInternalMap::key(it))); +#endif + return members; +} +// +//# ifdef JSON_USE_CPPTL +// EnumMemberNames +// Value::enumMemberNames() const +//{ +// if ( type_ == objectValue ) +// { +// return CppTL::Enum::any( CppTL::Enum::transform( +// CppTL::Enum::keys( *(value_.map_), CppTL::Type() ), +// MemberNamesTransform() ) ); +// } +// return EnumMemberNames(); +//} +// +// +// EnumValues +// Value::enumValues() const +//{ +// if ( type_ == objectValue || type_ == arrayValue ) +// return CppTL::Enum::anyValues( *(value_.map_), +// CppTL::Type() ); +// return EnumValues(); +//} +// +//# endif + +static bool IsIntegral(double d) { + double integral_part; + return modf(d, &integral_part) == 0.0; +} + +bool Value::isNull() const { return type_ == nullValue; } + +bool Value::isBool() const { return type_ == booleanValue; } + +bool Value::isInt() const { + switch (type_) { + case intValue: + return value_.int_ >= minInt && value_.int_ <= maxInt; + case uintValue: + return value_.uint_ <= UInt(maxInt); + case realValue: + return value_.real_ >= minInt && value_.real_ <= maxInt && + IsIntegral(value_.real_); + default: + break; + } + return false; +} + +bool Value::isUInt() const { + switch (type_) { + case intValue: + return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt); + case uintValue: + return value_.uint_ <= maxUInt; + case realValue: + return value_.real_ >= 0 && value_.real_ <= maxUInt && + IsIntegral(value_.real_); + default: + break; + } + return false; +} + +bool Value::isInt64() const { +#if defined(JSON_HAS_INT64) + switch (type_) { + case intValue: + return true; + case uintValue: + return value_.uint_ <= UInt64(maxInt64); + case realValue: + // Note that maxInt64 (= 2^63 - 1) is not exactly representable as a + // double, so double(maxInt64) will be rounded up to 2^63. Therefore we + // require the value to be strictly less than the limit. + return value_.real_ >= double(minInt64) && + value_.real_ < double(maxInt64) && IsIntegral(value_.real_); + default: + break; + } +#endif // JSON_HAS_INT64 + return false; +} + +bool Value::isUInt64() const { +#if defined(JSON_HAS_INT64) + switch (type_) { + case intValue: + return value_.int_ >= 0; + case uintValue: + return true; + case realValue: + // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a + // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we + // require the value to be strictly less than the limit. + return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble && + IsIntegral(value_.real_); + default: + break; + } +#endif // JSON_HAS_INT64 + return false; +} + +bool Value::isIntegral() const { +#if defined(JSON_HAS_INT64) + return isInt64() || isUInt64(); +#else + return isInt() || isUInt(); +#endif +} + +bool Value::isDouble() const { return type_ == realValue || isIntegral(); } + +bool Value::isNumeric() const { return isIntegral() || isDouble(); } + +bool Value::isString() const { return type_ == stringValue; } + +bool Value::isArray() const { return type_ == arrayValue; } + +bool Value::isObject() const { return type_ == objectValue; } + +void Value::setComment(const char* comment, CommentPlacement placement) { + if (!comments_) + comments_ = new CommentInfo[numberOfCommentPlacement]; + comments_[placement].setComment(comment); +} + +void Value::setComment(const std::string& comment, CommentPlacement placement) { + setComment(comment.c_str(), placement); +} + +bool Value::hasComment(CommentPlacement placement) const { + return comments_ != 0 && comments_[placement].comment_ != 0; +} + +std::string Value::getComment(CommentPlacement placement) const { + if (hasComment(placement)) + return comments_[placement].comment_; + return ""; +} + +void Value::setOffsetStart(size_t start) { start_ = start; } + +void Value::setOffsetLimit(size_t limit) { limit_ = limit; } + +size_t Value::getOffsetStart() const { return start_; } + +size_t Value::getOffsetLimit() const { return limit_; } + +std::string Value::toStyledString() const { + StyledWriter writer; + return writer.write(*this); +} + +Value::const_iterator Value::begin() const { + switch (type_) { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeBeginIterator(it); + return const_iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeBeginIterator(it); + return const_iterator(it); + } + break; +#else + case arrayValue: + case objectValue: + if (value_.map_) + return const_iterator(value_.map_->begin()); + break; +#endif + default: + break; + } + return const_iterator(); +} + +Value::const_iterator Value::end() const { + switch (type_) { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeEndIterator(it); + return const_iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeEndIterator(it); + return const_iterator(it); + } + break; +#else + case arrayValue: + case objectValue: + if (value_.map_) + return const_iterator(value_.map_->end()); + break; +#endif + default: + break; + } + return const_iterator(); +} + +Value::iterator Value::begin() { + switch (type_) { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeBeginIterator(it); + return iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeBeginIterator(it); + return iterator(it); + } + break; +#else + case arrayValue: + case objectValue: + if (value_.map_) + return iterator(value_.map_->begin()); + break; +#endif + default: + break; + } + return iterator(); +} + +Value::iterator Value::end() { + switch (type_) { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeEndIterator(it); + return iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeEndIterator(it); + return iterator(it); + } + break; +#else + case arrayValue: + case objectValue: + if (value_.map_) + return iterator(value_.map_->end()); + break; +#endif + default: + break; + } + return iterator(); +} + +// class PathArgument +// ////////////////////////////////////////////////////////////////// + +PathArgument::PathArgument() : key_(), index_(), kind_(kindNone) {} + +PathArgument::PathArgument(ArrayIndex index) + : key_(), index_(index), kind_(kindIndex) {} + +PathArgument::PathArgument(const char* key) + : key_(key), index_(), kind_(kindKey) {} + +PathArgument::PathArgument(const std::string& key) + : key_(key.c_str()), index_(), kind_(kindKey) {} + +// class Path +// ////////////////////////////////////////////////////////////////// + +Path::Path(const std::string& path, + const PathArgument& a1, + const PathArgument& a2, + const PathArgument& a3, + const PathArgument& a4, + const PathArgument& a5) { + InArgs in; + in.push_back(&a1); + in.push_back(&a2); + in.push_back(&a3); + in.push_back(&a4); + in.push_back(&a5); + makePath(path, in); +} + +void Path::makePath(const std::string& path, const InArgs& in) { + const char* current = path.c_str(); + const char* end = current + path.length(); + InArgs::const_iterator itInArg = in.begin(); + while (current != end) { + if (*current == '[') { + ++current; + if (*current == '%') + addPathInArg(path, in, itInArg, PathArgument::kindIndex); + else { + ArrayIndex index = 0; + for (; current != end && *current >= '0' && *current <= '9'; ++current) + index = index * 10 + ArrayIndex(*current - '0'); + args_.push_back(index); + } + if (current == end || *current++ != ']') + invalidPath(path, int(current - path.c_str())); + } else if (*current == '%') { + addPathInArg(path, in, itInArg, PathArgument::kindKey); + ++current; + } else if (*current == '.') { + ++current; + } else { + const char* beginName = current; + while (current != end && !strchr("[.", *current)) + ++current; + args_.push_back(std::string(beginName, current)); + } + } +} + +void Path::addPathInArg(const std::string& /*path*/, + const InArgs& in, + InArgs::const_iterator& itInArg, + PathArgument::Kind kind) { + if (itInArg == in.end()) { + // Error: missing argument %d + } else if ((*itInArg)->kind_ != kind) { + // Error: bad argument type + } else { + args_.push_back(**itInArg); + } +} + +void Path::invalidPath(const std::string& /*path*/, int /*location*/) { + // Error: invalid path. +} + +const Value& Path::resolve(const Value& root) const { + const Value* node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument& arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray() || !node->isValidIndex(arg.index_)) { + // Error: unable to resolve path (array value expected at position... + } + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) { + // Error: unable to resolve path (object value expected at position...) + } + node = &((*node)[arg.key_]); + if (node == &Value::null) { + // Error: unable to resolve path (object has no member named '' at + // position...) + } + } + } + return *node; +} + +Value Path::resolve(const Value& root, const Value& defaultValue) const { + const Value* node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument& arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray() || !node->isValidIndex(arg.index_)) + return defaultValue; + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) + return defaultValue; + node = &((*node)[arg.key_]); + if (node == &Value::null) + return defaultValue; + } + } + return *node; +} + +Value& Path::make(Value& root) const { + Value* node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument& arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray()) { + // Error: node is not an array at position ... + } + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) { + // Error: node is not an object at position... + } + node = &((*node)[arg.key_]); + } + } + return *node; +} + +} // namespace Json +// vim: et ts=2 sts=2 sw=2 tw=0 diff --git a/Utilities/cmjsoncpp/json_valueiterator.inl b/Utilities/cmjsoncpp/json_valueiterator.inl new file mode 100644 index 0000000..0ee2274 --- /dev/null +++ b/Utilities/cmjsoncpp/json_valueiterator.inl @@ -0,0 +1,242 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +// included by json_value.cpp + +namespace Json { + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueIteratorBase +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueIteratorBase::ValueIteratorBase() +#ifndef JSON_VALUE_USE_INTERNAL_MAP + : current_(), isNull_(true) { +} +#else + : isArray_(true), isNull_(true) { + iterator_.array_ = ValueInternalArray::IteratorState(); +} +#endif + +#ifndef JSON_VALUE_USE_INTERNAL_MAP +ValueIteratorBase::ValueIteratorBase( + const Value::ObjectValues::iterator& current) + : current_(current), isNull_(false) {} +#else +ValueIteratorBase::ValueIteratorBase( + const ValueInternalArray::IteratorState& state) + : isArray_(true) { + iterator_.array_ = state; +} + +ValueIteratorBase::ValueIteratorBase( + const ValueInternalMap::IteratorState& state) + : isArray_(false) { + iterator_.map_ = state; +} +#endif + +Value& ValueIteratorBase::deref() const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + return current_->second; +#else + if (isArray_) + return ValueInternalArray::dereference(iterator_.array_); + return ValueInternalMap::value(iterator_.map_); +#endif +} + +void ValueIteratorBase::increment() { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + ++current_; +#else + if (isArray_) + ValueInternalArray::increment(iterator_.array_); + ValueInternalMap::increment(iterator_.map_); +#endif +} + +void ValueIteratorBase::decrement() { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + --current_; +#else + if (isArray_) + ValueInternalArray::decrement(iterator_.array_); + ValueInternalMap::decrement(iterator_.map_); +#endif +} + +ValueIteratorBase::difference_type +ValueIteratorBase::computeDistance(const SelfType& other) const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP +#ifdef JSON_USE_CPPTL_SMALLMAP + return current_ - other.current_; +#else + // Iterator for null value are initialized using the default + // constructor, which initialize current_ to the default + // std::map::iterator. As begin() and end() are two instance + // of the default std::map::iterator, they can not be compared. + // To allow this, we handle this comparison specifically. + if (isNull_ && other.isNull_) { + return 0; + } + + // Usage of std::distance is not portable (does not compile with Sun Studio 12 + // RogueWave STL, + // which is the one used by default). + // Using a portable hand-made version for non random iterator instead: + // return difference_type( std::distance( current_, other.current_ ) ); + difference_type myDistance = 0; + for (Value::ObjectValues::iterator it = current_; it != other.current_; + ++it) { + ++myDistance; + } + return myDistance; +#endif +#else + if (isArray_) + return ValueInternalArray::distance(iterator_.array_, + other.iterator_.array_); + return ValueInternalMap::distance(iterator_.map_, other.iterator_.map_); +#endif +} + +bool ValueIteratorBase::isEqual(const SelfType& other) const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + if (isNull_) { + return other.isNull_; + } + return current_ == other.current_; +#else + if (isArray_) + return ValueInternalArray::equals(iterator_.array_, other.iterator_.array_); + return ValueInternalMap::equals(iterator_.map_, other.iterator_.map_); +#endif +} + +void ValueIteratorBase::copy(const SelfType& other) { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + current_ = other.current_; + isNull_ = other.isNull_; +#else + if (isArray_) + iterator_.array_ = other.iterator_.array_; + iterator_.map_ = other.iterator_.map_; +#endif +} + +Value ValueIteratorBase::key() const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + const Value::CZString czstring = (*current_).first; + if (czstring.c_str()) { + if (czstring.isStaticString()) + return Value(StaticString(czstring.c_str())); + return Value(czstring.c_str()); + } + return Value(czstring.index()); +#else + if (isArray_) + return Value(ValueInternalArray::indexOf(iterator_.array_)); + bool isStatic; + const char* memberName = ValueInternalMap::key(iterator_.map_, isStatic); + if (isStatic) + return Value(StaticString(memberName)); + return Value(memberName); +#endif +} + +UInt ValueIteratorBase::index() const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + const Value::CZString czstring = (*current_).first; + if (!czstring.c_str()) + return czstring.index(); + return Value::UInt(-1); +#else + if (isArray_) + return Value::UInt(ValueInternalArray::indexOf(iterator_.array_)); + return Value::UInt(-1); +#endif +} + +const char* ValueIteratorBase::memberName() const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + const char* name = (*current_).first.c_str(); + return name ? name : ""; +#else + if (!isArray_) + return ValueInternalMap::key(iterator_.map_); + return ""; +#endif +} + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueConstIterator +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueConstIterator::ValueConstIterator() {} + +#ifndef JSON_VALUE_USE_INTERNAL_MAP +ValueConstIterator::ValueConstIterator( + const Value::ObjectValues::iterator& current) + : ValueIteratorBase(current) {} +#else +ValueConstIterator::ValueConstIterator( + const ValueInternalArray::IteratorState& state) + : ValueIteratorBase(state) {} + +ValueConstIterator::ValueConstIterator( + const ValueInternalMap::IteratorState& state) + : ValueIteratorBase(state) {} +#endif + +ValueConstIterator& ValueConstIterator:: +operator=(const ValueIteratorBase& other) { + copy(other); + return *this; +} + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueIterator +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueIterator::ValueIterator() {} + +#ifndef JSON_VALUE_USE_INTERNAL_MAP +ValueIterator::ValueIterator(const Value::ObjectValues::iterator& current) + : ValueIteratorBase(current) {} +#else +ValueIterator::ValueIterator(const ValueInternalArray::IteratorState& state) + : ValueIteratorBase(state) {} + +ValueIterator::ValueIterator(const ValueInternalMap::IteratorState& state) + : ValueIteratorBase(state) {} +#endif + +ValueIterator::ValueIterator(const ValueConstIterator& other) + : ValueIteratorBase(other) {} + +ValueIterator::ValueIterator(const ValueIterator& other) + : ValueIteratorBase(other) {} + +ValueIterator& ValueIterator::operator=(const SelfType& other) { + copy(other); + return *this; +} + +} // namespace Json +// vim: et ts=3 sts=3 sw=3 tw=0 diff --git a/Utilities/cmjsoncpp/json_writer.cpp b/Utilities/cmjsoncpp/json_writer.cpp new file mode 100644 index 0000000..8eb7dc5 --- /dev/null +++ b/Utilities/cmjsoncpp/json_writer.cpp @@ -0,0 +1,690 @@ +// Copyright 2011 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#if !defined(JSON_IS_AMALGAMATION) +#include +#include "json_tool.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below +#include +#define isfinite _finite +#define snprintf _snprintf +#endif + +#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 +// Disable warning about strdup being deprecated. +#pragma warning(disable : 4996) +#endif + +namespace Json { + +static bool containsControlCharacter(const char* str) { + while (*str) { + if (isControlCharacter(*(str++))) + return true; + } + return false; +} + +std::string valueToString(LargestInt value) { + UIntToStringBuffer buffer; + char* current = buffer + sizeof(buffer); + bool isNegative = value < 0; + if (isNegative) + value = -value; + uintToString(LargestUInt(value), current); + if (isNegative) + *--current = '-'; + assert(current >= buffer); + return current; +} + +std::string valueToString(LargestUInt value) { + UIntToStringBuffer buffer; + char* current = buffer + sizeof(buffer); + uintToString(value, current); + assert(current >= buffer); + return current; +} + +#if defined(JSON_HAS_INT64) + +std::string valueToString(Int value) { + return valueToString(LargestInt(value)); +} + +std::string valueToString(UInt value) { + return valueToString(LargestUInt(value)); +} + +#endif // # if defined(JSON_HAS_INT64) + +std::string valueToString(double value) { + // Allocate a buffer that is more than large enough to store the 16 digits of + // precision requested below. + char buffer[32]; + int len = -1; + +// Print into the buffer. We need not request the alternative representation +// that always has a decimal point because JSON doesn't distingish the +// concepts of reals and integers. +#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with + // visual studio 2005 to + // avoid warning. +#if defined(WINCE) + len = _snprintf(buffer, sizeof(buffer), "%.16g", value); +#else + len = sprintf_s(buffer, sizeof(buffer), "%.16g", value); +#endif +#else + if (isfinite(value)) { + len = snprintf(buffer, sizeof(buffer), "%.16g", value); + } else { + // IEEE standard states that NaN values will not compare to themselves + if (value != value) { + len = snprintf(buffer, sizeof(buffer), "null"); + } else if (value < 0) { + len = snprintf(buffer, sizeof(buffer), "-1e+9999"); + } else { + len = snprintf(buffer, sizeof(buffer), "1e+9999"); + } + // For those, we do not need to call fixNumLoc, but it is fast. + } +#endif + assert(len >= 0); + fixNumericLocale(buffer, buffer + len); + return buffer; +} + +std::string valueToString(bool value) { return value ? "true" : "false"; } + +std::string valueToQuotedString(const char* value) { + if (value == NULL) + return ""; + // Not sure how to handle unicode... + if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL && + !containsControlCharacter(value)) + return std::string("\"") + value + "\""; + // We have to walk value and escape any special characters. + // Appending to std::string is not efficient, but this should be rare. + // (Note: forward slashes are *not* rare, but I am not escaping them.) + std::string::size_type maxsize = + strlen(value) * 2 + 3; // allescaped+quotes+NULL + std::string result; + result.reserve(maxsize); // to avoid lots of mallocs + result += "\""; + for (const char* c = value; *c != 0; ++c) { + switch (*c) { + case '\"': + result += "\\\""; + break; + case '\\': + result += "\\\\"; + break; + case '\b': + result += "\\b"; + break; + case '\f': + result += "\\f"; + break; + case '\n': + result += "\\n"; + break; + case '\r': + result += "\\r"; + break; + case '\t': + result += "\\t"; + break; + // case '/': + // Even though \/ is considered a legal escape in JSON, a bare + // slash is also legal, so I see no reason to escape it. + // (I hope I am not misunderstanding something. + // blep notes: actually escaping \/ may be useful in javascript to avoid (*c); + result += oss.str(); + } else { + result += *c; + } + break; + } + } + result += "\""; + return result; +} + +// Class Writer +// ////////////////////////////////////////////////////////////////// +Writer::~Writer() {} + +// Class FastWriter +// ////////////////////////////////////////////////////////////////// + +FastWriter::FastWriter() + : yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false), + omitEndingLineFeed_(false) {} + +void FastWriter::enableYAMLCompatibility() { yamlCompatiblityEnabled_ = true; } + +void FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; } + +void FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; } + +std::string FastWriter::write(const Value& root) { + document_ = ""; + writeValue(root); + if (!omitEndingLineFeed_) + document_ += "\n"; + return document_; +} + +void FastWriter::writeValue(const Value& value) { + switch (value.type()) { + case nullValue: + if (!dropNullPlaceholders_) + document_ += "null"; + break; + case intValue: + document_ += valueToString(value.asLargestInt()); + break; + case uintValue: + document_ += valueToString(value.asLargestUInt()); + break; + case realValue: + document_ += valueToString(value.asDouble()); + break; + case stringValue: + document_ += valueToQuotedString(value.asCString()); + break; + case booleanValue: + document_ += valueToString(value.asBool()); + break; + case arrayValue: { + document_ += "["; + int size = value.size(); + for (int index = 0; index < size; ++index) { + if (index > 0) + document_ += ","; + writeValue(value[index]); + } + document_ += "]"; + } break; + case objectValue: { + Value::Members members(value.getMemberNames()); + document_ += "{"; + for (Value::Members::iterator it = members.begin(); it != members.end(); + ++it) { + const std::string& name = *it; + if (it != members.begin()) + document_ += ","; + document_ += valueToQuotedString(name.c_str()); + document_ += yamlCompatiblityEnabled_ ? ": " : ":"; + writeValue(value[name]); + } + document_ += "}"; + } break; + } +} + +// Class StyledWriter +// ////////////////////////////////////////////////////////////////// + +StyledWriter::StyledWriter() + : rightMargin_(74), indentSize_(3), addChildValues_() {} + +std::string StyledWriter::write(const Value& root) { + document_ = ""; + addChildValues_ = false; + indentString_ = ""; + writeCommentBeforeValue(root); + writeValue(root); + writeCommentAfterValueOnSameLine(root); + document_ += "\n"; + return document_; +} + +void StyledWriter::writeValue(const Value& value) { + switch (value.type()) { + case nullValue: + pushValue("null"); + break; + case intValue: + pushValue(valueToString(value.asLargestInt())); + break; + case uintValue: + pushValue(valueToString(value.asLargestUInt())); + break; + case realValue: + pushValue(valueToString(value.asDouble())); + break; + case stringValue: + pushValue(valueToQuotedString(value.asCString())); + break; + case booleanValue: + pushValue(valueToString(value.asBool())); + break; + case arrayValue: + writeArrayValue(value); + break; + case objectValue: { + Value::Members members(value.getMemberNames()); + if (members.empty()) + pushValue("{}"); + else { + writeWithIndent("{"); + indent(); + Value::Members::iterator it = members.begin(); + for (;;) { + const std::string& name = *it; + const Value& childValue = value[name]; + writeCommentBeforeValue(childValue); + writeWithIndent(valueToQuotedString(name.c_str())); + document_ += " : "; + writeValue(childValue); + if (++it == members.end()) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + document_ += ","; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("}"); + } + } break; + } +} + +void StyledWriter::writeArrayValue(const Value& value) { + unsigned size = value.size(); + if (size == 0) + pushValue("[]"); + else { + bool isArrayMultiLine = isMultineArray(value); + if (isArrayMultiLine) { + writeWithIndent("["); + indent(); + bool hasChildValue = !childValues_.empty(); + unsigned index = 0; + for (;;) { + const Value& childValue = value[index]; + writeCommentBeforeValue(childValue); + if (hasChildValue) + writeWithIndent(childValues_[index]); + else { + writeIndent(); + writeValue(childValue); + } + if (++index == size) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + document_ += ","; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("]"); + } else // output on a single line + { + assert(childValues_.size() == size); + document_ += "[ "; + for (unsigned index = 0; index < size; ++index) { + if (index > 0) + document_ += ", "; + document_ += childValues_[index]; + } + document_ += " ]"; + } + } +} + +bool StyledWriter::isMultineArray(const Value& value) { + int size = value.size(); + bool isMultiLine = size * 3 >= rightMargin_; + childValues_.clear(); + for (int index = 0; index < size && !isMultiLine; ++index) { + const Value& childValue = value[index]; + isMultiLine = + isMultiLine || ((childValue.isArray() || childValue.isObject()) && + childValue.size() > 0); + } + if (!isMultiLine) // check if line length > max line length + { + childValues_.reserve(size); + addChildValues_ = true; + int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' + for (int index = 0; index < size; ++index) { + writeValue(value[index]); + lineLength += int(childValues_[index].length()); + } + addChildValues_ = false; + isMultiLine = isMultiLine || lineLength >= rightMargin_; + } + return isMultiLine; +} + +void StyledWriter::pushValue(const std::string& value) { + if (addChildValues_) + childValues_.push_back(value); + else + document_ += value; +} + +void StyledWriter::writeIndent() { + if (!document_.empty()) { + char last = document_[document_.length() - 1]; + if (last == ' ') // already indented + return; + if (last != '\n') // Comments may add new-line + document_ += '\n'; + } + document_ += indentString_; +} + +void StyledWriter::writeWithIndent(const std::string& value) { + writeIndent(); + document_ += value; +} + +void StyledWriter::indent() { indentString_ += std::string(indentSize_, ' '); } + +void StyledWriter::unindent() { + assert(int(indentString_.size()) >= indentSize_); + indentString_.resize(indentString_.size() - indentSize_); +} + +void StyledWriter::writeCommentBeforeValue(const Value& root) { + if (!root.hasComment(commentBefore)) + return; + + document_ += "\n"; + writeIndent(); + std::string normalizedComment = normalizeEOL(root.getComment(commentBefore)); + std::string::const_iterator iter = normalizedComment.begin(); + while (iter != normalizedComment.end()) { + document_ += *iter; + if (*iter == '\n' && *(iter + 1) == '/') + writeIndent(); + ++iter; + } + + // Comments are stripped of newlines, so add one here + document_ += "\n"; +} + +void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { + if (root.hasComment(commentAfterOnSameLine)) + document_ += " " + normalizeEOL(root.getComment(commentAfterOnSameLine)); + + if (root.hasComment(commentAfter)) { + document_ += "\n"; + document_ += normalizeEOL(root.getComment(commentAfter)); + document_ += "\n"; + } +} + +bool StyledWriter::hasCommentForValue(const Value& value) { + return value.hasComment(commentBefore) || + value.hasComment(commentAfterOnSameLine) || + value.hasComment(commentAfter); +} + +std::string StyledWriter::normalizeEOL(const std::string& text) { + std::string normalized; + normalized.reserve(text.length()); + const char* begin = text.c_str(); + const char* end = begin + text.length(); + const char* current = begin; + while (current != end) { + char c = *current++; + if (c == '\r') // mac or dos EOL + { + if (*current == '\n') // convert dos EOL + ++current; + normalized += '\n'; + } else // handle unix EOL & other char + normalized += c; + } + return normalized; +} + +// Class StyledStreamWriter +// ////////////////////////////////////////////////////////////////// + +StyledStreamWriter::StyledStreamWriter(std::string indentation) + : document_(NULL), rightMargin_(74), indentation_(indentation), + addChildValues_() {} + +void StyledStreamWriter::write(std::ostream& out, const Value& root) { + document_ = &out; + addChildValues_ = false; + indentString_ = ""; + writeCommentBeforeValue(root); + writeValue(root); + writeCommentAfterValueOnSameLine(root); + *document_ << "\n"; + document_ = NULL; // Forget the stream, for safety. +} + +void StyledStreamWriter::writeValue(const Value& value) { + switch (value.type()) { + case nullValue: + pushValue("null"); + break; + case intValue: + pushValue(valueToString(value.asLargestInt())); + break; + case uintValue: + pushValue(valueToString(value.asLargestUInt())); + break; + case realValue: + pushValue(valueToString(value.asDouble())); + break; + case stringValue: + pushValue(valueToQuotedString(value.asCString())); + break; + case booleanValue: + pushValue(valueToString(value.asBool())); + break; + case arrayValue: + writeArrayValue(value); + break; + case objectValue: { + Value::Members members(value.getMemberNames()); + if (members.empty()) + pushValue("{}"); + else { + writeWithIndent("{"); + indent(); + Value::Members::iterator it = members.begin(); + for (;;) { + const std::string& name = *it; + const Value& childValue = value[name]; + writeCommentBeforeValue(childValue); + writeWithIndent(valueToQuotedString(name.c_str())); + *document_ << " : "; + writeValue(childValue); + if (++it == members.end()) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + *document_ << ","; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("}"); + } + } break; + } +} + +void StyledStreamWriter::writeArrayValue(const Value& value) { + unsigned size = value.size(); + if (size == 0) + pushValue("[]"); + else { + bool isArrayMultiLine = isMultineArray(value); + if (isArrayMultiLine) { + writeWithIndent("["); + indent(); + bool hasChildValue = !childValues_.empty(); + unsigned index = 0; + for (;;) { + const Value& childValue = value[index]; + writeCommentBeforeValue(childValue); + if (hasChildValue) + writeWithIndent(childValues_[index]); + else { + writeIndent(); + writeValue(childValue); + } + if (++index == size) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + *document_ << ","; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("]"); + } else // output on a single line + { + assert(childValues_.size() == size); + *document_ << "[ "; + for (unsigned index = 0; index < size; ++index) { + if (index > 0) + *document_ << ", "; + *document_ << childValues_[index]; + } + *document_ << " ]"; + } + } +} + +bool StyledStreamWriter::isMultineArray(const Value& value) { + int size = value.size(); + bool isMultiLine = size * 3 >= rightMargin_; + childValues_.clear(); + for (int index = 0; index < size && !isMultiLine; ++index) { + const Value& childValue = value[index]; + isMultiLine = + isMultiLine || ((childValue.isArray() || childValue.isObject()) && + childValue.size() > 0); + } + if (!isMultiLine) // check if line length > max line length + { + childValues_.reserve(size); + addChildValues_ = true; + int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' + for (int index = 0; index < size; ++index) { + writeValue(value[index]); + lineLength += int(childValues_[index].length()); + } + addChildValues_ = false; + isMultiLine = isMultiLine || lineLength >= rightMargin_; + } + return isMultiLine; +} + +void StyledStreamWriter::pushValue(const std::string& value) { + if (addChildValues_) + childValues_.push_back(value); + else + *document_ << value; +} + +void StyledStreamWriter::writeIndent() { + /* + Some comments in this method would have been nice. ;-) + + if ( !document_.empty() ) + { + char last = document_[document_.length()-1]; + if ( last == ' ' ) // already indented + return; + if ( last != '\n' ) // Comments may add new-line + *document_ << '\n'; + } + */ + *document_ << '\n' << indentString_; +} + +void StyledStreamWriter::writeWithIndent(const std::string& value) { + writeIndent(); + *document_ << value; +} + +void StyledStreamWriter::indent() { indentString_ += indentation_; } + +void StyledStreamWriter::unindent() { + assert(indentString_.size() >= indentation_.size()); + indentString_.resize(indentString_.size() - indentation_.size()); +} + +void StyledStreamWriter::writeCommentBeforeValue(const Value& root) { + if (!root.hasComment(commentBefore)) + return; + *document_ << normalizeEOL(root.getComment(commentBefore)); + *document_ << "\n"; +} + +void StyledStreamWriter::writeCommentAfterValueOnSameLine(const Value& root) { + if (root.hasComment(commentAfterOnSameLine)) + *document_ << " " + normalizeEOL(root.getComment(commentAfterOnSameLine)); + + if (root.hasComment(commentAfter)) { + *document_ << "\n"; + *document_ << normalizeEOL(root.getComment(commentAfter)); + *document_ << "\n"; + } +} + +bool StyledStreamWriter::hasCommentForValue(const Value& value) { + return value.hasComment(commentBefore) || + value.hasComment(commentAfterOnSameLine) || + value.hasComment(commentAfter); +} + +std::string StyledStreamWriter::normalizeEOL(const std::string& text) { + std::string normalized; + normalized.reserve(text.length()); + const char* begin = text.c_str(); + const char* end = begin + text.length(); + const char* current = begin; + while (current != end) { + char c = *current++; + if (c == '\r') // mac or dos EOL + { + if (*current == '\n') // convert dos EOL + ++current; + normalized += '\n'; + } else // handle unix EOL & other char + normalized += c; + } + return normalized; +} + +std::ostream& operator<<(std::ostream& sout, const Value& root) { + Json::StyledStreamWriter writer; + writer.write(sout, root); + return sout; +} + +} // namespace Json ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 13 +- Help/command/ctest_submit.rst | 11 + Modules/CTestGCOV.cmake | 72 ++ Source/CMakeLists.txt | 4 +- Source/CTest/cmCTestCurl.cxx | 258 +++++ Source/CTest/cmCTestCurl.h | 50 + Source/CTest/cmCTestSubmitCommand.cxx | 30 +- Source/CTest/cmCTestSubmitCommand.h | 4 + Source/CTest/cmCTestSubmitHandler.cxx | 159 ++- Source/CTest/cmCTestSubmitHandler.h | 5 + Source/cmArchiveWrite.cxx | 16 + Source/cmArchiveWrite.h | 2 + Source/cmSystemTools.cxx | 6 +- Source/cmSystemTools.h | 6 +- Source/cmcmd.cxx | 21 +- Utilities/cmjsoncpp/CMakeLists.txt | 14 + Utilities/cmjsoncpp/json/assertions.h | 41 + Utilities/cmjsoncpp/json/config.h | 112 ++ Utilities/cmjsoncpp/json/features.h | 57 + Utilities/cmjsoncpp/json/forwards.h | 43 + Utilities/cmjsoncpp/json/json.h | 14 + Utilities/cmjsoncpp/json/reader.h | 253 +++++ Utilities/cmjsoncpp/json/value.h | 1086 ++++++++++++++++++++ Utilities/cmjsoncpp/json/version.h | 16 + Utilities/cmjsoncpp/json/writer.h | 213 ++++ Utilities/cmjsoncpp/json_batchallocator.h | 122 +++ Utilities/cmjsoncpp/json_reader.cpp | 846 +++++++++++++++ Utilities/cmjsoncpp/json_tool.h | 88 ++ Utilities/cmjsoncpp/json_value.cpp | 1541 ++++++++++++++++++++++++++++ Utilities/cmjsoncpp/json_valueiterator.inl | 242 +++++ Utilities/cmjsoncpp/json_writer.cpp | 690 +++++++++++++ 31 files changed, 6024 insertions(+), 11 deletions(-) create mode 100644 Modules/CTestGCOV.cmake create mode 100644 Source/CTest/cmCTestCurl.cxx create mode 100644 Source/CTest/cmCTestCurl.h create mode 100644 Utilities/cmjsoncpp/CMakeLists.txt create mode 100644 Utilities/cmjsoncpp/json/assertions.h create mode 100644 Utilities/cmjsoncpp/json/config.h create mode 100644 Utilities/cmjsoncpp/json/features.h create mode 100644 Utilities/cmjsoncpp/json/forwards.h create mode 100644 Utilities/cmjsoncpp/json/json.h create mode 100644 Utilities/cmjsoncpp/json/reader.h create mode 100644 Utilities/cmjsoncpp/json/value.h create mode 100644 Utilities/cmjsoncpp/json/version.h create mode 100644 Utilities/cmjsoncpp/json/writer.h create mode 100644 Utilities/cmjsoncpp/json_batchallocator.h create mode 100644 Utilities/cmjsoncpp/json_reader.cpp create mode 100644 Utilities/cmjsoncpp/json_tool.h create mode 100644 Utilities/cmjsoncpp/json_value.cpp create mode 100644 Utilities/cmjsoncpp/json_valueiterator.inl create mode 100644 Utilities/cmjsoncpp/json_writer.cpp hooks/post-receive -- CMake From bill.hoffman at kitware.com Mon Jan 12 17:34:36 2015 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Mon, 12 Jan 2015 17:34:36 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1813-gdb293e1 Message-ID: <20150112223436.CBBD0AA437@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via db293e1ca64acb9302b6ca660e94aee305045055 (commit) via c7e52683d35883c9f7f46574bf357d0c7ed3bb7f (commit) from 3f421206324fc57cfda97ef50e57e0c8c3ce1a40 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db293e1ca64acb9302b6ca660e94aee305045055 commit db293e1ca64acb9302b6ca660e94aee305045055 Merge: 3f42120 c7e5268 Author: Bill Hoffman AuthorDate: Mon Jan 12 17:34:36 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 17:34:36 2015 -0500 Merge topic 'cdash_upload_file_mode' into next c7e52683 Handle the case when there is no upload file or type. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c7e52683d35883c9f7f46574bf357d0c7ed3bb7f commit c7e52683d35883c9f7f46574bf357d0c7ed3bb7f Author: Bill Hoffman AuthorDate: Mon Jan 12 17:33:58 2015 -0500 Commit: Bill Hoffman CommitDate: Mon Jan 12 17:33:58 2015 -0500 Handle the case when there is no upload file or type. diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 71491d8..2f6a9e9 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1209,11 +1209,12 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, //---------------------------------------------------------------------------- int cmCTestSubmitHandler::ProcessHandler() { - std::string cdashUploadFile = this->GetOption("CDashUploadFile"); - std::string cdashUploadType = this->GetOption("CDashUploadType"); - if(cdashUploadFile.size()) + const char* cdashUploadFile = this->GetOption("CDashUploadFile"); + const char* cdashUploadType = this->GetOption("CDashUploadType"); + if(cdashUploadFile && cdashUploadType) { - return this->HandleCDashUploadFile(cdashUploadFile, cdashUploadType); + return this->HandleCDashUploadFile(std::string(cdashUploadFile), + std::string(cdashUploadType)); } std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); // cdash does not need to trigger so just return true ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestSubmitHandler.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Mon Jan 12 20:05:22 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 12 Jan 2015 20:05:22 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1815-gd656709 Message-ID: <20150113010522.A4AC8AA12F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d6567095f48bf1f9757114326b70c972333ce320 (commit) via 990175e47f2ef5da5723865f9bf627787a2f0a8d (commit) from db293e1ca64acb9302b6ca660e94aee305045055 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d6567095f48bf1f9757114326b70c972333ce320 commit d6567095f48bf1f9757114326b70c972333ce320 Merge: db293e1 990175e Author: Stephen Kelly AuthorDate: Mon Jan 12 20:05:19 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 12 20:05:19 2015 -0500 Merge topic 'fix-LOCATION-with-TARGET_OBJECTS' into next 990175e4 cmTarget: Compute link language of OBJECT_TARGETS with CMP0026 OLD (#15338) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=990175e47f2ef5da5723865f9bf627787a2f0a8d commit 990175e47f2ef5da5723865f9bf627787a2f0a8d Author: Stephen Kelly AuthorDate: Tue Jan 13 00:35:52 2015 +0100 Commit: Stephen Kelly CommitDate: Tue Jan 13 01:48:54 2015 +0100 cmTarget: Compute link language of OBJECT_TARGETS with CMP0026 OLD (#15338) Commit v3.1.0-rc1~297^2~5 (cmTarget: Drop 'head' argument from GetSourceFiles, 2014-07-10) exposed a dormant bug in source file computation, causing the test case to regress. After that commit, the source file computation and caching finds an existing container of source files. Prior to that patch, the GetSourceFiles method was called with either a null pointer for the head cmTarget, or it was called with the this pointer. The processSources method is eventually called, which normalizes the difference between the null pointer and the this pointer for the head target. However, the cache key depends on the actual pre-normalized pointer. The change in that commit caused the entry to be found in the cache where it was not before, which resulted in incorrect behavior. Prior to that commit, the test case also fails if the GetSourceFiles overload taking a vector is changed to normalize the head target at the beginning of the method: cmTarget const* head = head_ ? head_ : this; Such a construct was correctly used in other locations where similar caching was in place, before being removed in commit v3.1.0-rc1~310^2~25 (cmTarget: Remove 'head' argument from GetLinkInformation, 2014-06-12), but is not neccessary anymore. Commit v3.1.0-rc1~674^2~2 (cmTarget: Cache the cmSourceFiles in GetSourceFiles., 2014-04-05) introduced the caching, but fails the test case for an unrelated reason. That unrelated error was introduced in commit v3.1.0-rc1~688^2~5 (cmTarget: Allow any generator expression in SOURCES property., 2014-03-18) and fixed in commit v3.1.0-rc1~561^2~1 (cmTarget: Fix listing of source files at configure-time., 2014-04-13). All commits which fail the test case in the testable way do so when such a cached version of the source files is found and returned at generate time. In the test case, the cached content is populated at configure-time through the use of the deprecated LOCATION property. The cached content is an empty container for the bar target in the test case, because its source file 'foo.cpp.o' is not known until generate-time. That means that no source files are available to compute the link language and the reported error is issued. The actual problem is that the SourceFilesMap should be cleared after configure time by cmTarget::ClearLinkMaps. Clear it there now. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ad1c83e..4ebc1ce 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -547,6 +547,7 @@ void cmTarget::ClearLinkMaps() this->Internal->LinkInterfaceMap.clear(); 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) diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt new file mode 100644 index 0000000..0996cb6 --- /dev/null +++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt @@ -0,0 +1,12 @@ +CMake Warning \(dev\) at LOCATION-and-TARGET_OBJECTS.cmake:[0-9]+ \(get_target_property\): + Policy CMP0026 is not set: Disallow use of the LOCATION target property. + Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + The LOCATION property should not be read from target "bar". Use the target + name directly with add_custom_command, or use the generator expression + \$, as appropriate. + +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake new file mode 100644 index 0000000..3d8eb73 --- /dev/null +++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake @@ -0,0 +1,6 @@ + +enable_language(CXX) + +add_library(foo OBJECT empty.cpp) +add_executable(bar $) +get_target_property(location bar LOCATION) diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake index 7c2582f..fc58ea5 100644 --- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake @@ -10,3 +10,4 @@ run_cmake(CMP0026-LOCATION-CONFIG-NEW) run_cmake(CMP0026-LOCATION-CONFIG-OLD) run_cmake(CMP0026-LOCATION-CONFIG-WARN) run_cmake(ObjlibNotDefined) +run_cmake(LOCATION-and-TARGET_OBJECTS) ----------------------------------------------------------------------- Summary of changes: Source/cmTarget.cxx | 1 + .../LOCATION-and-TARGET_OBJECTS-result.txt} | 0 ...ned-stderr.txt => LOCATION-and-TARGET_OBJECTS-stderr.txt} | 10 +++++----- Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake | 6 ++++++ Tests/RunCMake/CMP0026/RunCMakeTest.cmake | 1 + 5 files changed, 13 insertions(+), 5 deletions(-) copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt} (100%) copy Tests/RunCMake/CMP0026/{ObjlibNotDefined-stderr.txt => LOCATION-and-TARGET_OBJECTS-stderr.txt} (50%) create mode 100644 Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jan 13 00:01:12 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 13 Jan 2015 00:01:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-733-gd61c6df Message-ID: <20150113050112.36F06A961C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via d61c6df2fa9161d784a71b05e584cb1e944a182a (commit) from 3dec4a2bfbad7b519cb1e7c9aa72dd2ee3c4e669 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d61c6df2fa9161d784a71b05e584cb1e944a182a commit d61c6df2fa9161d784a71b05e584cb1e944a182a Author: Kitware Robot AuthorDate: Tue Jan 13 00:01:09 2015 -0500 Commit: Kitware Robot CommitDate: Tue Jan 13 00:01:09 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 89ccad5..cea9400 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 20150112) +set(CMake_VERSION_PATCH 20150113) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Tue Jan 13 03:37:41 2015 From: steveire at gmail.com (Stephen Kelly) Date: Tue, 13 Jan 2015 03:37:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1817-g40750a7 Message-ID: <20150113083741.712BEAA125@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 40750a723f63a3f638fdfd80f94fb0dcc6db482d (commit) via 23f3798c7b38ef7274f318ab90f1788b569dbc5d (commit) from d6567095f48bf1f9757114326b70c972333ce320 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=40750a723f63a3f638fdfd80f94fb0dcc6db482d commit 40750a723f63a3f638fdfd80f94fb0dcc6db482d Merge: d656709 23f3798 Author: Stephen Kelly AuthorDate: Tue Jan 13 03:37:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 03:37:40 2015 -0500 Merge topic 'fix-LOCATION-with-TARGET_OBJECTS' into next 23f3798c cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23f3798c7b38ef7274f318ab90f1788b569dbc5d commit 23f3798c7b38ef7274f318ab90f1788b569dbc5d Author: Stephen Kelly AuthorDate: Tue Jan 13 00:35:52 2015 +0100 Commit: Stephen Kelly CommitDate: Tue Jan 13 09:36:20 2015 +0100 cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338) Commit v3.1.0-rc1~297^2~5 (cmTarget: Drop 'head' argument from GetSourceFiles, 2014-07-10) exposed a dormant bug in source file computation, causing the test case to regress. After that commit, the source file computation and caching finds an existing container of source files. Prior to that patch, the GetSourceFiles method was called with either a null pointer for the head cmTarget, or it was called with the this pointer. The processSources method is eventually called, which normalizes the difference between the null pointer and the this pointer for the head target. However, the cache key depends on the actual pre-normalized pointer. The change in that commit caused the entry to be found in the cache where it was not before, which resulted in incorrect behavior. Prior to that commit, the test case also fails if the GetSourceFiles overload taking a vector is changed to normalize the head target at the beginning of the method: cmTarget const* head = head_ ? head_ : this; Such a construct was correctly used in other locations where similar caching was in place, before being removed in commit v3.1.0-rc1~310^2~25 (cmTarget: Remove 'head' argument from GetLinkInformation, 2014-06-12), but is not neccessary anymore. Commit v3.1.0-rc1~674^2~2 (cmTarget: Cache the cmSourceFiles in GetSourceFiles., 2014-04-05) introduced the caching, but fails the test case for an unrelated reason. That unrelated error was introduced in commit v3.1.0-rc1~688^2~5 (cmTarget: Allow any generator expression in SOURCES property., 2014-03-18) and fixed in commit v3.1.0-rc1~561^2~1 (cmTarget: Fix listing of source files at configure-time., 2014-04-13). All commits which fail the test case in the testable way do so when such a cached version of the source files is found and returned at generate time. In the test case, the cached content is populated at configure-time through the use of the deprecated LOCATION property with CMP0026 OLD. The cached content is an empty container for the bar target in the test case, because its source file 'foo.cpp.o' is not known until generate-time. That means that no source files are available to compute the link language and the reported error is issued. The actual problem is that the SourceFilesMap should be cleared after configure time by cmTarget::ClearLinkMaps. Clear it there now. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ad1c83e..4ebc1ce 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -547,6 +547,7 @@ void cmTarget::ClearLinkMaps() this->Internal->LinkInterfaceMap.clear(); 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) diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt new file mode 100644 index 0000000..0996cb6 --- /dev/null +++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt @@ -0,0 +1,12 @@ +CMake Warning \(dev\) at LOCATION-and-TARGET_OBJECTS.cmake:[0-9]+ \(get_target_property\): + Policy CMP0026 is not set: Disallow use of the LOCATION target property. + Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + The LOCATION property should not be read from target "bar". Use the target + name directly with add_custom_command, or use the generator expression + \$, as appropriate. + +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake new file mode 100644 index 0000000..3d8eb73 --- /dev/null +++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake @@ -0,0 +1,6 @@ + +enable_language(CXX) + +add_library(foo OBJECT empty.cpp) +add_executable(bar $) +get_target_property(location bar LOCATION) diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake index 7c2582f..fc58ea5 100644 --- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake @@ -10,3 +10,4 @@ run_cmake(CMP0026-LOCATION-CONFIG-NEW) run_cmake(CMP0026-LOCATION-CONFIG-OLD) run_cmake(CMP0026-LOCATION-CONFIG-WARN) run_cmake(ObjlibNotDefined) +run_cmake(LOCATION-and-TARGET_OBJECTS) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 09:00:18 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 09:00:18 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1819-g9e514a1 Message-ID: <20150113140018.3BDC5AA080@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9e514a10d87fe26eec2920ef6f5b4ce299b6c8fb (commit) via 4048f7cde018b2cddb9e6e53b04dbf6f588b3e5f (commit) from 40750a723f63a3f638fdfd80f94fb0dcc6db482d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e514a10d87fe26eec2920ef6f5b4ce299b6c8fb commit 9e514a10d87fe26eec2920ef6f5b4ce299b6c8fb Merge: 40750a7 4048f7c Author: Brad King AuthorDate: Tue Jan 13 09:00:17 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 09:00:17 2015 -0500 Merge topic 'FindBoost-update-versions' into next 4048f7cd FindBoost: Add latest Boost version 1.57.0 and next milestone 1.58.0 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4048f7cde018b2cddb9e6e53b04dbf6f588b3e5f commit 4048f7cde018b2cddb9e6e53b04dbf6f588b3e5f Author: Sergey Nikulov AuthorDate: Tue Jan 13 16:51:14 2015 +0300 Commit: Brad King CommitDate: Tue Jan 13 08:59:13 2015 -0500 FindBoost: Add latest Boost version 1.57.0 and next milestone 1.58.0 diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 3642b3e..d837aeb 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -478,7 +478,7 @@ else() # The user has not requested an exact version. Among known # versions, find those that are acceptable to the user request. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} - "1.56.0" "1.56" "1.55.0" "1.55" "1.54.0" "1.54" + "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55" "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1" "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42" ----------------------------------------------------------------------- Summary of changes: Modules/FindBoost.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 09:59:58 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 09:59:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1821-g56db783 Message-ID: <20150113145958.D15CDA9E6C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 56db783f0c5e882d45c6f78f5d46dbf3f1c09ae4 (commit) via 546906243d21727ac6c1bab0210fc028ff80c3c0 (commit) from 9e514a10d87fe26eec2920ef6f5b4ce299b6c8fb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=56db783f0c5e882d45c6f78f5d46dbf3f1c09ae4 commit 56db783f0c5e882d45c6f78f5d46dbf3f1c09ae4 Merge: 9e514a1 5469062 Author: Brad King AuthorDate: Tue Jan 13 09:59:57 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 09:59:57 2015 -0500 Merge topic 'FindGit-local-Github' into next 54690624 FindGit: Search in 'GitHub for Windows' user directory http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=546906243d21727ac6c1bab0210fc028ff80c3c0 commit 546906243d21727ac6c1bab0210fc028ff80c3c0 Author: Frank Park AuthorDate: Mon Jan 12 21:23:37 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 08:54:31 2015 -0500 FindGit: Search in 'GitHub for Windows' user directory diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake index 570538d..b4f7b4b 100644 --- a/Modules/FindGit.cmake +++ b/Modules/FindGit.cmake @@ -45,11 +45,15 @@ set(git_names git eg) if(WIN32) if(NOT CMAKE_GENERATOR MATCHES "MSYS") set(git_names git.cmd git eg.cmd eg) + # GitHub search path for Windows + set(github_path "$ENV{LOCALAPPDATA}/Github/PortableGit*/bin") + file(GLOB github_path "${github_path}") endif() endif() find_program(GIT_EXECUTABLE NAMES ${git_names} + PATHS ${github_path} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client" ) ----------------------------------------------------------------------- Summary of changes: Modules/FindGit.cmake | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- CMake From bill.hoffman at kitware.com Tue Jan 13 10:59:45 2015 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Tue, 13 Jan 2015 10:59:45 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1823-g87c9680 Message-ID: <20150113155945.99F59A9F0B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 87c968015515351aacbee47779194e1df43b512e (commit) via 8bba38161855deaa90fe72057f6cd4564110d551 (commit) from 56db783f0c5e882d45c6f78f5d46dbf3f1c09ae4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=87c968015515351aacbee47779194e1df43b512e commit 87c968015515351aacbee47779194e1df43b512e Merge: 56db783 8bba381 Author: Bill Hoffman AuthorDate: Tue Jan 13 10:59:44 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 10:59:44 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 8bba3816 Do not set the options on the handler if they are not used. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8bba38161855deaa90fe72057f6cd4564110d551 commit 8bba38161855deaa90fe72057f6cd4564110d551 Author: Bill Hoffman AuthorDate: Tue Jan 13 10:58:40 2015 -0500 Commit: Bill Hoffman CommitDate: Tue Jan 13 10:58:40 2015 -0500 Do not set the options on the handler if they are not used. diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index c608034..dcd7982 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -145,10 +145,13 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() static_cast(handler)->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF"); - static_cast(handler)-> - SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); - static_cast(handler)-> - SetOption("CDashUploadType", this->CDashUploadType.c_str()); + if(this->CDashUploadFile.size()) + { + static_cast(handler)-> + SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); + static_cast(handler)-> + SetOption("CDashUploadType", this->CDashUploadType.c_str()); + } return handler; } ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestSubmitCommand.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 11:51:51 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 11:51:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1826-g122cef7 Message-ID: <20150113165151.C6725A941F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 122cef7ce4290f4163d56215babf7eafa5142249 (commit) via 137288283063480d7c29ce7d5127a258ad9a67c7 (commit) via 25f91c6450f1bc569465af9183bc9ff58f1a503f (commit) from 87c968015515351aacbee47779194e1df43b512e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=122cef7ce4290f4163d56215babf7eafa5142249 commit 122cef7ce4290f4163d56215babf7eafa5142249 Merge: 87c9680 1372882 Author: Brad King AuthorDate: Tue Jan 13 11:51:50 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 11:51:50 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 13728828 jsoncpp: Fix use of isfinite on ancient Linux 25f91c64 jsoncpp: Add missing include in json/writer.h http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=137288283063480d7c29ce7d5127a258ad9a67c7 commit 137288283063480d7c29ce7d5127a258ad9a67c7 Author: Brad King AuthorDate: Tue Jan 13 11:51:33 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 11:51:33 2015 -0500 jsoncpp: Fix use of isfinite on ancient Linux diff --git a/Utilities/cmjsoncpp/json_writer.cpp b/Utilities/cmjsoncpp/json_writer.cpp index 8eb7dc5..387fd35 100644 --- a/Utilities/cmjsoncpp/json_writer.cpp +++ b/Utilities/cmjsoncpp/json_writer.cpp @@ -21,6 +21,13 @@ #define snprintf _snprintf #endif +// Ancient Linux +#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 2 +# if !defined(isfinite) +# define isfinite __finite +# endif +#endif + #if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 // Disable warning about strdup being deprecated. #pragma warning(disable : 4996) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=25f91c6450f1bc569465af9183bc9ff58f1a503f commit 25f91c6450f1bc569465af9183bc9ff58f1a503f Author: Brad King AuthorDate: Tue Jan 13 11:50:29 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 11:51:00 2015 -0500 jsoncpp: Add missing include in json/writer.h The header uses std::ostream, so it must be declared. diff --git a/Utilities/cmjsoncpp/json/writer.h b/Utilities/cmjsoncpp/json/writer.h index dc9e46f..397bf6a 100644 --- a/Utilities/cmjsoncpp/json/writer.h +++ b/Utilities/cmjsoncpp/json/writer.h @@ -9,6 +9,7 @@ #if !defined(JSON_IS_AMALGAMATION) #include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) +#include #include #include ----------------------------------------------------------------------- Summary of changes: Utilities/cmjsoncpp/json/writer.h | 1 + Utilities/cmjsoncpp/json_writer.cpp | 7 +++++++ 2 files changed, 8 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 12:08:55 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 12:08:55 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1828-g96608c4 Message-ID: <20150113170855.E751DAA22D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 96608c4fd230f3ca50b0f68eb75c0cedc0507228 (commit) via 8ffd8b702415904a3a90cde5c6aaa06678a17635 (commit) from 122cef7ce4290f4163d56215babf7eafa5142249 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96608c4fd230f3ca50b0f68eb75c0cedc0507228 commit 96608c4fd230f3ca50b0f68eb75c0cedc0507228 Merge: 122cef7 8ffd8b7 Author: Brad King AuthorDate: Tue Jan 13 12:08:55 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 12:08:55 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 8ffd8b70 jsoncpp: Disable warnings to avoid changing 3rd party code http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8ffd8b702415904a3a90cde5c6aaa06678a17635 commit 8ffd8b702415904a3a90cde5c6aaa06678a17635 Author: Brad King AuthorDate: Tue Jan 13 10:45:23 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 12:07:31 2015 -0500 jsoncpp: Disable warnings to avoid changing 3rd party code Add '-w' or equivalent flag on compilers supporting it. Tell MSVC to use its lowest warning level inside jsoncpp sources. diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt index fb2236f..7289c8f 100644 --- a/Utilities/cmjsoncpp/CMakeLists.txt +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -1,5 +1,13 @@ project(JsonCpp) +# Disable warnings to avoid changing 3rd party code. +if(CMAKE_CXX_COMPILER_ID MATCHES + "^(GNU|Clang|AppleClang|XL|VisualAge|SunPro|MIPSpro|HP|Intel)$") + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -w") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PathScale") + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -woffall") +endif() + set(JSONCPP_SOURCES json_tool.h json_reader.cpp diff --git a/Utilities/cmjsoncpp/json/config.h b/Utilities/cmjsoncpp/json/config.h index afd3a45..5c711e3 100644 --- a/Utilities/cmjsoncpp/json/config.h +++ b/Utilities/cmjsoncpp/json/config.h @@ -6,6 +6,10 @@ #ifndef JSON_CONFIG_H_INCLUDED #define JSON_CONFIG_H_INCLUDED +#if defined(_MSC_VER) +# pragma warning(push,1) +#endif + /// If defined, indicates that json library is embedded in CppTL library. //# define JSON_IN_CPPTL 1 ----------------------------------------------------------------------- Summary of changes: Utilities/cmjsoncpp/CMakeLists.txt | 8 ++++++++ Utilities/cmjsoncpp/json/config.h | 4 ++++ 2 files changed, 12 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 14:36:29 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 14:36:29 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1830-g3b39c77 Message-ID: <20150113193629.3F889A9F0E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3b39c774d7a62c7e21c40f9b2256c31faa8e3892 (commit) via cc13bd844230d6cd50d244f0fbb46676d4d2ab0b (commit) from 96608c4fd230f3ca50b0f68eb75c0cedc0507228 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3b39c774d7a62c7e21c40f9b2256c31faa8e3892 commit 3b39c774d7a62c7e21c40f9b2256c31faa8e3892 Merge: 96608c4 cc13bd8 Author: Brad King AuthorDate: Tue Jan 13 14:36:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 14:36:26 2015 -0500 Merge topic 'cdash_upload_file_mode' into next cc13bd84 Revise topic 'cdash_upload_file_mode' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cc13bd844230d6cd50d244f0fbb46676d4d2ab0b commit cc13bd844230d6cd50d244f0fbb46676d4d2ab0b Author: Brad King AuthorDate: Tue Jan 13 12:12:33 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 12:12:33 2015 -0500 Revise topic 'cdash_upload_file_mode' Update tree object at head of topic to match upcoming revised topic. diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b57951..1847600 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 JSONCPP) + set(UTILITIES BZIP2 CURL EXPAT FORM LIBARCHIVE LIBLZMA ZLIB) foreach(util ${UTILITIES}) if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util} AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES) @@ -372,15 +372,9 @@ macro (CMAKE_BUILD_UTILITIES) endif() #--------------------------------------------------------------------- - # Build expat library for CMake and CTest. - if(CMAKE_USE_SYSTEM_JSONCPP) - message(FATAL_ERROR "System JSONCPP not implemented") - else() - set(CMAKE_JSONCPP_INCLUDES ${CMake_SOURCE_DIR}/Utilities/cmjsoncpp) - set(CMAKE_JSONCPP_LIBRARIES cmjsoncpp) - add_subdirectory(Utilities/cmjsoncpp) - CMAKE_SET_TARGET_FOLDER(jsoncpp "Utilities/3rdParty") - endif() + # Build jsoncpp library. + add_subdirectory(Utilities/cmjsoncpp) + CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty") #--------------------------------------------------------------------- # Build XMLRPC library for CMake and CTest. diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index 5196485..d96b96f 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -63,6 +63,7 @@ All Modules /module/CPack /module/CPackWIX /module/CTest + /module/CTestGCOV /module/CTestScriptMode /module/CTestUseLaunchers /module/Dart diff --git a/Help/module/CTestGCOV.rst b/Help/module/CTestGCOV.rst new file mode 100644 index 0000000..b1077fe --- /dev/null +++ b/Help/module/CTestGCOV.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/CTestGCOV.cmake diff --git a/Modules/CTestGCOV.cmake b/Modules/CTestGCOV.cmake index 0e3a1a8..f505159 100644 --- a/Modules/CTestGCOV.cmake +++ b/Modules/CTestGCOV.cmake @@ -1,28 +1,28 @@ #.rst: # CTestGCOV -# ----------------------------- +# --------- # -# CTestGCOV.cmake +# This module provides the function ``run_gcov_and_package_for_cdash``. +# The function will run gcov on the .gcda files in a binary tree and then +# package all of the .gcov files into a tar file with a data.json. +# This file can be sent to a CDash server for display with the +# :command:`ctest_submit(CDASH_UPLOAD)` command. # -# This module provides the function run_gcov_and_package_for_cdash. The -# function will run gcov on the .gcda files in a binary tree and then -# package all of the .gcov files into a tar file with a data.json. This -# file can be sent to a CDash server for display with ctest_submit -# CDASH_UPLOAD. +# .. command:: run_gcov_and_package_for_cdash # -# :: +# :: # -# run_gcov_and_package_for_cdash( -# ) +# run_gcov_and_package_for_cdash( +# ) # -# Run gcov and package a tar gz file for cdash. tarfile is the name -# of the tarfile that is created and it will be placed in binary_dir. -# source_dir is the source directory for the build and binary_dir is -# the binary directory for the build. The gcov_command is a full path -# to gcov for the machine. +# Run gcov and package a tar gz file for cdash. ```` is the name +# of the tarfile that is created and it will be placed in ````. +# ```` is the source directory for the build and ```` +# is the binary directory for the build. The ```` is a full +# path to ``gcov`` for the machine. #============================================================================= -# Copyright 2008-2009 Kitware, Inc. +# Copyright 2014-2015 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 5f08223..78bef91 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -74,7 +74,6 @@ configure_file( include_directories( "${CMake_BINARY_DIR}/Source" "${CMake_SOURCE_DIR}/Source" - ${CMAKE_JSONCPP_INCLUDES} ${CMAKE_ZLIB_INCLUDES} ${CMAKE_EXPAT_INCLUDES} ${CMAKE_TAR_INCLUDES} @@ -585,7 +584,7 @@ set(CTEST_SRCS cmCTest.cxx # Build CTestLib add_library(CTestLib ${CTEST_SRCS}) -target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES} ${CMAKE_JSONCPP_LIBRARIES}) +target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES} cmjsoncpp) # # Sources for CPack diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 2f6a9e9..3e5fa38 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -24,7 +24,7 @@ // For XML-RPC submission #include "cm_xmlrpc.h" -#include +#include // For curl submission #include "cm_curl.h" #include "cmCTestCurl.h" diff --git a/Utilities/cm_jsoncpp_reader.h b/Utilities/cm_jsoncpp_reader.h new file mode 100644 index 0000000..d7cb50e --- /dev/null +++ b/Utilities/cm_jsoncpp_reader.h @@ -0,0 +1,18 @@ +/*============================================================================ + 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_reader_h +#define cm_jsoncpp_reader_h + +/* Use the jsoncpp library configured for CMake. */ +#include + +#endif diff --git a/Utilities/cmjsoncpp/.gitattributes b/Utilities/cmjsoncpp/.gitattributes new file mode 100644 index 0000000..562b12e --- /dev/null +++ b/Utilities/cmjsoncpp/.gitattributes @@ -0,0 +1 @@ +* -whitespace diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt index 7289c8f..1a10295 100644 --- a/Utilities/cmjsoncpp/CMakeLists.txt +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -1,4 +1,4 @@ -project(JsonCpp) +project(JsonCpp CXX) # Disable warnings to avoid changing 3rd party code. if(CMAKE_CXX_COMPILER_ID MATCHES @@ -9,14 +9,14 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PathScale") endif() set(JSONCPP_SOURCES - json_tool.h - json_reader.cpp - json_batchallocator.h - json_valueiterator.inl - json_value.cpp - json_writer.cpp -) + src/lib_json/json_batchallocator.h + src/lib_json/json_reader.cpp + src/lib_json/json_tool.h + src/lib_json/json_value.cpp + src/lib_json/json_valueiterator.inl + src/lib_json/json_writer.cpp + ) -include_directories(${JsonCpp_SOURCE_DIR}) +include_directories(${JsonCpp_SOURCE_DIR}/include) add_library(cmjsoncpp ${JSONCPP_SOURCES}) diff --git a/Utilities/cmjsoncpp/LICENSE b/Utilities/cmjsoncpp/LICENSE new file mode 100644 index 0000000..ca2bfe1 --- /dev/null +++ b/Utilities/cmjsoncpp/LICENSE @@ -0,0 +1,55 @@ +The JsonCpp library's source code, including accompanying documentation, +tests and demonstration applications, are licensed under the following +conditions... + +The author (Baptiste Lepilleur) explicitly disclaims copyright in all +jurisdictions which recognize such a disclaimer. In such jurisdictions, +this software is released into the Public Domain. + +In jurisdictions which do not recognize Public Domain property (e.g. Germany as of +2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is +released under the terms of the MIT License (see below). + +In jurisdictions which recognize Public Domain property, the user of this +software may choose to accept it either as 1) Public Domain, 2) under the +conditions of the MIT License (see below), or 3) under the terms of dual +Public Domain/MIT License conditions described here, as they choose. + +The MIT License is about as close to Public Domain as a license can get, and is +described in clear, concise terms at: + + http://en.wikipedia.org/wiki/MIT_License + +The full text of the MIT License follows: + +======================================================================== +Copyright (c) 2007-2010 Baptiste Lepilleur + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +======================================================================== +(END LICENSE TEXT) + +The MIT license is compatible with both the GPL and commercial +software, affording one all of the rights of Public Domain with the +minor nuisance of being required to keep the above copyright notice +and license text in the source code. Note also that by accepting the +Public Domain "license" you can re-license your copy using whatever +license you like. diff --git a/Utilities/cmjsoncpp/README-CMake.txt b/Utilities/cmjsoncpp/README-CMake.txt new file mode 100644 index 0000000..cfd2d4d --- /dev/null +++ b/Utilities/cmjsoncpp/README-CMake.txt @@ -0,0 +1,66 @@ +The Utilities/cmjsoncpp directory contains a reduced distribution +of the jsoncpp source tree with only the library source code and +CMake build system. It is not a submodule; the actual content is part +of our source tree and changes can be made and committed directly. + +We update from upstream using Git's "subtree" merge strategy. A +special branch contains commits of upstream jsoncpp snapshots and +nothing else. No Git ref points explicitly to the head of this +branch, but it is merged into our history. + +Update jsoncpp from upstream as follows. Create a local branch to +explicitly reference the upstream snapshot branch head: + + git branch jsoncpp-upstream ca64c01e + +Use a temporary directory to checkout the branch: + + mkdir jsoncpp-tmp + cd jsoncpp-tmp + git init + git pull .. jsoncpp-upstream + rm -rf * + +Now place the (reduced) jsoncpp content in this directory. See +instructions shown by + + git log ca64c01e + +for help extracting the content from the upstream svn repo. Then run +the following commands to commit the new version. Substitute the +appropriate date and version number: + + git add --all + + GIT_AUTHOR_NAME='JsonCpp Upstream' \ + GIT_AUTHOR_EMAIL='github.com' \ + GIT_AUTHOR_DATE='Thu Nov 20 08:45:58 2014 -0600' \ + git commit -m 'JsonCpp 1.0.0 (reduced)' && + git commit --amend + +Edit the commit message to describe the procedure used to obtain the +content. Then push the changes back up to the main local repository: + + git push .. HEAD:jsoncpp-upstream + cd .. + rm -rf jsoncpp-tmp + +Create a topic in the main repository on which to perform the update: + + git checkout -b update-jsoncpp master + +Merge the jsoncpp-upstream branch as a subtree: + + git merge -s recursive -X subtree=Utilities/cmjsoncpp \ + jsoncpp-upstream + +If there are conflicts, resolve them and commit. Build and test the +tree. Commit any additional changes needed to succeed. + +Finally, run + + git rev-parse --short=8 jsoncpp-upstream + +to get the commit from which the jsoncpp-upstream branch must be started +on the next update. Edit the "git branch jsoncpp-upstream" line above to +record it, and commit this file. diff --git a/Utilities/cmjsoncpp/json/assertions.h b/Utilities/cmjsoncpp/include/json/assertions.h similarity index 100% rename from Utilities/cmjsoncpp/json/assertions.h rename to Utilities/cmjsoncpp/include/json/assertions.h diff --git a/Utilities/cmjsoncpp/json/config.h b/Utilities/cmjsoncpp/include/json/config.h similarity index 100% rename from Utilities/cmjsoncpp/json/config.h rename to Utilities/cmjsoncpp/include/json/config.h diff --git a/Utilities/cmjsoncpp/json/features.h b/Utilities/cmjsoncpp/include/json/features.h similarity index 100% rename from Utilities/cmjsoncpp/json/features.h rename to Utilities/cmjsoncpp/include/json/features.h diff --git a/Utilities/cmjsoncpp/json/forwards.h b/Utilities/cmjsoncpp/include/json/forwards.h similarity index 100% rename from Utilities/cmjsoncpp/json/forwards.h rename to Utilities/cmjsoncpp/include/json/forwards.h diff --git a/Utilities/cmjsoncpp/json/json.h b/Utilities/cmjsoncpp/include/json/json.h similarity index 100% rename from Utilities/cmjsoncpp/json/json.h rename to Utilities/cmjsoncpp/include/json/json.h diff --git a/Utilities/cmjsoncpp/json/reader.h b/Utilities/cmjsoncpp/include/json/reader.h similarity index 89% rename from Utilities/cmjsoncpp/json/reader.h rename to Utilities/cmjsoncpp/include/json/reader.h index e99dbc0..98814d5 100644 --- a/Utilities/cmjsoncpp/json/reader.h +++ b/Utilities/cmjsoncpp/include/json/reader.h @@ -130,6 +130,29 @@ public: */ std::vector getStructuredErrors() const; + /** \brief Add a semantic error message. + * \param value JSON Value location associated with the error + * \param message The error message. + * \return \c true if the error was successfully added, \c false if the + * Value offset exceeds the document size. + */ + bool pushError(const Value& value, const std::string& message); + + /** \brief Add a semantic error message with extra context. + * \param value JSON Value location associated with the error + * \param message The error message. + * \param extra Additional JSON Value location to contextualize the error + * \return \c true if the error was successfully added, \c false if either + * Value offset exceeds the document size. + */ + bool pushError(const Value& value, const std::string& message, const Value& extra); + + /** \brief Return whether there are any errors. + * \return \c true if there are no errors to report \c false if + * errors have occurred. + */ + bool good() const; + private: enum TokenType { tokenEndOfStream = 0, diff --git a/Utilities/cmjsoncpp/json/value.h b/Utilities/cmjsoncpp/include/json/value.h similarity index 99% rename from Utilities/cmjsoncpp/json/value.h rename to Utilities/cmjsoncpp/include/json/value.h index a60ca8f..197a856 100644 --- a/Utilities/cmjsoncpp/json/value.h +++ b/Utilities/cmjsoncpp/include/json/value.h @@ -440,6 +440,8 @@ Json::Value obj_value(Json::objectValue); // {} size_t getOffsetLimit() const; private: + void initBasic(ValueType type, bool allocated = false); + Value& resolveReference(const char* key, bool isStatic); #ifdef JSON_VALUE_USE_INTERNAL_MAP diff --git a/Utilities/cmjsoncpp/include/json/version.h b/Utilities/cmjsoncpp/include/json/version.h new file mode 100644 index 0000000..6fe0682 --- /dev/null +++ b/Utilities/cmjsoncpp/include/json/version.h @@ -0,0 +1,14 @@ +// DO NOT EDIT. This file is generated by CMake from "version" +// and "version.h.in" files. +// Run CMake configure step to update it. +#ifndef JSON_VERSION_H_INCLUDED +# define JSON_VERSION_H_INCLUDED + +# define JSONCPP_VERSION_STRING "1.0.0" +# define JSONCPP_VERSION_MAJOR 1 +# define JSONCPP_VERSION_MINOR 0 +# define JSONCPP_VERSION_PATCH 0 +# define JSONCPP_VERSION_QUALIFIER +# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8)) + +#endif // JSON_VERSION_H_INCLUDED diff --git a/Utilities/cmjsoncpp/json/writer.h b/Utilities/cmjsoncpp/include/json/writer.h similarity index 100% rename from Utilities/cmjsoncpp/json/writer.h rename to Utilities/cmjsoncpp/include/json/writer.h diff --git a/Utilities/cmjsoncpp/json/version.h b/Utilities/cmjsoncpp/json/version.h deleted file mode 100644 index 380827e..0000000 --- a/Utilities/cmjsoncpp/json/version.h +++ /dev/null @@ -1,16 +0,0 @@ -// DO NOT EDIT. This file is generated by CMake from "version" -// and "version.h.in" files. -// Run CMake configure step to update it. -#ifndef JSON_VERSION_H_INCLUDED -#define JSON_VERSION_H_INCLUDED - -#define JSONCPP_VERSION_STRING "0.7.0" -#define JSONCPP_VERSION_MAJOR 0 -#define JSONCPP_VERSION_MINOR 7 -#define JSONCPP_VERSION_PATCH 0 -#define JSONCPP_VERSION_QUALIFIER -#define JSONCPP_VERSION_HEXA \ - ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \ - (JSONCPP_VERSION_PATCH << 8)) - -#endif // JSON_VERSION_H_INCLUDED diff --git a/Utilities/cmjsoncpp/json_batchallocator.h b/Utilities/cmjsoncpp/src/lib_json/json_batchallocator.h similarity index 99% rename from Utilities/cmjsoncpp/json_batchallocator.h rename to Utilities/cmjsoncpp/src/lib_json/json_batchallocator.h index 3705c20..2fbef7a 100644 --- a/Utilities/cmjsoncpp/json_batchallocator.h +++ b/Utilities/cmjsoncpp/src/lib_json/json_batchallocator.h @@ -119,4 +119,3 @@ private: #endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION #endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED -// vim: et ts=2 sts=2 sw=2 tw=0 diff --git a/Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl b/Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl new file mode 100644 index 0000000..9ee15e9 --- /dev/null +++ b/Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl @@ -0,0 +1,360 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +// included by json_value.cpp + +namespace Json { + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueInternalArray +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueArrayAllocator::~ValueArrayAllocator() {} + +// ////////////////////////////////////////////////////////////////// +// class DefaultValueArrayAllocator +// ////////////////////////////////////////////////////////////////// +#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +class DefaultValueArrayAllocator : public ValueArrayAllocator { +public: // overridden from ValueArrayAllocator + virtual ~DefaultValueArrayAllocator() {} + + virtual ValueInternalArray* newArray() { return new ValueInternalArray(); } + + virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) { + return new ValueInternalArray(other); + } + + virtual void destructArray(ValueInternalArray* array) { delete array; } + + virtual void + reallocateArrayPageIndex(Value**& indexes, + ValueInternalArray::PageIndex& indexCount, + ValueInternalArray::PageIndex minNewIndexCount) { + ValueInternalArray::PageIndex newIndexCount = (indexCount * 3) / 2 + 1; + if (minNewIndexCount > newIndexCount) + newIndexCount = minNewIndexCount; + void* newIndexes = realloc(indexes, sizeof(Value*) * newIndexCount); + JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); + indexCount = newIndexCount; + indexes = static_cast(newIndexes); + } + virtual void releaseArrayPageIndex(Value** indexes, + ValueInternalArray::PageIndex indexCount) { + if (indexes) + free(indexes); + } + + virtual Value* allocateArrayPage() { + return static_cast( + malloc(sizeof(Value) * ValueInternalArray::itemsPerPage)); + } + + virtual void releaseArrayPage(Value* value) { + if (value) + free(value); + } +}; + +#else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +/// @todo make this thread-safe (lock when accessign batch allocator) +class DefaultValueArrayAllocator : public ValueArrayAllocator { +public: // overridden from ValueArrayAllocator + virtual ~DefaultValueArrayAllocator() {} + + virtual ValueInternalArray* newArray() { + ValueInternalArray* array = arraysAllocator_.allocate(); + new (array) ValueInternalArray(); // placement new + return array; + } + + virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) { + ValueInternalArray* array = arraysAllocator_.allocate(); + new (array) ValueInternalArray(other); // placement new + return array; + } + + virtual void destructArray(ValueInternalArray* array) { + if (array) { + array->~ValueInternalArray(); + arraysAllocator_.release(array); + } + } + + virtual void + reallocateArrayPageIndex(Value**& indexes, + ValueInternalArray::PageIndex& indexCount, + ValueInternalArray::PageIndex minNewIndexCount) { + ValueInternalArray::PageIndex newIndexCount = (indexCount * 3) / 2 + 1; + if (minNewIndexCount > newIndexCount) + newIndexCount = minNewIndexCount; + void* newIndexes = realloc(indexes, sizeof(Value*) * newIndexCount); + JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); + indexCount = newIndexCount; + indexes = static_cast(newIndexes); + } + virtual void releaseArrayPageIndex(Value** indexes, + ValueInternalArray::PageIndex indexCount) { + if (indexes) + free(indexes); + } + + virtual Value* allocateArrayPage() { + return static_cast(pagesAllocator_.allocate()); + } + + virtual void releaseArrayPage(Value* value) { + if (value) + pagesAllocator_.release(value); + } + +private: + BatchAllocator arraysAllocator_; + BatchAllocator pagesAllocator_; +}; +#endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR + +static ValueArrayAllocator*& arrayAllocator() { + static DefaultValueArrayAllocator defaultAllocator; + static ValueArrayAllocator* arrayAllocator = &defaultAllocator; + return arrayAllocator; +} + +static struct DummyArrayAllocatorInitializer { + DummyArrayAllocatorInitializer() { + arrayAllocator(); // ensure arrayAllocator() statics are initialized before + // main(). + } +} dummyArrayAllocatorInitializer; + +// ////////////////////////////////////////////////////////////////// +// class ValueInternalArray +// ////////////////////////////////////////////////////////////////// +bool ValueInternalArray::equals(const IteratorState& x, + const IteratorState& other) { + return x.array_ == other.array_ && + x.currentItemIndex_ == other.currentItemIndex_ && + x.currentPageIndex_ == other.currentPageIndex_; +} + +void ValueInternalArray::increment(IteratorState& it) { + JSON_ASSERT_MESSAGE( + it.array_ && (it.currentPageIndex_ - it.array_->pages_) * itemsPerPage + + it.currentItemIndex_ != + it.array_->size_, + "ValueInternalArray::increment(): moving iterator beyond end"); + ++(it.currentItemIndex_); + if (it.currentItemIndex_ == itemsPerPage) { + it.currentItemIndex_ = 0; + ++(it.currentPageIndex_); + } +} + +void ValueInternalArray::decrement(IteratorState& it) { + JSON_ASSERT_MESSAGE( + it.array_ && it.currentPageIndex_ == it.array_->pages_ && + it.currentItemIndex_ == 0, + "ValueInternalArray::decrement(): moving iterator beyond end"); + if (it.currentItemIndex_ == 0) { + it.currentItemIndex_ = itemsPerPage - 1; + --(it.currentPageIndex_); + } else { + --(it.currentItemIndex_); + } +} + +Value& ValueInternalArray::unsafeDereference(const IteratorState& it) { + return (*(it.currentPageIndex_))[it.currentItemIndex_]; +} + +Value& ValueInternalArray::dereference(const IteratorState& it) { + JSON_ASSERT_MESSAGE( + it.array_ && (it.currentPageIndex_ - it.array_->pages_) * itemsPerPage + + it.currentItemIndex_ < + it.array_->size_, + "ValueInternalArray::dereference(): dereferencing invalid iterator"); + return unsafeDereference(it); +} + +void ValueInternalArray::makeBeginIterator(IteratorState& it) const { + it.array_ = const_cast(this); + it.currentItemIndex_ = 0; + it.currentPageIndex_ = pages_; +} + +void ValueInternalArray::makeIterator(IteratorState& it, + ArrayIndex index) const { + it.array_ = const_cast(this); + it.currentItemIndex_ = index % itemsPerPage; + it.currentPageIndex_ = pages_ + index / itemsPerPage; +} + +void ValueInternalArray::makeEndIterator(IteratorState& it) const { + makeIterator(it, size_); +} + +ValueInternalArray::ValueInternalArray() : pages_(0), size_(0), pageCount_(0) {} + +ValueInternalArray::ValueInternalArray(const ValueInternalArray& other) + : pages_(0), size_(other.size_), pageCount_(0) { + PageIndex minNewPages = other.size_ / itemsPerPage; + arrayAllocator()->reallocateArrayPageIndex(pages_, pageCount_, minNewPages); + JSON_ASSERT_MESSAGE(pageCount_ >= minNewPages, + "ValueInternalArray::reserve(): bad reallocation"); + IteratorState itOther; + other.makeBeginIterator(itOther); + Value* value; + for (ArrayIndex index = 0; index < size_; ++index, increment(itOther)) { + if (index % itemsPerPage == 0) { + PageIndex pageIndex = index / itemsPerPage; + value = arrayAllocator()->allocateArrayPage(); + pages_[pageIndex] = value; + } + new (value) Value(dereference(itOther)); + } +} + +ValueInternalArray& ValueInternalArray::operator=(ValueInternalArray other) { + swap(other); + return *this; +} + +ValueInternalArray::~ValueInternalArray() { + // destroy all constructed items + IteratorState it; + IteratorState itEnd; + makeBeginIterator(it); + makeEndIterator(itEnd); + for (; !equals(it, itEnd); increment(it)) { + Value* value = &dereference(it); + value->~Value(); + } + // release all pages + PageIndex lastPageIndex = size_ / itemsPerPage; + for (PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex) + arrayAllocator()->releaseArrayPage(pages_[pageIndex]); + // release pages index + arrayAllocator()->releaseArrayPageIndex(pages_, pageCount_); +} + +void ValueInternalArray::swap(ValueInternalArray& other) { + Value** tempPages = pages_; + pages_ = other.pages_; + other.pages_ = tempPages; + ArrayIndex tempSize = size_; + size_ = other.size_; + other.size_ = tempSize; + PageIndex tempPageCount = pageCount_; + pageCount_ = other.pageCount_; + other.pageCount_ = tempPageCount; +} + +void ValueInternalArray::clear() { + ValueInternalArray dummy; + swap(dummy); +} + +void ValueInternalArray::resize(ArrayIndex newSize) { + if (newSize == 0) + clear(); + else if (newSize < size_) { + IteratorState it; + IteratorState itEnd; + makeIterator(it, newSize); + makeIterator(itEnd, size_); + for (; !equals(it, itEnd); increment(it)) { + Value* value = &dereference(it); + value->~Value(); + } + PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage; + PageIndex lastPageIndex = size_ / itemsPerPage; + for (; pageIndex < lastPageIndex; ++pageIndex) + arrayAllocator()->releaseArrayPage(pages_[pageIndex]); + size_ = newSize; + } else if (newSize > size_) + resolveReference(newSize); +} + +void ValueInternalArray::makeIndexValid(ArrayIndex index) { + // Need to enlarge page index ? + if (index >= pageCount_ * itemsPerPage) { + PageIndex minNewPages = (index + 1) / itemsPerPage; + arrayAllocator()->reallocateArrayPageIndex(pages_, pageCount_, minNewPages); + JSON_ASSERT_MESSAGE(pageCount_ >= minNewPages, + "ValueInternalArray::reserve(): bad reallocation"); + } + + // Need to allocate new pages ? + ArrayIndex nextPageIndex = (size_ % itemsPerPage) != 0 + ? size_ - (size_ % itemsPerPage) + itemsPerPage + : size_; + if (nextPageIndex <= index) { + PageIndex pageIndex = nextPageIndex / itemsPerPage; + PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1; + for (; pageToAllocate-- > 0; ++pageIndex) + pages_[pageIndex] = arrayAllocator()->allocateArrayPage(); + } + + // Initialize all new entries + IteratorState it; + IteratorState itEnd; + makeIterator(it, size_); + size_ = index + 1; + makeIterator(itEnd, size_); + for (; !equals(it, itEnd); increment(it)) { + Value* value = &dereference(it); + new (value) Value(); // Construct a default value using placement new + } +} + +Value& ValueInternalArray::resolveReference(ArrayIndex index) { + if (index >= size_) + makeIndexValid(index); + return pages_[index / itemsPerPage][index % itemsPerPage]; +} + +Value* ValueInternalArray::find(ArrayIndex index) const { + if (index >= size_) + return 0; + return &(pages_[index / itemsPerPage][index % itemsPerPage]); +} + +ValueInternalArray::ArrayIndex ValueInternalArray::size() const { + return size_; +} + +int ValueInternalArray::distance(const IteratorState& x, + const IteratorState& y) { + return indexOf(y) - indexOf(x); +} + +ValueInternalArray::ArrayIndex +ValueInternalArray::indexOf(const IteratorState& iterator) { + if (!iterator.array_) + return ArrayIndex(-1); + return ArrayIndex((iterator.currentPageIndex_ - iterator.array_->pages_) * + itemsPerPage + + iterator.currentItemIndex_); +} + +int ValueInternalArray::compare(const ValueInternalArray& other) const { + int sizeDiff(size_ - other.size_); + if (sizeDiff != 0) + return sizeDiff; + + for (ArrayIndex index = 0; index < size_; ++index) { + int diff = pages_[index / itemsPerPage][index % itemsPerPage].compare( + other.pages_[index / itemsPerPage][index % itemsPerPage]); + if (diff != 0) + return diff; + } + return 0; +} + +} // namespace Json diff --git a/Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl b/Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl new file mode 100644 index 0000000..ef3f330 --- /dev/null +++ b/Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl @@ -0,0 +1,473 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +// included by json_value.cpp + +namespace Json { + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueInternalMap +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +/** \internal MUST be safely initialized using memset( this, 0, + * sizeof(ValueInternalLink) ); + * This optimization is used by the fast allocator. + */ +ValueInternalLink::ValueInternalLink() : previous_(0), next_(0) {} + +ValueInternalLink::~ValueInternalLink() { + for (int index = 0; index < itemPerLink; ++index) { + if (!items_[index].isItemAvailable()) { + if (!items_[index].isMemberNameStatic()) + free(keys_[index]); + } else + break; + } +} + +ValueMapAllocator::~ValueMapAllocator() {} + +#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +class DefaultValueMapAllocator : public ValueMapAllocator { +public: // overridden from ValueMapAllocator + virtual ValueInternalMap* newMap() { return new ValueInternalMap(); } + + virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) { + return new ValueInternalMap(other); + } + + virtual void destructMap(ValueInternalMap* map) { delete map; } + + virtual ValueInternalLink* allocateMapBuckets(unsigned int size) { + return new ValueInternalLink[size]; + } + + virtual void releaseMapBuckets(ValueInternalLink* links) { delete[] links; } + + virtual ValueInternalLink* allocateMapLink() { + return new ValueInternalLink(); + } + + virtual void releaseMapLink(ValueInternalLink* link) { delete link; } +}; +#else +/// @todo make this thread-safe (lock when accessign batch allocator) +class DefaultValueMapAllocator : public ValueMapAllocator { +public: // overridden from ValueMapAllocator + virtual ValueInternalMap* newMap() { + ValueInternalMap* map = mapsAllocator_.allocate(); + new (map) ValueInternalMap(); // placement new + return map; + } + + virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) { + ValueInternalMap* map = mapsAllocator_.allocate(); + new (map) ValueInternalMap(other); // placement new + return map; + } + + virtual void destructMap(ValueInternalMap* map) { + if (map) { + map->~ValueInternalMap(); + mapsAllocator_.release(map); + } + } + + virtual ValueInternalLink* allocateMapBuckets(unsigned int size) { + return new ValueInternalLink[size]; + } + + virtual void releaseMapBuckets(ValueInternalLink* links) { delete[] links; } + + virtual ValueInternalLink* allocateMapLink() { + ValueInternalLink* link = linksAllocator_.allocate(); + memset(link, 0, sizeof(ValueInternalLink)); + return link; + } + + virtual void releaseMapLink(ValueInternalLink* link) { + link->~ValueInternalLink(); + linksAllocator_.release(link); + } + +private: + BatchAllocator mapsAllocator_; + BatchAllocator linksAllocator_; +}; +#endif + +static ValueMapAllocator*& mapAllocator() { + static DefaultValueMapAllocator defaultAllocator; + static ValueMapAllocator* mapAllocator = &defaultAllocator; + return mapAllocator; +} + +static struct DummyMapAllocatorInitializer { + DummyMapAllocatorInitializer() { + mapAllocator(); // ensure mapAllocator() statics are initialized before + // main(). + } +} dummyMapAllocatorInitializer; + +// h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32. + +/* +use linked list hash map. +buckets array is a container. +linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124) +value have extra state: valid, available, deleted +*/ + +ValueInternalMap::ValueInternalMap() + : buckets_(0), tailLink_(0), bucketsSize_(0), itemCount_(0) {} + +ValueInternalMap::ValueInternalMap(const ValueInternalMap& other) + : buckets_(0), tailLink_(0), bucketsSize_(0), itemCount_(0) { + reserve(other.itemCount_); + IteratorState it; + IteratorState itEnd; + other.makeBeginIterator(it); + other.makeEndIterator(itEnd); + for (; !equals(it, itEnd); increment(it)) { + bool isStatic; + const char* memberName = key(it, isStatic); + const Value& aValue = value(it); + resolveReference(memberName, isStatic) = aValue; + } +} + +ValueInternalMap& ValueInternalMap::operator=(ValueInternalMap other) { + swap(other); + return *this; +} + +ValueInternalMap::~ValueInternalMap() { + if (buckets_) { + for (BucketIndex bucketIndex = 0; bucketIndex < bucketsSize_; + ++bucketIndex) { + ValueInternalLink* link = buckets_[bucketIndex].next_; + while (link) { + ValueInternalLink* linkToRelease = link; + link = link->next_; + mapAllocator()->releaseMapLink(linkToRelease); + } + } + mapAllocator()->releaseMapBuckets(buckets_); + } +} + +void ValueInternalMap::swap(ValueInternalMap& other) { + ValueInternalLink* tempBuckets = buckets_; + buckets_ = other.buckets_; + other.buckets_ = tempBuckets; + ValueInternalLink* tempTailLink = tailLink_; + tailLink_ = other.tailLink_; + other.tailLink_ = tempTailLink; + BucketIndex tempBucketsSize = bucketsSize_; + bucketsSize_ = other.bucketsSize_; + other.bucketsSize_ = tempBucketsSize; + BucketIndex tempItemCount = itemCount_; + itemCount_ = other.itemCount_; + other.itemCount_ = tempItemCount; +} + +void ValueInternalMap::clear() { + ValueInternalMap dummy; + swap(dummy); +} + +ValueInternalMap::BucketIndex ValueInternalMap::size() const { + return itemCount_; +} + +bool ValueInternalMap::reserveDelta(BucketIndex growth) { + return reserve(itemCount_ + growth); +} + +bool ValueInternalMap::reserve(BucketIndex newItemCount) { + if (!buckets_ && newItemCount > 0) { + buckets_ = mapAllocator()->allocateMapBuckets(1); + bucketsSize_ = 1; + tailLink_ = &buckets_[0]; + } + // BucketIndex idealBucketCount = (newItemCount + + // ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink; + return true; +} + +const Value* ValueInternalMap::find(const char* key) const { + if (!bucketsSize_) + return 0; + HashKey hashedKey = hash(key); + BucketIndex bucketIndex = hashedKey % bucketsSize_; + for (const ValueInternalLink* current = &buckets_[bucketIndex]; current != 0; + current = current->next_) { + for (BucketIndex index = 0; index < ValueInternalLink::itemPerLink; + ++index) { + if (current->items_[index].isItemAvailable()) + return 0; + if (strcmp(key, current->keys_[index]) == 0) + return ¤t->items_[index]; + } + } + return 0; +} + +Value* ValueInternalMap::find(const char* key) { + const ValueInternalMap* constThis = this; + return const_cast(constThis->find(key)); +} + +Value& ValueInternalMap::resolveReference(const char* key, bool isStatic) { + HashKey hashedKey = hash(key); + if (bucketsSize_) { + BucketIndex bucketIndex = hashedKey % bucketsSize_; + ValueInternalLink** previous = 0; + BucketIndex index; + for (ValueInternalLink* current = &buckets_[bucketIndex]; current != 0; + previous = ¤t->next_, current = current->next_) { + for (index = 0; index < ValueInternalLink::itemPerLink; ++index) { + if (current->items_[index].isItemAvailable()) + return setNewItem(key, isStatic, current, index); + if (strcmp(key, current->keys_[index]) == 0) + return current->items_[index]; + } + } + } + + reserveDelta(1); + return unsafeAdd(key, isStatic, hashedKey); +} + +void ValueInternalMap::remove(const char* key) { + HashKey hashedKey = hash(key); + if (!bucketsSize_) + return; + BucketIndex bucketIndex = hashedKey % bucketsSize_; + for (ValueInternalLink* link = &buckets_[bucketIndex]; link != 0; + link = link->next_) { + BucketIndex index; + for (index = 0; index < ValueInternalLink::itemPerLink; ++index) { + if (link->items_[index].isItemAvailable()) + return; + if (strcmp(key, link->keys_[index]) == 0) { + doActualRemove(link, index, bucketIndex); + return; + } + } + } +} + +void ValueInternalMap::doActualRemove(ValueInternalLink* link, + BucketIndex index, + BucketIndex bucketIndex) { + // find last item of the bucket and swap it with the 'removed' one. + // set removed items flags to 'available'. + // if last page only contains 'available' items, then desallocate it (it's + // empty) + ValueInternalLink*& lastLink = getLastLinkInBucket(index); + BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1 + for (; lastItemIndex < ValueInternalLink::itemPerLink; + ++lastItemIndex) // may be optimized with dicotomic search + { + if (lastLink->items_[lastItemIndex].isItemAvailable()) + break; + } + + BucketIndex lastUsedIndex = lastItemIndex - 1; + Value* valueToDelete = &link->items_[index]; + Value* valueToPreserve = &lastLink->items_[lastUsedIndex]; + if (valueToDelete != valueToPreserve) + valueToDelete->swap(*valueToPreserve); + if (lastUsedIndex == 0) // page is now empty + { // remove it from bucket linked list and delete it. + ValueInternalLink* linkPreviousToLast = lastLink->previous_; + if (linkPreviousToLast != 0) // can not deleted bucket link. + { + mapAllocator()->releaseMapLink(lastLink); + linkPreviousToLast->next_ = 0; + lastLink = linkPreviousToLast; + } + } else { + Value dummy; + valueToPreserve->swap(dummy); // restore deleted to default Value. + valueToPreserve->setItemUsed(false); + } + --itemCount_; +} + +ValueInternalLink*& +ValueInternalMap::getLastLinkInBucket(BucketIndex bucketIndex) { + if (bucketIndex == bucketsSize_ - 1) + return tailLink_; + ValueInternalLink*& previous = buckets_[bucketIndex + 1].previous_; + if (!previous) + previous = &buckets_[bucketIndex]; + return previous; +} + +Value& ValueInternalMap::setNewItem(const char* key, + bool isStatic, + ValueInternalLink* link, + BucketIndex index) { + char* duplicatedKey = makeMemberName(key); + ++itemCount_; + link->keys_[index] = duplicatedKey; + link->items_[index].setItemUsed(); + link->items_[index].setMemberNameIsStatic(isStatic); + return link->items_[index]; // items already default constructed. +} + +Value& +ValueInternalMap::unsafeAdd(const char* key, bool isStatic, HashKey hashedKey) { + JSON_ASSERT_MESSAGE(bucketsSize_ > 0, + "ValueInternalMap::unsafeAdd(): internal logic error."); + BucketIndex bucketIndex = hashedKey % bucketsSize_; + ValueInternalLink*& previousLink = getLastLinkInBucket(bucketIndex); + ValueInternalLink* link = previousLink; + BucketIndex index; + for (index = 0; index < ValueInternalLink::itemPerLink; ++index) { + if (link->items_[index].isItemAvailable()) + break; + } + if (index == ValueInternalLink::itemPerLink) // need to add a new page + { + ValueInternalLink* newLink = mapAllocator()->allocateMapLink(); + index = 0; + link->next_ = newLink; + previousLink = newLink; + link = newLink; + } + return setNewItem(key, isStatic, link, index); +} + +ValueInternalMap::HashKey ValueInternalMap::hash(const char* key) const { + HashKey hash = 0; + while (*key) + hash += *key++ * 37; + return hash; +} + +int ValueInternalMap::compare(const ValueInternalMap& other) const { + int sizeDiff(itemCount_ - other.itemCount_); + if (sizeDiff != 0) + return sizeDiff; + // Strict order guaranty is required. Compare all keys FIRST, then compare + // values. + IteratorState it; + IteratorState itEnd; + makeBeginIterator(it); + makeEndIterator(itEnd); + for (; !equals(it, itEnd); increment(it)) { + if (!other.find(key(it))) + return 1; + } + + // All keys are equals, let's compare values + makeBeginIterator(it); + for (; !equals(it, itEnd); increment(it)) { + const Value* otherValue = other.find(key(it)); + int valueDiff = value(it).compare(*otherValue); + if (valueDiff != 0) + return valueDiff; + } + return 0; +} + +void ValueInternalMap::makeBeginIterator(IteratorState& it) const { + it.map_ = const_cast(this); + it.bucketIndex_ = 0; + it.itemIndex_ = 0; + it.link_ = buckets_; +} + +void ValueInternalMap::makeEndIterator(IteratorState& it) const { + it.map_ = const_cast(this); + it.bucketIndex_ = bucketsSize_; + it.itemIndex_ = 0; + it.link_ = 0; +} + +bool ValueInternalMap::equals(const IteratorState& x, + const IteratorState& other) { + return x.map_ == other.map_ && x.bucketIndex_ == other.bucketIndex_ && + x.link_ == other.link_ && x.itemIndex_ == other.itemIndex_; +} + +void ValueInternalMap::incrementBucket(IteratorState& iterator) { + ++iterator.bucketIndex_; + JSON_ASSERT_MESSAGE( + iterator.bucketIndex_ <= iterator.map_->bucketsSize_, + "ValueInternalMap::increment(): attempting to iterate beyond end."); + if (iterator.bucketIndex_ == iterator.map_->bucketsSize_) + iterator.link_ = 0; + else + iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]); + iterator.itemIndex_ = 0; +} + +void ValueInternalMap::increment(IteratorState& iterator) { + JSON_ASSERT_MESSAGE(iterator.map_, + "Attempting to iterator using invalid iterator."); + ++iterator.itemIndex_; + if (iterator.itemIndex_ == ValueInternalLink::itemPerLink) { + JSON_ASSERT_MESSAGE( + iterator.link_ != 0, + "ValueInternalMap::increment(): attempting to iterate beyond end."); + iterator.link_ = iterator.link_->next_; + if (iterator.link_ == 0) + incrementBucket(iterator); + } else if (iterator.link_->items_[iterator.itemIndex_].isItemAvailable()) { + incrementBucket(iterator); + } +} + +void ValueInternalMap::decrement(IteratorState& iterator) { + if (iterator.itemIndex_ == 0) { + JSON_ASSERT_MESSAGE(iterator.map_, + "Attempting to iterate using invalid iterator."); + if (iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_]) { + JSON_ASSERT_MESSAGE(iterator.bucketIndex_ > 0, + "Attempting to iterate beyond beginning."); + --(iterator.bucketIndex_); + } + iterator.link_ = iterator.link_->previous_; + iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1; + } +} + +const char* ValueInternalMap::key(const IteratorState& iterator) { + JSON_ASSERT_MESSAGE(iterator.link_, + "Attempting to iterate using invalid iterator."); + return iterator.link_->keys_[iterator.itemIndex_]; +} + +const char* ValueInternalMap::key(const IteratorState& iterator, + bool& isStatic) { + JSON_ASSERT_MESSAGE(iterator.link_, + "Attempting to iterate using invalid iterator."); + isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic(); + return iterator.link_->keys_[iterator.itemIndex_]; +} + +Value& ValueInternalMap::value(const IteratorState& iterator) { + JSON_ASSERT_MESSAGE(iterator.link_, + "Attempting to iterate using invalid iterator."); + return iterator.link_->items_[iterator.itemIndex_]; +} + +int ValueInternalMap::distance(const IteratorState& x, const IteratorState& y) { + int offset = 0; + IteratorState it = x; + while (!equals(it, y)) + increment(it); + return offset; +} + +} // namespace Json diff --git a/Utilities/cmjsoncpp/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp similarity index 95% rename from Utilities/cmjsoncpp/json_reader.cpp rename to Utilities/cmjsoncpp/src/lib_json/json_reader.cpp index c6a35bf..c5111f8 100644 --- a/Utilities/cmjsoncpp/json_reader.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp @@ -830,6 +830,45 @@ std::vector Reader::getStructuredErrors() const { return allErrors; } +bool Reader::pushError(const Value& value, const std::string& message) { + size_t length = end_ - begin_; + if(value.getOffsetStart() > length + || value.getOffsetLimit() > length) + return false; + Token token; + token.type_ = tokenError; + token.start_ = begin_ + value.getOffsetStart(); + token.end_ = end_ + value.getOffsetLimit(); + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = 0; + errors_.push_back(info); + return true; +} + +bool Reader::pushError(const Value& value, const std::string& message, const Value& extra) { + size_t length = end_ - begin_; + if(value.getOffsetStart() > length + || value.getOffsetLimit() > length + || extra.getOffsetLimit() > length) + return false; + Token token; + token.type_ = tokenError; + token.start_ = begin_ + value.getOffsetStart(); + token.end_ = begin_ + value.getOffsetLimit(); + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = begin_ + extra.getOffsetStart(); + errors_.push_back(info); + return true; +} + +bool Reader::good() const { + return !errors_.size(); +} + std::istream& operator>>(std::istream& sin, Value& root) { Json::Reader reader; bool ok = reader.parse(sin, root, true); diff --git a/Utilities/cmjsoncpp/json_tool.h b/Utilities/cmjsoncpp/src/lib_json/json_tool.h similarity index 98% rename from Utilities/cmjsoncpp/json_tool.h rename to Utilities/cmjsoncpp/src/lib_json/json_tool.h index 306a87a..f9b61c3 100644 --- a/Utilities/cmjsoncpp/json_tool.h +++ b/Utilities/cmjsoncpp/src/lib_json/json_tool.h @@ -85,4 +85,3 @@ static inline void fixNumericLocale(char* begin, char* end) { } // namespace Json { #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED -// vim: et ts=2 sts=2 sw=2 tw=0 diff --git a/Utilities/cmjsoncpp/json_value.cpp b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp similarity index 94% rename from Utilities/cmjsoncpp/json_value.cpp rename to Utilities/cmjsoncpp/src/lib_json/json_value.cpp index a656cce..b73deac 100644 --- a/Utilities/cmjsoncpp/json_value.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp @@ -175,7 +175,8 @@ Value::CZString::CZString(const CZString& other) ? duplicateStringValue(other.cstr_) : other.cstr_), index_(other.cstr_ - ? (other.index_ == noDuplication ? noDuplication : duplicate) + ? static_cast(other.index_ == noDuplication + ? noDuplication : duplicate) : other.index_) {} Value::CZString::~CZString() { @@ -225,14 +226,8 @@ bool Value::CZString::isStaticString() const { return index_ == noDuplication; } * memset( this, 0, sizeof(Value) ) * This optimization is used in ValueInternalMap fast allocator. */ -Value::Value(ValueType type) - : type_(type), allocated_(false) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { +Value::Value(ValueType type) { + initBasic(type); switch (type) { case nullValue: break; @@ -267,130 +262,62 @@ Value::Value(ValueType type) } } -Value::Value(UInt value) - : type_(uintValue), allocated_(false) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { - value_.uint_ = value; -} - -Value::Value(Int value) - : type_(intValue), allocated_(false) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { +Value::Value(Int value) { + initBasic(intValue); value_.int_ = value; } +Value::Value(UInt value) { + initBasic(uintValue); + value_.uint_ = value; +} #if defined(JSON_HAS_INT64) -Value::Value(Int64 value) - : type_(intValue), allocated_(false) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { +Value::Value(Int64 value) { + initBasic(intValue); value_.int_ = value; } - -Value::Value(UInt64 value) - : type_(uintValue), allocated_(false) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { +Value::Value(UInt64 value) { + initBasic(uintValue); value_.uint_ = value; } #endif // defined(JSON_HAS_INT64) -Value::Value(double value) - : type_(realValue), allocated_(false) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { +Value::Value(double value) { + initBasic(realValue); value_.real_ = value; } -Value::Value(const char* value) - : type_(stringValue), allocated_(true) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { +Value::Value(const char* value) { + initBasic(stringValue, true); value_.string_ = duplicateStringValue(value); } -Value::Value(const char* beginValue, const char* endValue) - : type_(stringValue), allocated_(true) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { +Value::Value(const char* beginValue, const char* endValue) { + initBasic(stringValue, true); value_.string_ = duplicateStringValue(beginValue, (unsigned int)(endValue - beginValue)); } -Value::Value(const std::string& value) - : type_(stringValue), allocated_(true) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { +Value::Value(const std::string& value) { + initBasic(stringValue, true); value_.string_ = duplicateStringValue(value.c_str(), (unsigned int)value.length()); } -Value::Value(const StaticString& value) - : type_(stringValue), allocated_(false) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { +Value::Value(const StaticString& value) { + initBasic(stringValue); value_.string_ = const_cast(value.c_str()); } #ifdef JSON_USE_CPPTL -Value::Value(const CppTL::ConstString& value) - : type_(stringValue), allocated_(true) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { +Value::Value(const CppTL::ConstString& value) { + initBasic(stringValue, true); value_.string_ = duplicateStringValue(value, value.length()); } #endif -Value::Value(bool value) - : type_(booleanValue), allocated_(false) -#ifdef JSON_VALUE_USE_INTERNAL_MAP - , - itemIsUsed_(0) -#endif - , - comments_(0), start_(0), limit_(0) { +Value::Value(bool value) { + initBasic(booleanValue); value_.bool_ = value; } @@ -966,6 +893,17 @@ Value& Value::operator[](const char* key) { return resolveReference(key, false); } +void Value::initBasic(ValueType type, bool allocated) { + type_ = type; + allocated_ = allocated; +#ifdef JSON_VALUE_USE_INTERNAL_MAP + itemIsUsed_ = 0; +#endif + comments_ = 0; + start_ = 0; + limit_ = 0; +} + Value& Value::resolveReference(const char* key, bool isStatic) { JSON_ASSERT_MESSAGE( type_ == nullValue || type_ == objectValue, @@ -1538,4 +1476,3 @@ Value& Path::make(Value& root) const { } } // namespace Json -// vim: et ts=2 sts=2 sw=2 tw=0 diff --git a/Utilities/cmjsoncpp/json_valueiterator.inl b/Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl similarity index 99% rename from Utilities/cmjsoncpp/json_valueiterator.inl rename to Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl index 0ee2274..a9f7df6 100644 --- a/Utilities/cmjsoncpp/json_valueiterator.inl +++ b/Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl @@ -239,4 +239,3 @@ ValueIterator& ValueIterator::operator=(const SelfType& other) { } } // namespace Json -// vim: et ts=3 sts=3 sw=3 tw=0 diff --git a/Utilities/cmjsoncpp/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp similarity index 98% rename from Utilities/cmjsoncpp/json_writer.cpp rename to Utilities/cmjsoncpp/src/lib_json/json_writer.cpp index 387fd35..0a42cc4 100644 --- a/Utilities/cmjsoncpp/json_writer.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp @@ -21,7 +21,7 @@ #define snprintf _snprintf #endif -// Ancient Linux +// Ancient glibc #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 2 # if !defined(isfinite) # define isfinite __finite @@ -224,28 +224,28 @@ void FastWriter::writeValue(const Value& value) { document_ += valueToString(value.asBool()); break; case arrayValue: { - document_ += "["; + document_ += '['; int size = value.size(); for (int index = 0; index < size; ++index) { if (index > 0) - document_ += ","; + document_ += ','; writeValue(value[index]); } - document_ += "]"; + document_ += ']'; } break; case objectValue: { Value::Members members(value.getMemberNames()); - document_ += "{"; + document_ += '{'; for (Value::Members::iterator it = members.begin(); it != members.end(); ++it) { const std::string& name = *it; if (it != members.begin()) - document_ += ","; + document_ += ','; document_ += valueToQuotedString(name.c_str()); document_ += yamlCompatiblityEnabled_ ? ": " : ":"; writeValue(value[name]); } - document_ += "}"; + document_ += '}'; } break; } } @@ -309,7 +309,7 @@ void StyledWriter::writeValue(const Value& value) { writeCommentAfterValueOnSameLine(childValue); break; } - document_ += ","; + document_ += ','; writeCommentAfterValueOnSameLine(childValue); } unindent(); @@ -343,7 +343,7 @@ void StyledWriter::writeArrayValue(const Value& value) { writeCommentAfterValueOnSameLine(childValue); break; } - document_ += ","; + document_ += ','; writeCommentAfterValueOnSameLine(childValue); } unindent(); ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 14 +- Help/manual/cmake-modules.7.rst | 1 + Help/module/CTestGCOV.rst | 1 + Modules/CTestGCOV.cmake | 32 +- Source/CMakeLists.txt | 3 +- Source/CTest/cmCTestSubmitHandler.cxx | 2 +- .../blub.h => Utilities/cm_jsoncpp_reader.h | 18 +- Utilities/{cmcurl => cmjsoncpp}/.gitattributes | 0 Utilities/cmjsoncpp/CMakeLists.txt | 18 +- Utilities/cmjsoncpp/LICENSE | 55 +++ .../{cmliblzma => cmjsoncpp}/README-CMake.txt | 46 +- .../cmjsoncpp/{ => include}/json/assertions.h | 0 Utilities/cmjsoncpp/{ => include}/json/config.h | 0 Utilities/cmjsoncpp/{ => include}/json/features.h | 0 Utilities/cmjsoncpp/{ => include}/json/forwards.h | 0 Utilities/cmjsoncpp/{ => include}/json/json.h | 0 Utilities/cmjsoncpp/{ => include}/json/reader.h | 23 + Utilities/cmjsoncpp/{ => include}/json/value.h | 2 + Utilities/cmjsoncpp/include/json/version.h | 14 + Utilities/cmjsoncpp/{ => include}/json/writer.h | 0 Utilities/cmjsoncpp/json/version.h | 16 - .../{ => src/lib_json}/json_batchallocator.h | 1 - .../cmjsoncpp/src/lib_json/json_internalarray.inl | 360 +++++++++++++++ .../cmjsoncpp/src/lib_json/json_internalmap.inl | 473 ++++++++++++++++++++ .../cmjsoncpp/{ => src/lib_json}/json_reader.cpp | 39 ++ Utilities/cmjsoncpp/{ => src/lib_json}/json_tool.h | 1 - .../cmjsoncpp/{ => src/lib_json}/json_value.cpp | 141 ++---- .../{ => src/lib_json}/json_valueiterator.inl | 1 - .../cmjsoncpp/{ => src/lib_json}/json_writer.cpp | 18 +- 29 files changed, 1075 insertions(+), 204 deletions(-) create mode 100644 Help/module/CTestGCOV.rst copy Tests/QtAutogen/blub.h => Utilities/cm_jsoncpp_reader.h (70%) copy Utilities/{cmcurl => cmjsoncpp}/.gitattributes (100%) create mode 100644 Utilities/cmjsoncpp/LICENSE copy Utilities/{cmliblzma => cmjsoncpp}/README-CMake.txt (51%) rename Utilities/cmjsoncpp/{ => include}/json/assertions.h (100%) rename Utilities/cmjsoncpp/{ => include}/json/config.h (100%) rename Utilities/cmjsoncpp/{ => include}/json/features.h (100%) rename Utilities/cmjsoncpp/{ => include}/json/forwards.h (100%) rename Utilities/cmjsoncpp/{ => include}/json/json.h (100%) rename Utilities/cmjsoncpp/{ => include}/json/reader.h (89%) rename Utilities/cmjsoncpp/{ => include}/json/value.h (99%) create mode 100644 Utilities/cmjsoncpp/include/json/version.h rename Utilities/cmjsoncpp/{ => include}/json/writer.h (100%) delete mode 100644 Utilities/cmjsoncpp/json/version.h rename Utilities/cmjsoncpp/{ => src/lib_json}/json_batchallocator.h (99%) create mode 100644 Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl create mode 100644 Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl rename Utilities/cmjsoncpp/{ => src/lib_json}/json_reader.cpp (95%) rename Utilities/cmjsoncpp/{ => src/lib_json}/json_tool.h (98%) rename Utilities/cmjsoncpp/{ => src/lib_json}/json_value.cpp (94%) rename Utilities/cmjsoncpp/{ => src/lib_json}/json_valueiterator.inl (99%) rename Utilities/cmjsoncpp/{ => src/lib_json}/json_writer.cpp (98%) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 14:45:07 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 14:45:07 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1832-g12084d6 Message-ID: <20150113194507.66D75224E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 12084d6c9159f5efe69d9f600fbeede4b8b150e1 (commit) via f2243ff0b724e907ba1db2be2130f0cdaabc02e7 (commit) from 3b39c774d7a62c7e21c40f9b2256c31faa8e3892 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12084d6c9159f5efe69d9f600fbeede4b8b150e1 commit 12084d6c9159f5efe69d9f600fbeede4b8b150e1 Merge: 3b39c77 f2243ff Author: Brad King AuthorDate: Tue Jan 13 14:45:06 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 14:45:06 2015 -0500 Merge topic 'cdash_upload_file_mode' into next f2243ff0 Revise topic 'cdash_upload_file_mode' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f2243ff0b724e907ba1db2be2130f0cdaabc02e7 commit f2243ff0b724e907ba1db2be2130f0cdaabc02e7 Author: Brad King AuthorDate: Tue Jan 13 14:44:48 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 14:44:48 2015 -0500 Revise topic 'cdash_upload_file_mode' diff --git a/Utilities/cmjsoncpp/README-CMake.txt b/Utilities/cmjsoncpp/README-CMake.txt index cfd2d4d..c7959ca 100644 --- a/Utilities/cmjsoncpp/README-CMake.txt +++ b/Utilities/cmjsoncpp/README-CMake.txt @@ -11,7 +11,7 @@ branch, but it is merged into our history. Update jsoncpp from upstream as follows. Create a local branch to explicitly reference the upstream snapshot branch head: - git branch jsoncpp-upstream ca64c01e + git branch jsoncpp-upstream 53f6ccb0 Use a temporary directory to checkout the branch: @@ -24,7 +24,7 @@ Use a temporary directory to checkout the branch: Now place the (reduced) jsoncpp content in this directory. See instructions shown by - git log ca64c01e + git log 53f6ccb0 for help extracting the content from the upstream svn repo. Then run the following commands to commit the new version. Substitute the ----------------------------------------------------------------------- Summary of changes: Utilities/cmjsoncpp/README-CMake.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 14:46:32 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 14:46:32 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1834-g20bd919 Message-ID: <20150113194632.687DA228B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 20bd919dd9d9f4f0f79054f976b50eb0cd272217 (commit) via c79e901e0f3502bd223a96366919aaf257631881 (commit) from 12084d6c9159f5efe69d9f600fbeede4b8b150e1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20bd919dd9d9f4f0f79054f976b50eb0cd272217 commit 20bd919dd9d9f4f0f79054f976b50eb0cd272217 Merge: 12084d6 c79e901 Author: Brad King AuthorDate: Tue Jan 13 14:46:31 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 14:46:31 2015 -0500 Merge topic 'cdash_upload_file_mode' into next c79e901e Revise topic 'cdash_upload_file_mode' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c79e901e0f3502bd223a96366919aaf257631881 commit c79e901e0f3502bd223a96366919aaf257631881 Author: Brad King AuthorDate: Tue Jan 13 14:46:09 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 14:46:09 2015 -0500 Revise topic 'cdash_upload_file_mode' diff --git a/Utilities/cmjsoncpp/README-CMake.txt b/Utilities/cmjsoncpp/README-CMake.txt index c7959ca..bf74094 100644 --- a/Utilities/cmjsoncpp/README-CMake.txt +++ b/Utilities/cmjsoncpp/README-CMake.txt @@ -33,7 +33,7 @@ appropriate date and version number: git add --all GIT_AUTHOR_NAME='JsonCpp Upstream' \ - GIT_AUTHOR_EMAIL='github.com' \ + GIT_AUTHOR_EMAIL='kwrobot at kitware.com' \ GIT_AUTHOR_DATE='Thu Nov 20 08:45:58 2014 -0600' \ git commit -m 'JsonCpp 1.0.0 (reduced)' && git commit --amend ----------------------------------------------------------------------- Summary of changes: Utilities/cmjsoncpp/README-CMake.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 14:48:48 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 14:48:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1844-g3352c05 Message-ID: <20150113194848.2E6F5493A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3352c05b873c03505d877acf7dbc922319e1f6a2 (commit) via 534c69261080277d213c3e344987266a92501363 (commit) via 71ec1d16980b2ea507536976a098d7c246a663eb (commit) via 0a3e091f3be9f882c6c6ba1255a1cfe52881f589 (commit) via 60218d5e51cc31fb3179434bb1aaefba910458bc (commit) via 8345ddb7ae431c6aeafbd24a368886b70e162bd0 (commit) via be2c3ac78174ed0a9d5b23e51719cc3ff220ed3a (commit) via a263d519fffab082fc31f8e3f454726e3fbd8363 (commit) via 53f6ccb0ee76a2b9ac40abd5ec5e07aa55fbb393 (commit) via 32fd56b066c28758e31ae97d4b16216b3633a843 (commit) from 20bd919dd9d9f4f0f79054f976b50eb0cd272217 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3352c05b873c03505d877acf7dbc922319e1f6a2 commit 3352c05b873c03505d877acf7dbc922319e1f6a2 Merge: 20bd919 534c692 Author: Brad King AuthorDate: Tue Jan 13 14:48:45 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 14:48:45 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 534c6926 Add support to ctest_submit to upload files to cdash with CDASH_UPLOAD. 71ec1d16 jsoncpp: Add README-CMake.txt 0a3e091f jsoncpp: Definen isfinite when not available on ancient glibc 60218d5e jsoncpp: Add missing include in json/writer.h 8345ddb7 jsoncpp: Disable warnings to avoid changing 3rd party code be2c3ac7 jsoncpp: Build the library within CMake a263d519 Merge branch 'jsoncpp-upstream' into import-jsoncpp 53f6ccb0 JsonCpp 1.0.0 (reduced) 32fd56b0 jsoncpp: Add .gitattributes to skip whitespace checks http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=534c69261080277d213c3e344987266a92501363 commit 534c69261080277d213c3e344987266a92501363 Author: Bill Hoffman AuthorDate: Tue Dec 23 11:03:14 2014 -0500 Commit: Brad King CommitDate: Tue Jan 13 14:45:54 2015 -0500 Add support to ctest_submit to upload files to cdash with CDASH_UPLOAD. This adds support for the new cdash API where arbitrary files can be uploaded to the CDash server. This CDash API communicates via json files so the json parser jsoncpp was added to the Utilities directory. In addition since CDash tracks the md5 sum of the files uploaded the --mtime option was added to cmake -E tar so that tar files could be created that would have the same md5sum with the same content. The first supported file upload type to CDash is a GCOV with branches coverage tar file. To support this a Modules/CTestGCOV.cmake was added to run gcov for a project via a CMake function. diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index d9b0b78..316a43d 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -37,3 +37,14 @@ timed-out submission before attempting to re-submit. The RETRY_COUNT option specifies how many times to retry a timed-out submission. + +:: + + ctest_submit([CDASH_UPLOAD file] + [CDASH_UPLOAD_TYPE type_string]) + +This second signature is used to upload files to CDash via the CDash +file upload API. The api first sends a request to upload to CDash along +with the md5 sum of the file. If CDash does not already have the file, +then it is uploaded. Along with the file, a CDash type string is specified +to tell CDash which handler to use to process the data. diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index 5196485..d96b96f 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -63,6 +63,7 @@ All Modules /module/CPack /module/CPackWIX /module/CTest + /module/CTestGCOV /module/CTestScriptMode /module/CTestUseLaunchers /module/Dart diff --git a/Help/module/CTestGCOV.rst b/Help/module/CTestGCOV.rst new file mode 100644 index 0000000..b1077fe --- /dev/null +++ b/Help/module/CTestGCOV.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/CTestGCOV.cmake diff --git a/Modules/CTestGCOV.cmake b/Modules/CTestGCOV.cmake new file mode 100644 index 0000000..f505159 --- /dev/null +++ b/Modules/CTestGCOV.cmake @@ -0,0 +1,72 @@ +#.rst: +# CTestGCOV +# --------- +# +# This module provides the function ``run_gcov_and_package_for_cdash``. +# The function will run gcov on the .gcda files in a binary tree and then +# package all of the .gcov files into a tar file with a data.json. +# This file can be sent to a CDash server for display with the +# :command:`ctest_submit(CDASH_UPLOAD)` command. +# +# .. command:: run_gcov_and_package_for_cdash +# +# :: +# +# run_gcov_and_package_for_cdash( +# ) +# +# Run gcov and package a tar gz file for cdash. ```` is the name +# of the tarfile that is created and it will be placed in ````. +# ```` is the source directory for the build and ```` +# is the binary directory for the build. The ```` is a full +# path to ``gcov`` for the machine. + +#============================================================================= +# 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.) + +function(run_gcov_and_package_for_cdash tarfile source_dir binary_dir + gcov_command) + # run gcov on each gcda file in the binary tree + file(GLOB_RECURSE GCDA_FILES RELATIVE ${binary_dir} "*.gcda") + + # return early if no coverage files were found + list(LENGTH GCDA_FILES len) + if(len EQUAL 0) + message("CTestGCOV: No .gcda files found, ignoring coverage request.") + return() + endif() + + foreach (gcda_file ${GCDA_FILES}) + # get the directory of the gcda file + get_filename_component(gcov_dir ${gcda_file} DIRECTORY) + # run gcov + execute_process(COMMAND + ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${binary_dir}) + endforeach() + # create json file with project information + file(WRITE ${binary_dir}/data.json + "{ + \"Source\": \"${source_dir}\", + \"Binary\": \"${binary_dir}\" +}" + ) + # collect the gcov files + file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "*.gcov") + # tar up the coverage info + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar cvf ${tarfile} + --mtime=1970-01-01\ 0:0:0\ UTC ${gcov_files} data.json + WORKING_DIRECTORY ${binary_dir}) +endfunction() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 96f4709..78bef91 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -533,6 +533,7 @@ set(CTEST_SRCS cmCTest.cxx CTest/cmCTestConfigureHandler.cxx CTest/cmCTestCoverageCommand.cxx CTest/cmCTestCoverageHandler.cxx + CTest/cmCTestCurl.cxx CTest/cmParseMumpsCoverage.cxx CTest/cmParseCacheCoverage.cxx CTest/cmParseGTMCoverage.cxx @@ -583,7 +584,7 @@ set(CTEST_SRCS cmCTest.cxx # Build CTestLib add_library(CTestLib ${CTEST_SRCS}) -target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) +target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES} cmjsoncpp) # # Sources for CPack diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx new file mode 100644 index 0000000..b354592 --- /dev/null +++ b/Source/CTest/cmCTestCurl.cxx @@ -0,0 +1,258 @@ +#include "cmCTestCurl.h" +#include "cmSystemTools.h" +#include "cmCTest.h" + +cmCTestCurl::cmCTestCurl(cmCTest* ctest) +{ + this->CTest = ctest; + this->SetProxyType(); + this->UseHttp10 = false; + // In windows, this will init the winsock stuff + ::curl_global_init(CURL_GLOBAL_ALL); + // default is to verify https + this->VerifyPeerOff = false; + this->VerifyHostOff = false; + this->TimeOutSeconds = 0; +} + +namespace +{ +static size_t +curlWriteMemoryCallback(void *ptr, size_t size, size_t nmemb, + void *data) +{ + int realsize = (int)(size * nmemb); + + std::vector *vec + = static_cast* >(data); + const char* chPtr = static_cast(ptr); + vec->insert(vec->end(), chPtr, chPtr + realsize); + return realsize; +} + +static size_t +curlDebugCallback(CURL *, curl_infotype, char *chPtr, + size_t size, void *data) +{ + std::vector *vec + = static_cast* >(data); + vec->insert(vec->end(), chPtr, chPtr + size); + + return size; +} + +} +void cmCTestCurl::SetCurlOptions(std::vector const& args) +{ + for( std::vector::const_iterator i = args.begin(); + i != args.end(); ++i) + { + if(*i == "CURLOPT_SSL_VERIFYPEER_OFF") + { + this->VerifyPeerOff = true; + } + if(*i == "CURLOPT_SSL_VERIFYHOST_OFF") + { + this->VerifyHostOff = true; + } + } +} + +bool cmCTestCurl::InitCurl() +{ + this->Curl = curl_easy_init(); + if(!this->Curl) + { + return false; + } + if(this->VerifyPeerOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYPEER, 0); + } + if(this->VerifyHostOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYHOST, 0); + } + if(this->HTTPProxy.size()) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXY, this->HTTPProxy.c_str()); + curl_easy_setopt(this->Curl, CURLOPT_PROXYTYPE, this->HTTPProxyType); + if (this->HTTPProxyAuth.size() > 0) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXYUSERPWD, + this->HTTPProxyAuth.c_str()); + } + } + if(this->UseHttp10) + { + curl_easy_setopt(this->Curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + } + // enable HTTP ERROR parsing + curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + return true; +} + + +bool cmCTestCurl::UploadFile(std::string const& local_file, + std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + /* enable uploading */ + curl_easy_setopt(this->Curl, CURLOPT_UPLOAD, 1); + // if there is little to no activity for too long stop submitting + if(this->TimeOutSeconds) + { + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_LIMIT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_TIME, + this->TimeOutSeconds); + } + /* HTTP PUT please */ + ::curl_easy_setopt(this->Curl, CURLOPT_PUT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_VERBOSE, 1); + + FILE* ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); + if(!ftpfile) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not open file for upload: " << local_file << "\n"); + return false; + } + // set the url + std::string upload_url = url; + upload_url += "?"; + upload_url += fields; + ::curl_easy_setopt(this->Curl, CURLOPT_URL, upload_url.c_str()); + // now specify which file to upload + ::curl_easy_setopt(this->Curl, CURLOPT_INFILE, ftpfile); + unsigned long filelen = cmSystemTools::FileLength(local_file); + // and give the size of the upload (optional) + ::curl_easy_setopt(this->Curl, CURLOPT_INFILESIZE, + static_cast(filelen)); + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + // Now run off and do what you've been told! + ::curl_easy_perform(this->Curl); + ::fclose(ftpfile); + ::curl_global_cleanup(); + + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Curl response: [" << response << "]\n"); + } + std::string curlDebug; + if ( debugData.size() > 0 ) + { + curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + if(response.size() == 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "No response from server.\n" << + curlDebug); + return false; + } + return true; +} + +bool cmCTestCurl::HttpRequest(std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + cmCTestLog(this->CTest, DEBUG, "HttpRequest\n" + << "url: " << url << "\n" + << "fields " << fields << "\n"); + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + curl_easy_setopt(this->Curl, CURLOPT_POST, 1); + curl_easy_setopt(this->Curl, CURLOPT_POSTFIELDS, fields.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_URL, url.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_FOLLOWLOCATION, 1); + //set response options + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + + CURLcode res = ::curl_easy_perform(this->Curl); + + ::curl_easy_cleanup(this->Curl); + ::curl_global_cleanup(); + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl response: [" << response << "]\n"); + } + if ( debugData.size() > 0 ) + { + std::string curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + cmCTestLog(this->CTest, DEBUG, "Curl res: " << res << "\n"); + return (res == 0); +} + +void cmCTestCurl::SetProxyType() +{ + if ( cmSystemTools::GetEnv("HTTP_PROXY") ) + { + this->HTTPProxy = cmSystemTools::GetEnv("HTTP_PROXY"); + if ( cmSystemTools::GetEnv("HTTP_PROXY_PORT") ) + { + this->HTTPProxy += ":"; + this->HTTPProxy += cmSystemTools::GetEnv("HTTP_PROXY_PORT"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_TYPE") ) + { + // this is the default + this->HTTPProxyType = CURLPROXY_HTTP; + std::string type = cmSystemTools::GetEnv("HTTP_PROXY_TYPE"); + // HTTP/SOCKS4/SOCKS5 + if ( type == "HTTP" ) + { + this->HTTPProxyType = CURLPROXY_HTTP; + } + else if ( type == "SOCKS4" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS4; + } + else if ( type == "SOCKS5" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS5; + } + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_USER") ) + { + this->HTTPProxyAuth = cmSystemTools::GetEnv("HTTP_PROXY_USER"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_PASSWD") ) + { + this->HTTPProxyAuth += ":"; + this->HTTPProxyAuth += cmSystemTools::GetEnv("HTTP_PROXY_PASSWD"); + } + } +} diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h new file mode 100644 index 0000000..bb5c74a --- /dev/null +++ b/Source/CTest/cmCTestCurl.h @@ -0,0 +1,50 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 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 cmCTestCurl_h +#define cmCTestCurl_h +#include "cm_curl.h" +#include "cmStandardIncludes.h" +class cmCTest; + +class cmCTestCurl +{ +public: + cmCTestCurl(cmCTest*); + bool UploadFile(std::string const& url, + std::string const& file, + std::string const& fields, + std::string& response); + bool HttpRequest(std::string const& url, + std::string const& fields, + std::string& response); + // currently only supports CURLOPT_SSL_VERIFYPEER_OFF + // and CURLOPT_SSL_VERIFYHOST_OFF + void SetCurlOptions(std::vector const& args); + void SetUseHttp10On() { this->UseHttp10 = true;} + void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s;} +protected: + void SetProxyType(); + bool InitCurl(); +private: + cmCTest* CTest; + CURL* Curl; + std::string HTTPProxyAuth; + std::string HTTPProxy; + curl_proxytype HTTPProxyType; + bool VerifyHostOff; + bool VerifyPeerOff; + bool UseHttp10; + int TimeOutSeconds; +}; + + +#endif diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 4005a63..dcd7982 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -27,7 +27,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() = this->Makefile->GetDefinition("CTEST_TRIGGER_SITE"); bool ctestDropSiteCDash = this->Makefile->IsOn("CTEST_DROP_SITE_CDASH"); - + const char* ctestProjectName + = this->Makefile->GetDefinition("CTEST_PROJECT_NAME"); if ( !ctestDropMethod ) { ctestDropMethod = "http"; @@ -43,7 +44,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() // error: CDash requires CTEST_DROP_LOCATION definition // in CTestConfig.cmake } - + this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName); this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod); this->CTest->SetCTestConfiguration("DropSite", ctestDropSite); this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation); @@ -144,6 +145,13 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() static_cast(handler)->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF"); + if(this->CDashUploadFile.size()) + { + static_cast(handler)-> + SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); + static_cast(handler)-> + SetOption("CDashUploadType", this->CDashUploadType.c_str()); + } return handler; } @@ -178,6 +186,16 @@ bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg) return true; } + if(arg == "CDASH_UPLOAD") + { + this->ArgumentDoing = ArgumentDoingCDashUpload; + return true; + } + if(arg == "CDASH_UPLOAD_TYPE") + { + this->ArgumentDoing = ArgumentDoingCDashUploadType; + return true; + } if(arg == "INTERNAL_TEST_CHECKSUM") { this->InternalTest = true; @@ -240,6 +258,17 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) return true; } + if(this->ArgumentDoing == ArgumentDoingCDashUpload) + { + this->CDashUploadFile = arg; + return true; + } + if(this->ArgumentDoing == ArgumentDoingCDashUploadType) + { + this->CDashUploadType = arg; + return true; + } + // Look for other arguments. return this->Superclass::CheckArgumentValue(arg); } diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index 3673fbd..cb0ac61 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -64,6 +64,8 @@ protected: ArgumentDoingFiles, ArgumentDoingRetryDelay, ArgumentDoingRetryCount, + ArgumentDoingCDashUpload, + ArgumentDoingCDashUploadType, ArgumentDoingLast2 }; @@ -74,6 +76,8 @@ protected: cmCTest::SetOfStrings Files; std::string RetryCount; std::string RetryDelay; + std::string CDashUploadFile; + std::string CDashUploadType; }; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index fea94ba..3e5fa38 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -10,7 +10,8 @@ See the License for more information. ============================================================================*/ #include "cmCTestSubmitHandler.h" - +#include "cmCTestScriptHandler.h" +#include "cmake.h" #include "cmSystemTools.h" #include "cmVersion.h" #include "cmGeneratedFileStream.h" @@ -23,8 +24,10 @@ // For XML-RPC submission #include "cm_xmlrpc.h" +#include // For curl submission #include "cm_curl.h" +#include "cmCTestCurl.h" #include @@ -1055,9 +1058,164 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(std::string const&, } #endif +void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod, + std::string& url) +{ + dropMethod = this->CTest->GetCTestConfiguration("DropMethod"); + url = dropMethod; + url += "://"; + if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 ) + { + url += this->CTest->GetCTestConfiguration("DropSiteUser"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + this->CTest->GetCTestConfiguration("DropSiteUser").c_str()); + if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 ) + { + url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******"); + } + url += "@"; + } + url += this->CTest->GetCTestConfiguration("DropSite") + + this->CTest->GetCTestConfiguration("DropLocation"); +} + + +int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, + std::string const& typeString) +{ + if(!cmSystemTools::FileExists(file)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Upload file not found: " << file << "\n"); + } + cmCTestCurl curl(this->CTest); + std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); + std::vector args; + cmSystemTools::ExpandListArgument(curlopt, args); + curl.SetCurlOptions(args); + curl.SetTimeOutSeconds(SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT); + std::string dropMethod; + std::string url; + this->ConstructCDashURL(dropMethod, url); + std::string::size_type pos = url.find("submit.php?"); + url = url.substr(0, pos+10); + if ( ! (dropMethod == "http" || dropMethod == "https" ) ) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Only http and https are supported for CDASH_UPLOAD\n"); + return -1; + } + char md5sum[33]; + md5sum[32] = 0; + cmSystemTools::ComputeFileMD5(file, md5sum); + // 1. request the buildid and check to see if the file + // has already been uploaded + // TODO I added support for subproject. You would need to add + // a "&subproject=subprojectname" to the first POST. + cmCTestScriptHandler* ch = + static_cast(this->CTest->GetHandler("script")); + cmake* cm = ch->GetCMake(); + const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + std::ostringstream str; + str << "project=" + << this->CTest->GetCTestConfiguration("ProjectName") << "&"; + if(subproject) + { + str << "subproject=" << subproject << "&"; + } + str << "stamp=" << this->CTest->GetCurrentTag() << "-" + << this->CTest->GetTestModelString() << "&" + << "model=" << this->CTest->GetTestModelString() << "&" + << "build=" << this->CTest->GetCTestConfiguration("BuildName") << "&" + << "site=" << this->CTest->GetCTestConfiguration("Site") << "&" + << "track=" << this->CTest->GetTestModelString() << "&" + << "starttime=" << (int)cmSystemTools::GetTime() << "&" + << "endtime=" << (int)cmSystemTools::GetTime() << "&" + << "datafilesmd5[0]=" << md5sum << "&" + << "type=" << typeString; + std::string fields = str.str(); + cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:" + << url << "\nfile: " << file << "\n"); + std::string response; + if(!curl.HttpRequest(url, fields, response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error in HttpRequest\n" << response); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Request upload response: [" << response << "]\n"); + Json::Value json; + Json::Reader reader; + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + if(json["status"].asInt() != 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Bad status returned from CDash: " + << json["status"].asInt()); + return -1; + } + if(json["datafilesmd5"].isArray()) + { + int datares = json["datafilesmd5"][0].asInt(); + if(datares == 1) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "File already exists on CDash, skip upload " + << file << "\n"); + return 0; + } + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "bad datafilesmd5 value in response " + << response << "\n"); + return -1; + } + + std::string upload_as = cmSystemTools::GetFilenameName(file); + std::ostringstream fstr; + fstr << "type=" << typeString << "&" + << "md5=" << md5sum << "&" + << "filename=" << upload_as << "&" + << "buildid=" << json["buildid"].asString(); + if(!curl.UploadFile(file, url, fstr.str(), response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error uploading to CDash. " + << file << " " << url << " " << fstr.str()); + return -1; + } + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Upload file response: [" << response << "]\n"); + return 0; +} + //---------------------------------------------------------------------------- int cmCTestSubmitHandler::ProcessHandler() { + const char* cdashUploadFile = this->GetOption("CDashUploadFile"); + const char* cdashUploadType = this->GetOption("CDashUploadType"); + if(cdashUploadFile && cdashUploadType) + { + return this->HandleCDashUploadFile(std::string(cdashUploadFile), + std::string(cdashUploadType)); + } std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); // cdash does not need to trigger so just return true if(iscdash.size()) diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index accabd1..f9cd894 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -41,6 +41,11 @@ public: /** Specify a set of files to submit. */ void SelectFiles(cmCTest::SetOfStrings const& files); + // handle the cdash file upload protocol + int HandleCDashUploadFile(std::string const& file, std::string const& type); + + void ConstructCDashURL(std::string& dropMethod, std::string& url); + private: void SetLogFile(std::ostream* ost) { this->LogFile = ost; } diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index a2aecac..fc4c40d 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -247,6 +247,11 @@ bool cmArchiveWrite::AddPath(const char* path, return true; } +// function from libarchive +extern "C" +{ + time_t __archive_get_date(time_t, const char*); +} //---------------------------------------------------------------------------- bool cmArchiveWrite::AddFile(const char* file, size_t skip, const char* prefix) @@ -275,6 +280,17 @@ bool cmArchiveWrite::AddFile(const char* file, this->Error += cm_archive_error_string(this->Disk); return false; } + if(this->MTime.size()) + { + time_t t = __archive_get_date(0, this->MTime.c_str()); + if (t == -1) + { + this->Error = "__archive_get_date: Unable to parse mtime: "; + this->Error += "[" + this->MTime + "]"; + 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..987e95c 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(const char* t) { if(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/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c769154..372d41c 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1469,7 +1469,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, - bool verbose) + bool verbose, const char* mtime) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); @@ -1501,6 +1501,10 @@ bool cmSystemTools::CreateTar(const char* outFileName, } cmArchiveWrite a(fout, compress, cmArchiveWrite::TypeTAR); + if(mtime) + { + a.SetMTime(mtime); + } a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); i != files.end(); ++i) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 09ceea6..1c7208f 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& files, - cmTarCompression compressType, bool verbose); - static bool ExtractTar(const char* inFileName, - bool verbose); + cmTarCompression compressType, bool verbose, + const char* mtime=0); + 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/cmcmd.cxx b/Source/cmcmd.cxx index 70d98d2..3465e55 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -729,9 +729,21 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) std::string flags = args[2]; std::string outFile = args[3]; std::vector files; + std::string mtime; for (std::string::size_type cc = 4; cc < args.size(); cc ++) { - files.push_back(args[cc]); + // if the first 8 chars of an arg are --mtime= and that arg + // is not a file on disk, treat it is the --mtime= flag and + // not a file + if( (args[cc].substr(0, 8) == "--mtime=") && + !cmSystemTools::FileExists(args[cc])) + { + mtime = args[cc].substr(8); + } + else + { + files.push_back(args[cc]); + } } cmSystemTools::cmTarCompression compress = cmSystemTools::TarCompressNone; @@ -773,8 +785,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) } else if ( flags.find_first_of('c') != flags.npos ) { + const char* mtimestr = 0; + if(mtime.size()) + { + mtimestr = mtime.c_str(); + } if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, compress, verbose) ) + outFile.c_str(), files, compress, verbose, mtimestr) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=71ec1d16980b2ea507536976a098d7c246a663eb commit 71ec1d16980b2ea507536976a098d7c246a663eb Author: Brad King AuthorDate: Tue Jan 13 12:00:16 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 14:45:48 2015 -0500 jsoncpp: Add README-CMake.txt Describe how to update jsoncpp from upstream. diff --git a/Utilities/cmjsoncpp/README-CMake.txt b/Utilities/cmjsoncpp/README-CMake.txt new file mode 100644 index 0000000..bf74094 --- /dev/null +++ b/Utilities/cmjsoncpp/README-CMake.txt @@ -0,0 +1,66 @@ +The Utilities/cmjsoncpp directory contains a reduced distribution +of the jsoncpp source tree with only the library source code and +CMake build system. It is not a submodule; the actual content is part +of our source tree and changes can be made and committed directly. + +We update from upstream using Git's "subtree" merge strategy. A +special branch contains commits of upstream jsoncpp snapshots and +nothing else. No Git ref points explicitly to the head of this +branch, but it is merged into our history. + +Update jsoncpp from upstream as follows. Create a local branch to +explicitly reference the upstream snapshot branch head: + + git branch jsoncpp-upstream 53f6ccb0 + +Use a temporary directory to checkout the branch: + + mkdir jsoncpp-tmp + cd jsoncpp-tmp + git init + git pull .. jsoncpp-upstream + rm -rf * + +Now place the (reduced) jsoncpp content in this directory. See +instructions shown by + + git log 53f6ccb0 + +for help extracting the content from the upstream svn repo. Then run +the following commands to commit the new version. Substitute the +appropriate date and version number: + + git add --all + + GIT_AUTHOR_NAME='JsonCpp Upstream' \ + GIT_AUTHOR_EMAIL='kwrobot at kitware.com' \ + GIT_AUTHOR_DATE='Thu Nov 20 08:45:58 2014 -0600' \ + git commit -m 'JsonCpp 1.0.0 (reduced)' && + git commit --amend + +Edit the commit message to describe the procedure used to obtain the +content. Then push the changes back up to the main local repository: + + git push .. HEAD:jsoncpp-upstream + cd .. + rm -rf jsoncpp-tmp + +Create a topic in the main repository on which to perform the update: + + git checkout -b update-jsoncpp master + +Merge the jsoncpp-upstream branch as a subtree: + + git merge -s recursive -X subtree=Utilities/cmjsoncpp \ + jsoncpp-upstream + +If there are conflicts, resolve them and commit. Build and test the +tree. Commit any additional changes needed to succeed. + +Finally, run + + git rev-parse --short=8 jsoncpp-upstream + +to get the commit from which the jsoncpp-upstream branch must be started +on the next update. Edit the "git branch jsoncpp-upstream" line above to +record it, and commit this file. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a3e091f3be9f882c6c6ba1255a1cfe52881f589 commit 0a3e091f3be9f882c6c6ba1255a1cfe52881f589 Author: Brad King AuthorDate: Tue Jan 13 11:54:06 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 14:42:31 2015 -0500 jsoncpp: Definen isfinite when not available on ancient glibc The glibc 2.1 headers provide isfinite only in C99 mode. Add its definition ourselves. diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp index 89964ea..0a42cc4 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp @@ -21,6 +21,13 @@ #define snprintf _snprintf #endif +// Ancient glibc +#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 2 +# if !defined(isfinite) +# define isfinite __finite +# endif +#endif + #if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 // Disable warning about strdup being deprecated. #pragma warning(disable : 4996) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=60218d5e51cc31fb3179434bb1aaefba910458bc commit 60218d5e51cc31fb3179434bb1aaefba910458bc Author: Brad King AuthorDate: Tue Jan 13 11:27:43 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 14:42:26 2015 -0500 jsoncpp: Add missing include in json/writer.h The header uses std::ostream, so it must be declared. diff --git a/Utilities/cmjsoncpp/include/json/writer.h b/Utilities/cmjsoncpp/include/json/writer.h index dc9e46f..397bf6a 100644 --- a/Utilities/cmjsoncpp/include/json/writer.h +++ b/Utilities/cmjsoncpp/include/json/writer.h @@ -9,6 +9,7 @@ #if !defined(JSON_IS_AMALGAMATION) #include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) +#include #include #include http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8345ddb7ae431c6aeafbd24a368886b70e162bd0 commit 8345ddb7ae431c6aeafbd24a368886b70e162bd0 Author: Brad King AuthorDate: Tue Jan 13 10:45:23 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 14:42:20 2015 -0500 jsoncpp: Disable warnings to avoid changing 3rd party code Add '-w' or equivalent flag on compilers supporting it. Tell MSVC to use its lowest warning level inside jsoncpp sources. diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt index 8938f4f..1a10295 100644 --- a/Utilities/cmjsoncpp/CMakeLists.txt +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -1,5 +1,13 @@ project(JsonCpp CXX) +# Disable warnings to avoid changing 3rd party code. +if(CMAKE_CXX_COMPILER_ID MATCHES + "^(GNU|Clang|AppleClang|XL|VisualAge|SunPro|MIPSpro|HP|Intel)$") + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -w") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PathScale") + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -woffall") +endif() + set(JSONCPP_SOURCES src/lib_json/json_batchallocator.h src/lib_json/json_reader.cpp diff --git a/Utilities/cmjsoncpp/include/json/config.h b/Utilities/cmjsoncpp/include/json/config.h index afd3a45..5c711e3 100644 --- a/Utilities/cmjsoncpp/include/json/config.h +++ b/Utilities/cmjsoncpp/include/json/config.h @@ -6,6 +6,10 @@ #ifndef JSON_CONFIG_H_INCLUDED #define JSON_CONFIG_H_INCLUDED +#if defined(_MSC_VER) +# pragma warning(push,1) +#endif + /// If defined, indicates that json library is embedded in CppTL library. //# define JSON_IN_CPPTL 1 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=be2c3ac78174ed0a9d5b23e51719cc3ff220ed3a commit be2c3ac78174ed0a9d5b23e51719cc3ff220ed3a Author: Brad King AuthorDate: Tue Jan 13 10:45:04 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 14:42:09 2015 -0500 jsoncpp: Build the library within CMake Update json/json.h to account for our lack of autolink.h. Add a cm_jsoncpp_reader.h header to include the CMake-provided copy of the json/reader.h header. diff --git a/CMakeLists.txt b/CMakeLists.txt index 1812b27..1847600 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -372,6 +372,11 @@ macro (CMAKE_BUILD_UTILITIES) endif() #--------------------------------------------------------------------- + # Build jsoncpp library. + add_subdirectory(Utilities/cmjsoncpp) + CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty") + + #--------------------------------------------------------------------- # Build XMLRPC library for CMake and CTest. if(CTEST_USE_XMLRPC) find_package(XMLRPC QUIET REQUIRED libwww-client) diff --git a/Utilities/cm_jsoncpp_reader.h b/Utilities/cm_jsoncpp_reader.h new file mode 100644 index 0000000..d7cb50e --- /dev/null +++ b/Utilities/cm_jsoncpp_reader.h @@ -0,0 +1,18 @@ +/*============================================================================ + 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_reader_h +#define cm_jsoncpp_reader_h + +/* Use the jsoncpp library configured for CMake. */ +#include + +#endif diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt new file mode 100644 index 0000000..8938f4f --- /dev/null +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -0,0 +1,14 @@ +project(JsonCpp CXX) + +set(JSONCPP_SOURCES + src/lib_json/json_batchallocator.h + src/lib_json/json_reader.cpp + src/lib_json/json_tool.h + src/lib_json/json_value.cpp + src/lib_json/json_valueiterator.inl + src/lib_json/json_writer.cpp + ) + +include_directories(${JsonCpp_SOURCE_DIR}/include) + +add_library(cmjsoncpp ${JSONCPP_SOURCES}) diff --git a/Utilities/cmjsoncpp/include/json/json.h b/Utilities/cmjsoncpp/include/json/json.h index 8f10ac2..f89bc62 100644 --- a/Utilities/cmjsoncpp/include/json/json.h +++ b/Utilities/cmjsoncpp/include/json/json.h @@ -6,7 +6,6 @@ #ifndef JSON_JSON_H_INCLUDED #define JSON_JSON_H_INCLUDED -#include "autolink.h" #include "value.h" #include "reader.h" #include "writer.h" http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a263d519fffab082fc31f8e3f454726e3fbd8363 commit a263d519fffab082fc31f8e3f454726e3fbd8363 Merge: 32fd56b 53f6ccb Author: Brad King AuthorDate: Tue Jan 13 10:36:49 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 14:42:00 2015 -0500 Merge branch 'jsoncpp-upstream' into import-jsoncpp Use a subtree merge to place the upstream content in the Utilities/cmjsoncpp directory. diff --cc Utilities/cmjsoncpp/LICENSE index 0000000,ca2bfe1..ca2bfe1 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/LICENSE +++ b/Utilities/cmjsoncpp/LICENSE diff --cc Utilities/cmjsoncpp/include/json/assertions.h index 0000000,5ef7e7b..5ef7e7b mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/include/json/assertions.h +++ b/Utilities/cmjsoncpp/include/json/assertions.h diff --cc Utilities/cmjsoncpp/include/json/config.h index 0000000,afd3a45..afd3a45 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/include/json/config.h +++ b/Utilities/cmjsoncpp/include/json/config.h diff --cc Utilities/cmjsoncpp/include/json/features.h index 0000000,1bb7bb6..1bb7bb6 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/include/json/features.h +++ b/Utilities/cmjsoncpp/include/json/features.h diff --cc Utilities/cmjsoncpp/include/json/forwards.h index 0000000,84a26cd..84a26cd mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/include/json/forwards.h +++ b/Utilities/cmjsoncpp/include/json/forwards.h diff --cc Utilities/cmjsoncpp/include/json/json.h index 0000000,8f10ac2..8f10ac2 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/include/json/json.h +++ b/Utilities/cmjsoncpp/include/json/json.h diff --cc Utilities/cmjsoncpp/include/json/reader.h index 0000000,98814d5..98814d5 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/include/json/reader.h +++ b/Utilities/cmjsoncpp/include/json/reader.h diff --cc Utilities/cmjsoncpp/include/json/value.h index 0000000,197a856..197a856 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/include/json/value.h +++ b/Utilities/cmjsoncpp/include/json/value.h diff --cc Utilities/cmjsoncpp/include/json/version.h index 0000000,6fe0682..6fe0682 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/include/json/version.h +++ b/Utilities/cmjsoncpp/include/json/version.h diff --cc Utilities/cmjsoncpp/include/json/writer.h index 0000000,dc9e46f..dc9e46f mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/include/json/writer.h +++ b/Utilities/cmjsoncpp/include/json/writer.h diff --cc Utilities/cmjsoncpp/src/lib_json/json_batchallocator.h index 0000000,2fbef7a..2fbef7a mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_batchallocator.h +++ b/Utilities/cmjsoncpp/src/lib_json/json_batchallocator.h diff --cc Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl index 0000000,9ee15e9..9ee15e9 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl +++ b/Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl diff --cc Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl index 0000000,ef3f330..ef3f330 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl +++ b/Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl diff --cc Utilities/cmjsoncpp/src/lib_json/json_reader.cpp index 0000000,c5111f8..c5111f8 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp diff --cc Utilities/cmjsoncpp/src/lib_json/json_tool.h index 0000000,f9b61c3..f9b61c3 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_tool.h +++ b/Utilities/cmjsoncpp/src/lib_json/json_tool.h diff --cc Utilities/cmjsoncpp/src/lib_json/json_value.cpp index 0000000,b73deac..b73deac mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp diff --cc Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl index 0000000,a9f7df6..a9f7df6 mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl +++ b/Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl diff --cc Utilities/cmjsoncpp/src/lib_json/json_writer.cpp index 0000000,89964ea..89964ea mode 000000,100644..100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53f6ccb0ee76a2b9ac40abd5ec5e07aa55fbb393 commit 53f6ccb0ee76a2b9ac40abd5ec5e07aa55fbb393 Author: JsonCpp Upstream AuthorDate: Thu Nov 20 08:45:58 2014 -0600 Commit: Brad King CommitDate: Tue Jan 13 14:41:08 2015 -0500 JsonCpp 1.0.0 (reduced) Extract upstream JsonCpp using the following shell code. url=https://github.com/open-source-parsers/jsoncpp && v=1.0.0 && r=7165f6ac && paths=" LICENSE include/json src/lib_json " && remove=" include/json/autolink.h src/lib_json/CMakeLists.txt src/lib_json/sconscript src/lib_json/version.h.in " && mkdir jsoncpp-$v-g$r-reduced && git clone $url jsoncpp-git && date=$(cd jsoncpp-git && git log -n 1 --format='%cd' $r) && (cd jsoncpp-git && git checkout $r && git archive --format=tar $r -- $paths) | (cd jsoncpp-$v-g$r-reduced && tar xv && rm -f $remove) && echo "g$r date: $date" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ca2bfe1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,55 @@ +The JsonCpp library's source code, including accompanying documentation, +tests and demonstration applications, are licensed under the following +conditions... + +The author (Baptiste Lepilleur) explicitly disclaims copyright in all +jurisdictions which recognize such a disclaimer. In such jurisdictions, +this software is released into the Public Domain. + +In jurisdictions which do not recognize Public Domain property (e.g. Germany as of +2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is +released under the terms of the MIT License (see below). + +In jurisdictions which recognize Public Domain property, the user of this +software may choose to accept it either as 1) Public Domain, 2) under the +conditions of the MIT License (see below), or 3) under the terms of dual +Public Domain/MIT License conditions described here, as they choose. + +The MIT License is about as close to Public Domain as a license can get, and is +described in clear, concise terms at: + + http://en.wikipedia.org/wiki/MIT_License + +The full text of the MIT License follows: + +======================================================================== +Copyright (c) 2007-2010 Baptiste Lepilleur + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +======================================================================== +(END LICENSE TEXT) + +The MIT license is compatible with both the GPL and commercial +software, affording one all of the rights of Public Domain with the +minor nuisance of being required to keep the above copyright notice +and license text in the source code. Note also that by accepting the +Public Domain "license" you can re-license your copy using whatever +license you like. diff --git a/include/json/assertions.h b/include/json/assertions.h new file mode 100644 index 0000000..5ef7e7b --- /dev/null +++ b/include/json/assertions.h @@ -0,0 +1,41 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED +#define CPPTL_JSON_ASSERTIONS_H_INCLUDED + +#include + +#if !defined(JSON_IS_AMALGAMATION) +#include "config.h" +#endif // if !defined(JSON_IS_AMALGAMATION) + +#if JSON_USE_EXCEPTION +#include +#define JSON_ASSERT(condition) \ + assert(condition); // @todo <= change this into an exception throw +#define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message); +#else // JSON_USE_EXCEPTION +#define JSON_ASSERT(condition) assert(condition); + +// The call to assert() will show the failure message in debug builds. In +// release bugs we write to invalid memory in order to crash hard, so that a +// debugger or crash reporter gets the chance to take over. We still call exit() +// afterward in order to tell the compiler that this macro doesn't return. +#define JSON_FAIL_MESSAGE(message) \ + { \ + assert(false&& message); \ + strcpy(reinterpret_cast(666), message); \ + exit(123); \ + } + +#endif + +#define JSON_ASSERT_MESSAGE(condition, message) \ + if (!(condition)) { \ + JSON_FAIL_MESSAGE(message) \ + } + +#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED diff --git a/include/json/config.h b/include/json/config.h new file mode 100644 index 0000000..afd3a45 --- /dev/null +++ b/include/json/config.h @@ -0,0 +1,112 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_CONFIG_H_INCLUDED +#define JSON_CONFIG_H_INCLUDED + +/// If defined, indicates that json library is embedded in CppTL library. +//# define JSON_IN_CPPTL 1 + +/// If defined, indicates that json may leverage CppTL library +//# define JSON_USE_CPPTL 1 +/// If defined, indicates that cpptl vector based map should be used instead of +/// std::map +/// as Value container. +//# define JSON_USE_CPPTL_SMALLMAP 1 +/// If defined, indicates that Json specific container should be used +/// (hash table & simple deque container with customizable allocator). +/// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332 +//# define JSON_VALUE_USE_INTERNAL_MAP 1 +/// Force usage of standard new/malloc based allocator instead of memory pool +/// based allocator. +/// The memory pools allocator used optimization (initializing Value and +/// ValueInternalLink +/// as if it was a POD) that may cause some validation tool to report errors. +/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. +//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 + +// If non-zero, the library uses exceptions to report bad input instead of C +// assertion macros. The default is to use exceptions. +#ifndef JSON_USE_EXCEPTION +#define JSON_USE_EXCEPTION 1 +#endif + +/// If defined, indicates that the source file is amalgated +/// to prevent private header inclusion. +/// Remarks: it is automatically defined in the generated amalgated header. +// #define JSON_IS_AMALGAMATION + +#ifdef JSON_IN_CPPTL +#include +#ifndef JSON_USE_CPPTL +#define JSON_USE_CPPTL 1 +#endif +#endif + +#ifdef JSON_IN_CPPTL +#define JSON_API CPPTL_API +#elif defined(JSON_DLL_BUILD) +#if defined(_MSC_VER) +#define JSON_API __declspec(dllexport) +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING +#endif // if defined(_MSC_VER) +#elif defined(JSON_DLL) +#if defined(_MSC_VER) +#define JSON_API __declspec(dllimport) +#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING +#endif // if defined(_MSC_VER) +#endif // ifdef JSON_IN_CPPTL +#if !defined(JSON_API) +#define JSON_API +#endif + +// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for +// integer +// Storages, and 64 bits integer support is disabled. +// #define JSON_NO_INT64 1 + +#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 +// Microsoft Visual Studio 6 only support conversion from __int64 to double +// (no conversion from unsigned __int64). +#define JSON_USE_INT64_DOUBLE_CONVERSION 1 +// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' +// characters in the debug information) +// All projects I've ever seen with VS6 were using this globally (not bothering +// with pragma push/pop). +#pragma warning(disable : 4786) +#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 + +#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 +/// Indicates that the following function is deprecated. +#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) +#endif + +#if !defined(JSONCPP_DEPRECATED) +#define JSONCPP_DEPRECATED(message) +#endif // if !defined(JSONCPP_DEPRECATED) + +namespace Json { +typedef int Int; +typedef unsigned int UInt; +#if defined(JSON_NO_INT64) +typedef int LargestInt; +typedef unsigned int LargestUInt; +#undef JSON_HAS_INT64 +#else // if defined(JSON_NO_INT64) +// For Microsoft Visual use specific types as long long is not supported +#if defined(_MSC_VER) // Microsoft Visual Studio +typedef __int64 Int64; +typedef unsigned __int64 UInt64; +#else // if defined(_MSC_VER) // Other platforms, use long long +typedef long long int Int64; +typedef unsigned long long int UInt64; +#endif // if defined(_MSC_VER) +typedef Int64 LargestInt; +typedef UInt64 LargestUInt; +#define JSON_HAS_INT64 +#endif // if defined(JSON_NO_INT64) +} // end namespace Json + +#endif // JSON_CONFIG_H_INCLUDED diff --git a/include/json/features.h b/include/json/features.h new file mode 100644 index 0000000..1bb7bb6 --- /dev/null +++ b/include/json/features.h @@ -0,0 +1,57 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_FEATURES_H_INCLUDED +#define CPPTL_JSON_FEATURES_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "forwards.h" +#endif // if !defined(JSON_IS_AMALGAMATION) + +namespace Json { + +/** \brief Configuration passed to reader and writer. + * This configuration object can be used to force the Reader or Writer + * to behave in a standard conforming way. + */ +class JSON_API Features { +public: + /** \brief A configuration that allows all features and assumes all strings + * are UTF-8. + * - C & C++ comments are allowed + * - Root object can be any JSON value + * - Assumes Value strings are encoded in UTF-8 + */ + static Features all(); + + /** \brief A configuration that is strictly compatible with the JSON + * specification. + * - Comments are forbidden. + * - Root object must be either an array or an object value. + * - Assumes Value strings are encoded in UTF-8 + */ + static Features strictMode(); + + /** \brief Initialize the configuration like JsonConfig::allFeatures; + */ + Features(); + + /// \c true if comments are allowed. Default: \c true. + bool allowComments_; + + /// \c true if root must be either an array or an object value. Default: \c + /// false. + bool strictRoot_; + + /// \c true if dropped null placeholders are allowed. Default: \c false. + bool allowDroppedNullPlaceholders_; + + /// \c true if numeric object key are allowed. Default: \c false. + bool allowNumericKeys_; +}; + +} // namespace Json + +#endif // CPPTL_JSON_FEATURES_H_INCLUDED diff --git a/include/json/forwards.h b/include/json/forwards.h new file mode 100644 index 0000000..84a26cd --- /dev/null +++ b/include/json/forwards.h @@ -0,0 +1,43 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_FORWARDS_H_INCLUDED +#define JSON_FORWARDS_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "config.h" +#endif // if !defined(JSON_IS_AMALGAMATION) + +namespace Json { + +// writer.h +class FastWriter; +class StyledWriter; + +// reader.h +class Reader; + +// features.h +class Features; + +// value.h +typedef unsigned int ArrayIndex; +class StaticString; +class Path; +class PathArgument; +class Value; +class ValueIteratorBase; +class ValueIterator; +class ValueConstIterator; +#ifdef JSON_VALUE_USE_INTERNAL_MAP +class ValueMapAllocator; +class ValueInternalLink; +class ValueInternalArray; +class ValueInternalMap; +#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP + +} // namespace Json + +#endif // JSON_FORWARDS_H_INCLUDED diff --git a/include/json/json.h b/include/json/json.h new file mode 100644 index 0000000..8f10ac2 --- /dev/null +++ b/include/json/json.h @@ -0,0 +1,15 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_JSON_H_INCLUDED +#define JSON_JSON_H_INCLUDED + +#include "autolink.h" +#include "value.h" +#include "reader.h" +#include "writer.h" +#include "features.h" + +#endif // JSON_JSON_H_INCLUDED diff --git a/include/json/reader.h b/include/json/reader.h new file mode 100644 index 0000000..98814d5 --- /dev/null +++ b/include/json/reader.h @@ -0,0 +1,276 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_READER_H_INCLUDED +#define CPPTL_JSON_READER_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "features.h" +#include "value.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include + +// Disable warning C4251: : needs to have dll-interface to +// be used by... +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(push) +#pragma warning(disable : 4251) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +namespace Json { + +/** \brief Unserialize a JSON document into a + *Value. + * + */ +class JSON_API Reader { +public: + typedef char Char; + typedef const Char* Location; + + /** \brief An error tagged with where in the JSON text it was encountered. + * + * The offsets give the [start, limit) range of bytes within the text. Note + * that this is bytes, not codepoints. + * + */ + struct StructuredError { + size_t offset_start; + size_t offset_limit; + std::string message; + }; + + /** \brief Constructs a Reader allowing all features + * for parsing. + */ + Reader(); + + /** \brief Constructs a Reader allowing the specified feature set + * for parsing. + */ + Reader(const Features& features); + + /** \brief Read a Value from a JSON + * document. + * \param document UTF-8 encoded string containing the document to read. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them + * back during + * serialization, \c false to discard comments. + * This parameter is ignored if + * Features::allowComments_ + * is \c false. + * \return \c true if the document was successfully parsed, \c false if an + * error occurred. + */ + bool + parse(const std::string& document, Value& root, bool collectComments = true); + + /** \brief Read a Value from a JSON + document. + * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the + document to read. + * \param endDoc Pointer on the end of the UTF-8 encoded string of the + document to read. + \ Must be >= beginDoc. + * \param root [out] Contains the root value of the document if it was + * successfully parsed. + * \param collectComments \c true to collect comment and allow writing them + back during + * serialization, \c false to discard comments. + * This parameter is ignored if + Features::allowComments_ + * is \c false. + * \return \c true if the document was successfully parsed, \c false if an + error occurred. + */ + bool parse(const char* beginDoc, + const char* endDoc, + Value& root, + bool collectComments = true); + + /// \brief Parse from input stream. + /// \see Json::operator>>(std::istream&, Json::Value&). + bool parse(std::istream& is, Value& root, bool collectComments = true); + + /** \brief Returns a user friendly string that list errors in the parsed + * document. + * \return Formatted error message with the list of errors with their location + * in + * 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 + * document. + * \return Formatted error message with the list of errors with their location + * in + * the parsed document. An empty string is returned if no error + * occurred + * during parsing. + */ + std::string getFormattedErrorMessages() const; + + /** \brief Returns a vector of structured erros encounted while parsing. + * \return A (possibly empty) vector of StructuredError objects. Currently + * only one error can be returned, but the caller should tolerate + * multiple + * errors. This can occur if the parser recovers from a non-fatal + * parse error and then encounters additional errors. + */ + std::vector getStructuredErrors() const; + + /** \brief Add a semantic error message. + * \param value JSON Value location associated with the error + * \param message The error message. + * \return \c true if the error was successfully added, \c false if the + * Value offset exceeds the document size. + */ + bool pushError(const Value& value, const std::string& message); + + /** \brief Add a semantic error message with extra context. + * \param value JSON Value location associated with the error + * \param message The error message. + * \param extra Additional JSON Value location to contextualize the error + * \return \c true if the error was successfully added, \c false if either + * Value offset exceeds the document size. + */ + bool pushError(const Value& value, const std::string& message, const Value& extra); + + /** \brief Return whether there are any errors. + * \return \c true if there are no errors to report \c false if + * errors have occurred. + */ + bool good() const; + +private: + enum TokenType { + tokenEndOfStream = 0, + tokenObjectBegin, + tokenObjectEnd, + tokenArrayBegin, + tokenArrayEnd, + tokenString, + tokenNumber, + tokenTrue, + tokenFalse, + tokenNull, + tokenArraySeparator, + tokenMemberSeparator, + tokenComment, + tokenError + }; + + class Token { + public: + TokenType type_; + Location start_; + Location end_; + }; + + class ErrorInfo { + public: + Token token_; + std::string message_; + Location extra_; + }; + + typedef std::deque Errors; + + bool expectToken(TokenType type, Token& token, const char* message); + bool readToken(Token& token); + void skipSpaces(); + bool match(Location pattern, int patternLength); + bool readComment(); + bool readCStyleComment(); + bool readCppStyleComment(); + bool readString(); + void readNumber(); + bool readValue(); + bool readObject(Token& token); + bool readArray(Token& token); + bool decodeNumber(Token& token); + bool decodeNumber(Token& token, Value& decoded); + bool decodeString(Token& token); + bool decodeString(Token& token, std::string& decoded); + bool decodeDouble(Token& token); + bool decodeDouble(Token& token, Value& decoded); + bool decodeUnicodeCodePoint(Token& token, + Location& current, + Location end, + unsigned int& unicode); + bool decodeUnicodeEscapeSequence(Token& token, + Location& current, + Location end, + unsigned int& unicode); + bool addError(const std::string& message, Token& token, Location extra = 0); + bool recoverFromError(TokenType skipUntilToken); + bool addErrorAndRecover(const std::string& message, + Token& token, + TokenType skipUntilToken); + void skipUntilSpace(); + Value& currentValue(); + Char getNextChar(); + void + getLocationLineAndColumn(Location location, int& line, int& column) const; + std::string getLocationLineAndColumn(Location location) const; + void addComment(Location begin, Location end, CommentPlacement placement); + void skipCommentTokens(Token& token); + + typedef std::stack Nodes; + Nodes nodes_; + Errors errors_; + std::string document_; + Location begin_; + Location end_; + Location current_; + Location lastValueEnd_; + Value* lastValue_; + std::string commentsBefore_; + Features features_; + bool collectComments_; +}; + +/** \brief Read from 'sin' into 'root'. + + Always keep comments from the input JSON. + + This can be used to read a file into a particular sub-object. + For example: + \code + Json::Value root; + cin >> root["dir"]["file"]; + cout << root; + \endcode + Result: + \verbatim + { + "dir": { + "file": { + // The input stream JSON would be nested here. + } + } + } + \endverbatim + \throw std::exception on parse error. + \see Json::operator<<() +*/ +JSON_API std::istream& operator>>(std::istream&, Value&); + +} // namespace Json + +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(pop) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +#endif // CPPTL_JSON_READER_H_INCLUDED diff --git a/include/json/value.h b/include/json/value.h new file mode 100644 index 0000000..197a856 --- /dev/null +++ b/include/json/value.h @@ -0,0 +1,1088 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef CPPTL_JSON_H_INCLUDED +#define CPPTL_JSON_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "forwards.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include + +#ifndef JSON_USE_CPPTL_SMALLMAP +#include +#else +#include +#endif +#ifdef JSON_USE_CPPTL +#include +#endif + +// Disable warning C4251: : needs to have dll-interface to +// be used by... +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(push) +#pragma warning(disable : 4251) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +/** \brief JSON (JavaScript Object Notation). + */ +namespace Json { + +/** \brief Type of the value held by a Value object. + */ +enum ValueType { + nullValue = 0, ///< 'null' value + intValue, ///< signed integer value + uintValue, ///< unsigned integer value + realValue, ///< double value + stringValue, ///< UTF-8 string value + booleanValue, ///< bool value + arrayValue, ///< array value (ordered list) + objectValue ///< object value (collection of name/value pairs). +}; + +enum CommentPlacement { + commentBefore = 0, ///< a comment placed on the line before a value + commentAfterOnSameLine, ///< a comment just after a value on the same line + commentAfter, ///< a comment on the line after a value (only make sense for + /// root value) + numberOfCommentPlacement +}; + +//# ifdef JSON_USE_CPPTL +// typedef CppTL::AnyEnumerator EnumMemberNames; +// typedef CppTL::AnyEnumerator EnumValues; +//# endif + +/** \brief Lightweight wrapper to tag static string. + * + * Value constructor and objectValue member assignement takes advantage of the + * StaticString and avoid the cost of string duplication when storing the + * string or the member name. + * + * Example of usage: + * \code + * Json::Value aValue( StaticString("some text") ); + * Json::Value object; + * static const StaticString code("code"); + * object[code] = 1234; + * \endcode + */ +class JSON_API StaticString { +public: + explicit StaticString(const char* czstring) : str_(czstring) {} + + operator const char*() const { return str_; } + + const char* c_str() const { return str_; } + +private: + const char* str_; +}; + +/** \brief Represents a JSON value. + * + * This class is a discriminated union wrapper that can represents a: + * - signed integer [range: Value::minInt - Value::maxInt] + * - unsigned integer (range: 0 - Value::maxUInt) + * - double + * - UTF-8 string + * - boolean + * - 'null' + * - an ordered list of Value + * - collection of name/value pairs (javascript object) + * + * The type of the held value is represented by a #ValueType and + * can be obtained using type(). + * + * values of an #objectValue or #arrayValue can be accessed using operator[]() + *methods. + * Non const methods will automatically create the a #nullValue element + * if it does not exist. + * The sequence of an #arrayValue will be automatically resize and initialized + * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. + * + * The get() methods can be used to obtanis default value in the case the + *required element + * does not exist. + * + * It is possible to iterate over the list of a #objectValue values using + * the getMemberNames() method. + */ +class JSON_API Value { + friend class ValueIteratorBase; +#ifdef JSON_VALUE_USE_INTERNAL_MAP + friend class ValueInternalLink; + friend class ValueInternalMap; +#endif +public: + typedef std::vector Members; + typedef ValueIterator iterator; + typedef ValueConstIterator const_iterator; + typedef Json::UInt UInt; + typedef Json::Int Int; +#if defined(JSON_HAS_INT64) + typedef Json::UInt64 UInt64; + typedef Json::Int64 Int64; +#endif // defined(JSON_HAS_INT64) + typedef Json::LargestInt LargestInt; + typedef Json::LargestUInt LargestUInt; + typedef Json::ArrayIndex ArrayIndex; + + static const Value& null; + /// Minimum signed integer value that can be stored in a Json::Value. + static const LargestInt minLargestInt; + /// Maximum signed integer value that can be stored in a Json::Value. + static const LargestInt maxLargestInt; + /// Maximum unsigned integer value that can be stored in a Json::Value. + static const LargestUInt maxLargestUInt; + + /// Minimum signed int value that can be stored in a Json::Value. + static const Int minInt; + /// Maximum signed int value that can be stored in a Json::Value. + static const Int maxInt; + /// Maximum unsigned int value that can be stored in a Json::Value. + static const UInt maxUInt; + +#if defined(JSON_HAS_INT64) + /// Minimum signed 64 bits int value that can be stored in a Json::Value. + static const Int64 minInt64; + /// Maximum signed 64 bits int value that can be stored in a Json::Value. + static const Int64 maxInt64; + /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. + static const UInt64 maxUInt64; +#endif // defined(JSON_HAS_INT64) + +private: +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION +#ifndef JSON_VALUE_USE_INTERNAL_MAP + class CZString { + public: + enum DuplicationPolicy { + noDuplication = 0, + duplicate, + duplicateOnCopy + }; + CZString(ArrayIndex index); + CZString(const char* cstr, DuplicationPolicy allocate); + CZString(const CZString& other); + ~CZString(); + CZString& operator=(CZString other); + bool operator<(const CZString& other) const; + bool operator==(const CZString& other) const; + ArrayIndex index() const; + const char* c_str() const; + bool isStaticString() const; + + private: + void swap(CZString& other); + const char* cstr_; + ArrayIndex index_; + }; + +public: +#ifndef JSON_USE_CPPTL_SMALLMAP + typedef std::map ObjectValues; +#else + typedef CppTL::SmallMap ObjectValues; +#endif // ifndef JSON_USE_CPPTL_SMALLMAP +#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP +#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + +public: + /** \brief Create a default Value of the given type. + + This is a very useful constructor. + To create an empty array, pass arrayValue. + To create an empty object, pass objectValue. + Another Value can then be set to this one by assignment. +This is useful since clear() and resize() will not alter types. + + Examples: +\code +Json::Value null_value; // null +Json::Value arr_value(Json::arrayValue); // [] +Json::Value obj_value(Json::objectValue); // {} +\endcode + */ + Value(ValueType type = nullValue); + Value(Int value); + Value(UInt value); +#if defined(JSON_HAS_INT64) + Value(Int64 value); + Value(UInt64 value); +#endif // if defined(JSON_HAS_INT64) + Value(double value); + Value(const char* value); + Value(const char* beginValue, const char* endValue); + /** \brief Constructs a value from a static string. + + * Like other value string constructor but do not duplicate the string for + * internal storage. The given string must remain alive after the call to this + * constructor. + * Example of usage: + * \code + * Json::Value aValue( StaticString("some text") ); + * \endcode + */ + Value(const StaticString& value); + Value(const std::string& value); +#ifdef JSON_USE_CPPTL + Value(const CppTL::ConstString& value); +#endif + Value(bool value); + Value(const Value& other); + ~Value(); + + Value& operator=(Value other); + /// Swap values. + /// \note Currently, comments are intentionally not swapped, for + /// both logic and efficiency. + void swap(Value& other); + + ValueType type() const; + + bool operator<(const Value& other) const; + bool operator<=(const Value& other) const; + bool operator>=(const Value& other) const; + bool operator>(const Value& other) const; + + bool operator==(const Value& other) const; + bool operator!=(const Value& other) const; + + int compare(const Value& other) const; + + const char* asCString() const; + std::string asString() const; +#ifdef JSON_USE_CPPTL + CppTL::ConstString asConstString() const; +#endif + Int asInt() const; + UInt asUInt() const; +#if defined(JSON_HAS_INT64) + Int64 asInt64() const; + UInt64 asUInt64() const; +#endif // if defined(JSON_HAS_INT64) + LargestInt asLargestInt() const; + LargestUInt asLargestUInt() const; + float asFloat() const; + double asDouble() const; + bool asBool() const; + + bool isNull() const; + bool isBool() const; + bool isInt() const; + bool isInt64() const; + bool isUInt() const; + bool isUInt64() const; + bool isIntegral() const; + bool isDouble() const; + bool isNumeric() const; + bool isString() const; + bool isArray() const; + bool isObject() const; + + bool isConvertibleTo(ValueType other) const; + + /// Number of values in array or object + ArrayIndex size() const; + + /// \brief Return true if empty array, empty object, or null; + /// otherwise, false. + bool empty() const; + + /// Return isNull() + bool operator!() const; + + /// Remove all object members and array elements. + /// \pre type() is arrayValue, objectValue, or nullValue + /// \post type() is unchanged + void clear(); + + /// Resize the array to size elements. + /// New elements are initialized to null. + /// May only be called on nullValue or arrayValue. + /// \pre type() is arrayValue or nullValue + /// \post type() is arrayValue + void resize(ArrayIndex size); + + /// Access an array element (zero based index ). + /// If the array contains less than index element, then null value are + /// inserted + /// in the array so that its size is index+1. + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + Value& operator[](ArrayIndex index); + + /// Access an array element (zero based index ). + /// If the array contains less than index element, then null value are + /// inserted + /// in the array so that its size is index+1. + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + Value& operator[](int index); + + /// Access an array element (zero based index ) + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + const Value& operator[](ArrayIndex index) const; + + /// Access an array element (zero based index ) + /// (You may need to say 'value[0u]' to get your compiler to distinguish + /// this from the operator[] which takes a string.) + const Value& operator[](int index) const; + + /// If the array contains at least index+1 elements, returns the element + /// value, + /// otherwise returns defaultValue. + Value get(ArrayIndex index, const Value& defaultValue) const; + /// Return true if index < size(). + bool isValidIndex(ArrayIndex index) const; + /// \brief Append value to array at the end. + /// + /// Equivalent to jsonvalue[jsonvalue.size()] = value; + Value& append(const Value& value); + + /// Access an object value by name, create a null member if it does not exist. + Value& operator[](const char* key); + /// Access an object value by name, returns null if there is no member with + /// that name. + const Value& operator[](const char* key) const; + /// Access an object value by name, create a null member if it does not exist. + Value& operator[](const std::string& key); + /// Access an object value by name, returns null if there is no member with + /// that name. + const Value& operator[](const std::string& key) const; + /** \brief Access an object value by name, create a null member if it does not + exist. + + * If the object as no entry for that name, then the member name used to store + * the new entry is not duplicated. + * Example of use: + * \code + * Json::Value object; + * static const StaticString code("code"); + * object[code] = 1234; + * \endcode + */ + Value& operator[](const StaticString& key); +#ifdef JSON_USE_CPPTL + /// Access an object value by name, create a null member if it does not exist. + Value& operator[](const CppTL::ConstString& key); + /// Access an object value by name, returns null if there is no member with + /// that name. + const Value& operator[](const CppTL::ConstString& key) const; +#endif + /// Return the member named key if it exist, defaultValue otherwise. + Value get(const char* key, const Value& defaultValue) const; + /// Return the member named key if it exist, defaultValue otherwise. + Value get(const std::string& key, const Value& defaultValue) const; +#ifdef JSON_USE_CPPTL + /// Return the member named key if it exist, defaultValue otherwise. + Value get(const CppTL::ConstString& key, const Value& defaultValue) const; +#endif + /// \brief Remove and return the named member. + /// + /// Do nothing if it did not exist. + /// \return the removed Value, or null. + /// \pre type() is objectValue or nullValue + /// \post type() is unchanged + Value removeMember(const char* key); + /// Same as removeMember(const char*) + Value removeMember(const std::string& key); + + /// Return true if the object has a member named key. + bool isMember(const char* key) const; + /// Return true if the object has a member named key. + bool isMember(const std::string& key) const; +#ifdef JSON_USE_CPPTL + /// Return true if the object has a member named key. + bool isMember(const CppTL::ConstString& key) const; +#endif + + /// \brief Return a list of the member names. + /// + /// If null, return an empty list. + /// \pre type() is objectValue or nullValue + /// \post if type() was nullValue, it remains nullValue + Members getMemberNames() const; + + //# ifdef JSON_USE_CPPTL + // EnumMemberNames enumMemberNames() const; + // EnumValues enumValues() const; + //# endif + + /// Comments must be //... or /* ... */ + void setComment(const char* comment, CommentPlacement placement); + /// Comments must be //... or /* ... */ + void setComment(const std::string& comment, CommentPlacement placement); + bool hasComment(CommentPlacement placement) const; + /// Include delimiters and embedded newlines. + std::string getComment(CommentPlacement placement) const; + + std::string toStyledString() const; + + const_iterator begin() const; + const_iterator end() const; + + iterator begin(); + iterator end(); + + // Accessors for the [start, limit) range of bytes within the JSON text from + // which this value was parsed, if any. + void setOffsetStart(size_t start); + void setOffsetLimit(size_t limit); + size_t getOffsetStart() const; + size_t getOffsetLimit() const; + +private: + void initBasic(ValueType type, bool allocated = false); + + Value& resolveReference(const char* key, bool isStatic); + +#ifdef JSON_VALUE_USE_INTERNAL_MAP + inline bool isItemAvailable() const { return itemIsUsed_ == 0; } + + inline void setItemUsed(bool isUsed = true) { itemIsUsed_ = isUsed ? 1 : 0; } + + inline bool isMemberNameStatic() const { return memberNameIsStatic_ == 0; } + + inline void setMemberNameIsStatic(bool isStatic) { + memberNameIsStatic_ = isStatic ? 1 : 0; + } +#endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP + +private: + struct CommentInfo { + CommentInfo(); + ~CommentInfo(); + + void setComment(const char* text); + + char* comment_; + }; + + // struct MemberNamesTransform + //{ + // typedef const char *result_type; + // const char *operator()( const CZString &name ) const + // { + // return name.c_str(); + // } + //}; + + union ValueHolder { + LargestInt int_; + LargestUInt uint_; + double real_; + bool bool_; + char* string_; +#ifdef JSON_VALUE_USE_INTERNAL_MAP + ValueInternalArray* array_; + ValueInternalMap* map_; +#else + ObjectValues* map_; +#endif + } value_; + ValueType type_ : 8; + int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. +#ifdef JSON_VALUE_USE_INTERNAL_MAP + unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. + int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. +#endif + CommentInfo* comments_; + + // [start, limit) byte offsets in the source JSON text from which this Value + // was extracted. + size_t start_; + size_t limit_; +}; + +/** \brief Experimental and untested: represents an element of the "path" to + * access a node. + */ +class JSON_API PathArgument { +public: + friend class Path; + + PathArgument(); + PathArgument(ArrayIndex index); + PathArgument(const char* key); + PathArgument(const std::string& key); + +private: + enum Kind { + kindNone = 0, + kindIndex, + kindKey + }; + std::string key_; + ArrayIndex index_; + Kind kind_; +}; + +/** \brief Experimental and untested: represents a "path" to access a node. + * + * Syntax: + * - "." => root node + * - ".[n]" => elements at index 'n' of root node (an array value) + * - ".name" => member named 'name' of root node (an object value) + * - ".name1.name2.name3" + * - ".[0][1][2].name1[3]" + * - ".%" => member name is provided as parameter + * - ".[%]" => index is provied as parameter + */ +class JSON_API Path { +public: + Path(const std::string& path, + const PathArgument& a1 = PathArgument(), + const PathArgument& a2 = PathArgument(), + const PathArgument& a3 = PathArgument(), + const PathArgument& a4 = PathArgument(), + const PathArgument& a5 = PathArgument()); + + const Value& resolve(const Value& root) const; + Value resolve(const Value& root, const Value& defaultValue) const; + /// Creates the "path" to access the specified node and returns a reference on + /// the node. + Value& make(Value& root) const; + +private: + typedef std::vector InArgs; + typedef std::vector Args; + + void makePath(const std::string& path, const InArgs& in); + void addPathInArg(const std::string& path, + const InArgs& in, + InArgs::const_iterator& itInArg, + PathArgument::Kind kind); + void invalidPath(const std::string& path, int location); + + Args args_; +}; + +#ifdef JSON_VALUE_USE_INTERNAL_MAP +/** \brief Allocator to customize Value internal map. + * Below is an example of a simple implementation (default implementation + actually + * use memory pool for speed). + * \code + class DefaultValueMapAllocator : public ValueMapAllocator + { + public: // overridden from ValueMapAllocator + virtual ValueInternalMap *newMap() + { + return new ValueInternalMap(); + } + + virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) + { + return new ValueInternalMap( other ); + } + + virtual void destructMap( ValueInternalMap *map ) + { + delete map; + } + + virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) + { + return new ValueInternalLink[size]; + } + + virtual void releaseMapBuckets( ValueInternalLink *links ) + { + delete [] links; + } + + virtual ValueInternalLink *allocateMapLink() + { + return new ValueInternalLink(); + } + + virtual void releaseMapLink( ValueInternalLink *link ) + { + delete link; + } + }; + * \endcode + */ +class JSON_API ValueMapAllocator { +public: + virtual ~ValueMapAllocator(); + virtual ValueInternalMap* newMap() = 0; + virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) = 0; + virtual void destructMap(ValueInternalMap* map) = 0; + virtual ValueInternalLink* allocateMapBuckets(unsigned int size) = 0; + virtual void releaseMapBuckets(ValueInternalLink* links) = 0; + virtual ValueInternalLink* allocateMapLink() = 0; + virtual void releaseMapLink(ValueInternalLink* link) = 0; +}; + +/** \brief ValueInternalMap hash-map bucket chain link (for internal use only). + * \internal previous_ & next_ allows for bidirectional traversal. + */ +class JSON_API ValueInternalLink { +public: + enum { + itemPerLink = 6 + }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. + enum InternalFlags { + flagAvailable = 0, + flagUsed = 1 + }; + + ValueInternalLink(); + + ~ValueInternalLink(); + + Value items_[itemPerLink]; + char* keys_[itemPerLink]; + ValueInternalLink* previous_; + ValueInternalLink* next_; +}; + +/** \brief A linked page based hash-table implementation used internally by + *Value. + * \internal ValueInternalMap is a tradional bucket based hash-table, with a + *linked + * list in each bucket to handle collision. There is an addional twist in that + * each node of the collision linked list is a page containing a fixed amount of + * value. This provides a better compromise between memory usage and speed. + * + * Each bucket is made up of a chained list of ValueInternalLink. The last + * link of a given bucket can be found in the 'previous_' field of the following + *bucket. + * The last link of the last bucket is stored in tailLink_ as it has no + *following bucket. + * Only the last link of a bucket may contains 'available' item. The last link + *always + * contains at least one element unless is it the bucket one very first link. + */ +class JSON_API ValueInternalMap { + friend class ValueIteratorBase; + friend class Value; + +public: + typedef unsigned int HashKey; + typedef unsigned int BucketIndex; + +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + struct IteratorState { + IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {} + ValueInternalMap* map_; + ValueInternalLink* link_; + BucketIndex itemIndex_; + BucketIndex bucketIndex_; + }; +#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + + ValueInternalMap(); + ValueInternalMap(const ValueInternalMap& other); + ValueInternalMap& operator=(ValueInternalMap other); + ~ValueInternalMap(); + + void swap(ValueInternalMap& other); + + BucketIndex size() const; + + void clear(); + + bool reserveDelta(BucketIndex growth); + + bool reserve(BucketIndex newItemCount); + + const Value* find(const char* key) const; + + Value* find(const char* key); + + Value& resolveReference(const char* key, bool isStatic); + + void remove(const char* key); + + void doActualRemove(ValueInternalLink* link, + BucketIndex index, + BucketIndex bucketIndex); + + ValueInternalLink*& getLastLinkInBucket(BucketIndex bucketIndex); + + Value& setNewItem(const char* key, + bool isStatic, + ValueInternalLink* link, + BucketIndex index); + + Value& unsafeAdd(const char* key, bool isStatic, HashKey hashedKey); + + HashKey hash(const char* key) const; + + int compare(const ValueInternalMap& other) const; + +private: + void makeBeginIterator(IteratorState& it) const; + void makeEndIterator(IteratorState& it) const; + static bool equals(const IteratorState& x, const IteratorState& other); + static void increment(IteratorState& iterator); + static void incrementBucket(IteratorState& iterator); + static void decrement(IteratorState& iterator); + static const char* key(const IteratorState& iterator); + static const char* key(const IteratorState& iterator, bool& isStatic); + static Value& value(const IteratorState& iterator); + static int distance(const IteratorState& x, const IteratorState& y); + +private: + ValueInternalLink* buckets_; + ValueInternalLink* tailLink_; + BucketIndex bucketsSize_; + BucketIndex itemCount_; +}; + +/** \brief A simplified deque implementation used internally by Value. +* \internal +* It is based on a list of fixed "page", each page contains a fixed number of +*items. +* Instead of using a linked-list, a array of pointer is used for fast item +*look-up. +* Look-up for an element is as follow: +* - compute page index: pageIndex = itemIndex / itemsPerPage +* - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] +* +* Insertion is amortized constant time (only the array containing the index of +*pointers +* need to be reallocated when items are appended). +*/ +class JSON_API ValueInternalArray { + friend class Value; + friend class ValueIteratorBase; + +public: + enum { + itemsPerPage = 8 + }; // should be a power of 2 for fast divide and modulo. + typedef Value::ArrayIndex ArrayIndex; + typedef unsigned int PageIndex; + +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + struct IteratorState // Must be a POD + { + IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {} + ValueInternalArray* array_; + Value** currentPageIndex_; + unsigned int currentItemIndex_; + }; +#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + + ValueInternalArray(); + ValueInternalArray(const ValueInternalArray& other); + ValueInternalArray& operator=(ValueInternalArray other); + ~ValueInternalArray(); + void swap(ValueInternalArray& other); + + void clear(); + void resize(ArrayIndex newSize); + + Value& resolveReference(ArrayIndex index); + + Value* find(ArrayIndex index) const; + + ArrayIndex size() const; + + int compare(const ValueInternalArray& other) const; + +private: + static bool equals(const IteratorState& x, const IteratorState& other); + static void increment(IteratorState& iterator); + static void decrement(IteratorState& iterator); + static Value& dereference(const IteratorState& iterator); + static Value& unsafeDereference(const IteratorState& iterator); + static int distance(const IteratorState& x, const IteratorState& y); + static ArrayIndex indexOf(const IteratorState& iterator); + void makeBeginIterator(IteratorState& it) const; + void makeEndIterator(IteratorState& it) const; + void makeIterator(IteratorState& it, ArrayIndex index) const; + + void makeIndexValid(ArrayIndex index); + + Value** pages_; + ArrayIndex size_; + PageIndex pageCount_; +}; + +/** \brief Experimental: do not use. Allocator to customize Value internal +array. + * Below is an example of a simple implementation (actual implementation use + * memory pool). + \code +class DefaultValueArrayAllocator : public ValueArrayAllocator +{ +public: // overridden from ValueArrayAllocator +virtual ~DefaultValueArrayAllocator() +{ +} + +virtual ValueInternalArray *newArray() +{ + return new ValueInternalArray(); +} + +virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) +{ + return new ValueInternalArray( other ); +} + +virtual void destruct( ValueInternalArray *array ) +{ + delete array; +} + +virtual void reallocateArrayPageIndex( Value **&indexes, + ValueInternalArray::PageIndex +&indexCount, + ValueInternalArray::PageIndex +minNewIndexCount ) +{ + ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; + if ( minNewIndexCount > newIndexCount ) + newIndexCount = minNewIndexCount; + void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); + if ( !newIndexes ) + throw std::bad_alloc(); + indexCount = newIndexCount; + indexes = static_cast( newIndexes ); +} +virtual void releaseArrayPageIndex( Value **indexes, + ValueInternalArray::PageIndex indexCount ) +{ + if ( indexes ) + free( indexes ); +} + +virtual Value *allocateArrayPage() +{ + return static_cast( malloc( sizeof(Value) * +ValueInternalArray::itemsPerPage ) ); +} + +virtual void releaseArrayPage( Value *value ) +{ + if ( value ) + free( value ); +} +}; + \endcode + */ +class JSON_API ValueArrayAllocator { +public: + virtual ~ValueArrayAllocator(); + virtual ValueInternalArray* newArray() = 0; + virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) = 0; + virtual void destructArray(ValueInternalArray* array) = 0; + /** \brief Reallocate array page index. + * Reallocates an array of pointer on each page. + * \param indexes [input] pointer on the current index. May be \c NULL. + * [output] pointer on the new index of at least + * \a minNewIndexCount pages. + * \param indexCount [input] current number of pages in the index. + * [output] number of page the reallocated index can handle. + * \b MUST be >= \a minNewIndexCount. + * \param minNewIndexCount Minimum number of page the new index must be able + * to + * handle. + */ + virtual void + reallocateArrayPageIndex(Value**& indexes, + ValueInternalArray::PageIndex& indexCount, + ValueInternalArray::PageIndex minNewIndexCount) = 0; + virtual void + releaseArrayPageIndex(Value** indexes, + ValueInternalArray::PageIndex indexCount) = 0; + virtual Value* allocateArrayPage() = 0; + virtual void releaseArrayPage(Value* value) = 0; +}; +#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP + +/** \brief base class for Value iterators. + * + */ +class JSON_API ValueIteratorBase { +public: + typedef std::bidirectional_iterator_tag iterator_category; + typedef unsigned int size_t; + typedef int difference_type; + typedef ValueIteratorBase SelfType; + + ValueIteratorBase(); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + explicit ValueIteratorBase(const Value::ObjectValues::iterator& current); +#else + ValueIteratorBase(const ValueInternalArray::IteratorState& state); + ValueIteratorBase(const ValueInternalMap::IteratorState& state); +#endif + + bool operator==(const SelfType& other) const { return isEqual(other); } + + bool operator!=(const SelfType& other) const { return !isEqual(other); } + + difference_type operator-(const SelfType& other) const { + return computeDistance(other); + } + + /// Return either the index or the member name of the referenced value as a + /// Value. + Value key() const; + + /// Return the index of the referenced Value. -1 if it is not an arrayValue. + UInt index() const; + + /// Return the member name of the referenced Value. "" if it is not an + /// objectValue. + const char* memberName() const; + +protected: + Value& deref() const; + + void increment(); + + void decrement(); + + difference_type computeDistance(const SelfType& other) const; + + bool isEqual(const SelfType& other) const; + + void copy(const SelfType& other); + +private: +#ifndef JSON_VALUE_USE_INTERNAL_MAP + Value::ObjectValues::iterator current_; + // Indicates that iterator is for a null value. + bool isNull_; +#else + union { + ValueInternalArray::IteratorState array_; + ValueInternalMap::IteratorState map_; + } iterator_; + bool isArray_; +#endif +}; + +/** \brief const iterator for object and array value. + * + */ +class JSON_API ValueConstIterator : public ValueIteratorBase { + friend class Value; + +public: + typedef const Value value_type; + typedef unsigned int size_t; + typedef int difference_type; + typedef const Value& reference; + typedef const Value* pointer; + typedef ValueConstIterator SelfType; + + ValueConstIterator(); + +private: +/*! \internal Use by Value to create an iterator. + */ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + explicit ValueConstIterator(const Value::ObjectValues::iterator& current); +#else + ValueConstIterator(const ValueInternalArray::IteratorState& state); + ValueConstIterator(const ValueInternalMap::IteratorState& state); +#endif +public: + SelfType& operator=(const ValueIteratorBase& other); + + SelfType operator++(int) { + SelfType temp(*this); + ++*this; + return temp; + } + + SelfType operator--(int) { + SelfType temp(*this); + --*this; + return temp; + } + + SelfType& operator--() { + decrement(); + return *this; + } + + SelfType& operator++() { + increment(); + return *this; + } + + reference operator*() const { return deref(); } + + pointer operator->() const { return &deref(); } +}; + +/** \brief Iterator for object and array value. + */ +class JSON_API ValueIterator : public ValueIteratorBase { + friend class Value; + +public: + typedef Value value_type; + typedef unsigned int size_t; + typedef int difference_type; + typedef Value& reference; + typedef Value* pointer; + typedef ValueIterator SelfType; + + ValueIterator(); + ValueIterator(const ValueConstIterator& other); + ValueIterator(const ValueIterator& other); + +private: +/*! \internal Use by Value to create an iterator. + */ +#ifndef JSON_VALUE_USE_INTERNAL_MAP + explicit ValueIterator(const Value::ObjectValues::iterator& current); +#else + ValueIterator(const ValueInternalArray::IteratorState& state); + ValueIterator(const ValueInternalMap::IteratorState& state); +#endif +public: + SelfType& operator=(const SelfType& other); + + SelfType operator++(int) { + SelfType temp(*this); + ++*this; + return temp; + } + + SelfType operator--(int) { + SelfType temp(*this); + --*this; + return temp; + } + + SelfType& operator--() { + decrement(); + return *this; + } + + SelfType& operator++() { + increment(); + return *this; + } + + reference operator*() const { return deref(); } + + pointer operator->() const { return &deref(); } +}; + +} // namespace Json + +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(pop) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +#endif // CPPTL_JSON_H_INCLUDED diff --git a/include/json/version.h b/include/json/version.h new file mode 100644 index 0000000..6fe0682 --- /dev/null +++ b/include/json/version.h @@ -0,0 +1,14 @@ +// DO NOT EDIT. This file is generated by CMake from "version" +// and "version.h.in" files. +// Run CMake configure step to update it. +#ifndef JSON_VERSION_H_INCLUDED +# define JSON_VERSION_H_INCLUDED + +# define JSONCPP_VERSION_STRING "1.0.0" +# define JSONCPP_VERSION_MAJOR 1 +# define JSONCPP_VERSION_MINOR 0 +# define JSONCPP_VERSION_PATCH 0 +# define JSONCPP_VERSION_QUALIFIER +# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8)) + +#endif // JSON_VERSION_H_INCLUDED diff --git a/include/json/writer.h b/include/json/writer.h new file mode 100644 index 0000000..dc9e46f --- /dev/null +++ b/include/json/writer.h @@ -0,0 +1,213 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSON_WRITER_H_INCLUDED +#define JSON_WRITER_H_INCLUDED + +#if !defined(JSON_IS_AMALGAMATION) +#include "value.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include + +// Disable warning C4251: : needs to have dll-interface to +// be used by... +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(push) +#pragma warning(disable : 4251) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +namespace Json { + +class Value; + +/** \brief Abstract class for writers. + */ +class JSON_API Writer { +public: + virtual ~Writer(); + + virtual std::string write(const Value& root) = 0; +}; + +/** \brief Outputs a Value in JSON format + *without formatting (not human friendly). + * + * The JSON document is written in a single line. It is not intended for 'human' + *consumption, + * but may be usefull to support feature such as RPC where bandwith is limited. + * \sa Reader, Value + */ +class JSON_API FastWriter : public Writer { +public: + FastWriter(); + virtual ~FastWriter() {} + + void enableYAMLCompatibility(); + + /** \brief Drop the "null" string from the writer's output for nullValues. + * Strictly speaking, this is not valid JSON. But when the output is being + * fed to a browser's Javascript, it makes for smaller output and the + * browser can handle the output just fine. + */ + void dropNullPlaceholders(); + + void omitEndingLineFeed(); + +public: // overridden from Writer + virtual std::string write(const Value& root); + +private: + void writeValue(const Value& value); + + std::string document_; + bool yamlCompatiblityEnabled_; + bool dropNullPlaceholders_; + bool omitEndingLineFeed_; +}; + +/** \brief Writes a Value in JSON format in a + *human friendly way. + * + * The rules for line break and indent are as follow: + * - Object value: + * - if empty then print {} without indent and line break + * - if not empty the print '{', line break & indent, print one value per + *line + * and then unindent and line break and print '}'. + * - Array value: + * - if empty then print [] without indent and line break + * - if the array contains no object value, empty array or some other value + *types, + * and all the values fit on one lines, then print the array on a single + *line. + * - otherwise, it the values do not fit on one line, or the array contains + * object or non empty array, then print one value per line. + * + * If the Value have comments then they are outputed according to their + *#CommentPlacement. + * + * \sa Reader, Value, Value::setComment() + */ +class JSON_API StyledWriter : public Writer { +public: + StyledWriter(); + virtual ~StyledWriter() {} + +public: // overridden from Writer + /** \brief Serialize a Value in JSON format. + * \param root Value to serialize. + * \return String containing the JSON document that represents the root value. + */ + virtual std::string write(const Value& root); + +private: + void writeValue(const Value& value); + void writeArrayValue(const Value& value); + bool isMultineArray(const Value& value); + void pushValue(const std::string& value); + void writeIndent(); + void writeWithIndent(const std::string& value); + void indent(); + void unindent(); + void writeCommentBeforeValue(const Value& root); + void writeCommentAfterValueOnSameLine(const Value& root); + bool hasCommentForValue(const Value& value); + static std::string normalizeEOL(const std::string& text); + + typedef std::vector ChildValues; + + ChildValues childValues_; + std::string document_; + std::string indentString_; + int rightMargin_; + int indentSize_; + bool addChildValues_; +}; + +/** \brief Writes a Value in JSON format in a + human friendly way, + to a stream rather than to a string. + * + * The rules for line break and indent are as follow: + * - Object value: + * - if empty then print {} without indent and line break + * - if not empty the print '{', line break & indent, print one value per + line + * and then unindent and line break and print '}'. + * - Array value: + * - if empty then print [] without indent and line break + * - if the array contains no object value, empty array or some other value + types, + * and all the values fit on one lines, then print the array on a single + line. + * - otherwise, it the values do not fit on one line, or the array contains + * object or non empty array, then print one value per line. + * + * 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 { +public: + StyledStreamWriter(std::string indentation = "\t"); + ~StyledStreamWriter() {} + +public: + /** \brief Serialize a Value in JSON format. + * \param out Stream to write to. (Can be ostringstream, e.g.) + * \param root Value to serialize. + * \note There is no point in deriving from Writer, since write() should not + * return a value. + */ + void write(std::ostream& out, const Value& root); + +private: + void writeValue(const Value& value); + void writeArrayValue(const Value& value); + bool isMultineArray(const Value& value); + void pushValue(const std::string& value); + void writeIndent(); + void writeWithIndent(const std::string& value); + void indent(); + void unindent(); + void writeCommentBeforeValue(const Value& root); + void writeCommentAfterValueOnSameLine(const Value& root); + bool hasCommentForValue(const Value& value); + static std::string normalizeEOL(const std::string& text); + + typedef std::vector ChildValues; + + ChildValues childValues_; + std::ostream* document_; + std::string indentString_; + int rightMargin_; + std::string indentation_; + bool addChildValues_; +}; + +#if defined(JSON_HAS_INT64) +std::string JSON_API valueToString(Int value); +std::string JSON_API valueToString(UInt value); +#endif // if defined(JSON_HAS_INT64) +std::string JSON_API valueToString(LargestInt value); +std::string JSON_API valueToString(LargestUInt value); +std::string JSON_API valueToString(double value); +std::string JSON_API valueToString(bool value); +std::string JSON_API valueToQuotedString(const char* value); + +/// \brief Output using the StyledStreamWriter. +/// \see Json::operator>>() +JSON_API std::ostream& operator<<(std::ostream&, const Value& root); + +} // namespace Json + +#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) +#pragma warning(pop) +#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) + +#endif // JSON_WRITER_H_INCLUDED diff --git a/src/lib_json/json_batchallocator.h b/src/lib_json/json_batchallocator.h new file mode 100644 index 0000000..2fbef7a --- /dev/null +++ b/src/lib_json/json_batchallocator.h @@ -0,0 +1,121 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED +#define JSONCPP_BATCHALLOCATOR_H_INCLUDED + +#include +#include + +#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION + +namespace Json { + +/* Fast memory allocator. + * + * This memory allocator allocates memory for a batch of object (specified by + * the page size, the number of object in each page). + * + * It does not allow the destruction of a single object. All the allocated + * objects can be destroyed at once. The memory can be either released or reused + * for future allocation. + * + * The in-place new operator must be used to construct the object using the + * pointer returned by allocate. + */ +template +class BatchAllocator { +public: + BatchAllocator(unsigned int objectsPerPage = 255) + : freeHead_(0), objectsPerPage_(objectsPerPage) { + // printf( "Size: %d => %s\n", sizeof(AllocatedType), + // typeid(AllocatedType).name() ); + assert(sizeof(AllocatedType) * objectPerAllocation >= + sizeof(AllocatedType*)); // We must be able to store a slist in the + // object free space. + assert(objectsPerPage >= 16); + batches_ = allocateBatch(0); // allocated a dummy page + currentBatch_ = batches_; + } + + ~BatchAllocator() { + for (BatchInfo* batch = batches_; batch;) { + BatchInfo* nextBatch = batch->next_; + free(batch); + batch = nextBatch; + } + } + + /// allocate space for an array of objectPerAllocation object. + /// @warning it is the responsability of the caller to call objects + /// constructors. + AllocatedType* allocate() { + if (freeHead_) // returns node from free list. + { + AllocatedType* object = freeHead_; + freeHead_ = *(AllocatedType**)object; + return object; + } + if (currentBatch_->used_ == currentBatch_->end_) { + currentBatch_ = currentBatch_->next_; + while (currentBatch_ && currentBatch_->used_ == currentBatch_->end_) + currentBatch_ = currentBatch_->next_; + + if (!currentBatch_) // no free batch found, allocate a new one + { + currentBatch_ = allocateBatch(objectsPerPage_); + currentBatch_->next_ = batches_; // insert at the head of the list + batches_ = currentBatch_; + } + } + AllocatedType* allocated = currentBatch_->used_; + currentBatch_->used_ += objectPerAllocation; + return allocated; + } + + /// Release the object. + /// @warning it is the responsability of the caller to actually destruct the + /// object. + void release(AllocatedType* object) { + assert(object != 0); + *(AllocatedType**)object = freeHead_; + freeHead_ = object; + } + +private: + struct BatchInfo { + BatchInfo* next_; + AllocatedType* used_; + AllocatedType* end_; + AllocatedType buffer_[objectPerAllocation]; + }; + + // disabled copy constructor and assignement operator. + BatchAllocator(const BatchAllocator&); + void operator=(const BatchAllocator&); + + static BatchInfo* allocateBatch(unsigned int objectsPerPage) { + const unsigned int mallocSize = + sizeof(BatchInfo) - sizeof(AllocatedType) * objectPerAllocation + + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage; + BatchInfo* batch = static_cast(malloc(mallocSize)); + batch->next_ = 0; + batch->used_ = batch->buffer_; + batch->end_ = batch->buffer_ + objectsPerPage; + return batch; + } + + BatchInfo* batches_; + BatchInfo* currentBatch_; + /// Head of a single linked list within the allocated space of freeed object + AllocatedType* freeHead_; + unsigned int objectsPerPage_; +}; + +} // namespace Json + +#endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION + +#endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED diff --git a/src/lib_json/json_internalarray.inl b/src/lib_json/json_internalarray.inl new file mode 100644 index 0000000..9ee15e9 --- /dev/null +++ b/src/lib_json/json_internalarray.inl @@ -0,0 +1,360 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +// included by json_value.cpp + +namespace Json { + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueInternalArray +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueArrayAllocator::~ValueArrayAllocator() {} + +// ////////////////////////////////////////////////////////////////// +// class DefaultValueArrayAllocator +// ////////////////////////////////////////////////////////////////// +#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +class DefaultValueArrayAllocator : public ValueArrayAllocator { +public: // overridden from ValueArrayAllocator + virtual ~DefaultValueArrayAllocator() {} + + virtual ValueInternalArray* newArray() { return new ValueInternalArray(); } + + virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) { + return new ValueInternalArray(other); + } + + virtual void destructArray(ValueInternalArray* array) { delete array; } + + virtual void + reallocateArrayPageIndex(Value**& indexes, + ValueInternalArray::PageIndex& indexCount, + ValueInternalArray::PageIndex minNewIndexCount) { + ValueInternalArray::PageIndex newIndexCount = (indexCount * 3) / 2 + 1; + if (minNewIndexCount > newIndexCount) + newIndexCount = minNewIndexCount; + void* newIndexes = realloc(indexes, sizeof(Value*) * newIndexCount); + JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); + indexCount = newIndexCount; + indexes = static_cast(newIndexes); + } + virtual void releaseArrayPageIndex(Value** indexes, + ValueInternalArray::PageIndex indexCount) { + if (indexes) + free(indexes); + } + + virtual Value* allocateArrayPage() { + return static_cast( + malloc(sizeof(Value) * ValueInternalArray::itemsPerPage)); + } + + virtual void releaseArrayPage(Value* value) { + if (value) + free(value); + } +}; + +#else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +/// @todo make this thread-safe (lock when accessign batch allocator) +class DefaultValueArrayAllocator : public ValueArrayAllocator { +public: // overridden from ValueArrayAllocator + virtual ~DefaultValueArrayAllocator() {} + + virtual ValueInternalArray* newArray() { + ValueInternalArray* array = arraysAllocator_.allocate(); + new (array) ValueInternalArray(); // placement new + return array; + } + + virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) { + ValueInternalArray* array = arraysAllocator_.allocate(); + new (array) ValueInternalArray(other); // placement new + return array; + } + + virtual void destructArray(ValueInternalArray* array) { + if (array) { + array->~ValueInternalArray(); + arraysAllocator_.release(array); + } + } + + virtual void + reallocateArrayPageIndex(Value**& indexes, + ValueInternalArray::PageIndex& indexCount, + ValueInternalArray::PageIndex minNewIndexCount) { + ValueInternalArray::PageIndex newIndexCount = (indexCount * 3) / 2 + 1; + if (minNewIndexCount > newIndexCount) + newIndexCount = minNewIndexCount; + void* newIndexes = realloc(indexes, sizeof(Value*) * newIndexCount); + JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); + indexCount = newIndexCount; + indexes = static_cast(newIndexes); + } + virtual void releaseArrayPageIndex(Value** indexes, + ValueInternalArray::PageIndex indexCount) { + if (indexes) + free(indexes); + } + + virtual Value* allocateArrayPage() { + return static_cast(pagesAllocator_.allocate()); + } + + virtual void releaseArrayPage(Value* value) { + if (value) + pagesAllocator_.release(value); + } + +private: + BatchAllocator arraysAllocator_; + BatchAllocator pagesAllocator_; +}; +#endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR + +static ValueArrayAllocator*& arrayAllocator() { + static DefaultValueArrayAllocator defaultAllocator; + static ValueArrayAllocator* arrayAllocator = &defaultAllocator; + return arrayAllocator; +} + +static struct DummyArrayAllocatorInitializer { + DummyArrayAllocatorInitializer() { + arrayAllocator(); // ensure arrayAllocator() statics are initialized before + // main(). + } +} dummyArrayAllocatorInitializer; + +// ////////////////////////////////////////////////////////////////// +// class ValueInternalArray +// ////////////////////////////////////////////////////////////////// +bool ValueInternalArray::equals(const IteratorState& x, + const IteratorState& other) { + return x.array_ == other.array_ && + x.currentItemIndex_ == other.currentItemIndex_ && + x.currentPageIndex_ == other.currentPageIndex_; +} + +void ValueInternalArray::increment(IteratorState& it) { + JSON_ASSERT_MESSAGE( + it.array_ && (it.currentPageIndex_ - it.array_->pages_) * itemsPerPage + + it.currentItemIndex_ != + it.array_->size_, + "ValueInternalArray::increment(): moving iterator beyond end"); + ++(it.currentItemIndex_); + if (it.currentItemIndex_ == itemsPerPage) { + it.currentItemIndex_ = 0; + ++(it.currentPageIndex_); + } +} + +void ValueInternalArray::decrement(IteratorState& it) { + JSON_ASSERT_MESSAGE( + it.array_ && it.currentPageIndex_ == it.array_->pages_ && + it.currentItemIndex_ == 0, + "ValueInternalArray::decrement(): moving iterator beyond end"); + if (it.currentItemIndex_ == 0) { + it.currentItemIndex_ = itemsPerPage - 1; + --(it.currentPageIndex_); + } else { + --(it.currentItemIndex_); + } +} + +Value& ValueInternalArray::unsafeDereference(const IteratorState& it) { + return (*(it.currentPageIndex_))[it.currentItemIndex_]; +} + +Value& ValueInternalArray::dereference(const IteratorState& it) { + JSON_ASSERT_MESSAGE( + it.array_ && (it.currentPageIndex_ - it.array_->pages_) * itemsPerPage + + it.currentItemIndex_ < + it.array_->size_, + "ValueInternalArray::dereference(): dereferencing invalid iterator"); + return unsafeDereference(it); +} + +void ValueInternalArray::makeBeginIterator(IteratorState& it) const { + it.array_ = const_cast(this); + it.currentItemIndex_ = 0; + it.currentPageIndex_ = pages_; +} + +void ValueInternalArray::makeIterator(IteratorState& it, + ArrayIndex index) const { + it.array_ = const_cast(this); + it.currentItemIndex_ = index % itemsPerPage; + it.currentPageIndex_ = pages_ + index / itemsPerPage; +} + +void ValueInternalArray::makeEndIterator(IteratorState& it) const { + makeIterator(it, size_); +} + +ValueInternalArray::ValueInternalArray() : pages_(0), size_(0), pageCount_(0) {} + +ValueInternalArray::ValueInternalArray(const ValueInternalArray& other) + : pages_(0), size_(other.size_), pageCount_(0) { + PageIndex minNewPages = other.size_ / itemsPerPage; + arrayAllocator()->reallocateArrayPageIndex(pages_, pageCount_, minNewPages); + JSON_ASSERT_MESSAGE(pageCount_ >= minNewPages, + "ValueInternalArray::reserve(): bad reallocation"); + IteratorState itOther; + other.makeBeginIterator(itOther); + Value* value; + for (ArrayIndex index = 0; index < size_; ++index, increment(itOther)) { + if (index % itemsPerPage == 0) { + PageIndex pageIndex = index / itemsPerPage; + value = arrayAllocator()->allocateArrayPage(); + pages_[pageIndex] = value; + } + new (value) Value(dereference(itOther)); + } +} + +ValueInternalArray& ValueInternalArray::operator=(ValueInternalArray other) { + swap(other); + return *this; +} + +ValueInternalArray::~ValueInternalArray() { + // destroy all constructed items + IteratorState it; + IteratorState itEnd; + makeBeginIterator(it); + makeEndIterator(itEnd); + for (; !equals(it, itEnd); increment(it)) { + Value* value = &dereference(it); + value->~Value(); + } + // release all pages + PageIndex lastPageIndex = size_ / itemsPerPage; + for (PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex) + arrayAllocator()->releaseArrayPage(pages_[pageIndex]); + // release pages index + arrayAllocator()->releaseArrayPageIndex(pages_, pageCount_); +} + +void ValueInternalArray::swap(ValueInternalArray& other) { + Value** tempPages = pages_; + pages_ = other.pages_; + other.pages_ = tempPages; + ArrayIndex tempSize = size_; + size_ = other.size_; + other.size_ = tempSize; + PageIndex tempPageCount = pageCount_; + pageCount_ = other.pageCount_; + other.pageCount_ = tempPageCount; +} + +void ValueInternalArray::clear() { + ValueInternalArray dummy; + swap(dummy); +} + +void ValueInternalArray::resize(ArrayIndex newSize) { + if (newSize == 0) + clear(); + else if (newSize < size_) { + IteratorState it; + IteratorState itEnd; + makeIterator(it, newSize); + makeIterator(itEnd, size_); + for (; !equals(it, itEnd); increment(it)) { + Value* value = &dereference(it); + value->~Value(); + } + PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage; + PageIndex lastPageIndex = size_ / itemsPerPage; + for (; pageIndex < lastPageIndex; ++pageIndex) + arrayAllocator()->releaseArrayPage(pages_[pageIndex]); + size_ = newSize; + } else if (newSize > size_) + resolveReference(newSize); +} + +void ValueInternalArray::makeIndexValid(ArrayIndex index) { + // Need to enlarge page index ? + if (index >= pageCount_ * itemsPerPage) { + PageIndex minNewPages = (index + 1) / itemsPerPage; + arrayAllocator()->reallocateArrayPageIndex(pages_, pageCount_, minNewPages); + JSON_ASSERT_MESSAGE(pageCount_ >= minNewPages, + "ValueInternalArray::reserve(): bad reallocation"); + } + + // Need to allocate new pages ? + ArrayIndex nextPageIndex = (size_ % itemsPerPage) != 0 + ? size_ - (size_ % itemsPerPage) + itemsPerPage + : size_; + if (nextPageIndex <= index) { + PageIndex pageIndex = nextPageIndex / itemsPerPage; + PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1; + for (; pageToAllocate-- > 0; ++pageIndex) + pages_[pageIndex] = arrayAllocator()->allocateArrayPage(); + } + + // Initialize all new entries + IteratorState it; + IteratorState itEnd; + makeIterator(it, size_); + size_ = index + 1; + makeIterator(itEnd, size_); + for (; !equals(it, itEnd); increment(it)) { + Value* value = &dereference(it); + new (value) Value(); // Construct a default value using placement new + } +} + +Value& ValueInternalArray::resolveReference(ArrayIndex index) { + if (index >= size_) + makeIndexValid(index); + return pages_[index / itemsPerPage][index % itemsPerPage]; +} + +Value* ValueInternalArray::find(ArrayIndex index) const { + if (index >= size_) + return 0; + return &(pages_[index / itemsPerPage][index % itemsPerPage]); +} + +ValueInternalArray::ArrayIndex ValueInternalArray::size() const { + return size_; +} + +int ValueInternalArray::distance(const IteratorState& x, + const IteratorState& y) { + return indexOf(y) - indexOf(x); +} + +ValueInternalArray::ArrayIndex +ValueInternalArray::indexOf(const IteratorState& iterator) { + if (!iterator.array_) + return ArrayIndex(-1); + return ArrayIndex((iterator.currentPageIndex_ - iterator.array_->pages_) * + itemsPerPage + + iterator.currentItemIndex_); +} + +int ValueInternalArray::compare(const ValueInternalArray& other) const { + int sizeDiff(size_ - other.size_); + if (sizeDiff != 0) + return sizeDiff; + + for (ArrayIndex index = 0; index < size_; ++index) { + int diff = pages_[index / itemsPerPage][index % itemsPerPage].compare( + other.pages_[index / itemsPerPage][index % itemsPerPage]); + if (diff != 0) + return diff; + } + return 0; +} + +} // namespace Json diff --git a/src/lib_json/json_internalmap.inl b/src/lib_json/json_internalmap.inl new file mode 100644 index 0000000..ef3f330 --- /dev/null +++ b/src/lib_json/json_internalmap.inl @@ -0,0 +1,473 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +// included by json_value.cpp + +namespace Json { + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueInternalMap +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +/** \internal MUST be safely initialized using memset( this, 0, + * sizeof(ValueInternalLink) ); + * This optimization is used by the fast allocator. + */ +ValueInternalLink::ValueInternalLink() : previous_(0), next_(0) {} + +ValueInternalLink::~ValueInternalLink() { + for (int index = 0; index < itemPerLink; ++index) { + if (!items_[index].isItemAvailable()) { + if (!items_[index].isMemberNameStatic()) + free(keys_[index]); + } else + break; + } +} + +ValueMapAllocator::~ValueMapAllocator() {} + +#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +class DefaultValueMapAllocator : public ValueMapAllocator { +public: // overridden from ValueMapAllocator + virtual ValueInternalMap* newMap() { return new ValueInternalMap(); } + + virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) { + return new ValueInternalMap(other); + } + + virtual void destructMap(ValueInternalMap* map) { delete map; } + + virtual ValueInternalLink* allocateMapBuckets(unsigned int size) { + return new ValueInternalLink[size]; + } + + virtual void releaseMapBuckets(ValueInternalLink* links) { delete[] links; } + + virtual ValueInternalLink* allocateMapLink() { + return new ValueInternalLink(); + } + + virtual void releaseMapLink(ValueInternalLink* link) { delete link; } +}; +#else +/// @todo make this thread-safe (lock when accessign batch allocator) +class DefaultValueMapAllocator : public ValueMapAllocator { +public: // overridden from ValueMapAllocator + virtual ValueInternalMap* newMap() { + ValueInternalMap* map = mapsAllocator_.allocate(); + new (map) ValueInternalMap(); // placement new + return map; + } + + virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) { + ValueInternalMap* map = mapsAllocator_.allocate(); + new (map) ValueInternalMap(other); // placement new + return map; + } + + virtual void destructMap(ValueInternalMap* map) { + if (map) { + map->~ValueInternalMap(); + mapsAllocator_.release(map); + } + } + + virtual ValueInternalLink* allocateMapBuckets(unsigned int size) { + return new ValueInternalLink[size]; + } + + virtual void releaseMapBuckets(ValueInternalLink* links) { delete[] links; } + + virtual ValueInternalLink* allocateMapLink() { + ValueInternalLink* link = linksAllocator_.allocate(); + memset(link, 0, sizeof(ValueInternalLink)); + return link; + } + + virtual void releaseMapLink(ValueInternalLink* link) { + link->~ValueInternalLink(); + linksAllocator_.release(link); + } + +private: + BatchAllocator mapsAllocator_; + BatchAllocator linksAllocator_; +}; +#endif + +static ValueMapAllocator*& mapAllocator() { + static DefaultValueMapAllocator defaultAllocator; + static ValueMapAllocator* mapAllocator = &defaultAllocator; + return mapAllocator; +} + +static struct DummyMapAllocatorInitializer { + DummyMapAllocatorInitializer() { + mapAllocator(); // ensure mapAllocator() statics are initialized before + // main(). + } +} dummyMapAllocatorInitializer; + +// h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32. + +/* +use linked list hash map. +buckets array is a container. +linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124) +value have extra state: valid, available, deleted +*/ + +ValueInternalMap::ValueInternalMap() + : buckets_(0), tailLink_(0), bucketsSize_(0), itemCount_(0) {} + +ValueInternalMap::ValueInternalMap(const ValueInternalMap& other) + : buckets_(0), tailLink_(0), bucketsSize_(0), itemCount_(0) { + reserve(other.itemCount_); + IteratorState it; + IteratorState itEnd; + other.makeBeginIterator(it); + other.makeEndIterator(itEnd); + for (; !equals(it, itEnd); increment(it)) { + bool isStatic; + const char* memberName = key(it, isStatic); + const Value& aValue = value(it); + resolveReference(memberName, isStatic) = aValue; + } +} + +ValueInternalMap& ValueInternalMap::operator=(ValueInternalMap other) { + swap(other); + return *this; +} + +ValueInternalMap::~ValueInternalMap() { + if (buckets_) { + for (BucketIndex bucketIndex = 0; bucketIndex < bucketsSize_; + ++bucketIndex) { + ValueInternalLink* link = buckets_[bucketIndex].next_; + while (link) { + ValueInternalLink* linkToRelease = link; + link = link->next_; + mapAllocator()->releaseMapLink(linkToRelease); + } + } + mapAllocator()->releaseMapBuckets(buckets_); + } +} + +void ValueInternalMap::swap(ValueInternalMap& other) { + ValueInternalLink* tempBuckets = buckets_; + buckets_ = other.buckets_; + other.buckets_ = tempBuckets; + ValueInternalLink* tempTailLink = tailLink_; + tailLink_ = other.tailLink_; + other.tailLink_ = tempTailLink; + BucketIndex tempBucketsSize = bucketsSize_; + bucketsSize_ = other.bucketsSize_; + other.bucketsSize_ = tempBucketsSize; + BucketIndex tempItemCount = itemCount_; + itemCount_ = other.itemCount_; + other.itemCount_ = tempItemCount; +} + +void ValueInternalMap::clear() { + ValueInternalMap dummy; + swap(dummy); +} + +ValueInternalMap::BucketIndex ValueInternalMap::size() const { + return itemCount_; +} + +bool ValueInternalMap::reserveDelta(BucketIndex growth) { + return reserve(itemCount_ + growth); +} + +bool ValueInternalMap::reserve(BucketIndex newItemCount) { + if (!buckets_ && newItemCount > 0) { + buckets_ = mapAllocator()->allocateMapBuckets(1); + bucketsSize_ = 1; + tailLink_ = &buckets_[0]; + } + // BucketIndex idealBucketCount = (newItemCount + + // ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink; + return true; +} + +const Value* ValueInternalMap::find(const char* key) const { + if (!bucketsSize_) + return 0; + HashKey hashedKey = hash(key); + BucketIndex bucketIndex = hashedKey % bucketsSize_; + for (const ValueInternalLink* current = &buckets_[bucketIndex]; current != 0; + current = current->next_) { + for (BucketIndex index = 0; index < ValueInternalLink::itemPerLink; + ++index) { + if (current->items_[index].isItemAvailable()) + return 0; + if (strcmp(key, current->keys_[index]) == 0) + return ¤t->items_[index]; + } + } + return 0; +} + +Value* ValueInternalMap::find(const char* key) { + const ValueInternalMap* constThis = this; + return const_cast(constThis->find(key)); +} + +Value& ValueInternalMap::resolveReference(const char* key, bool isStatic) { + HashKey hashedKey = hash(key); + if (bucketsSize_) { + BucketIndex bucketIndex = hashedKey % bucketsSize_; + ValueInternalLink** previous = 0; + BucketIndex index; + for (ValueInternalLink* current = &buckets_[bucketIndex]; current != 0; + previous = ¤t->next_, current = current->next_) { + for (index = 0; index < ValueInternalLink::itemPerLink; ++index) { + if (current->items_[index].isItemAvailable()) + return setNewItem(key, isStatic, current, index); + if (strcmp(key, current->keys_[index]) == 0) + return current->items_[index]; + } + } + } + + reserveDelta(1); + return unsafeAdd(key, isStatic, hashedKey); +} + +void ValueInternalMap::remove(const char* key) { + HashKey hashedKey = hash(key); + if (!bucketsSize_) + return; + BucketIndex bucketIndex = hashedKey % bucketsSize_; + for (ValueInternalLink* link = &buckets_[bucketIndex]; link != 0; + link = link->next_) { + BucketIndex index; + for (index = 0; index < ValueInternalLink::itemPerLink; ++index) { + if (link->items_[index].isItemAvailable()) + return; + if (strcmp(key, link->keys_[index]) == 0) { + doActualRemove(link, index, bucketIndex); + return; + } + } + } +} + +void ValueInternalMap::doActualRemove(ValueInternalLink* link, + BucketIndex index, + BucketIndex bucketIndex) { + // find last item of the bucket and swap it with the 'removed' one. + // set removed items flags to 'available'. + // if last page only contains 'available' items, then desallocate it (it's + // empty) + ValueInternalLink*& lastLink = getLastLinkInBucket(index); + BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1 + for (; lastItemIndex < ValueInternalLink::itemPerLink; + ++lastItemIndex) // may be optimized with dicotomic search + { + if (lastLink->items_[lastItemIndex].isItemAvailable()) + break; + } + + BucketIndex lastUsedIndex = lastItemIndex - 1; + Value* valueToDelete = &link->items_[index]; + Value* valueToPreserve = &lastLink->items_[lastUsedIndex]; + if (valueToDelete != valueToPreserve) + valueToDelete->swap(*valueToPreserve); + if (lastUsedIndex == 0) // page is now empty + { // remove it from bucket linked list and delete it. + ValueInternalLink* linkPreviousToLast = lastLink->previous_; + if (linkPreviousToLast != 0) // can not deleted bucket link. + { + mapAllocator()->releaseMapLink(lastLink); + linkPreviousToLast->next_ = 0; + lastLink = linkPreviousToLast; + } + } else { + Value dummy; + valueToPreserve->swap(dummy); // restore deleted to default Value. + valueToPreserve->setItemUsed(false); + } + --itemCount_; +} + +ValueInternalLink*& +ValueInternalMap::getLastLinkInBucket(BucketIndex bucketIndex) { + if (bucketIndex == bucketsSize_ - 1) + return tailLink_; + ValueInternalLink*& previous = buckets_[bucketIndex + 1].previous_; + if (!previous) + previous = &buckets_[bucketIndex]; + return previous; +} + +Value& ValueInternalMap::setNewItem(const char* key, + bool isStatic, + ValueInternalLink* link, + BucketIndex index) { + char* duplicatedKey = makeMemberName(key); + ++itemCount_; + link->keys_[index] = duplicatedKey; + link->items_[index].setItemUsed(); + link->items_[index].setMemberNameIsStatic(isStatic); + return link->items_[index]; // items already default constructed. +} + +Value& +ValueInternalMap::unsafeAdd(const char* key, bool isStatic, HashKey hashedKey) { + JSON_ASSERT_MESSAGE(bucketsSize_ > 0, + "ValueInternalMap::unsafeAdd(): internal logic error."); + BucketIndex bucketIndex = hashedKey % bucketsSize_; + ValueInternalLink*& previousLink = getLastLinkInBucket(bucketIndex); + ValueInternalLink* link = previousLink; + BucketIndex index; + for (index = 0; index < ValueInternalLink::itemPerLink; ++index) { + if (link->items_[index].isItemAvailable()) + break; + } + if (index == ValueInternalLink::itemPerLink) // need to add a new page + { + ValueInternalLink* newLink = mapAllocator()->allocateMapLink(); + index = 0; + link->next_ = newLink; + previousLink = newLink; + link = newLink; + } + return setNewItem(key, isStatic, link, index); +} + +ValueInternalMap::HashKey ValueInternalMap::hash(const char* key) const { + HashKey hash = 0; + while (*key) + hash += *key++ * 37; + return hash; +} + +int ValueInternalMap::compare(const ValueInternalMap& other) const { + int sizeDiff(itemCount_ - other.itemCount_); + if (sizeDiff != 0) + return sizeDiff; + // Strict order guaranty is required. Compare all keys FIRST, then compare + // values. + IteratorState it; + IteratorState itEnd; + makeBeginIterator(it); + makeEndIterator(itEnd); + for (; !equals(it, itEnd); increment(it)) { + if (!other.find(key(it))) + return 1; + } + + // All keys are equals, let's compare values + makeBeginIterator(it); + for (; !equals(it, itEnd); increment(it)) { + const Value* otherValue = other.find(key(it)); + int valueDiff = value(it).compare(*otherValue); + if (valueDiff != 0) + return valueDiff; + } + return 0; +} + +void ValueInternalMap::makeBeginIterator(IteratorState& it) const { + it.map_ = const_cast(this); + it.bucketIndex_ = 0; + it.itemIndex_ = 0; + it.link_ = buckets_; +} + +void ValueInternalMap::makeEndIterator(IteratorState& it) const { + it.map_ = const_cast(this); + it.bucketIndex_ = bucketsSize_; + it.itemIndex_ = 0; + it.link_ = 0; +} + +bool ValueInternalMap::equals(const IteratorState& x, + const IteratorState& other) { + return x.map_ == other.map_ && x.bucketIndex_ == other.bucketIndex_ && + x.link_ == other.link_ && x.itemIndex_ == other.itemIndex_; +} + +void ValueInternalMap::incrementBucket(IteratorState& iterator) { + ++iterator.bucketIndex_; + JSON_ASSERT_MESSAGE( + iterator.bucketIndex_ <= iterator.map_->bucketsSize_, + "ValueInternalMap::increment(): attempting to iterate beyond end."); + if (iterator.bucketIndex_ == iterator.map_->bucketsSize_) + iterator.link_ = 0; + else + iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]); + iterator.itemIndex_ = 0; +} + +void ValueInternalMap::increment(IteratorState& iterator) { + JSON_ASSERT_MESSAGE(iterator.map_, + "Attempting to iterator using invalid iterator."); + ++iterator.itemIndex_; + if (iterator.itemIndex_ == ValueInternalLink::itemPerLink) { + JSON_ASSERT_MESSAGE( + iterator.link_ != 0, + "ValueInternalMap::increment(): attempting to iterate beyond end."); + iterator.link_ = iterator.link_->next_; + if (iterator.link_ == 0) + incrementBucket(iterator); + } else if (iterator.link_->items_[iterator.itemIndex_].isItemAvailable()) { + incrementBucket(iterator); + } +} + +void ValueInternalMap::decrement(IteratorState& iterator) { + if (iterator.itemIndex_ == 0) { + JSON_ASSERT_MESSAGE(iterator.map_, + "Attempting to iterate using invalid iterator."); + if (iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_]) { + JSON_ASSERT_MESSAGE(iterator.bucketIndex_ > 0, + "Attempting to iterate beyond beginning."); + --(iterator.bucketIndex_); + } + iterator.link_ = iterator.link_->previous_; + iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1; + } +} + +const char* ValueInternalMap::key(const IteratorState& iterator) { + JSON_ASSERT_MESSAGE(iterator.link_, + "Attempting to iterate using invalid iterator."); + return iterator.link_->keys_[iterator.itemIndex_]; +} + +const char* ValueInternalMap::key(const IteratorState& iterator, + bool& isStatic) { + JSON_ASSERT_MESSAGE(iterator.link_, + "Attempting to iterate using invalid iterator."); + isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic(); + return iterator.link_->keys_[iterator.itemIndex_]; +} + +Value& ValueInternalMap::value(const IteratorState& iterator) { + JSON_ASSERT_MESSAGE(iterator.link_, + "Attempting to iterate using invalid iterator."); + return iterator.link_->items_[iterator.itemIndex_]; +} + +int ValueInternalMap::distance(const IteratorState& x, const IteratorState& y) { + int offset = 0; + IteratorState it = x; + while (!equals(it, y)) + increment(it); + return offset; +} + +} // namespace Json diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp new file mode 100644 index 0000000..c5111f8 --- /dev/null +++ b/src/lib_json/json_reader.cpp @@ -0,0 +1,885 @@ +// Copyright 2007-2011 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include "json_tool.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below +#define snprintf _snprintf +#endif + +#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 +// Disable warning about strdup being deprecated. +#pragma warning(disable : 4996) +#endif + +namespace Json { + +// Implementation of class Features +// //////////////////////////////// + +Features::Features() + : allowComments_(true), strictRoot_(false), + allowDroppedNullPlaceholders_(false), allowNumericKeys_(false) {} + +Features Features::all() { return Features(); } + +Features Features::strictMode() { + Features features; + features.allowComments_ = false; + features.strictRoot_ = true; + features.allowDroppedNullPlaceholders_ = false; + features.allowNumericKeys_ = false; + return features; +} + +// Implementation of class Reader +// //////////////////////////////// + +static inline bool in(Reader::Char c, + Reader::Char c1, + Reader::Char c2, + Reader::Char c3, + Reader::Char c4) { + return c == c1 || c == c2 || c == c3 || c == c4; +} + +static inline bool in(Reader::Char c, + Reader::Char c1, + Reader::Char c2, + Reader::Char c3, + Reader::Char c4, + Reader::Char c5) { + return c == c1 || c == c2 || c == c3 || c == c4 || c == c5; +} + +static bool containsNewLine(Reader::Location begin, Reader::Location end) { + for (; begin < end; ++begin) + if (*begin == '\n' || *begin == '\r') + return true; + return false; +} + +// Class Reader +// ////////////////////////////////////////////////////////////////// + +Reader::Reader() + : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), + lastValue_(), commentsBefore_(), features_(Features::all()), + collectComments_() {} + +Reader::Reader(const Features& features) + : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(), + lastValue_(), commentsBefore_(), features_(features), collectComments_() { +} + +bool +Reader::parse(const std::string& document, Value& root, bool collectComments) { + document_ = document; + const char* begin = document_.c_str(); + const char* end = begin + document_.length(); + return parse(begin, end, root, collectComments); +} + +bool Reader::parse(std::istream& sin, Value& root, bool collectComments) { + // std::istream_iterator begin(sin); + // std::istream_iterator end; + // Those would allow streamed input from a file, if parse() were a + // template function. + + // Since std::string is reference-counted, this at least does not + // create an extra copy. + std::string doc; + std::getline(sin, doc, (char)EOF); + return parse(doc, root, collectComments); +} + +bool Reader::parse(const char* beginDoc, + const char* endDoc, + Value& root, + bool collectComments) { + if (!features_.allowComments_) { + collectComments = false; + } + + begin_ = beginDoc; + end_ = endDoc; + collectComments_ = collectComments; + current_ = begin_; + lastValueEnd_ = 0; + lastValue_ = 0; + commentsBefore_ = ""; + errors_.clear(); + while (!nodes_.empty()) + nodes_.pop(); + nodes_.push(&root); + + bool successful = readValue(); + Token token; + skipCommentTokens(token); + if (collectComments_ && !commentsBefore_.empty()) + root.setComment(commentsBefore_, commentAfter); + if (features_.strictRoot_) { + if (!root.isArray() && !root.isObject()) { + // Set error location to start of doc, ideally should be first token found + // in doc + token.type_ = tokenError; + token.start_ = beginDoc; + token.end_ = endDoc; + addError( + "A valid JSON document must be either an array or an object value.", + token); + return false; + } + } + return successful; +} + +bool Reader::readValue() { + Token token; + skipCommentTokens(token); + bool successful = true; + + if (collectComments_ && !commentsBefore_.empty()) { + // Remove newline characters at the end of the comments + size_t lastNonNewline = commentsBefore_.find_last_not_of("\r\n"); + if (lastNonNewline != std::string::npos) { + commentsBefore_.erase(lastNonNewline + 1); + } else { + commentsBefore_.clear(); + } + + currentValue().setComment(commentsBefore_, commentBefore); + commentsBefore_ = ""; + } + + switch (token.type_) { + case tokenObjectBegin: + successful = readObject(token); + currentValue().setOffsetLimit(current_ - begin_); + break; + case tokenArrayBegin: + successful = readArray(token); + currentValue().setOffsetLimit(current_ - begin_); + break; + case tokenNumber: + successful = decodeNumber(token); + break; + case tokenString: + successful = decodeString(token); + break; + case tokenTrue: + currentValue() = true; + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + break; + case tokenFalse: + currentValue() = false; + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + break; + case tokenNull: + currentValue() = Value(); + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + break; + case tokenArraySeparator: + if (features_.allowDroppedNullPlaceholders_) { + // "Un-read" the current token and mark the current value as a null + // token. + current_--; + currentValue() = Value(); + currentValue().setOffsetStart(current_ - begin_ - 1); + currentValue().setOffsetLimit(current_ - begin_); + break; + } + // Else, fall through... + default: + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return addError("Syntax error: value, object or array expected.", token); + } + + if (collectComments_) { + lastValueEnd_ = current_; + lastValue_ = ¤tValue(); + } + + return successful; +} + +void Reader::skipCommentTokens(Token& token) { + if (features_.allowComments_) { + do { + readToken(token); + } while (token.type_ == tokenComment); + } else { + readToken(token); + } +} + +bool Reader::expectToken(TokenType type, Token& token, const char* message) { + readToken(token); + if (token.type_ != type) + return addError(message, token); + return true; +} + +bool Reader::readToken(Token& token) { + skipSpaces(); + token.start_ = current_; + Char c = getNextChar(); + bool ok = true; + switch (c) { + case '{': + token.type_ = tokenObjectBegin; + break; + case '}': + token.type_ = tokenObjectEnd; + break; + case '[': + token.type_ = tokenArrayBegin; + break; + case ']': + token.type_ = tokenArrayEnd; + break; + case '"': + token.type_ = tokenString; + ok = readString(); + break; + case '/': + token.type_ = tokenComment; + ok = readComment(); + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + token.type_ = tokenNumber; + readNumber(); + break; + case 't': + token.type_ = tokenTrue; + ok = match("rue", 3); + break; + case 'f': + token.type_ = tokenFalse; + ok = match("alse", 4); + break; + case 'n': + token.type_ = tokenNull; + ok = match("ull", 3); + break; + case ',': + token.type_ = tokenArraySeparator; + break; + case ':': + token.type_ = tokenMemberSeparator; + break; + case 0: + token.type_ = tokenEndOfStream; + break; + default: + ok = false; + break; + } + if (!ok) + token.type_ = tokenError; + token.end_ = current_; + return true; +} + +void Reader::skipSpaces() { + while (current_ != end_) { + Char c = *current_; + if (c == ' ' || c == '\t' || c == '\r' || c == '\n') + ++current_; + else + break; + } +} + +bool Reader::match(Location pattern, int patternLength) { + if (end_ - current_ < patternLength) + return false; + int index = patternLength; + while (index--) + if (current_[index] != pattern[index]) + return false; + current_ += patternLength; + return true; +} + +bool Reader::readComment() { + Location commentBegin = current_ - 1; + Char c = getNextChar(); + bool successful = false; + if (c == '*') + successful = readCStyleComment(); + else if (c == '/') + successful = readCppStyleComment(); + if (!successful) + return false; + + if (collectComments_) { + CommentPlacement placement = commentBefore; + if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) { + if (c != '*' || !containsNewLine(commentBegin, current_)) + placement = commentAfterOnSameLine; + } + + addComment(commentBegin, current_, placement); + } + return true; +} + +void +Reader::addComment(Location begin, Location end, CommentPlacement placement) { + assert(collectComments_); + if (placement == commentAfterOnSameLine) { + assert(lastValue_ != 0); + lastValue_->setComment(std::string(begin, end), placement); + } else { + commentsBefore_ += std::string(begin, end); + } +} + +bool Reader::readCStyleComment() { + while (current_ != end_) { + Char c = getNextChar(); + if (c == '*' && *current_ == '/') + break; + } + return getNextChar() == '/'; +} + +bool Reader::readCppStyleComment() { + while (current_ != end_) { + Char c = getNextChar(); + if (c == '\r' || c == '\n') + break; + } + return true; +} + +void Reader::readNumber() { + while (current_ != end_) { + if (!(*current_ >= '0' && *current_ <= '9') && + !in(*current_, '.', 'e', 'E', '+', '-')) + break; + ++current_; + } +} + +bool Reader::readString() { + Char c = 0; + while (current_ != end_) { + c = getNextChar(); + if (c == '\\') + getNextChar(); + else if (c == '"') + break; + } + return c == '"'; +} + +bool Reader::readObject(Token& tokenStart) { + Token tokenName; + std::string name; + currentValue() = Value(objectValue); + currentValue().setOffsetStart(tokenStart.start_ - begin_); + while (readToken(tokenName)) { + bool initialTokenOk = true; + while (tokenName.type_ == tokenComment && initialTokenOk) + initialTokenOk = readToken(tokenName); + if (!initialTokenOk) + break; + if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object + return true; + name = ""; + if (tokenName.type_ == tokenString) { + if (!decodeString(tokenName, name)) + return recoverFromError(tokenObjectEnd); + } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) { + Value numberName; + if (!decodeNumber(tokenName, numberName)) + return recoverFromError(tokenObjectEnd); + name = numberName.asString(); + } else { + break; + } + + Token colon; + if (!readToken(colon) || colon.type_ != tokenMemberSeparator) { + return addErrorAndRecover( + "Missing ':' after object member name", colon, tokenObjectEnd); + } + Value& value = currentValue()[name]; + nodes_.push(&value); + bool ok = readValue(); + nodes_.pop(); + if (!ok) // error already set + return recoverFromError(tokenObjectEnd); + + Token comma; + if (!readToken(comma) || + (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator && + comma.type_ != tokenComment)) { + return addErrorAndRecover( + "Missing ',' or '}' in object declaration", comma, tokenObjectEnd); + } + bool finalizeTokenOk = true; + while (comma.type_ == tokenComment && finalizeTokenOk) + finalizeTokenOk = readToken(comma); + if (comma.type_ == tokenObjectEnd) + return true; + } + return addErrorAndRecover( + "Missing '}' or object member name", tokenName, tokenObjectEnd); +} + +bool Reader::readArray(Token& tokenStart) { + currentValue() = Value(arrayValue); + currentValue().setOffsetStart(tokenStart.start_ - begin_); + skipSpaces(); + if (*current_ == ']') // empty array + { + Token endArray; + readToken(endArray); + return true; + } + int index = 0; + for (;;) { + Value& value = currentValue()[index++]; + nodes_.push(&value); + bool ok = readValue(); + nodes_.pop(); + if (!ok) // error already set + return recoverFromError(tokenArrayEnd); + + Token token; + // Accept Comment after last item in the array. + ok = readToken(token); + while (token.type_ == tokenComment && ok) { + ok = readToken(token); + } + bool badTokenType = + (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd); + if (!ok || badTokenType) { + return addErrorAndRecover( + "Missing ',' or ']' in array declaration", token, tokenArrayEnd); + } + if (token.type_ == tokenArrayEnd) + break; + } + return true; +} + +bool Reader::decodeNumber(Token& token) { + Value decoded; + if (!decodeNumber(token, decoded)) + return false; + currentValue() = decoded; + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool Reader::decodeNumber(Token& token, Value& decoded) { + bool isDouble = false; + for (Location inspect = token.start_; inspect != token.end_; ++inspect) { + isDouble = isDouble || in(*inspect, '.', 'e', 'E', '+') || + (*inspect == '-' && inspect != token.start_); + } + if (isDouble) + return decodeDouble(token, decoded); + // Attempts to parse the number as an integer. If the number is + // larger than the maximum supported value of an integer then + // we decode the number as a double. + Location current = token.start_; + bool isNegative = *current == '-'; + if (isNegative) + ++current; + Value::LargestUInt maxIntegerValue = + isNegative ? Value::LargestUInt(-Value::minLargestInt) + : Value::maxLargestUInt; + Value::LargestUInt threshold = maxIntegerValue / 10; + Value::LargestUInt value = 0; + while (current < token.end_) { + Char c = *current++; + if (c < '0' || c > '9') + return addError("'" + std::string(token.start_, token.end_) + + "' is not a number.", + token); + Value::UInt digit(c - '0'); + if (value >= threshold) { + // We've hit or exceeded the max value divided by 10 (rounded down). If + // a) we've only just touched the limit, b) this is the last digit, and + // c) it's small enough to fit in that rounding delta, we're okay. + // Otherwise treat this number as a double to avoid overflow. + if (value > threshold || current != token.end_ || + digit > maxIntegerValue % 10) { + return decodeDouble(token, decoded); + } + } + value = value * 10 + digit; + } + if (isNegative) + decoded = -Value::LargestInt(value); + else if (value <= Value::LargestUInt(Value::maxInt)) + decoded = Value::LargestInt(value); + else + decoded = value; + return true; +} + +bool Reader::decodeDouble(Token& token) { + Value decoded; + if (!decodeDouble(token, decoded)) + return false; + currentValue() = decoded; + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool Reader::decodeDouble(Token& token, Value& decoded) { + double value = 0; + const int bufferSize = 32; + int count; + int length = int(token.end_ - token.start_); + + // Sanity check to avoid buffer overflow exploits. + if (length < 0) { + return addError("Unable to parse token length", token); + } + + // Avoid using a string constant for the format control string given to + // sscanf, as this can cause hard to debug crashes on OS X. See here for more + // info: + // + // http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html + char format[] = "%lf"; + + if (length <= bufferSize) { + Char buffer[bufferSize + 1]; + memcpy(buffer, token.start_, length); + buffer[length] = 0; + count = sscanf(buffer, format, &value); + } else { + std::string buffer(token.start_, token.end_); + count = sscanf(buffer.c_str(), format, &value); + } + + if (count != 1) + return addError("'" + std::string(token.start_, token.end_) + + "' is not a number.", + token); + decoded = value; + return true; +} + +bool Reader::decodeString(Token& token) { + std::string decoded; + if (!decodeString(token, decoded)) + return false; + currentValue() = decoded; + currentValue().setOffsetStart(token.start_ - begin_); + currentValue().setOffsetLimit(token.end_ - begin_); + return true; +} + +bool Reader::decodeString(Token& token, std::string& decoded) { + decoded.reserve(token.end_ - token.start_ - 2); + Location current = token.start_ + 1; // skip '"' + Location end = token.end_ - 1; // do not include '"' + while (current != end) { + Char c = *current++; + if (c == '"') + break; + else if (c == '\\') { + if (current == end) + return addError("Empty escape sequence in string", token, current); + Char escape = *current++; + switch (escape) { + case '"': + decoded += '"'; + break; + case '/': + decoded += '/'; + break; + case '\\': + decoded += '\\'; + break; + case 'b': + decoded += '\b'; + break; + case 'f': + decoded += '\f'; + break; + case 'n': + decoded += '\n'; + break; + case 'r': + decoded += '\r'; + break; + case 't': + decoded += '\t'; + break; + case 'u': { + unsigned int unicode; + if (!decodeUnicodeCodePoint(token, current, end, unicode)) + return false; + decoded += codePointToUTF8(unicode); + } break; + default: + return addError("Bad escape sequence in string", token, current); + } + } else { + decoded += c; + } + } + return true; +} + +bool Reader::decodeUnicodeCodePoint(Token& token, + Location& current, + Location end, + unsigned int& unicode) { + + if (!decodeUnicodeEscapeSequence(token, current, end, unicode)) + return false; + if (unicode >= 0xD800 && unicode <= 0xDBFF) { + // surrogate pairs + if (end - current < 6) + return addError( + "additional six characters expected to parse unicode surrogate pair.", + token, + current); + unsigned int surrogatePair; + if (*(current++) == '\\' && *(current++) == 'u') { + if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) { + unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF); + } else + return false; + } else + return addError("expecting another \\u token to begin the second half of " + "a unicode surrogate pair", + token, + current); + } + return true; +} + +bool Reader::decodeUnicodeEscapeSequence(Token& token, + Location& current, + Location end, + unsigned int& unicode) { + if (end - current < 4) + return addError( + "Bad unicode escape sequence in string: four digits expected.", + token, + current); + unicode = 0; + for (int index = 0; index < 4; ++index) { + Char c = *current++; + unicode *= 16; + if (c >= '0' && c <= '9') + unicode += c - '0'; + else if (c >= 'a' && c <= 'f') + unicode += c - 'a' + 10; + else if (c >= 'A' && c <= 'F') + unicode += c - 'A' + 10; + else + return addError( + "Bad unicode escape sequence in string: hexadecimal digit expected.", + token, + current); + } + return true; +} + +bool +Reader::addError(const std::string& message, Token& token, Location extra) { + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = extra; + errors_.push_back(info); + return false; +} + +bool Reader::recoverFromError(TokenType skipUntilToken) { + int errorCount = int(errors_.size()); + Token skip; + for (;;) { + if (!readToken(skip)) + errors_.resize(errorCount); // discard errors caused by recovery + if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream) + break; + } + errors_.resize(errorCount); + return false; +} + +bool Reader::addErrorAndRecover(const std::string& message, + Token& token, + TokenType skipUntilToken) { + addError(message, token); + return recoverFromError(skipUntilToken); +} + +Value& Reader::currentValue() { return *(nodes_.top()); } + +Reader::Char Reader::getNextChar() { + if (current_ == end_) + return 0; + return *current_++; +} + +void Reader::getLocationLineAndColumn(Location location, + int& line, + int& column) const { + Location current = begin_; + Location lastLineStart = current; + line = 0; + while (current < location && current != end_) { + Char c = *current++; + if (c == '\r') { + if (*current == '\n') + ++current; + lastLineStart = current; + ++line; + } else if (c == '\n') { + lastLineStart = current; + ++line; + } + } + // column & line start at 1 + column = int(location - lastLineStart) + 1; + ++line; +} + +std::string Reader::getLocationLineAndColumn(Location location) const { + int line, column; + getLocationLineAndColumn(location, line, column); + char buffer[18 + 16 + 16 + 1]; +#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) +#if defined(WINCE) + _snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#else + sprintf_s(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#endif +#else + snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column); +#endif + return buffer; +} + +// Deprecated. Preserved for backward compatibility +std::string Reader::getFormatedErrorMessages() const { + return getFormattedErrorMessages(); +} + +std::string Reader::getFormattedErrorMessages() const { + std::string formattedMessage; + for (Errors::const_iterator itError = errors_.begin(); + itError != errors_.end(); + ++itError) { + const ErrorInfo& error = *itError; + formattedMessage += + "* " + getLocationLineAndColumn(error.token_.start_) + "\n"; + formattedMessage += " " + error.message_ + "\n"; + if (error.extra_) + formattedMessage += + "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n"; + } + return formattedMessage; +} + +std::vector Reader::getStructuredErrors() const { + std::vector allErrors; + for (Errors::const_iterator itError = errors_.begin(); + itError != errors_.end(); + ++itError) { + const ErrorInfo& error = *itError; + Reader::StructuredError structured; + structured.offset_start = error.token_.start_ - begin_; + structured.offset_limit = error.token_.end_ - begin_; + structured.message = error.message_; + allErrors.push_back(structured); + } + return allErrors; +} + +bool Reader::pushError(const Value& value, const std::string& message) { + size_t length = end_ - begin_; + if(value.getOffsetStart() > length + || value.getOffsetLimit() > length) + return false; + Token token; + token.type_ = tokenError; + token.start_ = begin_ + value.getOffsetStart(); + token.end_ = end_ + value.getOffsetLimit(); + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = 0; + errors_.push_back(info); + return true; +} + +bool Reader::pushError(const Value& value, const std::string& message, const Value& extra) { + size_t length = end_ - begin_; + if(value.getOffsetStart() > length + || value.getOffsetLimit() > length + || extra.getOffsetLimit() > length) + return false; + Token token; + token.type_ = tokenError; + token.start_ = begin_ + value.getOffsetStart(); + token.end_ = begin_ + value.getOffsetLimit(); + ErrorInfo info; + info.token_ = token; + info.message_ = message; + info.extra_ = begin_ + extra.getOffsetStart(); + errors_.push_back(info); + return true; +} + +bool Reader::good() const { + return !errors_.size(); +} + +std::istream& operator>>(std::istream& sin, Value& root) { + Json::Reader reader; + bool ok = reader.parse(sin, root, true); + if (!ok) { + fprintf(stderr, + "Error from reader: %s", + reader.getFormattedErrorMessages().c_str()); + + JSON_FAIL_MESSAGE("reader error"); + } + return sin; +} + +} // namespace Json diff --git a/src/lib_json/json_tool.h b/src/lib_json/json_tool.h new file mode 100644 index 0000000..f9b61c3 --- /dev/null +++ b/src/lib_json/json_tool.h @@ -0,0 +1,87 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED +#define LIB_JSONCPP_JSON_TOOL_H_INCLUDED + +/* This header provides common string manipulation support, such as UTF-8, + * portable conversion from/to string... + * + * It is an internal header that must not be exposed. + */ + +namespace Json { + +/// Converts a unicode code-point to UTF-8. +static inline std::string codePointToUTF8(unsigned int cp) { + std::string result; + + // based on description from http://en.wikipedia.org/wiki/UTF-8 + + if (cp <= 0x7f) { + result.resize(1); + result[0] = static_cast(cp); + } else if (cp <= 0x7FF) { + result.resize(2); + result[1] = static_cast(0x80 | (0x3f & cp)); + result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); + } else if (cp <= 0xFFFF) { + result.resize(3); + result[2] = static_cast(0x80 | (0x3f & cp)); + result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); + result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); + } else if (cp <= 0x10FFFF) { + result.resize(4); + result[3] = static_cast(0x80 | (0x3f & cp)); + result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); + result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); + result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); + } + + return result; +} + +/// Returns true if ch is a control character (in range [0,32[). +static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; } + +enum { + /// Constant that specify the size of the buffer that must be passed to + /// uintToString. + uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 +}; + +// Defines a char buffer for use with uintToString(). +typedef char UIntToStringBuffer[uintToStringBufferSize]; + +/** Converts an unsigned integer to string. + * @param value Unsigned interger to convert to string + * @param current Input/Output string buffer. + * Must have at least uintToStringBufferSize chars free. + */ +static inline void uintToString(LargestUInt value, char*& current) { + *--current = 0; + do { + *--current = char(value % 10) + '0'; + value /= 10; + } while (value != 0); +} + +/** Change ',' to '.' everywhere in buffer. + * + * We had a sophisticated way, but it did not work in WinCE. + * @see https://github.com/open-source-parsers/jsoncpp/pull/9 + */ +static inline void fixNumericLocale(char* begin, char* end) { + while (begin < end) { + if (*begin == ',') { + *begin = '.'; + } + ++begin; + } +} + +} // namespace Json { + +#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp new file mode 100644 index 0000000..b73deac --- /dev/null +++ b/src/lib_json/json_value.cpp @@ -0,0 +1,1478 @@ +// Copyright 2011 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +#include "json_batchallocator.h" +#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include +#include +#ifdef JSON_USE_CPPTL +#include +#endif +#include // size_t + +#define JSON_ASSERT_UNREACHABLE assert(false) + +namespace Json { + +// This is a walkaround to avoid the static initialization of Value::null. +// kNull must be word-aligned to avoid crashing on ARM. We use an alignment of +// 8 (instead of 4) as a bit of future-proofing. +#if defined(__ARMEL__) +#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment))) +#else +#define ALIGNAS(byte_alignment) +#endif +static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 }; +const unsigned char& kNullRef = kNull[0]; +const Value& Value::null = reinterpret_cast(kNullRef); + +const Int Value::minInt = Int(~(UInt(-1) / 2)); +const Int Value::maxInt = Int(UInt(-1) / 2); +const UInt Value::maxUInt = UInt(-1); +#if defined(JSON_HAS_INT64) +const Int64 Value::minInt64 = Int64(~(UInt64(-1) / 2)); +const Int64 Value::maxInt64 = Int64(UInt64(-1) / 2); +const UInt64 Value::maxUInt64 = UInt64(-1); +// The constant is hard-coded because some compiler have trouble +// converting Value::maxUInt64 to a double correctly (AIX/xlC). +// Assumes that UInt64 is a 64 bits integer. +static const double maxUInt64AsDouble = 18446744073709551615.0; +#endif // defined(JSON_HAS_INT64) +const LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2)); +const LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2); +const LargestUInt Value::maxLargestUInt = LargestUInt(-1); + +/// Unknown size marker +static const unsigned int unknown = (unsigned)-1; + +#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) +template +static inline bool InRange(double d, T min, U max) { + return d >= min && d <= max; +} +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) +static inline double integerToDouble(Json::UInt64 value) { + return static_cast(Int64(value / 2)) * 2.0 + Int64(value & 1); +} + +template static inline double integerToDouble(T value) { + return static_cast(value); +} + +template +static inline bool InRange(double d, T min, U max) { + return d >= integerToDouble(min) && d <= integerToDouble(max); +} +#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + +/** Duplicates the specified string value. + * @param value Pointer to the string to duplicate. Must be zero-terminated if + * length is "unknown". + * @param length Length of the value. if equals to unknown, then it will be + * computed using strlen(value). + * @return Pointer on the duplicate instance of string. + */ +static inline char* duplicateStringValue(const char* value, + unsigned int length = unknown) { + if (length == unknown) + length = (unsigned int)strlen(value); + + // Avoid an integer overflow in the call to malloc below by limiting length + // to a sane value. + if (length >= (unsigned)Value::maxInt) + length = Value::maxInt - 1; + + char* newString = static_cast(malloc(length + 1)); + JSON_ASSERT_MESSAGE(newString != 0, + "in Json::Value::duplicateStringValue(): " + "Failed to allocate string value buffer"); + memcpy(newString, value, length); + newString[length] = 0; + return newString; +} + +/** Free the string duplicated by duplicateStringValue(). + */ +static inline void releaseStringValue(char* value) { free(value); } + +} // namespace Json + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ValueInternals... +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +#if !defined(JSON_IS_AMALGAMATION) +#ifdef JSON_VALUE_USE_INTERNAL_MAP +#include "json_internalarray.inl" +#include "json_internalmap.inl" +#endif // JSON_VALUE_USE_INTERNAL_MAP + +#include "json_valueiterator.inl" +#endif // if !defined(JSON_IS_AMALGAMATION) + +namespace Json { + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::CommentInfo +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +Value::CommentInfo::CommentInfo() : comment_(0) {} + +Value::CommentInfo::~CommentInfo() { + if (comment_) + releaseStringValue(comment_); +} + +void Value::CommentInfo::setComment(const char* text) { + if (comment_) + releaseStringValue(comment_); + JSON_ASSERT(text != 0); + JSON_ASSERT_MESSAGE( + text[0] == '\0' || text[0] == '/', + "in Json::Value::setComment(): Comments must start with /"); + // It seems that /**/ style comments are acceptable as well. + comment_ = duplicateStringValue(text); +} + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::CZString +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +#ifndef JSON_VALUE_USE_INTERNAL_MAP + +// Notes: index_ indicates if the string was allocated when +// a string is stored. + +Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {} + +Value::CZString::CZString(const char* cstr, DuplicationPolicy allocate) + : cstr_(allocate == duplicate ? duplicateStringValue(cstr) : cstr), + index_(allocate) {} + +Value::CZString::CZString(const CZString& other) + : cstr_(other.index_ != noDuplication && other.cstr_ != 0 + ? duplicateStringValue(other.cstr_) + : other.cstr_), + index_(other.cstr_ + ? static_cast(other.index_ == noDuplication + ? noDuplication : duplicate) + : other.index_) {} + +Value::CZString::~CZString() { + if (cstr_ && index_ == duplicate) + releaseStringValue(const_cast(cstr_)); +} + +void Value::CZString::swap(CZString& other) { + std::swap(cstr_, other.cstr_); + std::swap(index_, other.index_); +} + +Value::CZString& Value::CZString::operator=(CZString other) { + swap(other); + return *this; +} + +bool Value::CZString::operator<(const CZString& other) const { + if (cstr_) + return strcmp(cstr_, other.cstr_) < 0; + return index_ < other.index_; +} + +bool Value::CZString::operator==(const CZString& other) const { + if (cstr_) + return strcmp(cstr_, other.cstr_) == 0; + return index_ == other.index_; +} + +ArrayIndex Value::CZString::index() const { return index_; } + +const char* Value::CZString::c_str() const { return cstr_; } + +bool Value::CZString::isStaticString() const { return index_ == noDuplication; } + +#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class Value::Value +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +/*! \internal Default constructor initialization must be equivalent to: + * memset( this, 0, sizeof(Value) ) + * This optimization is used in ValueInternalMap fast allocator. + */ +Value::Value(ValueType type) { + initBasic(type); + switch (type) { + case nullValue: + break; + case intValue: + case uintValue: + value_.int_ = 0; + break; + case realValue: + value_.real_ = 0.0; + break; + case stringValue: + value_.string_ = 0; + break; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + value_.map_ = new ObjectValues(); + break; +#else + case arrayValue: + value_.array_ = arrayAllocator()->newArray(); + break; + case objectValue: + value_.map_ = mapAllocator()->newMap(); + break; +#endif + case booleanValue: + value_.bool_ = false; + break; + default: + JSON_ASSERT_UNREACHABLE; + } +} + +Value::Value(Int value) { + initBasic(intValue); + value_.int_ = value; +} + +Value::Value(UInt value) { + initBasic(uintValue); + value_.uint_ = value; +} +#if defined(JSON_HAS_INT64) +Value::Value(Int64 value) { + initBasic(intValue); + value_.int_ = value; +} +Value::Value(UInt64 value) { + initBasic(uintValue); + value_.uint_ = value; +} +#endif // defined(JSON_HAS_INT64) + +Value::Value(double value) { + initBasic(realValue); + value_.real_ = value; +} + +Value::Value(const char* value) { + initBasic(stringValue, true); + value_.string_ = duplicateStringValue(value); +} + +Value::Value(const char* beginValue, const char* endValue) { + initBasic(stringValue, true); + value_.string_ = + duplicateStringValue(beginValue, (unsigned int)(endValue - beginValue)); +} + +Value::Value(const std::string& value) { + initBasic(stringValue, true); + value_.string_ = + duplicateStringValue(value.c_str(), (unsigned int)value.length()); +} + +Value::Value(const StaticString& value) { + initBasic(stringValue); + value_.string_ = const_cast(value.c_str()); +} + +#ifdef JSON_USE_CPPTL +Value::Value(const CppTL::ConstString& value) { + initBasic(stringValue, true); + value_.string_ = duplicateStringValue(value, value.length()); +} +#endif + +Value::Value(bool value) { + initBasic(booleanValue); + value_.bool_ = value; +} + +Value::Value(const Value& other) + : type_(other.type_), allocated_(false) +#ifdef JSON_VALUE_USE_INTERNAL_MAP + , + itemIsUsed_(0) +#endif + , + comments_(0), start_(other.start_), limit_(other.limit_) { + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + value_ = other.value_; + break; + case stringValue: + if (other.value_.string_) { + value_.string_ = duplicateStringValue(other.value_.string_); + allocated_ = true; + } else { + value_.string_ = 0; + allocated_ = false; + } + break; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + value_.map_ = new ObjectValues(*other.value_.map_); + break; +#else + case arrayValue: + value_.array_ = arrayAllocator()->newArrayCopy(*other.value_.array_); + break; + case objectValue: + value_.map_ = mapAllocator()->newMapCopy(*other.value_.map_); + break; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + if (other.comments_) { + comments_ = new CommentInfo[numberOfCommentPlacement]; + for (int comment = 0; comment < numberOfCommentPlacement; ++comment) { + const CommentInfo& otherComment = other.comments_[comment]; + if (otherComment.comment_) + comments_[comment].setComment(otherComment.comment_); + } + } +} + +Value::~Value() { + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + break; + case stringValue: + if (allocated_) + releaseStringValue(value_.string_); + break; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + delete value_.map_; + break; +#else + case arrayValue: + arrayAllocator()->destructArray(value_.array_); + break; + case objectValue: + mapAllocator()->destructMap(value_.map_); + break; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + + if (comments_) + delete[] comments_; +} + +Value& Value::operator=(Value other) { + swap(other); + return *this; +} + +void Value::swap(Value& other) { + ValueType temp = type_; + type_ = other.type_; + other.type_ = temp; + std::swap(value_, other.value_); + int temp2 = allocated_; + allocated_ = other.allocated_; + other.allocated_ = temp2; + std::swap(start_, other.start_); + std::swap(limit_, other.limit_); +} + +ValueType Value::type() const { return type_; } + +int Value::compare(const Value& other) const { + if (*this < other) + return -1; + if (*this > other) + return 1; + return 0; +} + +bool Value::operator<(const Value& other) const { + int typeDelta = type_ - other.type_; + if (typeDelta) + return typeDelta < 0 ? true : false; + switch (type_) { + case nullValue: + return false; + case intValue: + return value_.int_ < other.value_.int_; + case uintValue: + return value_.uint_ < other.value_.uint_; + case realValue: + return value_.real_ < other.value_.real_; + case booleanValue: + return value_.bool_ < other.value_.bool_; + case stringValue: + return (value_.string_ == 0 && other.value_.string_) || + (other.value_.string_ && value_.string_ && + strcmp(value_.string_, other.value_.string_) < 0); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: { + int delta = int(value_.map_->size() - other.value_.map_->size()); + if (delta) + return delta < 0; + return (*value_.map_) < (*other.value_.map_); + } +#else + case arrayValue: + return value_.array_->compare(*(other.value_.array_)) < 0; + case objectValue: + return value_.map_->compare(*(other.value_.map_)) < 0; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + return false; // unreachable +} + +bool Value::operator<=(const Value& other) const { return !(other < *this); } + +bool Value::operator>=(const Value& other) const { return !(*this < other); } + +bool Value::operator>(const Value& other) const { return other < *this; } + +bool Value::operator==(const Value& other) const { + // if ( type_ != other.type_ ) + // GCC 2.95.3 says: + // attempt to take address of bit-field structure member `Json::Value::type_' + // Beats me, but a temp solves the problem. + int temp = other.type_; + if (type_ != temp) + return false; + switch (type_) { + case nullValue: + return true; + case intValue: + return value_.int_ == other.value_.int_; + case uintValue: + return value_.uint_ == other.value_.uint_; + case realValue: + return value_.real_ == other.value_.real_; + case booleanValue: + return value_.bool_ == other.value_.bool_; + case stringValue: + return (value_.string_ == other.value_.string_) || + (other.value_.string_ && value_.string_ && + strcmp(value_.string_, other.value_.string_) == 0); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + return value_.map_->size() == other.value_.map_->size() && + (*value_.map_) == (*other.value_.map_); +#else + case arrayValue: + return value_.array_->compare(*(other.value_.array_)) == 0; + case objectValue: + return value_.map_->compare(*(other.value_.map_)) == 0; +#endif + default: + JSON_ASSERT_UNREACHABLE; + } + return false; // unreachable +} + +bool Value::operator!=(const Value& other) const { return !(*this == other); } + +const char* Value::asCString() const { + JSON_ASSERT_MESSAGE(type_ == stringValue, + "in Json::Value::asCString(): requires stringValue"); + return value_.string_; +} + +std::string Value::asString() const { + switch (type_) { + case nullValue: + return ""; + case stringValue: + return value_.string_ ? value_.string_ : ""; + case booleanValue: + return value_.bool_ ? "true" : "false"; + case intValue: + return valueToString(value_.int_); + case uintValue: + return valueToString(value_.uint_); + case realValue: + return valueToString(value_.real_); + default: + JSON_FAIL_MESSAGE("Type is not convertible to string"); + } +} + +#ifdef JSON_USE_CPPTL +CppTL::ConstString Value::asConstString() const { + return CppTL::ConstString(asString().c_str()); +} +#endif + +Value::Int Value::asInt() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isInt(), "LargestInt out of Int range"); + return Int(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isInt(), "LargestUInt out of Int range"); + return Int(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt), + "double out of Int range"); + return Int(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to Int."); +} + +Value::UInt Value::asUInt() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range"); + return UInt(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range"); + return UInt(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt), + "double out of UInt range"); + return UInt(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to UInt."); +} + +#if defined(JSON_HAS_INT64) + +Value::Int64 Value::asInt64() const { + switch (type_) { + case intValue: + return Int64(value_.int_); + case uintValue: + JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range"); + return Int64(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64), + "double out of Int64 range"); + return Int64(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to Int64."); +} + +Value::UInt64 Value::asUInt64() const { + switch (type_) { + case intValue: + JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range"); + return UInt64(value_.int_); + case uintValue: + return UInt64(value_.uint_); + case realValue: + JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64), + "double out of UInt64 range"); + return UInt64(value_.real_); + case nullValue: + return 0; + case booleanValue: + return value_.bool_ ? 1 : 0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to UInt64."); +} +#endif // if defined(JSON_HAS_INT64) + +LargestInt Value::asLargestInt() const { +#if defined(JSON_NO_INT64) + return asInt(); +#else + return asInt64(); +#endif +} + +LargestUInt Value::asLargestUInt() const { +#if defined(JSON_NO_INT64) + return asUInt(); +#else + return asUInt64(); +#endif +} + +double Value::asDouble() const { + switch (type_) { + case intValue: + return static_cast(value_.int_); + case uintValue: +#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return static_cast(value_.uint_); +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return integerToDouble(value_.uint_); +#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + case realValue: + return value_.real_; + case nullValue: + return 0.0; + case booleanValue: + return value_.bool_ ? 1.0 : 0.0; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to double."); +} + +float Value::asFloat() const { + switch (type_) { + case intValue: + return static_cast(value_.int_); + case uintValue: +#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return static_cast(value_.uint_); +#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + return integerToDouble(value_.uint_); +#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) + case realValue: + return static_cast(value_.real_); + case nullValue: + return 0.0; + case booleanValue: + return value_.bool_ ? 1.0f : 0.0f; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to float."); +} + +bool Value::asBool() const { + switch (type_) { + case booleanValue: + return value_.bool_; + case nullValue: + return false; + case intValue: + return value_.int_ ? true : false; + case uintValue: + return value_.uint_ ? true : false; + case realValue: + return value_.real_ ? true : false; + default: + break; + } + JSON_FAIL_MESSAGE("Value is not convertible to bool."); +} + +bool Value::isConvertibleTo(ValueType other) const { + switch (other) { + case nullValue: + return (isNumeric() && asDouble() == 0.0) || + (type_ == booleanValue && value_.bool_ == false) || + (type_ == stringValue && asString() == "") || + (type_ == arrayValue && value_.map_->size() == 0) || + (type_ == objectValue && value_.map_->size() == 0) || + type_ == nullValue; + case intValue: + return isInt() || + (type_ == realValue && InRange(value_.real_, minInt, maxInt)) || + type_ == booleanValue || type_ == nullValue; + case uintValue: + return isUInt() || + (type_ == realValue && InRange(value_.real_, 0, maxUInt)) || + type_ == booleanValue || type_ == nullValue; + case realValue: + return isNumeric() || type_ == booleanValue || type_ == nullValue; + case booleanValue: + return isNumeric() || type_ == booleanValue || type_ == nullValue; + case stringValue: + return isNumeric() || type_ == booleanValue || type_ == stringValue || + type_ == nullValue; + case arrayValue: + return type_ == arrayValue || type_ == nullValue; + case objectValue: + return type_ == objectValue || type_ == nullValue; + } + JSON_ASSERT_UNREACHABLE; + return false; +} + +/// Number of values in array or object +ArrayIndex Value::size() const { + switch (type_) { + case nullValue: + case intValue: + case uintValue: + case realValue: + case booleanValue: + case stringValue: + return 0; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: // size of the array is highest index + 1 + if (!value_.map_->empty()) { + ObjectValues::const_iterator itLast = value_.map_->end(); + --itLast; + return (*itLast).first.index() + 1; + } + return 0; + case objectValue: + return ArrayIndex(value_.map_->size()); +#else + case arrayValue: + return Int(value_.array_->size()); + case objectValue: + return Int(value_.map_->size()); +#endif + } + JSON_ASSERT_UNREACHABLE; + return 0; // unreachable; +} + +bool Value::empty() const { + if (isNull() || isArray() || isObject()) + return size() == 0u; + else + return false; +} + +bool Value::operator!() const { return isNull(); } + +void Value::clear() { + JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue || + type_ == objectValue, + "in Json::Value::clear(): requires complex value"); + start_ = 0; + limit_ = 0; + switch (type_) { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + case objectValue: + value_.map_->clear(); + break; +#else + case arrayValue: + value_.array_->clear(); + break; + case objectValue: + value_.map_->clear(); + break; +#endif + default: + break; + } +} + +void Value::resize(ArrayIndex newSize) { + JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue, + "in Json::Value::resize(): requires arrayValue"); + if (type_ == nullValue) + *this = Value(arrayValue); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + ArrayIndex oldSize = size(); + if (newSize == 0) + clear(); + else if (newSize > oldSize) + (*this)[newSize - 1]; + else { + for (ArrayIndex index = newSize; index < oldSize; ++index) { + value_.map_->erase(index); + } + assert(size() == newSize); + } +#else + value_.array_->resize(newSize); +#endif +} + +Value& Value::operator[](ArrayIndex index) { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == arrayValue, + "in Json::Value::operator[](ArrayIndex): requires arrayValue"); + if (type_ == nullValue) + *this = Value(arrayValue); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString key(index); + ObjectValues::iterator it = value_.map_->lower_bound(key); + if (it != value_.map_->end() && (*it).first == key) + return (*it).second; + + ObjectValues::value_type defaultValue(key, null); + it = value_.map_->insert(it, defaultValue); + return (*it).second; +#else + return value_.array_->resolveReference(index); +#endif +} + +Value& Value::operator[](int index) { + JSON_ASSERT_MESSAGE( + index >= 0, + "in Json::Value::operator[](int index): index cannot be negative"); + return (*this)[ArrayIndex(index)]; +} + +const Value& Value::operator[](ArrayIndex index) const { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == arrayValue, + "in Json::Value::operator[](ArrayIndex)const: requires arrayValue"); + if (type_ == nullValue) + return null; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString key(index); + ObjectValues::const_iterator it = value_.map_->find(key); + if (it == value_.map_->end()) + return null; + return (*it).second; +#else + Value* value = value_.array_->find(index); + return value ? *value : null; +#endif +} + +const Value& Value::operator[](int index) const { + JSON_ASSERT_MESSAGE( + index >= 0, + "in Json::Value::operator[](int index) const: index cannot be negative"); + return (*this)[ArrayIndex(index)]; +} + +Value& Value::operator[](const char* key) { + return resolveReference(key, false); +} + +void Value::initBasic(ValueType type, bool allocated) { + type_ = type; + allocated_ = allocated; +#ifdef JSON_VALUE_USE_INTERNAL_MAP + itemIsUsed_ = 0; +#endif + comments_ = 0; + start_ = 0; + limit_ = 0; +} + +Value& Value::resolveReference(const char* key, bool isStatic) { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == objectValue, + "in Json::Value::resolveReference(): requires objectValue"); + if (type_ == nullValue) + *this = Value(objectValue); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString actualKey( + key, isStatic ? CZString::noDuplication : CZString::duplicateOnCopy); + ObjectValues::iterator it = value_.map_->lower_bound(actualKey); + if (it != value_.map_->end() && (*it).first == actualKey) + return (*it).second; + + ObjectValues::value_type defaultValue(actualKey, null); + it = value_.map_->insert(it, defaultValue); + Value& value = (*it).second; + return value; +#else + return value_.map_->resolveReference(key, isStatic); +#endif +} + +Value Value::get(ArrayIndex index, const Value& defaultValue) const { + const Value* value = &((*this)[index]); + return value == &null ? defaultValue : *value; +} + +bool Value::isValidIndex(ArrayIndex index) const { return index < size(); } + +const Value& Value::operator[](const char* key) const { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == objectValue, + "in Json::Value::operator[](char const*)const: requires objectValue"); + if (type_ == nullValue) + return null; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString actualKey(key, CZString::noDuplication); + ObjectValues::const_iterator it = value_.map_->find(actualKey); + if (it == value_.map_->end()) + return null; + return (*it).second; +#else + const Value* value = value_.map_->find(key); + return value ? *value : null; +#endif +} + +Value& Value::operator[](const std::string& key) { + return (*this)[key.c_str()]; +} + +const Value& Value::operator[](const std::string& key) const { + return (*this)[key.c_str()]; +} + +Value& Value::operator[](const StaticString& key) { + return resolveReference(key, true); +} + +#ifdef JSON_USE_CPPTL +Value& Value::operator[](const CppTL::ConstString& key) { + return (*this)[key.c_str()]; +} + +const Value& Value::operator[](const CppTL::ConstString& key) const { + return (*this)[key.c_str()]; +} +#endif + +Value& Value::append(const Value& value) { return (*this)[size()] = value; } + +Value Value::get(const char* key, const Value& defaultValue) const { + const Value* value = &((*this)[key]); + return value == &null ? defaultValue : *value; +} + +Value Value::get(const std::string& key, const Value& defaultValue) const { + return get(key.c_str(), defaultValue); +} + +Value Value::removeMember(const char* key) { + JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue, + "in Json::Value::removeMember(): requires objectValue"); + if (type_ == nullValue) + return null; +#ifndef JSON_VALUE_USE_INTERNAL_MAP + CZString actualKey(key, CZString::noDuplication); + ObjectValues::iterator it = value_.map_->find(actualKey); + if (it == value_.map_->end()) + return null; + Value old(it->second); + value_.map_->erase(it); + return old; +#else + Value* value = value_.map_->find(key); + if (value) { + Value old(*value); + value_.map_.remove(key); + return old; + } else { + return null; + } +#endif +} + +Value Value::removeMember(const std::string& key) { + return removeMember(key.c_str()); +} + +#ifdef JSON_USE_CPPTL +Value Value::get(const CppTL::ConstString& key, + const Value& defaultValue) const { + return get(key.c_str(), defaultValue); +} +#endif + +bool Value::isMember(const char* key) const { + const Value* value = &((*this)[key]); + return value != &null; +} + +bool Value::isMember(const std::string& key) const { + return isMember(key.c_str()); +} + +#ifdef JSON_USE_CPPTL +bool Value::isMember(const CppTL::ConstString& key) const { + return isMember(key.c_str()); +} +#endif + +Value::Members Value::getMemberNames() const { + JSON_ASSERT_MESSAGE( + type_ == nullValue || type_ == objectValue, + "in Json::Value::getMemberNames(), value must be objectValue"); + if (type_ == nullValue) + return Value::Members(); + Members members; + members.reserve(value_.map_->size()); +#ifndef JSON_VALUE_USE_INTERNAL_MAP + ObjectValues::const_iterator it = value_.map_->begin(); + ObjectValues::const_iterator itEnd = value_.map_->end(); + for (; it != itEnd; ++it) + members.push_back(std::string((*it).first.c_str())); +#else + ValueInternalMap::IteratorState it; + ValueInternalMap::IteratorState itEnd; + value_.map_->makeBeginIterator(it); + value_.map_->makeEndIterator(itEnd); + for (; !ValueInternalMap::equals(it, itEnd); ValueInternalMap::increment(it)) + members.push_back(std::string(ValueInternalMap::key(it))); +#endif + return members; +} +// +//# ifdef JSON_USE_CPPTL +// EnumMemberNames +// Value::enumMemberNames() const +//{ +// if ( type_ == objectValue ) +// { +// return CppTL::Enum::any( CppTL::Enum::transform( +// CppTL::Enum::keys( *(value_.map_), CppTL::Type() ), +// MemberNamesTransform() ) ); +// } +// return EnumMemberNames(); +//} +// +// +// EnumValues +// Value::enumValues() const +//{ +// if ( type_ == objectValue || type_ == arrayValue ) +// return CppTL::Enum::anyValues( *(value_.map_), +// CppTL::Type() ); +// return EnumValues(); +//} +// +//# endif + +static bool IsIntegral(double d) { + double integral_part; + return modf(d, &integral_part) == 0.0; +} + +bool Value::isNull() const { return type_ == nullValue; } + +bool Value::isBool() const { return type_ == booleanValue; } + +bool Value::isInt() const { + switch (type_) { + case intValue: + return value_.int_ >= minInt && value_.int_ <= maxInt; + case uintValue: + return value_.uint_ <= UInt(maxInt); + case realValue: + return value_.real_ >= minInt && value_.real_ <= maxInt && + IsIntegral(value_.real_); + default: + break; + } + return false; +} + +bool Value::isUInt() const { + switch (type_) { + case intValue: + return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt); + case uintValue: + return value_.uint_ <= maxUInt; + case realValue: + return value_.real_ >= 0 && value_.real_ <= maxUInt && + IsIntegral(value_.real_); + default: + break; + } + return false; +} + +bool Value::isInt64() const { +#if defined(JSON_HAS_INT64) + switch (type_) { + case intValue: + return true; + case uintValue: + return value_.uint_ <= UInt64(maxInt64); + case realValue: + // Note that maxInt64 (= 2^63 - 1) is not exactly representable as a + // double, so double(maxInt64) will be rounded up to 2^63. Therefore we + // require the value to be strictly less than the limit. + return value_.real_ >= double(minInt64) && + value_.real_ < double(maxInt64) && IsIntegral(value_.real_); + default: + break; + } +#endif // JSON_HAS_INT64 + return false; +} + +bool Value::isUInt64() const { +#if defined(JSON_HAS_INT64) + switch (type_) { + case intValue: + return value_.int_ >= 0; + case uintValue: + return true; + case realValue: + // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a + // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we + // require the value to be strictly less than the limit. + return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble && + IsIntegral(value_.real_); + default: + break; + } +#endif // JSON_HAS_INT64 + return false; +} + +bool Value::isIntegral() const { +#if defined(JSON_HAS_INT64) + return isInt64() || isUInt64(); +#else + return isInt() || isUInt(); +#endif +} + +bool Value::isDouble() const { return type_ == realValue || isIntegral(); } + +bool Value::isNumeric() const { return isIntegral() || isDouble(); } + +bool Value::isString() const { return type_ == stringValue; } + +bool Value::isArray() const { return type_ == arrayValue; } + +bool Value::isObject() const { return type_ == objectValue; } + +void Value::setComment(const char* comment, CommentPlacement placement) { + if (!comments_) + comments_ = new CommentInfo[numberOfCommentPlacement]; + comments_[placement].setComment(comment); +} + +void Value::setComment(const std::string& comment, CommentPlacement placement) { + setComment(comment.c_str(), placement); +} + +bool Value::hasComment(CommentPlacement placement) const { + return comments_ != 0 && comments_[placement].comment_ != 0; +} + +std::string Value::getComment(CommentPlacement placement) const { + if (hasComment(placement)) + return comments_[placement].comment_; + return ""; +} + +void Value::setOffsetStart(size_t start) { start_ = start; } + +void Value::setOffsetLimit(size_t limit) { limit_ = limit; } + +size_t Value::getOffsetStart() const { return start_; } + +size_t Value::getOffsetLimit() const { return limit_; } + +std::string Value::toStyledString() const { + StyledWriter writer; + return writer.write(*this); +} + +Value::const_iterator Value::begin() const { + switch (type_) { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeBeginIterator(it); + return const_iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeBeginIterator(it); + return const_iterator(it); + } + break; +#else + case arrayValue: + case objectValue: + if (value_.map_) + return const_iterator(value_.map_->begin()); + break; +#endif + default: + break; + } + return const_iterator(); +} + +Value::const_iterator Value::end() const { + switch (type_) { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeEndIterator(it); + return const_iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeEndIterator(it); + return const_iterator(it); + } + break; +#else + case arrayValue: + case objectValue: + if (value_.map_) + return const_iterator(value_.map_->end()); + break; +#endif + default: + break; + } + return const_iterator(); +} + +Value::iterator Value::begin() { + switch (type_) { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeBeginIterator(it); + return iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeBeginIterator(it); + return iterator(it); + } + break; +#else + case arrayValue: + case objectValue: + if (value_.map_) + return iterator(value_.map_->begin()); + break; +#endif + default: + break; + } + return iterator(); +} + +Value::iterator Value::end() { + switch (type_) { +#ifdef JSON_VALUE_USE_INTERNAL_MAP + case arrayValue: + if (value_.array_) { + ValueInternalArray::IteratorState it; + value_.array_->makeEndIterator(it); + return iterator(it); + } + break; + case objectValue: + if (value_.map_) { + ValueInternalMap::IteratorState it; + value_.map_->makeEndIterator(it); + return iterator(it); + } + break; +#else + case arrayValue: + case objectValue: + if (value_.map_) + return iterator(value_.map_->end()); + break; +#endif + default: + break; + } + return iterator(); +} + +// class PathArgument +// ////////////////////////////////////////////////////////////////// + +PathArgument::PathArgument() : key_(), index_(), kind_(kindNone) {} + +PathArgument::PathArgument(ArrayIndex index) + : key_(), index_(index), kind_(kindIndex) {} + +PathArgument::PathArgument(const char* key) + : key_(key), index_(), kind_(kindKey) {} + +PathArgument::PathArgument(const std::string& key) + : key_(key.c_str()), index_(), kind_(kindKey) {} + +// class Path +// ////////////////////////////////////////////////////////////////// + +Path::Path(const std::string& path, + const PathArgument& a1, + const PathArgument& a2, + const PathArgument& a3, + const PathArgument& a4, + const PathArgument& a5) { + InArgs in; + in.push_back(&a1); + in.push_back(&a2); + in.push_back(&a3); + in.push_back(&a4); + in.push_back(&a5); + makePath(path, in); +} + +void Path::makePath(const std::string& path, const InArgs& in) { + const char* current = path.c_str(); + const char* end = current + path.length(); + InArgs::const_iterator itInArg = in.begin(); + while (current != end) { + if (*current == '[') { + ++current; + if (*current == '%') + addPathInArg(path, in, itInArg, PathArgument::kindIndex); + else { + ArrayIndex index = 0; + for (; current != end && *current >= '0' && *current <= '9'; ++current) + index = index * 10 + ArrayIndex(*current - '0'); + args_.push_back(index); + } + if (current == end || *current++ != ']') + invalidPath(path, int(current - path.c_str())); + } else if (*current == '%') { + addPathInArg(path, in, itInArg, PathArgument::kindKey); + ++current; + } else if (*current == '.') { + ++current; + } else { + const char* beginName = current; + while (current != end && !strchr("[.", *current)) + ++current; + args_.push_back(std::string(beginName, current)); + } + } +} + +void Path::addPathInArg(const std::string& /*path*/, + const InArgs& in, + InArgs::const_iterator& itInArg, + PathArgument::Kind kind) { + if (itInArg == in.end()) { + // Error: missing argument %d + } else if ((*itInArg)->kind_ != kind) { + // Error: bad argument type + } else { + args_.push_back(**itInArg); + } +} + +void Path::invalidPath(const std::string& /*path*/, int /*location*/) { + // Error: invalid path. +} + +const Value& Path::resolve(const Value& root) const { + const Value* node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument& arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray() || !node->isValidIndex(arg.index_)) { + // Error: unable to resolve path (array value expected at position... + } + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) { + // Error: unable to resolve path (object value expected at position...) + } + node = &((*node)[arg.key_]); + if (node == &Value::null) { + // Error: unable to resolve path (object has no member named '' at + // position...) + } + } + } + return *node; +} + +Value Path::resolve(const Value& root, const Value& defaultValue) const { + const Value* node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument& arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray() || !node->isValidIndex(arg.index_)) + return defaultValue; + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) + return defaultValue; + node = &((*node)[arg.key_]); + if (node == &Value::null) + return defaultValue; + } + } + return *node; +} + +Value& Path::make(Value& root) const { + Value* node = &root; + for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) { + const PathArgument& arg = *it; + if (arg.kind_ == PathArgument::kindIndex) { + if (!node->isArray()) { + // Error: node is not an array at position ... + } + node = &((*node)[arg.index_]); + } else if (arg.kind_ == PathArgument::kindKey) { + if (!node->isObject()) { + // Error: node is not an object at position... + } + node = &((*node)[arg.key_]); + } + } + return *node; +} + +} // namespace Json diff --git a/src/lib_json/json_valueiterator.inl b/src/lib_json/json_valueiterator.inl new file mode 100644 index 0000000..a9f7df6 --- /dev/null +++ b/src/lib_json/json_valueiterator.inl @@ -0,0 +1,241 @@ +// Copyright 2007-2010 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +// included by json_value.cpp + +namespace Json { + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueIteratorBase +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueIteratorBase::ValueIteratorBase() +#ifndef JSON_VALUE_USE_INTERNAL_MAP + : current_(), isNull_(true) { +} +#else + : isArray_(true), isNull_(true) { + iterator_.array_ = ValueInternalArray::IteratorState(); +} +#endif + +#ifndef JSON_VALUE_USE_INTERNAL_MAP +ValueIteratorBase::ValueIteratorBase( + const Value::ObjectValues::iterator& current) + : current_(current), isNull_(false) {} +#else +ValueIteratorBase::ValueIteratorBase( + const ValueInternalArray::IteratorState& state) + : isArray_(true) { + iterator_.array_ = state; +} + +ValueIteratorBase::ValueIteratorBase( + const ValueInternalMap::IteratorState& state) + : isArray_(false) { + iterator_.map_ = state; +} +#endif + +Value& ValueIteratorBase::deref() const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + return current_->second; +#else + if (isArray_) + return ValueInternalArray::dereference(iterator_.array_); + return ValueInternalMap::value(iterator_.map_); +#endif +} + +void ValueIteratorBase::increment() { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + ++current_; +#else + if (isArray_) + ValueInternalArray::increment(iterator_.array_); + ValueInternalMap::increment(iterator_.map_); +#endif +} + +void ValueIteratorBase::decrement() { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + --current_; +#else + if (isArray_) + ValueInternalArray::decrement(iterator_.array_); + ValueInternalMap::decrement(iterator_.map_); +#endif +} + +ValueIteratorBase::difference_type +ValueIteratorBase::computeDistance(const SelfType& other) const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP +#ifdef JSON_USE_CPPTL_SMALLMAP + return current_ - other.current_; +#else + // Iterator for null value are initialized using the default + // constructor, which initialize current_ to the default + // std::map::iterator. As begin() and end() are two instance + // of the default std::map::iterator, they can not be compared. + // To allow this, we handle this comparison specifically. + if (isNull_ && other.isNull_) { + return 0; + } + + // Usage of std::distance is not portable (does not compile with Sun Studio 12 + // RogueWave STL, + // which is the one used by default). + // Using a portable hand-made version for non random iterator instead: + // return difference_type( std::distance( current_, other.current_ ) ); + difference_type myDistance = 0; + for (Value::ObjectValues::iterator it = current_; it != other.current_; + ++it) { + ++myDistance; + } + return myDistance; +#endif +#else + if (isArray_) + return ValueInternalArray::distance(iterator_.array_, + other.iterator_.array_); + return ValueInternalMap::distance(iterator_.map_, other.iterator_.map_); +#endif +} + +bool ValueIteratorBase::isEqual(const SelfType& other) const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + if (isNull_) { + return other.isNull_; + } + return current_ == other.current_; +#else + if (isArray_) + return ValueInternalArray::equals(iterator_.array_, other.iterator_.array_); + return ValueInternalMap::equals(iterator_.map_, other.iterator_.map_); +#endif +} + +void ValueIteratorBase::copy(const SelfType& other) { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + current_ = other.current_; + isNull_ = other.isNull_; +#else + if (isArray_) + iterator_.array_ = other.iterator_.array_; + iterator_.map_ = other.iterator_.map_; +#endif +} + +Value ValueIteratorBase::key() const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + const Value::CZString czstring = (*current_).first; + if (czstring.c_str()) { + if (czstring.isStaticString()) + return Value(StaticString(czstring.c_str())); + return Value(czstring.c_str()); + } + return Value(czstring.index()); +#else + if (isArray_) + return Value(ValueInternalArray::indexOf(iterator_.array_)); + bool isStatic; + const char* memberName = ValueInternalMap::key(iterator_.map_, isStatic); + if (isStatic) + return Value(StaticString(memberName)); + return Value(memberName); +#endif +} + +UInt ValueIteratorBase::index() const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + const Value::CZString czstring = (*current_).first; + if (!czstring.c_str()) + return czstring.index(); + return Value::UInt(-1); +#else + if (isArray_) + return Value::UInt(ValueInternalArray::indexOf(iterator_.array_)); + return Value::UInt(-1); +#endif +} + +const char* ValueIteratorBase::memberName() const { +#ifndef JSON_VALUE_USE_INTERNAL_MAP + const char* name = (*current_).first.c_str(); + return name ? name : ""; +#else + if (!isArray_) + return ValueInternalMap::key(iterator_.map_); + return ""; +#endif +} + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueConstIterator +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueConstIterator::ValueConstIterator() {} + +#ifndef JSON_VALUE_USE_INTERNAL_MAP +ValueConstIterator::ValueConstIterator( + const Value::ObjectValues::iterator& current) + : ValueIteratorBase(current) {} +#else +ValueConstIterator::ValueConstIterator( + const ValueInternalArray::IteratorState& state) + : ValueIteratorBase(state) {} + +ValueConstIterator::ValueConstIterator( + const ValueInternalMap::IteratorState& state) + : ValueIteratorBase(state) {} +#endif + +ValueConstIterator& ValueConstIterator:: +operator=(const ValueIteratorBase& other) { + copy(other); + return *this; +} + +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// class ValueIterator +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// +// ////////////////////////////////////////////////////////////////// + +ValueIterator::ValueIterator() {} + +#ifndef JSON_VALUE_USE_INTERNAL_MAP +ValueIterator::ValueIterator(const Value::ObjectValues::iterator& current) + : ValueIteratorBase(current) {} +#else +ValueIterator::ValueIterator(const ValueInternalArray::IteratorState& state) + : ValueIteratorBase(state) {} + +ValueIterator::ValueIterator(const ValueInternalMap::IteratorState& state) + : ValueIteratorBase(state) {} +#endif + +ValueIterator::ValueIterator(const ValueConstIterator& other) + : ValueIteratorBase(other) {} + +ValueIterator::ValueIterator(const ValueIterator& other) + : ValueIteratorBase(other) {} + +ValueIterator& ValueIterator::operator=(const SelfType& other) { + copy(other); + return *this; +} + +} // namespace Json diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp new file mode 100644 index 0000000..89964ea --- /dev/null +++ b/src/lib_json/json_writer.cpp @@ -0,0 +1,690 @@ +// Copyright 2011 Baptiste Lepilleur +// Distributed under MIT license, or public domain if desired and +// recognized in your jurisdiction. +// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE + +#if !defined(JSON_IS_AMALGAMATION) +#include +#include "json_tool.h" +#endif // if !defined(JSON_IS_AMALGAMATION) +#include +#include +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below +#include +#define isfinite _finite +#define snprintf _snprintf +#endif + +#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 +// Disable warning about strdup being deprecated. +#pragma warning(disable : 4996) +#endif + +namespace Json { + +static bool containsControlCharacter(const char* str) { + while (*str) { + if (isControlCharacter(*(str++))) + return true; + } + return false; +} + +std::string valueToString(LargestInt value) { + UIntToStringBuffer buffer; + char* current = buffer + sizeof(buffer); + bool isNegative = value < 0; + if (isNegative) + value = -value; + uintToString(LargestUInt(value), current); + if (isNegative) + *--current = '-'; + assert(current >= buffer); + return current; +} + +std::string valueToString(LargestUInt value) { + UIntToStringBuffer buffer; + char* current = buffer + sizeof(buffer); + uintToString(value, current); + assert(current >= buffer); + return current; +} + +#if defined(JSON_HAS_INT64) + +std::string valueToString(Int value) { + return valueToString(LargestInt(value)); +} + +std::string valueToString(UInt value) { + return valueToString(LargestUInt(value)); +} + +#endif // # if defined(JSON_HAS_INT64) + +std::string valueToString(double value) { + // Allocate a buffer that is more than large enough to store the 16 digits of + // precision requested below. + char buffer[32]; + int len = -1; + +// Print into the buffer. We need not request the alternative representation +// that always has a decimal point because JSON doesn't distingish the +// concepts of reals and integers. +#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__) // Use secure version with + // visual studio 2005 to + // avoid warning. +#if defined(WINCE) + len = _snprintf(buffer, sizeof(buffer), "%.16g", value); +#else + len = sprintf_s(buffer, sizeof(buffer), "%.16g", value); +#endif +#else + if (isfinite(value)) { + len = snprintf(buffer, sizeof(buffer), "%.16g", value); + } else { + // IEEE standard states that NaN values will not compare to themselves + if (value != value) { + len = snprintf(buffer, sizeof(buffer), "null"); + } else if (value < 0) { + len = snprintf(buffer, sizeof(buffer), "-1e+9999"); + } else { + len = snprintf(buffer, sizeof(buffer), "1e+9999"); + } + // For those, we do not need to call fixNumLoc, but it is fast. + } +#endif + assert(len >= 0); + fixNumericLocale(buffer, buffer + len); + return buffer; +} + +std::string valueToString(bool value) { return value ? "true" : "false"; } + +std::string valueToQuotedString(const char* value) { + if (value == NULL) + return ""; + // Not sure how to handle unicode... + if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL && + !containsControlCharacter(value)) + return std::string("\"") + value + "\""; + // We have to walk value and escape any special characters. + // Appending to std::string is not efficient, but this should be rare. + // (Note: forward slashes are *not* rare, but I am not escaping them.) + std::string::size_type maxsize = + strlen(value) * 2 + 3; // allescaped+quotes+NULL + std::string result; + result.reserve(maxsize); // to avoid lots of mallocs + result += "\""; + for (const char* c = value; *c != 0; ++c) { + switch (*c) { + case '\"': + result += "\\\""; + break; + case '\\': + result += "\\\\"; + break; + case '\b': + result += "\\b"; + break; + case '\f': + result += "\\f"; + break; + case '\n': + result += "\\n"; + break; + case '\r': + result += "\\r"; + break; + case '\t': + result += "\\t"; + break; + // case '/': + // Even though \/ is considered a legal escape in JSON, a bare + // slash is also legal, so I see no reason to escape it. + // (I hope I am not misunderstanding something. + // blep notes: actually escaping \/ may be useful in javascript to avoid (*c); + result += oss.str(); + } else { + result += *c; + } + break; + } + } + result += "\""; + return result; +} + +// Class Writer +// ////////////////////////////////////////////////////////////////// +Writer::~Writer() {} + +// Class FastWriter +// ////////////////////////////////////////////////////////////////// + +FastWriter::FastWriter() + : yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false), + omitEndingLineFeed_(false) {} + +void FastWriter::enableYAMLCompatibility() { yamlCompatiblityEnabled_ = true; } + +void FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; } + +void FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; } + +std::string FastWriter::write(const Value& root) { + document_ = ""; + writeValue(root); + if (!omitEndingLineFeed_) + document_ += "\n"; + return document_; +} + +void FastWriter::writeValue(const Value& value) { + switch (value.type()) { + case nullValue: + if (!dropNullPlaceholders_) + document_ += "null"; + break; + case intValue: + document_ += valueToString(value.asLargestInt()); + break; + case uintValue: + document_ += valueToString(value.asLargestUInt()); + break; + case realValue: + document_ += valueToString(value.asDouble()); + break; + case stringValue: + document_ += valueToQuotedString(value.asCString()); + break; + case booleanValue: + document_ += valueToString(value.asBool()); + break; + case arrayValue: { + document_ += '['; + int size = value.size(); + for (int index = 0; index < size; ++index) { + if (index > 0) + document_ += ','; + writeValue(value[index]); + } + document_ += ']'; + } break; + case objectValue: { + Value::Members members(value.getMemberNames()); + document_ += '{'; + for (Value::Members::iterator it = members.begin(); it != members.end(); + ++it) { + const std::string& name = *it; + if (it != members.begin()) + document_ += ','; + document_ += valueToQuotedString(name.c_str()); + document_ += yamlCompatiblityEnabled_ ? ": " : ":"; + writeValue(value[name]); + } + document_ += '}'; + } break; + } +} + +// Class StyledWriter +// ////////////////////////////////////////////////////////////////// + +StyledWriter::StyledWriter() + : rightMargin_(74), indentSize_(3), addChildValues_() {} + +std::string StyledWriter::write(const Value& root) { + document_ = ""; + addChildValues_ = false; + indentString_ = ""; + writeCommentBeforeValue(root); + writeValue(root); + writeCommentAfterValueOnSameLine(root); + document_ += "\n"; + return document_; +} + +void StyledWriter::writeValue(const Value& value) { + switch (value.type()) { + case nullValue: + pushValue("null"); + break; + case intValue: + pushValue(valueToString(value.asLargestInt())); + break; + case uintValue: + pushValue(valueToString(value.asLargestUInt())); + break; + case realValue: + pushValue(valueToString(value.asDouble())); + break; + case stringValue: + pushValue(valueToQuotedString(value.asCString())); + break; + case booleanValue: + pushValue(valueToString(value.asBool())); + break; + case arrayValue: + writeArrayValue(value); + break; + case objectValue: { + Value::Members members(value.getMemberNames()); + if (members.empty()) + pushValue("{}"); + else { + writeWithIndent("{"); + indent(); + Value::Members::iterator it = members.begin(); + for (;;) { + const std::string& name = *it; + const Value& childValue = value[name]; + writeCommentBeforeValue(childValue); + writeWithIndent(valueToQuotedString(name.c_str())); + document_ += " : "; + writeValue(childValue); + if (++it == members.end()) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + document_ += ','; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("}"); + } + } break; + } +} + +void StyledWriter::writeArrayValue(const Value& value) { + unsigned size = value.size(); + if (size == 0) + pushValue("[]"); + else { + bool isArrayMultiLine = isMultineArray(value); + if (isArrayMultiLine) { + writeWithIndent("["); + indent(); + bool hasChildValue = !childValues_.empty(); + unsigned index = 0; + for (;;) { + const Value& childValue = value[index]; + writeCommentBeforeValue(childValue); + if (hasChildValue) + writeWithIndent(childValues_[index]); + else { + writeIndent(); + writeValue(childValue); + } + if (++index == size) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + document_ += ','; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("]"); + } else // output on a single line + { + assert(childValues_.size() == size); + document_ += "[ "; + for (unsigned index = 0; index < size; ++index) { + if (index > 0) + document_ += ", "; + document_ += childValues_[index]; + } + document_ += " ]"; + } + } +} + +bool StyledWriter::isMultineArray(const Value& value) { + int size = value.size(); + bool isMultiLine = size * 3 >= rightMargin_; + childValues_.clear(); + for (int index = 0; index < size && !isMultiLine; ++index) { + const Value& childValue = value[index]; + isMultiLine = + isMultiLine || ((childValue.isArray() || childValue.isObject()) && + childValue.size() > 0); + } + if (!isMultiLine) // check if line length > max line length + { + childValues_.reserve(size); + addChildValues_ = true; + int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' + for (int index = 0; index < size; ++index) { + writeValue(value[index]); + lineLength += int(childValues_[index].length()); + } + addChildValues_ = false; + isMultiLine = isMultiLine || lineLength >= rightMargin_; + } + return isMultiLine; +} + +void StyledWriter::pushValue(const std::string& value) { + if (addChildValues_) + childValues_.push_back(value); + else + document_ += value; +} + +void StyledWriter::writeIndent() { + if (!document_.empty()) { + char last = document_[document_.length() - 1]; + if (last == ' ') // already indented + return; + if (last != '\n') // Comments may add new-line + document_ += '\n'; + } + document_ += indentString_; +} + +void StyledWriter::writeWithIndent(const std::string& value) { + writeIndent(); + document_ += value; +} + +void StyledWriter::indent() { indentString_ += std::string(indentSize_, ' '); } + +void StyledWriter::unindent() { + assert(int(indentString_.size()) >= indentSize_); + indentString_.resize(indentString_.size() - indentSize_); +} + +void StyledWriter::writeCommentBeforeValue(const Value& root) { + if (!root.hasComment(commentBefore)) + return; + + document_ += "\n"; + writeIndent(); + std::string normalizedComment = normalizeEOL(root.getComment(commentBefore)); + std::string::const_iterator iter = normalizedComment.begin(); + while (iter != normalizedComment.end()) { + document_ += *iter; + if (*iter == '\n' && *(iter + 1) == '/') + writeIndent(); + ++iter; + } + + // Comments are stripped of newlines, so add one here + document_ += "\n"; +} + +void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { + if (root.hasComment(commentAfterOnSameLine)) + document_ += " " + normalizeEOL(root.getComment(commentAfterOnSameLine)); + + if (root.hasComment(commentAfter)) { + document_ += "\n"; + document_ += normalizeEOL(root.getComment(commentAfter)); + document_ += "\n"; + } +} + +bool StyledWriter::hasCommentForValue(const Value& value) { + return value.hasComment(commentBefore) || + value.hasComment(commentAfterOnSameLine) || + value.hasComment(commentAfter); +} + +std::string StyledWriter::normalizeEOL(const std::string& text) { + std::string normalized; + normalized.reserve(text.length()); + const char* begin = text.c_str(); + const char* end = begin + text.length(); + const char* current = begin; + while (current != end) { + char c = *current++; + if (c == '\r') // mac or dos EOL + { + if (*current == '\n') // convert dos EOL + ++current; + normalized += '\n'; + } else // handle unix EOL & other char + normalized += c; + } + return normalized; +} + +// Class StyledStreamWriter +// ////////////////////////////////////////////////////////////////// + +StyledStreamWriter::StyledStreamWriter(std::string indentation) + : document_(NULL), rightMargin_(74), indentation_(indentation), + addChildValues_() {} + +void StyledStreamWriter::write(std::ostream& out, const Value& root) { + document_ = &out; + addChildValues_ = false; + indentString_ = ""; + writeCommentBeforeValue(root); + writeValue(root); + writeCommentAfterValueOnSameLine(root); + *document_ << "\n"; + document_ = NULL; // Forget the stream, for safety. +} + +void StyledStreamWriter::writeValue(const Value& value) { + switch (value.type()) { + case nullValue: + pushValue("null"); + break; + case intValue: + pushValue(valueToString(value.asLargestInt())); + break; + case uintValue: + pushValue(valueToString(value.asLargestUInt())); + break; + case realValue: + pushValue(valueToString(value.asDouble())); + break; + case stringValue: + pushValue(valueToQuotedString(value.asCString())); + break; + case booleanValue: + pushValue(valueToString(value.asBool())); + break; + case arrayValue: + writeArrayValue(value); + break; + case objectValue: { + Value::Members members(value.getMemberNames()); + if (members.empty()) + pushValue("{}"); + else { + writeWithIndent("{"); + indent(); + Value::Members::iterator it = members.begin(); + for (;;) { + const std::string& name = *it; + const Value& childValue = value[name]; + writeCommentBeforeValue(childValue); + writeWithIndent(valueToQuotedString(name.c_str())); + *document_ << " : "; + writeValue(childValue); + if (++it == members.end()) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + *document_ << ","; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("}"); + } + } break; + } +} + +void StyledStreamWriter::writeArrayValue(const Value& value) { + unsigned size = value.size(); + if (size == 0) + pushValue("[]"); + else { + bool isArrayMultiLine = isMultineArray(value); + if (isArrayMultiLine) { + writeWithIndent("["); + indent(); + bool hasChildValue = !childValues_.empty(); + unsigned index = 0; + for (;;) { + const Value& childValue = value[index]; + writeCommentBeforeValue(childValue); + if (hasChildValue) + writeWithIndent(childValues_[index]); + else { + writeIndent(); + writeValue(childValue); + } + if (++index == size) { + writeCommentAfterValueOnSameLine(childValue); + break; + } + *document_ << ","; + writeCommentAfterValueOnSameLine(childValue); + } + unindent(); + writeWithIndent("]"); + } else // output on a single line + { + assert(childValues_.size() == size); + *document_ << "[ "; + for (unsigned index = 0; index < size; ++index) { + if (index > 0) + *document_ << ", "; + *document_ << childValues_[index]; + } + *document_ << " ]"; + } + } +} + +bool StyledStreamWriter::isMultineArray(const Value& value) { + int size = value.size(); + bool isMultiLine = size * 3 >= rightMargin_; + childValues_.clear(); + for (int index = 0; index < size && !isMultiLine; ++index) { + const Value& childValue = value[index]; + isMultiLine = + isMultiLine || ((childValue.isArray() || childValue.isObject()) && + childValue.size() > 0); + } + if (!isMultiLine) // check if line length > max line length + { + childValues_.reserve(size); + addChildValues_ = true; + int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]' + for (int index = 0; index < size; ++index) { + writeValue(value[index]); + lineLength += int(childValues_[index].length()); + } + addChildValues_ = false; + isMultiLine = isMultiLine || lineLength >= rightMargin_; + } + return isMultiLine; +} + +void StyledStreamWriter::pushValue(const std::string& value) { + if (addChildValues_) + childValues_.push_back(value); + else + *document_ << value; +} + +void StyledStreamWriter::writeIndent() { + /* + Some comments in this method would have been nice. ;-) + + if ( !document_.empty() ) + { + char last = document_[document_.length()-1]; + if ( last == ' ' ) // already indented + return; + if ( last != '\n' ) // Comments may add new-line + *document_ << '\n'; + } + */ + *document_ << '\n' << indentString_; +} + +void StyledStreamWriter::writeWithIndent(const std::string& value) { + writeIndent(); + *document_ << value; +} + +void StyledStreamWriter::indent() { indentString_ += indentation_; } + +void StyledStreamWriter::unindent() { + assert(indentString_.size() >= indentation_.size()); + indentString_.resize(indentString_.size() - indentation_.size()); +} + +void StyledStreamWriter::writeCommentBeforeValue(const Value& root) { + if (!root.hasComment(commentBefore)) + return; + *document_ << normalizeEOL(root.getComment(commentBefore)); + *document_ << "\n"; +} + +void StyledStreamWriter::writeCommentAfterValueOnSameLine(const Value& root) { + if (root.hasComment(commentAfterOnSameLine)) + *document_ << " " + normalizeEOL(root.getComment(commentAfterOnSameLine)); + + if (root.hasComment(commentAfter)) { + *document_ << "\n"; + *document_ << normalizeEOL(root.getComment(commentAfter)); + *document_ << "\n"; + } +} + +bool StyledStreamWriter::hasCommentForValue(const Value& value) { + return value.hasComment(commentBefore) || + value.hasComment(commentAfterOnSameLine) || + value.hasComment(commentAfter); +} + +std::string StyledStreamWriter::normalizeEOL(const std::string& text) { + std::string normalized; + normalized.reserve(text.length()); + const char* begin = text.c_str(); + const char* end = begin + text.length(); + const char* current = begin; + while (current != end) { + char c = *current++; + if (c == '\r') // mac or dos EOL + { + if (*current == '\n') // convert dos EOL + ++current; + normalized += '\n'; + } else // handle unix EOL & other char + normalized += c; + } + return normalized; +} + +std::ostream& operator<<(std::ostream& sout, const Value& root) { + Json::StyledStreamWriter writer; + writer.write(sout, root); + return sout; +} + +} // namespace Json http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32fd56b066c28758e31ae97d4b16216b3633a843 commit 32fd56b066c28758e31ae97d4b16216b3633a843 Author: Brad King AuthorDate: Tue Jan 13 10:36:19 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 10:36:19 2015 -0500 jsoncpp: Add .gitattributes to skip whitespace checks diff --git a/Utilities/cmjsoncpp/.gitattributes b/Utilities/cmjsoncpp/.gitattributes new file mode 100644 index 0000000..562b12e --- /dev/null +++ b/Utilities/cmjsoncpp/.gitattributes @@ -0,0 +1 @@ +* -whitespace ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 14:52:34 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 14:52:34 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1846-gbf3deea Message-ID: <20150113195234.9AA3649AD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via bf3deea7a7a709877500743304f7185789234877 (commit) via dc17dd894a3f21ffbd9bcb85a86aa42ee7879ebf (commit) from 3352c05b873c03505d877acf7dbc922319e1f6a2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf3deea7a7a709877500743304f7185789234877 commit bf3deea7a7a709877500743304f7185789234877 Merge: 3352c05 dc17dd8 Author: Brad King AuthorDate: Tue Jan 13 14:52:33 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 14:52:33 2015 -0500 Merge topic 'Apple-compiler-selection' into next dc17dd89 Apple: Resolve compiler in /usr/bin to that reported by Xcode http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc17dd894a3f21ffbd9bcb85a86aa42ee7879ebf commit dc17dd894a3f21ffbd9bcb85a86aa42ee7879ebf Author: Stephen Kelly AuthorDate: Sat Jan 3 17:36:34 2015 +0100 Commit: Stephen Kelly CommitDate: Mon Jan 12 20:13:31 2015 +0100 Apple: Resolve compiler in /usr/bin to that reported by Xcode The compiler in the PATH on mac is a stub for a different delegate depending on the environment. Rather than requiring xcode-select to change the used Xcode globally, users should be able to choose the compiler per-session. That is possible with the DEVELOPER_DIR environment variable. However, the environment can change between running CMake and invoking the build. In such cases, CMake prefers to record the relevant paths from the environment and use them when invoking the build. That is not currently done for the compilers on APPLE, so the compiler used is not the one reported when running cmake: $ DEVELOPER_DIR=/Applications/Xcode2.app/Contents/Developer/ cc --version Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix $ DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ cc --version Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix Update that now by querying Xcode for the correct compiler path if the compiler located by ordinary means is located in /usr/bin. It is expected that compilers installed manually or through a package manager will not be found there but will be in /usr/local instead. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 0ab3af6..7b21dcf 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -71,7 +71,9 @@ macro(_cmake_find_compiler lang) unset(_languages) # Look for a make tool provided by Xcode - if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE) + if(CMAKE_HOST_APPLE + AND (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" + OR CMAKE_${lang}_COMPILER MATCHES "^/usr/bin")) foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) execute_process(COMMAND xcrun --find ${comp} OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 15:17:41 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 15:17:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1848-gca12a97 Message-ID: <20150113201741.9B7BAA895E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ca12a9763d13b8a2ba6dd0cbbff15a277654f120 (commit) via 4c3f5201d75267e4f24d7dd61308457041d3a4a3 (commit) from bf3deea7a7a709877500743304f7185789234877 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca12a9763d13b8a2ba6dd0cbbff15a277654f120 commit ca12a9763d13b8a2ba6dd0cbbff15a277654f120 Merge: bf3deea 4c3f520 Author: Brad King AuthorDate: Tue Jan 13 15:17:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 15:17:40 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 4c3f5201 jsoncpp: Add missing assert before strcmp in json_value.cpp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c3f5201d75267e4f24d7dd61308457041d3a4a3 commit 4c3f5201d75267e4f24d7dd61308457041d3a4a3 Author: Brad King AuthorDate: Tue Jan 13 15:08:32 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 15:16:01 2015 -0500 jsoncpp: Add missing assert before strcmp in json_value.cpp The strcmp function does not allow NULL pointers, so add an assert to tell Clang scan-build that the code does not expect a NULL pointer. diff --git a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp index b73deac..aabc957 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp @@ -195,14 +195,18 @@ Value::CZString& Value::CZString::operator=(CZString other) { } bool Value::CZString::operator<(const CZString& other) const { - if (cstr_) + if (cstr_) { + assert(other.cstr_); return strcmp(cstr_, other.cstr_) < 0; + } return index_ < other.index_; } bool Value::CZString::operator==(const CZString& other) const { - if (cstr_) + if (cstr_) { + assert(other.cstr_); return strcmp(cstr_, other.cstr_) == 0; + } return index_ == other.index_; } ----------------------------------------------------------------------- Summary of changes: Utilities/cmjsoncpp/src/lib_json/json_value.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 16:01:31 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 16:01:31 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1850-g75b8f59 Message-ID: <20150113210131.3FB90A80AA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 75b8f5923866c9ce9f47a35574dcdd332f24b9dc (commit) via 06bc75835a2fee9dadd6a2c0c0988f97c3316324 (commit) from ca12a9763d13b8a2ba6dd0cbbff15a277654f120 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=75b8f5923866c9ce9f47a35574dcdd332f24b9dc commit 75b8f5923866c9ce9f47a35574dcdd332f24b9dc Merge: ca12a97 06bc758 Author: Brad King AuthorDate: Tue Jan 13 16:01:27 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 16:01:27 2015 -0500 Merge topic 'extend-COMPILE_FEATURES-test' into next 06bc7583 Revert "Features: Extend the tests for the COMPILE_FEATURES genex." diff --cc Tests/CompileFeatures/CMakeLists.txt index 58a5f2a,9fb8d1b..f0a4e74 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -273,9 -168,5 +218,6 @@@ if (CMAKE_CXX_COMPILE_FEATURES target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ - HAVE_THREAD_LOCAL=$ - HAVE_FINAL=$ - HAVE_THREAD_LOCAL_AND_FINAL=$ ) + endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06bc75835a2fee9dadd6a2c0c0988f97c3316324 commit 06bc75835a2fee9dadd6a2c0c0988f97c3316324 Author: Brad King AuthorDate: Tue Jan 13 16:00:51 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 16:00:51 2015 -0500 Revert "Features: Extend the tests for the COMPILE_FEATURES genex." This reverts commit 4eb34e13fe4c24ac34330b1926fa045078389070. The MSVC and AppleClang feature knowledge does not match this test yet. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 80f16d6..9fb8d1b 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -146,64 +146,12 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_definitions(-DEXPECT_OVERRIDE_CONTROL=1) - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) - add_definitions( - -DEXPECT_THREAD_LOCAL=1 - -DEXPECT_FINAL=1 - -DEXPECT_THREAD_LOCAL_AND_FINAL=1 - ) - elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) - add_definitions( - -DEXPECT_THREAD_LOCAL=0 - -DEXPECT_FINAL=1 - -DEXPECT_THREAD_LOCAL_AND_FINAL=0 - ) - else() - add_definitions( - -DEXPECT_THREAD_LOCAL=0 - -DEXPECT_FINAL=0 - -DEXPECT_THREAD_LOCAL_AND_FINAL=0 - ) - endif() - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" - OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" ) - add_definitions( - -DEXPECT_THREAD_LOCAL=1 - -DEXPECT_FINAL=1 - -DEXPECT_THREAD_LOCAL_AND_FINAL=1 - ) - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 1900) - add_definitions( - -DEXPECT_THREAD_LOCAL=1 - -DEXPECT_FINAL=1 - -DEXPECT_THREAD_LOCAL_AND_FINAL=1 - ) - elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 1700) - add_definitions( - -DEXPECT_THREAD_LOCAL=0 - -DEXPECT_FINAL=1 - -DEXPECT_THREAD_LOCAL_AND_FINAL=0 - ) - else() - add_definitions( - -DEXPECT_THREAD_LOCAL=0 - -DEXPECT_FINAL=0 - -DEXPECT_THREAD_LOCAL_AND_FINAL=0 - ) - endif() - endif() - add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ - HAVE_THREAD_LOCAL=$ - HAVE_FINAL=$ - HAVE_THREAD_LOCAL_AND_FINAL=$ ) add_executable(CompileFeaturesGenex2 genex_test.cpp) @@ -211,9 +159,6 @@ if (CMAKE_CXX_COMPILE_FEATURES) target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ - HAVE_THREAD_LOCAL=$ - HAVE_FINAL=$ - HAVE_THREAD_LOCAL_AND_FINAL=$ ) add_library(static_assert_iface INTERFACE) @@ -223,8 +168,5 @@ if (CMAKE_CXX_COMPILE_FEATURES) target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ - HAVE_THREAD_LOCAL=$ - HAVE_FINAL=$ - HAVE_THREAD_LOCAL_AND_FINAL=$ ) endif() diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index c56d764..4412569 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -21,36 +21,6 @@ struct B : A #error "Expect nullptr feature" #else -#if !HAVE_THREAD_LOCAL -# if EXPECT_THREAD_LOCAL -# error Expect cxx_thread_local support -# endif -#else -# if !EXPECT_THREAD_LOCAL -# error Expect no cxx_thread_local support -# endif -#endif - -#if !HAVE_FINAL -# if EXPECT_FINAL -# error Expect cxx_final support -# endif -#else -# if !EXPECT_FINAL -# error Expect no cxx_final support -# endif -#endif - -#if !HAVE_THREAD_LOCAL_AND_FINAL -# if EXPECT_THREAD_LOCAL_AND_FINAL -# error Expect cxx_thread_local and cxx_final support -# endif -#else -# if !EXPECT_THREAD_LOCAL_AND_FINAL -# error Expect no combined cxx_thread_local and cxx_final support -# endif -#endif - const char* getString() { return nullptr; ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 58 ---------------------------------- Tests/CompileFeatures/genex_test.cpp | 30 ------------------ 2 files changed, 88 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 16:14:41 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 16:14:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-738-ge4fd66b Message-ID: <20150113211441.953ED2201@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e4fd66b1922c10e6487362c8921669925742309a (commit) via ef1f4f47823594adee3da62807f5434685ded3d8 (commit) via ddca664a08a1908a617657d65aaf8c442f2af793 (commit) via f3ad57d25e293f84205d74b40744301f65f472e8 (commit) via 1f41ec2ac21e75efc91bea0a786f9b2fb69e67a0 (commit) from d61c6df2fa9161d784a71b05e584cb1e944a182a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 16:14:41 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 16:14:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1857-g5370578 Message-ID: <20150113211441.C1E3F2202@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5370578b13372d26867d41c5e372af4f52a0167a (commit) via e4fd66b1922c10e6487362c8921669925742309a (commit) via d61c6df2fa9161d784a71b05e584cb1e944a182a (commit) via ef1f4f47823594adee3da62807f5434685ded3d8 (commit) via ddca664a08a1908a617657d65aaf8c442f2af793 (commit) via f3ad57d25e293f84205d74b40744301f65f472e8 (commit) via 1f41ec2ac21e75efc91bea0a786f9b2fb69e67a0 (commit) from 75b8f5923866c9ce9f47a35574dcdd332f24b9dc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5370578b13372d26867d41c5e372af4f52a0167a commit 5370578b13372d26867d41c5e372af4f52a0167a Merge: 75b8f59 e4fd66b Author: Brad King AuthorDate: Tue Jan 13 16:13:53 2015 -0500 Commit: Brad King CommitDate: Tue Jan 13 16:13:53 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 13 16:14:42 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 13 Jan 2015 16:14:42 -0500 (EST) Subject: [Cmake-commits] CMake branch, release, updated. v3.1.0-44-gef1f4f4 Message-ID: <20150113211442.08B552203@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via ef1f4f47823594adee3da62807f5434685ded3d8 (commit) via 3515b0a40d0c96133bada09bdb2eecb2fe5ef747 (commit) via ddca664a08a1908a617657d65aaf8c442f2af793 (commit) via f3ad57d25e293f84205d74b40744301f65f472e8 (commit) via 1f41ec2ac21e75efc91bea0a786f9b2fb69e67a0 (commit) via 9a673737163a3474c83c8100c57454318344ef1c (commit) via 7b7209f63579f701afb665c9542ada584ee64328 (commit) via 8435088d6a387847bf58c3805424bd82ad6e09ca (commit) via b8abd25897c49aaf7461937283043f33c837031d (commit) via 7c585699304ac071cdf7c1b8d7677d38b859e70f (commit) from ca5fe169aa4873af5b1ba4c6b2ecb35b84364974 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Copyright.txt | 2 +- Help/command/find_package.rst | 2 ++ Help/manual/cmake-variables.7.rst | 1 + Help/variable/CMAKE_FIND_PACKAGE_NAME.rst | 6 ++++++ Modules/CMakeDetermineCompilerId.cmake | 5 ----- Modules/CompilerId/Xcode-3.pbxproj.in | 2 +- Source/cmSourceFile.cxx | 2 +- Tests/QtAutogen/CMakeLists.txt | 6 ++++++ Tests/QtAutogen/calwidget.cpp | 3 +++ 9 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 Help/variable/CMAKE_FIND_PACKAGE_NAME.rst hooks/post-receive -- CMake From steveire at gmail.com Tue Jan 13 17:01:29 2015 From: steveire at gmail.com (Stephen Kelly) Date: Tue, 13 Jan 2015 17:01:29 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1862-g813257d Message-ID: <20150113220129.8F7C45141@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 813257d9aa8fa07d261f77e9349c8f2f11fd3efc (commit) via 65b81da458614c6a4652ea2e4fc933893c671281 (commit) via 30d2de9aa82196a12f47930e736181c48c568585 (commit) via 4a6e795b0c5cdafbc78f12389ec20d6bc4f9ca34 (commit) via abb4a6781f96b28e4c30014915f566dee9130db7 (commit) from 5370578b13372d26867d41c5e372af4f52a0167a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=813257d9aa8fa07d261f77e9349c8f2f11fd3efc commit 813257d9aa8fa07d261f77e9349c8f2f11fd3efc Merge: 5370578 65b81da Author: Stephen Kelly AuthorDate: Tue Jan 13 17:01:28 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 17:01:28 2015 -0500 Merge topic 'delete-algorithm' into next 65b81da4 cmVariableWatch: Use the cmDeleteAll algorithm with for_each. 30d2de9a cmGeneratorExpressionEvaluator: Replace own algorithm with cmDeleteAll. 4a6e795b Use the cmDeleteAll algorithm instead of trivial raw loops. abb4a678 Add a generic algorithm for deleting items in a container. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=65b81da458614c6a4652ea2e4fc933893c671281 commit 65b81da458614c6a4652ea2e4fc933893c671281 Author: Stephen Kelly AuthorDate: Sun Jan 4 16:33:15 2015 +0100 Commit: Stephen Kelly CommitDate: Tue Jan 13 23:00:17 2015 +0100 cmVariableWatch: Use the cmDeleteAll algorithm with for_each. diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx index cb6cb12..b8a6df2 100644 --- a/Source/cmVariableWatch.cxx +++ b/Source/cmVariableWatch.cxx @@ -34,21 +34,16 @@ cmVariableWatch::cmVariableWatch() { } -cmVariableWatch::~cmVariableWatch() +template +void deleteAllSecond(typename C::value_type it) { - cmVariableWatch::StringToVectorOfPairs::iterator svp_it; - - for ( svp_it = this->WatchMap.begin(); - svp_it != this->WatchMap.end(); ++svp_it ) - { - cmVariableWatch::VectorOfPairs::iterator p_it; + cmDeleteAll(it.second); +} - for ( p_it = svp_it->second.begin(); - p_it != svp_it->second.end(); ++p_it ) - { - delete *p_it; - } - } +cmVariableWatch::~cmVariableWatch() +{ + std::for_each(this->WatchMap.begin(), this->WatchMap.end(), + deleteAllSecond); } bool cmVariableWatch::AddWatch(const std::string& variable, http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=30d2de9aa82196a12f47930e736181c48c568585 commit 30d2de9aa82196a12f47930e736181c48c568585 Author: Stephen Kelly AuthorDate: Sun Jan 4 16:35:26 2015 +0100 Commit: Stephen Kelly CommitDate: Tue Jan 13 23:00:17 2015 +0100 cmGeneratorExpressionEvaluator: Replace own algorithm with cmDeleteAll. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 2f17915..22b61ba 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -2045,30 +2045,9 @@ std::string GeneratorExpressionContent::EvaluateParameters( } //---------------------------------------------------------------------------- -static void deleteAll(const std::vector &c) -{ - std::vector::const_iterator it - = c.begin(); - const std::vector::const_iterator end - = c.end(); - for ( ; it != end; ++it) - { - delete *it; - } -} - -//---------------------------------------------------------------------------- GeneratorExpressionContent::~GeneratorExpressionContent() { - deleteAll(this->IdentifierChildren); - - typedef std::vector EvaluatorVector; - std::vector::const_iterator pit = - this->ParamChildren.begin(); - const std::vector::const_iterator pend = - this->ParamChildren.end(); - for ( ; pit != pend; ++pit) - { - deleteAll(*pit); - } + cmDeleteAll(this->IdentifierChildren); + std::for_each(this->ParamChildren.begin(), this->ParamChildren.end(), + cmDeleteAll >); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4a6e795b0c5cdafbc78f12389ec20d6bc4f9ca34 commit 4a6e795b0c5cdafbc78f12389ec20d6bc4f9ca34 Author: Stephen Kelly AuthorDate: Sun Jan 4 13:33:16 2015 +0100 Commit: Stephen Kelly CommitDate: Tue Jan 13 23:00:17 2015 +0100 Use the cmDeleteAll algorithm instead of trivial raw loops. diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index 94ca536..a07c29a 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -158,11 +158,7 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory() //---------------------------------------------------------------------- cmCPackGeneratorFactory::~cmCPackGeneratorFactory() { - std::vector::iterator it; - for ( it = this->Generators.begin(); it != this->Generators.end(); ++ it ) - { - delete *it; - } + cmDeleteAll(this->Generators); } //---------------------------------------------------------------------- diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 4200e9e..248efaf 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -69,11 +69,7 @@ cmCursesMainForm::~cmCursesMainForm() // Clean-up composites if (this->Entries) { - std::vector::iterator it; - for (it = this->Entries->begin(); it != this->Entries->end(); ++it) - { - delete *it; - } + cmDeleteAll(*this->Entries); } delete this->Entries; if (this->CMakeInstance) @@ -188,12 +184,7 @@ void cmCursesMainForm::InitializeUI() // Clean old entries if (this->Entries) { - // Have to call delete on each pointer - std::vector::iterator it; - for (it = this->Entries->begin(); it != this->Entries->end(); ++it) - { - delete *it; - } + cmDeleteAll(*this->Entries); } delete this->Entries; this->Entries = newEntries; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index f80d4ac..76873ad 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -378,13 +378,7 @@ cmCTest::cmCTest() //---------------------------------------------------------------------- cmCTest::~cmCTest() { - cmCTest::t_TestingHandlers::iterator it; - for ( it = this->TestingHandlers.begin(); - it != this->TestingHandlers.end(); ++ it ) - { - delete it->second; - it->second = 0; - } + cmDeleteAll(this->TestingHandlers); this->SetOutputLogFileName(0); } diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 0ddb571..f0bae28 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -200,12 +200,7 @@ cmComputeLinkDepends //---------------------------------------------------------------------------- cmComputeLinkDepends::~cmComputeLinkDepends() { - for(std::vector::iterator - i = this->InferredDependSets.begin(); - i != this->InferredDependSets.end(); ++i) - { - delete *i; - } + cmDeleteAll(this->InferredDependSets); delete this->CCG; } diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index a8711eb..5ae065e 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -90,12 +90,7 @@ cmDependsC::cmDependsC(cmLocalGenerator* lg, cmDependsC::~cmDependsC() { this->WriteCacheFile(); - - for (std::map::iterator it= - this->FileCache.begin(); it!=this->FileCache.end(); ++it) - { - delete it->second; - } + cmDeleteAll(this->FileCache); } //---------------------------------------------------------------------------- diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index 3ff1017..a268d12 100644 --- a/Source/cmDocumentation.cxx +++ b/Source/cmDocumentation.cxx @@ -87,12 +87,7 @@ cmDocumentation::cmDocumentation() //---------------------------------------------------------------------------- cmDocumentation::~cmDocumentation() { - for(std::map::iterator i = - this->AllSections.begin(); - i != this->AllSections.end(); ++i) - { - delete i->second; - } + cmDeleteAll(this->AllSections); } //---------------------------------------------------------------------------- diff --git a/Source/cmExportSet.cxx b/Source/cmExportSet.cxx index 33b0630..14812e4 100644 --- a/Source/cmExportSet.cxx +++ b/Source/cmExportSet.cxx @@ -15,10 +15,7 @@ cmExportSet::~cmExportSet() { - for(unsigned int i = 0; i < this->TargetExports.size(); ++ i) - { - delete this->TargetExports[i]; - } + cmDeleteAll(this->TargetExports); } void cmExportSet::AddTargetExport(cmTargetExport* te) diff --git a/Source/cmFileLockPool.cxx b/Source/cmFileLockPool.cxx index 551a75a..cf8e9a9 100644 --- a/Source/cmFileLockPool.cxx +++ b/Source/cmFileLockPool.cxx @@ -23,16 +23,8 @@ cmFileLockPool::cmFileLockPool() cmFileLockPool::~cmFileLockPool() { - for (It i = this->FunctionScopes.begin(); - i != this->FunctionScopes.end(); ++i) - { - delete *i; - } - - for (It i = this->FileScopes.begin(); i != this->FileScopes.end(); ++i) - { - delete *i; - } + cmDeleteAll(this->FunctionScopes); + cmDeleteAll(this->FileScopes); } void cmFileLockPool::PushFunctionScope() @@ -148,10 +140,7 @@ cmFileLockPool::ScopePool::ScopePool() cmFileLockPool::ScopePool::~ScopePool() { - for (It i = this->Locks.begin(); i != this->Locks.end(); ++i) - { - delete *i; - } + cmDeleteAll(this->Locks); } cmFileLockResult cmFileLockPool::ScopePool::Lock( diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 861122c..b2a2386 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -150,15 +150,7 @@ cmCompiledGeneratorExpression::cmCompiledGeneratorExpression( //---------------------------------------------------------------------------- cmCompiledGeneratorExpression::~cmCompiledGeneratorExpression() { - std::vector::const_iterator it - = this->Evaluators.begin(); - const std::vector::const_iterator end - = this->Evaluators.end(); - - for ( ; it != end; ++it) - { - delete *it; - } + cmDeleteAll(this->Evaluators); } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index aee96dd..d17710e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1517,27 +1517,13 @@ void cmGlobalGenerator::ClearGeneratorMembers() } this->GeneratorTargets.clear(); - for(std::vector::const_iterator - li = this->EvaluationFiles.begin(); - li != this->EvaluationFiles.end(); - ++li) - { - delete *li; - } + cmDeleteAll(this->EvaluationFiles); this->EvaluationFiles.clear(); - for(std::map::iterator - i = this->BuildExportSets.begin(); - i != this->BuildExportSets.end(); ++i) - { - delete i->second; - } + cmDeleteAll(this->BuildExportSets); this->BuildExportSets.clear(); - for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) - { - delete this->LocalGenerators[i]; - } + cmDeleteAll(this->LocalGenerators); this->LocalGenerators.clear(); this->ExportSets.clear(); diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h index 7134a4e..503f92c 100644 --- a/Source/cmInstalledFile.h +++ b/Source/cmInstalledFile.h @@ -38,11 +38,7 @@ public: ~Property() { - for(ExpressionVectorType::iterator i = ValueExpressions.begin(); - i != ValueExpressions.end(); ++i) - { - delete *i; - } + cmDeleteAll(this->ValueExpressions); } ExpressionVectorType ValueExpressions; diff --git a/Source/cmMakeDepend.cxx b/Source/cmMakeDepend.cxx index 1499e57..54b8535 100644 --- a/Source/cmMakeDepend.cxx +++ b/Source/cmMakeDepend.cxx @@ -34,12 +34,7 @@ cmMakeDepend::cmMakeDepend() cmMakeDepend::~cmMakeDepend() { - for(DependInformationMapType::iterator i = - this->DependInformationMap.begin(); - i != this->DependInformationMap.end(); ++i) - { - delete i->second; - } + cmDeleteAll(this->DependInformationMap); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index d188331..fdf311f 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -194,45 +194,13 @@ bool cmMakefile::NeedCacheCompatibility(int major, int minor) const cmMakefile::~cmMakefile() { - for(std::vector::iterator - i = this->InstallGenerators.begin(); - i != this->InstallGenerators.end(); ++i) - { - delete *i; - } - for(std::vector::iterator - i = this->TestGenerators.begin(); - i != this->TestGenerators.end(); ++i) - { - delete *i; - } - for(std::vector::iterator i = this->SourceFiles.begin(); - i != this->SourceFiles.end(); ++i) - { - delete *i; - } - for(std::map::iterator i = this->Tests.begin(); - i != this->Tests.end(); ++i) - { - delete i->second; - } - for(std::vector::iterator - i = this->ImportedTargetsOwned.begin(); - i != this->ImportedTargetsOwned.end(); ++i) - { - delete *i; - } - for(unsigned int i=0; i < this->FinalPassCommands.size(); i++) - { - delete this->FinalPassCommands[i]; - } - std::vector::iterator pos; - for (pos = this->FunctionBlockers.begin(); - pos != this->FunctionBlockers.end(); ++pos) - { - cmFunctionBlocker* b = *pos; - delete b; - } + cmDeleteAll(this->InstallGenerators); + cmDeleteAll(this->TestGenerators); + cmDeleteAll(this->SourceFiles); + cmDeleteAll(this->Tests); + cmDeleteAll(this->ImportedTargetsOwned); + cmDeleteAll(this->FinalPassCommands); + cmDeleteAll(this->FunctionBlockers); this->FunctionBlockers.clear(); if (this->PolicyStack.size() != 1) { diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 116d42f..23f8526 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -291,18 +291,8 @@ cmOrderDirectories::cmOrderDirectories(cmGlobalGenerator* gg, //---------------------------------------------------------------------------- cmOrderDirectories::~cmOrderDirectories() { - for(std::vector::iterator - i = this->ConstraintEntries.begin(); - i != this->ConstraintEntries.end(); ++i) - { - delete *i; - } - for(std::vector::iterator - i = this->ImplicitDirEntries.begin(); - i != this->ImplicitDirEntries.end(); ++i) - { - delete *i; - } + cmDeleteAll(this->ConstraintEntries); + cmDeleteAll(this->ImplicitDirEntries); } //---------------------------------------------------------------------------- diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index da64617..3a48101 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -378,13 +378,7 @@ cmPolicies::cmPolicies() cmPolicies::~cmPolicies() { - // free the policies - std::map::iterator i - = this->Policies.begin(); - for (;i != this->Policies.end(); ++i) - { - delete i->second; - } + cmDeleteAll(this->Policies); } void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b138f0a..1158ed8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -226,13 +226,7 @@ cmLinkImplItem cmTargetInternals::TargetPropertyEntry::NoLinkImplItem; static void deleteAndClear( std::vector &entries) { - for (std::vector::const_iterator - it = entries.begin(), - end = entries.end(); - it != end; ++it) - { - delete *it; - } + cmDeleteAll(entries); entries.clear(); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5e48157..4244b25 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -171,16 +171,8 @@ cmake::~cmake() delete this->GlobalGenerator; this->GlobalGenerator = 0; } - for(RegisteredCommandsMap::iterator j = this->Commands.begin(); - j != this->Commands.end(); ++j) - { - delete (*j).second; - } - for(RegisteredGeneratorsVector::iterator j = this->Generators.begin(); - j != this->Generators.end(); ++j) - { - delete *j; - } + cmDeleteAll(this->Commands); + cmDeleteAll(this->Generators); #ifdef CMAKE_BUILD_WITH_CMAKE delete this->VariableWatch; #endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=abb4a6781f96b28e4c30014915f566dee9130db7 commit abb4a6781f96b28e4c30014915f566dee9130db7 Author: Stephen Kelly AuthorDate: Sun Jan 4 14:53:24 2015 +0100 Commit: Stephen Kelly CommitDate: Tue Jan 13 23:00:16 2015 +0100 Add a generic algorithm for deleting items in a container. Specialize for std::map types to delete the second element from the iterator. This is not quite general enough that it can be used everywhere, because CMake inherits from std::map and creates typedefs with custom comparison functors etc, which can not use this algorithm. diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 2d988c9..251a043 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -237,4 +237,31 @@ private: const std::string m_test; }; +namespace ContainerAlgorithms { + +template +struct DefaultDeleter +{ + void operator()(typename Container::value_type value) { + delete value; + } +}; + +template +struct DefaultDeleter > +{ + void operator()(typename std::map::value_type value) { + delete value.second; + } +}; + +} + +template +void cmDeleteAll(Container const& c) +{ + std::for_each(c.begin(), c.end(), + ContainerAlgorithms::DefaultDeleter()); +} + #endif ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Tue Jan 13 17:17:10 2015 From: steveire at gmail.com (Stephen Kelly) Date: Tue, 13 Jan 2015 17:17:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1864-ga0b93d7 Message-ID: <20150113221710.58BF9A8CEC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a0b93d7dd06b94731be61a639bcedaecf5fe7192 (commit) via f85156c9061bde41d50db94fd4f5ba8c520563a2 (commit) from 813257d9aa8fa07d261f77e9349c8f2f11fd3efc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0b93d7dd06b94731be61a639bcedaecf5fe7192 commit a0b93d7dd06b94731be61a639bcedaecf5fe7192 Merge: 813257d f85156c Author: Stephen Kelly AuthorDate: Tue Jan 13 17:17:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 17:17:09 2015 -0500 Merge topic 'Apple-compiler-selection' into next f85156c9 New approach. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f85156c9061bde41d50db94fd4f5ba8c520563a2 commit f85156c9061bde41d50db94fd4f5ba8c520563a2 Author: Stephen Kelly AuthorDate: Tue Jan 13 23:10:46 2015 +0100 Commit: Stephen Kelly CommitDate: Tue Jan 13 23:16:07 2015 +0100 New approach. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 7b21dcf..e3b4434 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -71,18 +71,31 @@ macro(_cmake_find_compiler lang) unset(_languages) # Look for a make tool provided by Xcode - if(CMAKE_HOST_APPLE - AND (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" - OR CMAKE_${lang}_COMPILER MATCHES "^/usr/bin")) - foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) - execute_process(COMMAND xcrun --find ${comp} + if(CMAKE_HOST_APPLE) + macro(_query_xrun compiler_name result_var_keyword result_var) + if(NOT result_var_keyword STREQUAL "RESULT_VAR") + message(FATAL_ERROR "Bad arguments to macro") + endif() + execute_process(COMMAND xcrun --find ${compiler_name} OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE _xcrun_err) - if(_xcrun_out) - set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_out}") - break() - endif() - endforeach() + set(${result_var} ${_xcrun_out}) + endmacro() + + set(xcrun_result) + if (CMAKE_${lang}_COMPILER MATCHES "^/usr/bin/(.+)$") + _query_xrun(${CMAKE_MATCH_1} RESULT_VAR xcrun_result) + elseif (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND") + foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) + _query_xrun(${comp} RESULT_VAR xcrun_result) + if(xcrun_result) + break() + endif() + endforeach() + endif() + if (xcrun_result) + set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${xcrun_result}") + endif() endif() endmacro() ----------------------------------------------------------------------- Summary of changes: Modules/CMakeDetermineCompiler.cmake | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Tue Jan 13 17:17:59 2015 From: steveire at gmail.com (Stephen Kelly) Date: Tue, 13 Jan 2015 17:17:59 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1867-g261a06e Message-ID: <20150113221759.CDBCBA8DB2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 261a06e8ed0fd47ceb7d38cd3f64061a6e5ee876 (commit) via c20ec207885ed72d331a101ae7e7a37767268a87 (commit) via 28dae13cad1aab10fb7c9f14b1b417038dd0c144 (commit) from a0b93d7dd06b94731be61a639bcedaecf5fe7192 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=261a06e8ed0fd47ceb7d38cd3f64061a6e5ee876 commit 261a06e8ed0fd47ceb7d38cd3f64061a6e5ee876 Merge: a0b93d7 c20ec20 Author: Stephen Kelly AuthorDate: Tue Jan 13 17:17:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 13 17:17:59 2015 -0500 Merge topic 'Apple-compiler-selection' into next c20ec207 Apple: Resolve compiler in /usr/bin to that reported by Xcode 28dae13c Project: Extract xcrun invocation into a macro. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c20ec207885ed72d331a101ae7e7a37767268a87 commit c20ec207885ed72d331a101ae7e7a37767268a87 Author: Stephen Kelly AuthorDate: Sat Jan 3 17:36:34 2015 +0100 Commit: Stephen Kelly CommitDate: Tue Jan 13 23:12:57 2015 +0100 Apple: Resolve compiler in /usr/bin to that reported by Xcode The compiler in the PATH on mac is a stub for a different delegate depending on the environment. Rather than requiring xcode-select to change the used Xcode globally, users should be able to choose the compiler per-session. That is possible with the DEVELOPER_DIR environment variable. However, the environment can change between running CMake and invoking the build. In such cases, CMake prefers to record the relevant paths from the environment and use them when invoking the build. That is not currently done for the compilers on APPLE, so the compiler used is not the one reported when running cmake: $ DEVELOPER_DIR=/Applications/Xcode2.app/Contents/Developer/ cc --version Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix $ DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ cc --version Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix Update that now by querying Xcode for the correct compiler path if the compiler located by ordinary means is located in /usr/bin. It is expected that compilers installed manually or through a package manager will not be found there but will be in /usr/local instead. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 7cc0ee0..e3b4434 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -71,7 +71,7 @@ macro(_cmake_find_compiler lang) unset(_languages) # Look for a make tool provided by Xcode - if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE) + if(CMAKE_HOST_APPLE) macro(_query_xrun compiler_name result_var_keyword result_var) if(NOT result_var_keyword STREQUAL "RESULT_VAR") message(FATAL_ERROR "Bad arguments to macro") @@ -81,13 +81,21 @@ macro(_cmake_find_compiler lang) ERROR_VARIABLE _xcrun_err) set(${result_var} ${_xcrun_out}) endmacro() - foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) - _query_xrun(${comp} RESULT_VAR _xcrun_result) - if(_xcrun_result) - set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_result}") - break() - endif() - endforeach() + + set(xcrun_result) + if (CMAKE_${lang}_COMPILER MATCHES "^/usr/bin/(.+)$") + _query_xrun(${CMAKE_MATCH_1} RESULT_VAR xcrun_result) + elseif (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND") + foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) + _query_xrun(${comp} RESULT_VAR xcrun_result) + if(xcrun_result) + break() + endif() + endforeach() + endif() + if (xcrun_result) + set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${xcrun_result}") + endif() endif() endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28dae13cad1aab10fb7c9f14b1b417038dd0c144 commit 28dae13cad1aab10fb7c9f14b1b417038dd0c144 Author: Stephen Kelly AuthorDate: Tue Jan 13 23:10:46 2015 +0100 Commit: Stephen Kelly CommitDate: Tue Jan 13 23:10:46 2015 +0100 Project: Extract xcrun invocation into a macro. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 0ab3af6..7cc0ee0 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -72,12 +72,19 @@ macro(_cmake_find_compiler lang) # Look for a make tool provided by Xcode if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE) - foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) - execute_process(COMMAND xcrun --find ${comp} + macro(_query_xrun compiler_name result_var_keyword result_var) + if(NOT result_var_keyword STREQUAL "RESULT_VAR") + message(FATAL_ERROR "Bad arguments to macro") + endif() + execute_process(COMMAND xcrun --find ${compiler_name} OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE _xcrun_err) - if(_xcrun_out) - set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_out}") + set(${result_var} ${_xcrun_out}) + endmacro() + foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) + _query_xrun(${comp} RESULT_VAR _xcrun_result) + if(_xcrun_result) + set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_result}") break() endif() endforeach() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jan 14 00:01:19 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 14 Jan 2015 00:01:19 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-739-g2ece345 Message-ID: <20150114050119.897F9A961C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 2ece34516a6c4f99d27c42018b3548d0cb75e72e (commit) from e4fd66b1922c10e6487362c8921669925742309a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ece34516a6c4f99d27c42018b3548d0cb75e72e commit 2ece34516a6c4f99d27c42018b3548d0cb75e72e Author: Kitware Robot AuthorDate: Wed Jan 14 00:01:16 2015 -0500 Commit: Kitware Robot CommitDate: Wed Jan 14 00:01:16 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index cea9400..d741a92 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 20150113) +set(CMake_VERSION_PATCH 20150114) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From clinton at elemtech.com Wed Jan 14 01:59:37 2015 From: clinton at elemtech.com (Clinton Stimpson) Date: Wed, 14 Jan 2015 01:59:37 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1870-g84fa667 Message-ID: <20150114065937.23C12A98D5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 84fa667ac294544aee9b0baed03f49776d6b1d1e (commit) via 17f2053b9dbe7c23fe56fea0550bd5dd19ba510d (commit) via 2ece34516a6c4f99d27c42018b3548d0cb75e72e (commit) from 261a06e8ed0fd47ceb7d38cd3f64061a6e5ee876 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=84fa667ac294544aee9b0baed03f49776d6b1d1e commit 84fa667ac294544aee9b0baed03f49776d6b1d1e Merge: 261a06e 17f2053b Author: Clinton Stimpson AuthorDate: Wed Jan 14 01:59:36 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 01:59:36 2015 -0500 Merge topic 'windows-utf-8' into next 17f2053b Encoding: Switch to use UTF-8 internally by default on Windows. 2ece3451 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=17f2053b9dbe7c23fe56fea0550bd5dd19ba510d commit 17f2053b9dbe7c23fe56fea0550bd5dd19ba510d Author: Clinton Stimpson AuthorDate: Fri Dec 26 21:25:20 2014 -0700 Commit: Clinton Stimpson CommitDate: Tue Jan 13 23:54:41 2015 -0700 Encoding: Switch to use UTF-8 internally by default on Windows. This fixes several reported bugs about CMake not handling non-ascii paths on Windows. Practically, the use of some unicode characters may still be limited by the build or compiler tools. For example, a user may be limited by the build tools to using characters within the Windows ANSI code page (which can include non-ascii characters in the current system language). diff --git a/CMakeLists.txt b/CMakeLists.txt index 1812b27..33d2ce6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ if(NOT DEFINED CMAKE_CXX_STANDARD) endif() # option to set the internal encoding of CMake to UTF-8 -option(CMAKE_ENCODING_UTF8 "Use UTF-8 encoding internally (experimental)." OFF) +option(CMAKE_ENCODING_UTF8 "Use UTF-8 encoding internally." ON) mark_as_advanced(CMAKE_ENCODING_UTF8) if(CMAKE_ENCODING_UTF8) set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8) ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 2 +- Source/CMakeVersion.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 08:39:03 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 08:39:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1872-gd6c55ab Message-ID: <20150114133903.71C84C01@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d6c55abeac4d100edfa34fa2db5c50822f343705 (commit) via ea916230efeb59938b04f9286a56ea9db1a3af6c (commit) from 84fa667ac294544aee9b0baed03f49776d6b1d1e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d6c55abeac4d100edfa34fa2db5c50822f343705 commit d6c55abeac4d100edfa34fa2db5c50822f343705 Merge: 84fa667 ea91623 Author: Brad King AuthorDate: Wed Jan 14 08:39:02 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 08:39:02 2015 -0500 Merge topic 'backport-cpack_invalid_cmake_generator' into next ea916230 CPack: Avoid crash on invalid CMake generator name (#15308) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea916230efeb59938b04f9286a56ea9db1a3af6c commit ea916230efeb59938b04f9286a56ea9db1a3af6c Author: Domen Vrankar AuthorDate: Fri Jan 2 10:46:08 2015 +0100 Commit: Brad King CommitDate: Wed Jan 14 08:38:23 2015 -0500 CPack: Avoid crash on invalid CMake generator name (#15308) Case where CPACK_CMAKE_GENERATOR value is non existent or or contains multiple words that were not quoted was not handled and produced a segmentation fault. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 1461bb1..84e6482 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -628,6 +628,14 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( cmGlobalGenerator* globalGenerator = this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator( cmakeGenerator); + if ( !globalGenerator ) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Specified package generator not found. " + "CPACK_CMAKE_GENERATOR value is invalid." + << std::endl); + return 0; + } // set the global flag for unix style paths on cmSystemTools as // soon as the generator is set. This allows gmake to be used // on windows. ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 08:44:30 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 08:44:30 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-741-g37fd5b8 Message-ID: <20150114134430.E61444937@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 37fd5b87f867351517f469ce02b76bef984dc2c3 (commit) via ea916230efeb59938b04f9286a56ea9db1a3af6c (commit) from 2ece34516a6c4f99d27c42018b3548d0cb75e72e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37fd5b87f867351517f469ce02b76bef984dc2c3 commit 37fd5b87f867351517f469ce02b76bef984dc2c3 Merge: 2ece345 ea91623 Author: Brad King AuthorDate: Wed Jan 14 08:44:29 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 08:44:29 2015 -0500 Merge topic 'backport-cpack_invalid_cmake_generator' ea916230 CPack: Avoid crash on invalid CMake generator name (#15308) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 08:53:18 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 08:53:18 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1874-ga382e60 Message-ID: <20150114135318.E5DB414756@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a382e6004e61ccd56b12f3d4ab3c4c08fdb4d777 (commit) via 37fd5b87f867351517f469ce02b76bef984dc2c3 (commit) from d6c55abeac4d100edfa34fa2db5c50822f343705 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a382e6004e61ccd56b12f3d4ab3c4c08fdb4d777 commit a382e6004e61ccd56b12f3d4ab3c4c08fdb4d777 Merge: d6c55ab 37fd5b8 Author: Brad King AuthorDate: Wed Jan 14 08:53:11 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 08:53:11 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 09:20:41 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 09:20:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1876-gf06bf49 Message-ID: <20150114142042.04DC3A9165@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f06bf49a9982f5adc55406b8c510c241489941e5 (commit) via 74b8f7862291d795eba525f3103f1370b8ec7518 (commit) from a382e6004e61ccd56b12f3d4ab3c4c08fdb4d777 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f06bf49a9982f5adc55406b8c510c241489941e5 commit f06bf49a9982f5adc55406b8c510c241489941e5 Merge: a382e60 74b8f78 Author: Brad King AuthorDate: Wed Jan 14 09:20:41 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 09:20:41 2015 -0500 Merge topic 'zlib-suppress-warnings' into next 74b8f786 zlib: Disable warnings to avoid changing 3rd party code http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=74b8f7862291d795eba525f3103f1370b8ec7518 commit 74b8f7862291d795eba525f3103f1370b8ec7518 Author: Brad King AuthorDate: Wed Jan 14 09:20:27 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 09:20:27 2015 -0500 zlib: Disable warnings to avoid changing 3rd party code diff --git a/Utilities/cmzlib/CMakeLists.txt b/Utilities/cmzlib/CMakeLists.txt index 66e8be2..0be48f1 100644 --- a/Utilities/cmzlib/CMakeLists.txt +++ b/Utilities/cmzlib/CMakeLists.txt @@ -1,5 +1,13 @@ PROJECT(CMZLIB) +# Disable warnings to avoid changing 3rd party code. +if(CMAKE_C_COMPILER_ID MATCHES + "^(GNU|Clang|AppleClang|XL|VisualAge|SunPro|MIPSpro|HP|Intel)$") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") +elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") +endif() + INCLUDE_DIRECTORIES( "${CMZLIB_SOURCE_DIR}" "${CMZLIB_SOURCE_DIR}/.." ----------------------------------------------------------------------- Summary of changes: Utilities/cmzlib/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 09:28:04 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 09:28:04 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1878-gff07a15 Message-ID: <20150114142804.2CC68A9FAF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ff07a15758b434369771229ca2a664496d8d4522 (commit) via 046828185e329b07757141b759e9a38393e64d2b (commit) from f06bf49a9982f5adc55406b8c510c241489941e5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff07a15758b434369771229ca2a664496d8d4522 commit ff07a15758b434369771229ca2a664496d8d4522 Merge: f06bf49 0468281 Author: Brad King AuthorDate: Wed Jan 14 09:28:03 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 09:28:03 2015 -0500 Merge topic 'Apple-compiler-selection' into next 04682818 CMakeDetermineCompiler: Fix _query_xrun macro, rename to _query_xcrun http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=046828185e329b07757141b759e9a38393e64d2b commit 046828185e329b07757141b759e9a38393e64d2b Author: Brad King AuthorDate: Wed Jan 14 09:27:15 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 09:27:33 2015 -0500 CMakeDetermineCompiler: Fix _query_xrun macro, rename to _query_xcrun diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index e3b4434..85c8662 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -72,22 +72,22 @@ macro(_cmake_find_compiler lang) # Look for a make tool provided by Xcode if(CMAKE_HOST_APPLE) - macro(_query_xrun compiler_name result_var_keyword result_var) - if(NOT result_var_keyword STREQUAL "RESULT_VAR") + macro(_query_xcrun compiler_name result_var_keyword result_var) + if(NOT "x${result_var_keyword}" STREQUAL "xRESULT_VAR") message(FATAL_ERROR "Bad arguments to macro") endif() execute_process(COMMAND xcrun --find ${compiler_name} OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE _xcrun_err) - set(${result_var} ${_xcrun_out}) + set("${result_var}" "${_xcrun_out}") endmacro() set(xcrun_result) if (CMAKE_${lang}_COMPILER MATCHES "^/usr/bin/(.+)$") - _query_xrun(${CMAKE_MATCH_1} RESULT_VAR xcrun_result) + _query_xcrun("${CMAKE_MATCH_1}" RESULT_VAR xcrun_result) elseif (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND") foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) - _query_xrun(${comp} RESULT_VAR xcrun_result) + _query_xcrun("${comp}" RESULT_VAR xcrun_result) if(xcrun_result) break() endif() ----------------------------------------------------------------------- Summary of changes: Modules/CMakeDetermineCompiler.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 09:56:04 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 09:56:04 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1880-g5cd1873 Message-ID: <20150114145604.B90A8AA1CF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5cd18731aa5216246cd017372bd45b8877194572 (commit) via a44294641e27c74657665079147a41b81ceb3372 (commit) from ff07a15758b434369771229ca2a664496d8d4522 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5cd18731aa5216246cd017372bd45b8877194572 commit 5cd18731aa5216246cd017372bd45b8877194572 Merge: ff07a15 a442946 Author: Brad King AuthorDate: Wed Jan 14 09:56:04 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 09:56:04 2015 -0500 Merge topic 'cdash_upload_file_mode' into next a4429464 jsoncpp: Fix warning suppression to not use C flags for C++ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a44294641e27c74657665079147a41b81ceb3372 commit a44294641e27c74657665079147a41b81ceb3372 Author: Brad King AuthorDate: Wed Jan 14 09:55:52 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 09:55:52 2015 -0500 jsoncpp: Fix warning suppression to not use C flags for C++ diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt index 1a10295..9f29558 100644 --- a/Utilities/cmjsoncpp/CMakeLists.txt +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -3,9 +3,9 @@ project(JsonCpp CXX) # Disable warnings to avoid changing 3rd party code. if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|XL|VisualAge|SunPro|MIPSpro|HP|Intel)$") - set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -w") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PathScale") - set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -woffall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -woffall") endif() set(JSONCPP_SOURCES ----------------------------------------------------------------------- Summary of changes: Utilities/cmjsoncpp/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 10:02:51 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 10:02:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1883-gc990a18 Message-ID: <20150114150251.8343CAA4DB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c990a180a963ca8f9df769f84533cb2fb0199750 (commit) via dda973be563bb45ca65670c4d4115f26f5d6a49e (commit) via f4b3e6937ee6bd0588295b212a96d8378290c2e3 (commit) from 5cd18731aa5216246cd017372bd45b8877194572 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c990a180a963ca8f9df769f84533cb2fb0199750 commit c990a180a963ca8f9df769f84533cb2fb0199750 Merge: 5cd1873 dda973b Author: Brad King AuthorDate: Wed Jan 14 10:02:50 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 10:02:50 2015 -0500 Merge topic 'Apple-compiler-selection' into next dda973be Apple: Resolve compiler in /usr/bin to that reported by Xcode f4b3e693 CMakeDetermineCompiler: Extract xcrun invocation into a macro. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dda973be563bb45ca65670c4d4115f26f5d6a49e commit dda973be563bb45ca65670c4d4115f26f5d6a49e Author: Stephen Kelly AuthorDate: Sat Jan 3 17:36:34 2015 +0100 Commit: Brad King CommitDate: Wed Jan 14 10:02:02 2015 -0500 Apple: Resolve compiler in /usr/bin to that reported by Xcode The compiler in the PATH on mac is a stub for a different delegate depending on the environment. Rather than requiring xcode-select to change the used Xcode globally, users should be able to choose the compiler per-session. That is possible with the DEVELOPER_DIR environment variable. However, the environment can change between running CMake and invoking the build. In such cases, CMake prefers to record the relevant paths from the environment and use them when invoking the build. That is not currently done for the compilers on APPLE, so the compiler used is not the one reported when running cmake: $ DEVELOPER_DIR=/Applications/Xcode2.app/Contents/Developer/ cc --version Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix $ DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ cc --version Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix Update that now by querying Xcode for the correct compiler path if the compiler located by ordinary means is located in /usr/bin. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 7a5cbcd..85c8662 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -71,7 +71,7 @@ macro(_cmake_find_compiler lang) unset(_languages) # Look for a make tool provided by Xcode - if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE) + if(CMAKE_HOST_APPLE) macro(_query_xcrun compiler_name result_var_keyword result_var) if(NOT "x${result_var_keyword}" STREQUAL "xRESULT_VAR") message(FATAL_ERROR "Bad arguments to macro") @@ -81,13 +81,21 @@ macro(_cmake_find_compiler lang) ERROR_VARIABLE _xcrun_err) set("${result_var}" "${_xcrun_out}") endmacro() - foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) - _query_xcrun("${comp}" RESULT_VAR _xcrun_result) - if(_xcrun_result) - set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_result}") - break() - endif() - endforeach() + + set(xcrun_result) + if (CMAKE_${lang}_COMPILER MATCHES "^/usr/bin/(.+)$") + _query_xcrun("${CMAKE_MATCH_1}" RESULT_VAR xcrun_result) + elseif (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND") + foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) + _query_xcrun("${comp}" RESULT_VAR xcrun_result) + if(xcrun_result) + break() + endif() + endforeach() + endif() + if (xcrun_result) + set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${xcrun_result}") + endif() endif() endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4b3e6937ee6bd0588295b212a96d8378290c2e3 commit f4b3e6937ee6bd0588295b212a96d8378290c2e3 Author: Stephen Kelly AuthorDate: Tue Jan 13 23:10:46 2015 +0100 Commit: Brad King CommitDate: Wed Jan 14 09:58:50 2015 -0500 CMakeDetermineCompiler: Extract xcrun invocation into a macro. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 0ab3af6..7a5cbcd 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -72,12 +72,19 @@ macro(_cmake_find_compiler lang) # Look for a make tool provided by Xcode if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE) - foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) - execute_process(COMMAND xcrun --find ${comp} + macro(_query_xcrun compiler_name result_var_keyword result_var) + if(NOT "x${result_var_keyword}" STREQUAL "xRESULT_VAR") + message(FATAL_ERROR "Bad arguments to macro") + endif() + execute_process(COMMAND xcrun --find ${compiler_name} OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE _xcrun_err) - if(_xcrun_out) - set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_out}") + set("${result_var}" "${_xcrun_out}") + endmacro() + foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) + _query_xcrun("${comp}" RESULT_VAR _xcrun_result) + if(_xcrun_result) + set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_result}") break() endif() endforeach() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 10:03:34 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 10:03:34 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1885-g0965a0f Message-ID: <20150114150334.1E27BAA4ED@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0965a0f01819c0e1d727ab1ee41fbd8123c7925b (commit) via 38802dc00af0ea5ffc8ef224bd42bbb54d410b57 (commit) from c990a180a963ca8f9df769f84533cb2fb0199750 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0965a0f01819c0e1d727ab1ee41fbd8123c7925b commit 0965a0f01819c0e1d727ab1ee41fbd8123c7925b Merge: c990a18 38802dc Author: Brad King AuthorDate: Wed Jan 14 10:03:33 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 10:03:33 2015 -0500 Merge topic 'rpm_at_in_path' into next 38802dc0 Revert "rpm revert at in path escaping patch" http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=38802dc00af0ea5ffc8ef224bd42bbb54d410b57 commit 38802dc00af0ea5ffc8ef224bd42bbb54d410b57 Author: Brad King AuthorDate: Wed Jan 14 10:03:10 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 10:03:10 2015 -0500 Revert "rpm revert at in path escaping patch" This reverts commit 5d0a04f09487dacac5520c6e963a64cce854d2bd. It will be restored with a test case. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 7de3aa3..d2cb2ee 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -1058,6 +1058,13 @@ if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}") endif() +# protect @ in pathname in order to avoid their +# interpretation during the configure_file step +set(CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES}") +set(PROTECTED_AT "@") +string(REPLACE "@" "\@PROTECTED_AT\@" CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES_LIST}") +set(CPACK_RPM_INSTALL_FILES_LIST "") + # # USER generated/provided spec file handling. # @@ -1168,6 +1175,9 @@ else() configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY) endif() +# remove AT protection +unset(PROTECTED_AT) + if(RPMBUILD_EXECUTABLE) # Now call rpmbuild using the SPECFILE execute_process( ----------------------------------------------------------------------- Summary of changes: Modules/CPackRPM.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 10:20:00 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 10:20:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1887-g94daeed Message-ID: <20150114152000.37FE8A8F69@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 94daeed95bbedf1bf341775eb1f0e0e1def12270 (commit) via 68857ccd823088caf240318f2a7b39522fc383da (commit) from 0965a0f01819c0e1d727ab1ee41fbd8123c7925b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=94daeed95bbedf1bf341775eb1f0e0e1def12270 commit 94daeed95bbedf1bf341775eb1f0e0e1def12270 Merge: 0965a0f 68857cc Author: Brad King AuthorDate: Wed Jan 14 10:19:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 10:19:59 2015 -0500 Merge topic 'safer-msmpi-checks' into next 68857ccd FindMPI: handle trailing slash from $MSMPI_BIN http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68857ccd823088caf240318f2a7b39522fc383da commit 68857ccd823088caf240318f2a7b39522fc383da Author: Ben Boeckel AuthorDate: Mon Jan 12 09:21:23 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 10:19:06 2015 -0500 FindMPI: handle trailing slash from $MSMPI_BIN When installing, MSMPI puts a trailing backslash in the MSMPI_BIN environment variable. This causes trouble when concatenating in CMake since the list separator is now escaped and no longer a list separator due to the trailing backslash. Instead, use file(TO_CMAKE_PATH) to make the path CMake-friendly. diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 9192054..545b077 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -175,7 +175,9 @@ set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun) set(_MPI_PREFIX_PATH) if(WIN32) # MSMPI - list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_BIN}") + file(TO_CMAKE_PATH "$ENV{MSMPI_BIN}" msmpi_bin_path) # The default path ends with a '\' and doesn't mix with ';' when appending. + list(APPEND _MPI_PREFIX_PATH "${msmpi_bin_path}") + unset(msmpi_bin_path) list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]/Bin") list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_INC}/..") # The SDK is installed separately from the runtime # MPICH ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 10:35:25 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 10:35:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-744-g0d7176b Message-ID: <20150114153525.F0B75AA1E7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0d7176b2f7298fc818a67d004e3a3e5d392a68d4 (commit) via 46eae529685bed736736713914d119fcab6e0a5c (commit) via 8909d887389887171f7846cb3040c575e6262b04 (commit) from 37fd5b87f867351517f469ce02b76bef984dc2c3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 10:35:26 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 10:35:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1891-ga403754 Message-ID: <20150114153526.24151AA1E9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a403754fe0761fee9e60e185c003bcef04c719c3 (commit) via 0d7176b2f7298fc818a67d004e3a3e5d392a68d4 (commit) via 46eae529685bed736736713914d119fcab6e0a5c (commit) via 8909d887389887171f7846cb3040c575e6262b04 (commit) from 94daeed95bbedf1bf341775eb1f0e0e1def12270 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a403754fe0761fee9e60e185c003bcef04c719c3 commit a403754fe0761fee9e60e185c003bcef04c719c3 Merge: 94daeed 0d7176b Author: Brad King AuthorDate: Wed Jan 14 10:34:57 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 10:34:57 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 10:35:26 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 10:35:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, release, updated. v3.1.0-48-g46eae52 Message-ID: <20150114153526.349F9AA1E9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 46eae529685bed736736713914d119fcab6e0a5c (commit) via 8909d887389887171f7846cb3040c575e6262b04 (commit) via ea916230efeb59938b04f9286a56ea9db1a3af6c (commit) via ac5922317f4f2229c5dc79b29d913275fa55f021 (commit) from ef1f4f47823594adee3da62807f5434685ded3d8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/Platform/Linux-XL-C.cmake | 1 + Modules/Platform/Linux-XL-CXX.cmake | 1 + Modules/Platform/Linux-XL-Fortran.cmake | 1 + Source/CPack/cmCPackGenerator.cxx | 8 ++++++++ 4 files changed, 11 insertions(+) hooks/post-receive -- CMake From clinton at elemtech.com Wed Jan 14 11:02:42 2015 From: clinton at elemtech.com (Clinton Stimpson) Date: Wed, 14 Jan 2015 11:02:42 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1893-gb4346c1 Message-ID: <20150114160243.049AAAA0CA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b4346c10c6f407b069c5db7ace6d325b83404c1c (commit) via 8de75f13b69b5e3498330e3f0d509bd66e340ed9 (commit) from a403754fe0761fee9e60e185c003bcef04c719c3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4346c10c6f407b069c5db7ace6d325b83404c1c commit b4346c10c6f407b069c5db7ace6d325b83404c1c Merge: a403754 8de75f1 Author: Clinton Stimpson AuthorDate: Wed Jan 14 11:02:42 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 11:02:42 2015 -0500 Merge topic 'windows-utf-8' into next 8de75f13 Add release note for windows-utf-8. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8de75f13b69b5e3498330e3f0d509bd66e340ed9 commit 8de75f13b69b5e3498330e3f0d509bd66e340ed9 Author: Clinton Stimpson AuthorDate: Wed Jan 14 09:01:37 2015 -0700 Commit: Clinton Stimpson CommitDate: Wed Jan 14 09:01:37 2015 -0700 Add release note for windows-utf-8. diff --git a/Help/release/dev/windows-utf-8.rst b/Help/release/dev/windows-utf-8.rst new file mode 100644 index 0000000..fe02153 --- /dev/null +++ b/Help/release/dev/windows-utf-8.rst @@ -0,0 +1,17 @@ +windows-utf-8 +------------------------- + +* The Windows version of CMake has been enhanced to use Unicode. This + allows using characters from multiple languages in CMake. Because CMake + interoperates with many other tools, there may still be some limitations + when using certain Unicode characters. + + The Visual Studio generators have been enhanced to write solution and + project files in UTF-8 instead of Windows-1252. Windows-1252 supported + Latin 1 languages such as those found in North and South America and Western + Europe. With UTF-8, additional languages are supported. + + The CMakeLists.txt file and other files read by CMake file are expected + to be UTF-8 encoded. If files are already ASCII, they will be compatible. + If files were in a different encoding, including Latin 1, they will need to + be converted. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/windows-utf-8.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Help/release/dev/windows-utf-8.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 13:43:23 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 13:43:23 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1896-gc6199c5 Message-ID: <20150114184323.63CD32271@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c6199c5223bec8fbd36ce3f9809bc341a6e30fe1 (commit) via 4ce110bbbac36362d8f3fbddb0b405320695ed36 (commit) via 0b7e7e277c111d274d7dba378273f77d5b2a4fd7 (commit) from b4346c10c6f407b069c5db7ace6d325b83404c1c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6199c5223bec8fbd36ce3f9809bc341a6e30fe1 commit c6199c5223bec8fbd36ce3f9809bc341a6e30fe1 Merge: b4346c1 4ce110b Author: Brad King AuthorDate: Wed Jan 14 13:43:22 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 13:43:22 2015 -0500 Merge topic 'revert-feature_record_msvc' into next 4ce110bb Tests: Revert workaround for COMPILE_FEATURES genex bug 0b7e7e27 Revert topic 'feature_record_msvc' diff --cc Tests/CompileFeatures/CMakeLists.txt index f0a4e74,b164f06..b3799dd --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -83,48 -52,7 +72,37 @@@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU cxx_return_type_deduction ) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(REMOVE_ITEM CXX_non_features + # Micrsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() + +set(MSVC_) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + MSVC_VERSION LESS 1800) + list(REMOVE_ITEM CXX_non_features + # Microsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() + +set(MSVC_) +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + MSVC_VERSION LESS 1800) + list(REMOVE_ITEM CXX_non_features + # Microsoft only officially supports this feature in VS2013 and above, due + # to new wording of the proposal. We don't test for this with MSVC because + # older compiler pass the test but might not actually conform + cxx_contextual_conversions + ) +endif() - set(MSVC_) - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND - MSVC_VERSION LESS 1800) - list(REMOVE_ITEM CXX_non_features - # Microsoft only officially supports this feature in VS2013 and above, due - # to new wording of the proposal. We don't test for this with MSVC because - # older compiler pass the test but might not actually conform - cxx_contextual_conversions - ) - endif() - set(C_ext c) set(C_standard_flag 11) set(CXX_ext cpp) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ce110bbbac36362d8f3fbddb0b405320695ed36 commit 4ce110bbbac36362d8f3fbddb0b405320695ed36 Author: Brad King AuthorDate: Wed Jan 14 13:41:45 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 13:41:45 2015 -0500 Tests: Revert workaround for COMPILE_FEATURES genex bug The second hunk of commit 07d1f6fc (Features: Properly evaluate if the compiler supports cxx_final, 2014-12-31) was a workaround for a bug in the COMPILE_FEATURES generator expression that caused it never to return 0. Revert the workaround so we can fix the bug instead. diff --git a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake index 4de8e88..b544b99 100644 --- a/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake +++ b/Tests/RunCMake/CompileFeatures/NonValidTarget1.cmake @@ -11,7 +11,7 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_res COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp" ) -add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${expected_result}.cpp") +add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp") if (HAVE_FINAL) target_compile_features(empty PRIVATE cxx_final) endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b7e7e277c111d274d7dba378273f77d5b2a4fd7 commit 0b7e7e277c111d274d7dba378273f77d5b2a4fd7 Author: Brad King AuthorDate: Wed Jan 14 13:35:53 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 13:35:58 2015 -0500 Revert topic 'feature_record_msvc' Revert commits: 2d738ce3 Help: Add notes for topic 'feature_record_msvc' f73718c9 Features: Enable writing of MSVC compiler feature header. 64c30bdc Features: Record for MSVC C++ 2015 and MSVC C 2010-2015. 225c0ef8 Features: Record for MSVC 2010-2013. This topic was merged to master prematurely, so remove it. diff --git a/Help/release/dev/feature_record_msvc.rst b/Help/release/dev/feature_record_msvc.rst deleted file mode 100644 index 63b642d..0000000 --- a/Help/release/dev/feature_record_msvc.rst +++ /dev/null @@ -1,6 +0,0 @@ -feature_record_msvc -------------------- - -* The :manual:`Compile Features ` functionality - is now aware of features supported by Visual Studio 2010 and above - (``MSVC``). diff --git a/Modules/Compiler/MSVC-C-FeatureTests.cmake b/Modules/Compiler/MSVC-C-FeatureTests.cmake deleted file mode 100644 index e449358..0000000 --- a/Modules/Compiler/MSVC-C-FeatureTests.cmake +++ /dev/null @@ -1,23 +0,0 @@ - -# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx -# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx -# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx - -set(_cmake_oldestSupported "_MSC_VER >= 1300") - -set(MSVC_2010 "_MSC_VER >= 1600") -set(_cmake_feature_test_c_static_assert "${MSVC_2010}") -set(_cmake_feature_test_c_variadic_macros "${MSVC_2010}") - -set(MSVC_2003 "_MSC_VER >= 1300") -set(_cmake_feature_test_c_function_prototypes "${MSVC_2003}") - -# Currently unsupported: -# restrict requires the __restrict syntax in msvc -# set(_cmake_feature_test_c_restrict) - -# Unset all the variables that we don't need exposed. -# _cmake_oldestSupported is required by WriteCompilerDetectionHeader -set(MSVC_2010) -set(MSVC_2003) \ No newline at end of file diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake deleted file mode 100644 index b238fde..0000000 --- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake +++ /dev/null @@ -1,97 +0,0 @@ - -# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx -# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx -# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx - - -set(_cmake_oldestSupported "_MSC_VER >= 1600") - -set(MSVC_2015 "_MSC_VER >= 1900") -set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") -set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") -set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") -set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") -set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") -set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") -# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -# Note 1. While previous version of VisualStudio said they supported this -# they silently produced bad code, and are now marked as having partial -# support -set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") -set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") -set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") -set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") -set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") -set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") -set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") -set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") -set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") -set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") -set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") -set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") - -set(MSVC_2013 "_MSC_VER >= 1800") -set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") -set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") -set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") -set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") -set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") -set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") -set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") -set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") -set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") -# Possibly broken: -# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 -set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") -# Microsoft now states they support contextual conversions -# see footnote 6 at: -# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}") - -set(MSVC_2012 "_MSC_VER >= 1700") -set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") -set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") -set(_cmake_feature_test_cxx_final "${MSVC_2012}") -set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") -set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") - -set(MSVC_2010 "_MSC_VER >= 1600") -set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") -set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") -set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") -set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") -set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") -set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") -set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") -set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") -set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") -set(_cmake_feature_test_cxx_override "${MSVC_2010}") -set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") -set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") -set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") -set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") -set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") -set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") - -# Currently unsupported: -# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ -# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx - -# set(_cmake_feature_test_cxx_reference_qualified_functions ) -# set(_cmake_feature_test_cxx_constexpr ) -# set(_cmake_feature_test_cxx_attributes ) -# set(_cmake_feature_test_cxx_aggregate_default_initializers ) -# set(_cmake_feature_test_cxx_attribute_deprecated ) -# set(_cmake_feature_test_cxx_defaulted_move_initializers ) -# set(_cmake_feature_test_cxx_nonstatic_member_init ) -# set(_cmake_feature_test_cxx_relaxed_constexpr ) -# set(_cmake_feature_test_cxx_variable_templates ) - - -# Unset all the variables that we don't need exposed. -# _cmake_oldestSupported is required by WriteCompilerDetectionHeader -set(MSVC_2015) -set(MSVC_2013) -set(MSVC_2012) -set(MSVC_2010) diff --git a/Modules/Platform/Windows-MSVC-C.cmake b/Modules/Platform/Windows-MSVC-C.cmake index c7792eb..cbe1586 100644 --- a/Modules/Platform/Windows-MSVC-C.cmake +++ b/Modules/Platform/Windows-MSVC-C.cmake @@ -3,5 +3,3 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_C " /FS") endif() __windows_compiler_msvc(C) - -set(CMAKE_C_STANDARD_DEFAULT 90) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index ad56f68..0e85005 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -4,12 +4,3 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_CXX " /FS") endif() __windows_compiler_msvc(CXX) - -# No version of MSVC has full conformance to C++11. Therefore the -# __cplusplus macro always evaluates to 98 even if the compilers come with -# C++11/14/+ features enabled. -set(CMAKE_CXX_STANDARD_DEFAULT 98) - -macro(cmake_record_cxx_compile_features) - record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) -endmacro() diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index bcaaafa..36b9706 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang MSVC +# COMPILERS GNU Clang # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang MSVC +# COMPILERS GNU Clang AppleClang # FEATURES cxx_variadic_templates # ) # @@ -316,7 +316,6 @@ function(write_compiler_detection_header GNU Clang AppleClang - MSVC ) set(_hex_compilers ADSP Borland Embarcadero SunPro) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9fb8d1b..b164f06 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -26,18 +26,7 @@ get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES) foreach(feature ${c_features}) run_test(${feature} C) endforeach() - get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) - -if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - list(REMOVE_ITEM cxx_features - # This test requires auto return type deduction to work properly, but - # that is not supported by all versions of MSVC that support decltype - # incomplete return types. - cxx_decltype_incomplete_return_types - ) -endif() - foreach(feature ${cxx_features}) run_test(${feature} CXX) endforeach() @@ -64,17 +53,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) endif() -set(MSVC_) -if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND - MSVC_VERSION LESS 1800) - list(REMOVE_ITEM CXX_non_features - # Microsoft only officially supports this feature in VS2013 and above, due - # to new wording of the proposal. We don't test for this with MSVC because - # older compiler pass the test but might not actually conform - cxx_contextual_conversions - ) -endif() - set(C_ext c) set(C_standard_flag 11) set(CXX_ext cpp) @@ -148,7 +126,6 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) - target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index 4412569..f667cc4 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -10,7 +10,7 @@ struct A virtual int getA() { return 7; } }; -struct B : A +struct B final : A { int getA() override { return 42; } }; diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index cfaa78c..401de95 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 MSVC + COMPILERS GNU Clang AppleClang VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -64,18 +64,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() -# for msvc the compiler version determines which c++11 features are available. -# Both variadic templates and delegating constructors support exist in -# all versions that we write compile headers for. -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND - ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") - list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) - list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) -else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) - list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) -endif() - if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -93,7 +81,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 MSVC + COMPILERS GNU Clang AppleClang VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 3b37091..1892a5c 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,13 +27,8 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - # compilers such as MSVC have no explicit flags to enable c++11 mode. - # Instead they come with all c++11 features implicitly enabled. - # So for those types of compilers this tests is not applicable. - if(CMAKE_CXX11_STANDARD_COMPILE_OPTION) - run_cmake(LinkImplementationFeatureCycle) - run_cmake(LinkImplementationFeatureCycleSolved) - endif() + run_cmake(LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycleSolved) if (";${CXX_FEATURES};" MATCHES ";cxx_final;") set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") ----------------------------------------------------------------------- Summary of changes: Help/release/dev/feature_record_msvc.rst | 6 -- Modules/Compiler/MSVC-C-FeatureTests.cmake | 23 ----- Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 97 -------------------- Modules/Platform/Windows-MSVC-C.cmake | 2 - Modules/Platform/Windows-MSVC-CXX.cmake | 9 -- Modules/WriteCompilerDetectionHeader.cmake | 5 +- Tests/CompileFeatures/CMakeLists.txt | 23 ----- Tests/CompileFeatures/genex_test.cpp | 2 +- .../WriteCompilerDetectionHeader/CMakeLists.txt | 16 +--- .../RunCMake/CompileFeatures/NonValidTarget1.cmake | 2 +- Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake | 9 +- 11 files changed, 8 insertions(+), 186 deletions(-) delete mode 100644 Help/release/dev/feature_record_msvc.rst delete mode 100644 Modules/Compiler/MSVC-C-FeatureTests.cmake delete mode 100644 Modules/Compiler/MSVC-CXX-FeatureTests.cmake hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 14:46:20 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 14:46:20 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1898-gdabaf75 Message-ID: <20150114194620.17265512E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via dabaf75fb5182c34dd8f55497ac02ce4478700c6 (commit) via f121b6b12856d9b0f6f7131f492d70602a023ebd (commit) from c6199c5223bec8fbd36ce3f9809bc341a6e30fe1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dabaf75fb5182c34dd8f55497ac02ce4478700c6 commit dabaf75fb5182c34dd8f55497ac02ce4478700c6 Merge: c6199c5 f121b6b Author: Brad King AuthorDate: Wed Jan 14 14:46:18 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 14:46:18 2015 -0500 Merge topic 'Apple-GNU-compiler-features' into next f121b6b1 Help: Add notes for topic 'Apple-GNU-compiler-features' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f121b6b12856d9b0f6f7131f492d70602a023ebd commit f121b6b12856d9b0f6f7131f492d70602a023ebd Author: Brad King AuthorDate: Wed Jan 14 14:45:16 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 14:45:16 2015 -0500 Help: Add notes for topic 'Apple-GNU-compiler-features' diff --git a/Help/release/dev/Apple-GNU-compiler-features.rst b/Help/release/dev/Apple-GNU-compiler-features.rst new file mode 100644 index 0000000..40c3712 --- /dev/null +++ b/Help/release/dev/Apple-GNU-compiler-features.rst @@ -0,0 +1,5 @@ +Apple-GNU-compiler-features +--------------------------- + +* The :manual:`Compile Features ` functionality + is now aware of features supported by GNU compilers on OS X. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/Apple-GNU-compiler-features.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Help/release/dev/Apple-GNU-compiler-features.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 14:48:17 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 14:48:17 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1900-gaae70bc Message-ID: <20150114194817.735219ADFF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via aae70bca34411da0d5f147bb177159497070f834 (commit) via 31cbfd41dabebd632c66c997565eb4a3f9fe6533 (commit) from dabaf75fb5182c34dd8f55497ac02ce4478700c6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aae70bca34411da0d5f147bb177159497070f834 commit aae70bca34411da0d5f147bb177159497070f834 Merge: dabaf75 31cbfd4 Author: Brad King AuthorDate: Wed Jan 14 14:48:16 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 14:48:16 2015 -0500 Merge topic 'record-GNU-5-features' into next 31cbfd41 Help: Add notes for topic 'record-GNU-5-features' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=31cbfd41dabebd632c66c997565eb4a3f9fe6533 commit 31cbfd41dabebd632c66c997565eb4a3f9fe6533 Author: Brad King AuthorDate: Wed Jan 14 14:47:39 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 14:47:39 2015 -0500 Help: Add notes for topic 'record-GNU-5-features' diff --git a/Help/release/dev/record-GNU-5-features.rst b/Help/release/dev/record-GNU-5-features.rst new file mode 100644 index 0000000..0da9e75 --- /dev/null +++ b/Help/release/dev/record-GNU-5-features.rst @@ -0,0 +1,5 @@ +record-GNU-5-features +--------------------- + +* The :manual:`Compile Features ` functionality + is now aware of features supported by GNU compiler version 5.0. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/record-GNU-5-features.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Help/release/dev/record-GNU-5-features.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 14:49:09 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 14:49:09 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1902-g7668615 Message-ID: <20150114194909.7454FA603E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7668615cfe6db836a6c5b8c6e5971a6063887148 (commit) via a3513ceea9909eda524863ca2024621cba65003f (commit) from aae70bca34411da0d5f147bb177159497070f834 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7668615cfe6db836a6c5b8c6e5971a6063887148 commit 7668615cfe6db836a6c5b8c6e5971a6063887148 Merge: aae70bc a3513ce Author: Brad King AuthorDate: Wed Jan 14 14:49:08 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 14:49:08 2015 -0500 Merge topic 'find-msmpi' into next a3513cee Help: Add notes for topic 'find-msmpi' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a3513ceea9909eda524863ca2024621cba65003f commit a3513ceea9909eda524863ca2024621cba65003f Author: Brad King AuthorDate: Wed Jan 14 10:21:11 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 10:21:11 2015 -0500 Help: Add notes for topic 'find-msmpi' diff --git a/Help/release/dev/find-msmpi.rst b/Help/release/dev/find-msmpi.rst new file mode 100644 index 0000000..6ece5c8 --- /dev/null +++ b/Help/release/dev/find-msmpi.rst @@ -0,0 +1,4 @@ +find-msmpi +---------- + +* The :module:`FindMPI` module learned to find MS-MPI on Windows. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/find-msmpi.rst | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Help/release/dev/find-msmpi.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 14:59:31 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 14:59:31 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1903-g92ad27b Message-ID: <20150114195931.5445BAA1AC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 92ad27b0f20fa1bc6e93582b3dad1766f89db627 (commit) from 7668615cfe6db836a6c5b8c6e5971a6063887148 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92ad27b0f20fa1bc6e93582b3dad1766f89db627 commit 92ad27b0f20fa1bc6e93582b3dad1766f89db627 Merge: 7668615 4ce110b Author: Brad King AuthorDate: Wed Jan 14 14:58:14 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 14:58:14 2015 -0500 Merge branch 'revert-feature_record_msvc' into next Fix merged tree object to revert changes from next left from repeated merges. ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 31 ------------------------------- 1 file changed, 31 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 15:06:51 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 15:06:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1905-gedcbded Message-ID: <20150114200651.6B909AA294@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via edcbded42e4932285a0a89327dc383704da3fc4c (commit) via dcd72a740573392b2074bbea3d9d992bcd8959f8 (commit) from 92ad27b0f20fa1bc6e93582b3dad1766f89db627 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=edcbded42e4932285a0a89327dc383704da3fc4c commit edcbded42e4932285a0a89327dc383704da3fc4c Merge: 92ad27b dcd72a7 Author: Brad King AuthorDate: Wed Jan 14 15:06:50 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 15:06:50 2015 -0500 Merge topic 'Xcode-clang-compile-features' into next dcd72a74 Help: Add notes for topic 'Xcode-clang-compile-features' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dcd72a740573392b2074bbea3d9d992bcd8959f8 commit dcd72a740573392b2074bbea3d9d992bcd8959f8 Author: Brad King AuthorDate: Wed Jan 14 15:06:11 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 15:06:11 2015 -0500 Help: Add notes for topic 'Xcode-clang-compile-features' diff --git a/Help/release/dev/Xcode-clang-compile-features.rst b/Help/release/dev/Xcode-clang-compile-features.rst new file mode 100644 index 0000000..d93475f --- /dev/null +++ b/Help/release/dev/Xcode-clang-compile-features.rst @@ -0,0 +1,5 @@ +Xcode-clang-compile-features +---------------------------- + +* The :manual:`Compile Features ` functionality + is now aware of features supported by Apple Clang (``AppleClang``). ----------------------------------------------------------------------- Summary of changes: Help/release/dev/Xcode-clang-compile-features.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Help/release/dev/Xcode-clang-compile-features.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 15:09:06 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 15:09:06 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1907-g34c4e62 Message-ID: <20150114200906.DEE16D2F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 34c4e62dc7fd782e916dbe512f3caa863a8735c6 (commit) via ff880ecea13537a45b914fab05ac4a3c26287f2d (commit) from edcbded42e4932285a0a89327dc383704da3fc4c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=34c4e62dc7fd782e916dbe512f3caa863a8735c6 commit 34c4e62dc7fd782e916dbe512f3caa863a8735c6 Merge: edcbded ff880ec Author: Brad King AuthorDate: Wed Jan 14 15:09:06 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 15:09:06 2015 -0500 Merge topic 'FindGit-local-Github' into next ff880ece Help: Add notes for topic 'FindGit-local-Github' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff880ecea13537a45b914fab05ac4a3c26287f2d commit ff880ecea13537a45b914fab05ac4a3c26287f2d Author: Brad King AuthorDate: Wed Jan 14 15:08:12 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 15:08:12 2015 -0500 Help: Add notes for topic 'FindGit-local-Github' diff --git a/Help/release/dev/FindGit-local-Github.rst b/Help/release/dev/FindGit-local-Github.rst new file mode 100644 index 0000000..3523e86 --- /dev/null +++ b/Help/release/dev/FindGit-local-Github.rst @@ -0,0 +1,5 @@ +FindGit-local-Github +-------------------- + +* The :module:`FindGit` module learned to find the ``git`` command-line tool + that comes with GitHub for Windows installed in user home directories. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/FindGit-local-Github.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Help/release/dev/FindGit-local-Github.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 15:14:29 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 15:14:29 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1909-gcde1bb2 Message-ID: <20150114201429.E5FD4228B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via cde1bb24e240366fd2c87a4918e1121045ee442e (commit) via e96d5ccfab7cb87c199f6aaf9c7f41257855f897 (commit) from 34c4e62dc7fd782e916dbe512f3caa863a8735c6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cde1bb24e240366fd2c87a4918e1121045ee442e commit cde1bb24e240366fd2c87a4918e1121045ee442e Merge: 34c4e62 e96d5cc Author: Brad King AuthorDate: Wed Jan 14 15:14:29 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 15:14:29 2015 -0500 Merge topic 'Apple-compiler-selection' into next e96d5ccf Help: Add notes for topic 'Apple-compiler-selection' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e96d5ccfab7cb87c199f6aaf9c7f41257855f897 commit e96d5ccfab7cb87c199f6aaf9c7f41257855f897 Author: Brad King AuthorDate: Wed Jan 14 15:13:33 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 15:13:33 2015 -0500 Help: Add notes for topic 'Apple-compiler-selection' diff --git a/Help/release/dev/Apple-compiler-selection.rst b/Help/release/dev/Apple-compiler-selection.rst new file mode 100644 index 0000000..5ff5653 --- /dev/null +++ b/Help/release/dev/Apple-compiler-selection.rst @@ -0,0 +1,8 @@ +Apple-compiler-selection +------------------------ + +* On OS X with Makefile and Ninja generators, when a compiler is found + in ``/usr/bin`` it is now mapped to the corresponding compiler inside + the Xcode application folder, if any. This allows such build + trees to continue to work with their original compiler even when + ``xcode-select`` switches to a different Xcode installation. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/Apple-compiler-selection.rst | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Help/release/dev/Apple-compiler-selection.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 15:24:05 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 15:24:05 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-746-g28f4467 Message-ID: <20150114202405.CE5ECA92BB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 28f44670c807e4098d71504d9f5204c6ffedc676 (commit) via 31cbfd41dabebd632c66c997565eb4a3f9fe6533 (commit) from 0d7176b2f7298fc818a67d004e3a3e5d392a68d4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28f44670c807e4098d71504d9f5204c6ffedc676 commit 28f44670c807e4098d71504d9f5204c6ffedc676 Merge: 0d7176b 31cbfd4 Author: Brad King AuthorDate: Wed Jan 14 15:24:04 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 15:24:04 2015 -0500 Merge topic 'record-GNU-5-features' 31cbfd41 Help: Add notes for topic 'record-GNU-5-features' ----------------------------------------------------------------------- Summary of changes: Help/release/dev/record-GNU-5-features.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Help/release/dev/record-GNU-5-features.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 15:24:08 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 15:24:08 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-748-ga985f1b Message-ID: <20150114202408.8A576A92BC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via a985f1b1f64c4c5e515e1859fac7a1281add254d (commit) via a3513ceea9909eda524863ca2024621cba65003f (commit) from 28f44670c807e4098d71504d9f5204c6ffedc676 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a985f1b1f64c4c5e515e1859fac7a1281add254d commit a985f1b1f64c4c5e515e1859fac7a1281add254d Merge: 28f4467 a3513ce Author: Brad King AuthorDate: Wed Jan 14 15:24:06 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 15:24:06 2015 -0500 Merge topic 'find-msmpi' a3513cee Help: Add notes for topic 'find-msmpi' ----------------------------------------------------------------------- Summary of changes: Help/release/dev/find-msmpi.rst | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Help/release/dev/find-msmpi.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 15:24:10 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 15:24:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-750-geb7b060 Message-ID: <20150114202410.98829A92D1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via eb7b060dc4b8e5e15d4f612db5558966c22d2315 (commit) via f121b6b12856d9b0f6f7131f492d70602a023ebd (commit) from a985f1b1f64c4c5e515e1859fac7a1281add254d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb7b060dc4b8e5e15d4f612db5558966c22d2315 commit eb7b060dc4b8e5e15d4f612db5558966c22d2315 Merge: a985f1b f121b6b Author: Brad King AuthorDate: Wed Jan 14 15:24:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 15:24:09 2015 -0500 Merge topic 'Apple-GNU-compiler-features' f121b6b1 Help: Add notes for topic 'Apple-GNU-compiler-features' ----------------------------------------------------------------------- Summary of changes: Help/release/dev/Apple-GNU-compiler-features.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Help/release/dev/Apple-GNU-compiler-features.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 15:24:26 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 15:24:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1913-gce9f627 Message-ID: <20150114202430.462B1A92D1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ce9f6273812be91e47f61a86b676e17f9b2c30fb (commit) via eb7b060dc4b8e5e15d4f612db5558966c22d2315 (commit) via a985f1b1f64c4c5e515e1859fac7a1281add254d (commit) via 28f44670c807e4098d71504d9f5204c6ffedc676 (commit) from cde1bb24e240366fd2c87a4918e1121045ee442e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ce9f6273812be91e47f61a86b676e17f9b2c30fb commit ce9f6273812be91e47f61a86b676e17f9b2c30fb Merge: cde1bb2 eb7b060 Author: Brad King AuthorDate: Wed Jan 14 15:24:18 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 15:24:18 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 14 15:27:53 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 14 Jan 2015 15:27:53 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1917-ge9ecfbc Message-ID: <20150114202753.8E915A9D98@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e9ecfbc0de78bda55e0fae8fe3c0fcab63d6a231 (commit) via da928d305b10445c2a736597d87fb2a8c4409eb7 (commit) via 1f085e11e40a20f8e8702da7920e950e47deb27c (commit) via 85d3173590e4bae63e8422ac8083a77806491b92 (commit) from ce9f6273812be91e47f61a86b676e17f9b2c30fb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e9ecfbc0de78bda55e0fae8fe3c0fcab63d6a231 commit e9ecfbc0de78bda55e0fae8fe3c0fcab63d6a231 Merge: ce9f627 da928d3 Author: Brad King AuthorDate: Wed Jan 14 15:27:52 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 15:27:52 2015 -0500 Merge topic 'Apple-compiler-selection' into next da928d30 Help: Add notes for topic 'Apple-compiler-selection' 1f085e11 OS X: Resolve compiler in /usr/bin to that reported by Xcode xcrun 85d31735 CMakeDetermineCompiler: Factor out xcrun invocation into a macro http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da928d305b10445c2a736597d87fb2a8c4409eb7 commit da928d305b10445c2a736597d87fb2a8c4409eb7 Author: Brad King AuthorDate: Wed Jan 14 15:13:33 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 15:27:06 2015 -0500 Help: Add notes for topic 'Apple-compiler-selection' diff --git a/Help/release/dev/Apple-compiler-selection.rst b/Help/release/dev/Apple-compiler-selection.rst new file mode 100644 index 0000000..5ff5653 --- /dev/null +++ b/Help/release/dev/Apple-compiler-selection.rst @@ -0,0 +1,8 @@ +Apple-compiler-selection +------------------------ + +* On OS X with Makefile and Ninja generators, when a compiler is found + in ``/usr/bin`` it is now mapped to the corresponding compiler inside + the Xcode application folder, if any. This allows such build + trees to continue to work with their original compiler even when + ``xcode-select`` switches to a different Xcode installation. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f085e11e40a20f8e8702da7920e950e47deb27c commit 1f085e11e40a20f8e8702da7920e950e47deb27c Author: Stephen Kelly AuthorDate: Sat Jan 3 17:36:34 2015 +0100 Commit: Brad King CommitDate: Wed Jan 14 15:26:53 2015 -0500 OS X: Resolve compiler in /usr/bin to that reported by Xcode xcrun The compiler in the PATH on mac is a stub for a different delegate depending on the environment. Rather than requiring xcode-select to change the used Xcode globally, users should be able to choose the compiler per-session. That is possible with the DEVELOPER_DIR environment variable. However, the environment can change between running CMake and invoking the build. In such cases, CMake prefers to record the relevant paths from the environment and use them when invoking the build. That is not currently done for the compilers on APPLE, so the compiler used is not the one reported when running cmake: $ DEVELOPER_DIR=/Applications/Xcode2.app/Contents/Developer/ cc --version Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix $ DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ cc --version Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix Update that now by querying Xcode for the correct compiler path if the compiler located by ordinary means is located in /usr/bin. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 7a5cbcd..85c8662 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -71,7 +71,7 @@ macro(_cmake_find_compiler lang) unset(_languages) # Look for a make tool provided by Xcode - if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE) + if(CMAKE_HOST_APPLE) macro(_query_xcrun compiler_name result_var_keyword result_var) if(NOT "x${result_var_keyword}" STREQUAL "xRESULT_VAR") message(FATAL_ERROR "Bad arguments to macro") @@ -81,13 +81,21 @@ macro(_cmake_find_compiler lang) ERROR_VARIABLE _xcrun_err) set("${result_var}" "${_xcrun_out}") endmacro() - foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) - _query_xcrun("${comp}" RESULT_VAR _xcrun_result) - if(_xcrun_result) - set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_result}") - break() - endif() - endforeach() + + set(xcrun_result) + if (CMAKE_${lang}_COMPILER MATCHES "^/usr/bin/(.+)$") + _query_xcrun("${CMAKE_MATCH_1}" RESULT_VAR xcrun_result) + elseif (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND") + foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) + _query_xcrun("${comp}" RESULT_VAR xcrun_result) + if(xcrun_result) + break() + endif() + endforeach() + endif() + if (xcrun_result) + set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${xcrun_result}") + endif() endif() endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85d3173590e4bae63e8422ac8083a77806491b92 commit 85d3173590e4bae63e8422ac8083a77806491b92 Author: Stephen Kelly AuthorDate: Tue Jan 13 23:10:46 2015 +0100 Commit: Brad King CommitDate: Wed Jan 14 15:26:26 2015 -0500 CMakeDetermineCompiler: Factor out xcrun invocation into a macro This will allow it to be re-used in multiple code paths later. diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake index 0ab3af6..7a5cbcd 100644 --- a/Modules/CMakeDetermineCompiler.cmake +++ b/Modules/CMakeDetermineCompiler.cmake @@ -72,12 +72,19 @@ macro(_cmake_find_compiler lang) # Look for a make tool provided by Xcode if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE) - foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) - execute_process(COMMAND xcrun --find ${comp} + macro(_query_xcrun compiler_name result_var_keyword result_var) + if(NOT "x${result_var_keyword}" STREQUAL "xRESULT_VAR") + message(FATAL_ERROR "Bad arguments to macro") + endif() + execute_process(COMMAND xcrun --find ${compiler_name} OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE _xcrun_err) - if(_xcrun_out) - set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_out}") + set("${result_var}" "${_xcrun_out}") + endmacro() + foreach(comp ${CMAKE_${lang}_COMPILER_LIST}) + _query_xcrun("${comp}" RESULT_VAR _xcrun_result) + if(_xcrun_result) + set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_result}") break() endif() endforeach() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From clinton at elemtech.com Wed Jan 14 17:08:47 2015 From: clinton at elemtech.com (Clinton Stimpson) Date: Wed, 14 Jan 2015 17:08:47 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1919-gdb5583d Message-ID: <20150114220847.90C52AA127@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via db5583de060221ed7af339eb1a9101d43794f11a (commit) via 67384cf24f1431e3db942ab10e42eb79276611bd (commit) from e9ecfbc0de78bda55e0fae8fe3c0fcab63d6a231 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db5583de060221ed7af339eb1a9101d43794f11a commit db5583de060221ed7af339eb1a9101d43794f11a Merge: e9ecfbc 67384cf Author: Clinton Stimpson AuthorDate: Wed Jan 14 17:08:46 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 14 17:08:46 2015 -0500 Merge topic 'windows-utf-8' into next 67384cf2 Fix release note for windows-utf-8, and update cmake-language docs. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=67384cf24f1431e3db942ab10e42eb79276611bd commit 67384cf24f1431e3db942ab10e42eb79276611bd Author: Clinton Stimpson AuthorDate: Wed Jan 14 15:07:55 2015 -0700 Commit: Clinton Stimpson CommitDate: Wed Jan 14 15:07:55 2015 -0700 Fix release note for windows-utf-8, and update cmake-language docs. In cmake-language, a note was added about UTF-8 support on Windows. diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 15c101f..1d4b09c 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -60,15 +60,16 @@ Syntax Encoding -------- -A CMake Language source file must be written in 7-bit ASCII text -to be portable across all supported platforms. Newlines may be +A CMake Language source file may be written in 7-bit ASCII text for +maximum portability across all supported platforms. Newlines may be encoded as either ``\n`` or ``\r\n`` but will be converted to ``\n`` as input files are read. Note that the implementation is 8-bit clean so source files may be encoded as UTF-8 on platforms with system APIs supporting this -encoding. Furthermore, CMake 3.0 and above allow a leading UTF-8 -`Byte-Order Mark`_ in source files. +encoding. In addition, CMake 3.2 and above support UTF-8 files on +Windows while using UTF-16 to call system APIs. Furthermore, CMake 3.0 +and above allow a leading UTF-8 `Byte-Order Mark`_ in source files. .. _`Byte-Order Mark`: http://en.wikipedia.org/wiki/Byte_order_mark diff --git a/Help/release/dev/windows-utf-8.rst b/Help/release/dev/windows-utf-8.rst index fe02153..9438cdc 100644 --- a/Help/release/dev/windows-utf-8.rst +++ b/Help/release/dev/windows-utf-8.rst @@ -11,7 +11,7 @@ windows-utf-8 Latin 1 languages such as those found in North and South America and Western Europe. With UTF-8, additional languages are supported. - The CMakeLists.txt file and other files read by CMake file are expected - to be UTF-8 encoded. If files are already ASCII, they will be compatible. - If files were in a different encoding, including Latin 1, they will need to - be converted. + Files written in the :manual:`cmake-language(7)`, such as + ``CMakeLists.txt`` for ``*.cmake`` files are expected to be UTF-8 encoded. + If files are already ASCII, they will be compatible. If files were in a + different encoding, including Latin 1, they will need to be converted. ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-language.7.rst | 9 +++++---- Help/release/dev/windows-utf-8.rst | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jan 15 00:01:11 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 15 Jan 2015 00:01:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-751-g23c02d2 Message-ID: <20150115050111.91381A81A4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 23c02d245425ab15d6d0a99941355488ddee8cf5 (commit) from eb7b060dc4b8e5e15d4f612db5558966c22d2315 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23c02d245425ab15d6d0a99941355488ddee8cf5 commit 23c02d245425ab15d6d0a99941355488ddee8cf5 Author: Kitware Robot AuthorDate: Thu Jan 15 00:01:09 2015 -0500 Commit: Kitware Robot CommitDate: Thu Jan 15 00:01:09 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index d741a92..509a4e0 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 20150114) +set(CMake_VERSION_PATCH 20150115) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:39:32 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:39:32 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1921-g13da15f Message-ID: <20150115143932.5C6DA2198@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 13da15ff0ad34ec35039acfd6a1f3b343f38dc87 (commit) via 509f2713bfa0a289851dfd8d6e45a356adf233b7 (commit) from db5583de060221ed7af339eb1a9101d43794f11a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13da15ff0ad34ec35039acfd6a1f3b343f38dc87 commit 13da15ff0ad34ec35039acfd6a1f3b343f38dc87 Merge: db5583d 509f271 Author: Brad King AuthorDate: Thu Jan 15 09:39:31 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:39:31 2015 -0500 Merge topic 'fix-ctest_build-output-processing-regression' into next 509f2713 ctest_build: Fix logic regression in parent that clips build output http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=509f2713bfa0a289851dfd8d6e45a356adf233b7 commit 509f2713bfa0a289851dfd8d6e45a356adf233b7 Author: Brad King AuthorDate: Thu Jan 15 09:28:21 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 09:32:58 2015 -0500 ctest_build: Fix logic regression in parent that clips build output The sweeping pattern change in commit 238dd2fb (Use insert instead of a loop in some cases, 2014-11-22) accidentally changed the iterator range used on the queue in cmCTestBuildHandler::ProcessBuffer. Instead of ending at the iterator positioned at the next newline to populate CurrentProcessingLine, it was changed to go to the end of the queue. This causes the line to contain newlines and possibly be cut off in the middle of a line. Fix this regression by restoring use of the proper end-of-line position. diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 5e7d764..0c3f206 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -1095,7 +1095,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length, // Create a contiguous array for the line this->CurrentProcessingLine.clear(); this->CurrentProcessingLine.insert(this->CurrentProcessingLine.end(), - queue->begin(), queue->end()); + queue->begin(), it); this->CurrentProcessingLine.push_back(0); const char* line = &*this->CurrentProcessingLine.begin(); ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestBuildHandler.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:53:48 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:53:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-754-g101a62a Message-ID: <20150115145348.6C054A9FD2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 101a62aacbcc812263439ca42faaf4f2419b6119 (commit) via 4ce110bbbac36362d8f3fbddb0b405320695ed36 (commit) via 0b7e7e277c111d274d7dba378273f77d5b2a4fd7 (commit) from 23c02d245425ab15d6d0a99941355488ddee8cf5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=101a62aacbcc812263439ca42faaf4f2419b6119 commit 101a62aacbcc812263439ca42faaf4f2419b6119 Merge: 23c02d2 4ce110b Author: Brad King AuthorDate: Thu Jan 15 09:53:47 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:53:47 2015 -0500 Merge topic 'revert-feature_record_msvc' 4ce110bb Tests: Revert workaround for COMPILE_FEATURES genex bug 0b7e7e27 Revert topic 'feature_record_msvc' ----------------------------------------------------------------------- Summary of changes: Help/release/dev/feature_record_msvc.rst | 6 -- Modules/Compiler/MSVC-C-FeatureTests.cmake | 23 ----- Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 97 -------------------- Modules/Platform/Windows-MSVC-C.cmake | 2 - Modules/Platform/Windows-MSVC-CXX.cmake | 9 -- Modules/WriteCompilerDetectionHeader.cmake | 5 +- Tests/CompileFeatures/CMakeLists.txt | 23 ----- Tests/CompileFeatures/genex_test.cpp | 2 +- .../WriteCompilerDetectionHeader/CMakeLists.txt | 16 +--- .../RunCMake/CompileFeatures/NonValidTarget1.cmake | 2 +- Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake | 9 +- 11 files changed, 8 insertions(+), 186 deletions(-) delete mode 100644 Help/release/dev/feature_record_msvc.rst delete mode 100644 Modules/Compiler/MSVC-C-FeatureTests.cmake delete mode 100644 Modules/Compiler/MSVC-CXX-FeatureTests.cmake hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:53:50 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:53:50 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-756-g49bfaf2 Message-ID: <20150115145350.DCE2EA9FD3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 49bfaf2bda8368cb8398313bed8f91e3aa8ada14 (commit) via dd5d2eb156b7e45ded53f694a12a1e00d19f6cd6 (commit) from 101a62aacbcc812263439ca42faaf4f2419b6119 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=49bfaf2bda8368cb8398313bed8f91e3aa8ada14 commit 49bfaf2bda8368cb8398313bed8f91e3aa8ada14 Merge: 101a62a dd5d2eb Author: Brad King AuthorDate: Thu Jan 15 09:53:49 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:53:49 2015 -0500 Merge topic 'FindRuby-zero-version' dd5d2eb1 FindRuby: fix selection of version x.0 (#15345) ----------------------------------------------------------------------- Summary of changes: Modules/FindRuby.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:53:53 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:53:53 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-758-g1720869 Message-ID: <20150115145353.3A39EA9FD4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 1720869a7e287786e5d4f5c85d07bf418dd81782 (commit) via 802d0aa0b0a0af72fdc95bf1f69afeb362b6ef95 (commit) from 49bfaf2bda8368cb8398313bed8f91e3aa8ada14 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1720869a7e287786e5d4f5c85d07bf418dd81782 commit 1720869a7e287786e5d4f5c85d07bf418dd81782 Merge: 49bfaf2 802d0aa Author: Brad King AuthorDate: Thu Jan 15 09:53:52 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:53:52 2015 -0500 Merge topic 'FindRuby-fix-version' 802d0aa0 FindRuby: Fix output check in _RUBY_CONFIG_VAR ----------------------------------------------------------------------- Summary of changes: Modules/FindRuby.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:53:55 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:53:55 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-760-g526a80b Message-ID: <20150115145355.7989EA9FD9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 526a80b32a28bf3a1601ed086bba10f9059d5940 (commit) via 4048f7cde018b2cddb9e6e53b04dbf6f588b3e5f (commit) from 1720869a7e287786e5d4f5c85d07bf418dd81782 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=526a80b32a28bf3a1601ed086bba10f9059d5940 commit 526a80b32a28bf3a1601ed086bba10f9059d5940 Merge: 1720869 4048f7c Author: Brad King AuthorDate: Thu Jan 15 09:53:54 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:53:54 2015 -0500 Merge topic 'FindBoost-update-versions' 4048f7cd FindBoost: Add latest Boost version 1.57.0 and next milestone 1.58.0 ----------------------------------------------------------------------- Summary of changes: Modules/FindBoost.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:53:58 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:53:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-762-gfa636e1 Message-ID: <20150115145358.1D020A9FD7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via fa636e19ce42c7523c4858ea697376fe94080097 (commit) via 70abf6e780185c9c7041593bc99aff0a26bc9265 (commit) from 526a80b32a28bf3a1601ed086bba10f9059d5940 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fa636e19ce42c7523c4858ea697376fe94080097 commit fa636e19ce42c7523c4858ea697376fe94080097 Merge: 526a80b 70abf6e Author: Brad King AuthorDate: Thu Jan 15 09:53:56 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:53:56 2015 -0500 Merge topic 'cpack-PackageMaker-OSX-10.10' 70abf6e7 CPack: Fix PackageMaker internal versioning for OS X 10.10 diff --cc Source/CPack/cmCPackPackageMakerGenerator.cxx index 8a22131,e58415c..dfe35c9 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@@ -710,9 -726,9 +726,9 @@@ GenerateComponentPackage(const char *pa packageFile << std::endl); // The command that will be used to run PackageMaker - cmOStringStream pkgCmd; + std::ostringstream pkgCmd; - if (this->PackageCompatibilityVersion < 10.5 || + if (this->PackageCompatibilityVersion < getVersion(10, 5) || this->PackageMakerVersion < 3.0) { // Create Description.plist and Info.plist files for normal Mac OS ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackPackageMakerGenerator.cxx | 34 ++++++++++++++++++------- Source/CPack/cmCPackPackageMakerGenerator.h | 2 +- 2 files changed, 26 insertions(+), 10 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:54:00 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:54:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-764-g44612e7 Message-ID: <20150115145400.C6E8AA9FDB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 44612e74075f751b01950dd0f00e86d61f9ba05a (commit) via 23f3798c7b38ef7274f318ab90f1788b569dbc5d (commit) from fa636e19ce42c7523c4858ea697376fe94080097 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44612e74075f751b01950dd0f00e86d61f9ba05a commit 44612e74075f751b01950dd0f00e86d61f9ba05a Merge: fa636e1 23f3798 Author: Brad King AuthorDate: Thu Jan 15 09:53:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:53:59 2015 -0500 Merge topic 'fix-LOCATION-with-TARGET_OBJECTS' 23f3798c cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338) ----------------------------------------------------------------------- Summary of changes: Source/cmTarget.cxx | 1 + .../LOCATION-and-TARGET_OBJECTS-result.txt} | 0 ...ned-stderr.txt => LOCATION-and-TARGET_OBJECTS-stderr.txt} | 10 +++++----- Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake | 6 ++++++ Tests/RunCMake/CMP0026/RunCMakeTest.cmake | 1 + 5 files changed, 13 insertions(+), 5 deletions(-) copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt} (100%) copy Tests/RunCMake/CMP0026/{ObjlibNotDefined-stderr.txt => LOCATION-and-TARGET_OBJECTS-stderr.txt} (50%) create mode 100644 Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:54:03 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:54:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-767-g6418eef Message-ID: <20150115145403.56E5EA9FEA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 6418eef222304db9a884a3cf101f86c2eabfb503 (commit) via 45ec182d27dc27412c94ccb49632e22a55d5fbe4 (commit) via 2bead0eb1b605cc5d0db23d9af00087277157921 (commit) from 44612e74075f751b01950dd0f00e86d61f9ba05a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6418eef222304db9a884a3cf101f86c2eabfb503 commit 6418eef222304db9a884a3cf101f86c2eabfb503 Merge: 44612e7 45ec182 Author: Brad King AuthorDate: Thu Jan 15 09:54:02 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:54:02 2015 -0500 Merge topic 'fix-COMPILE_FEATURES-genex' 45ec182d Features: Fix the COMPILE_FEATURES genex for unavailable features. 2bead0eb cmMakefile: Rename a method to what it really does. ----------------------------------------------------------------------- Summary of changes: Source/cmGeneratorExpressionEvaluator.cxx | 9 ++++++++- Source/cmMakefile.cxx | 11 ++++++----- Source/cmMakefile.h | 6 +++--- 3 files changed, 17 insertions(+), 9 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:54:05 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:54:05 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-772-g4ecc392 Message-ID: <20150115145405.9226BA9FD2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 4ecc392b42e999e3e103eac0c0e28fa63c39167c (commit) via 65b81da458614c6a4652ea2e4fc933893c671281 (commit) via 30d2de9aa82196a12f47930e736181c48c568585 (commit) via 4a6e795b0c5cdafbc78f12389ec20d6bc4f9ca34 (commit) via abb4a6781f96b28e4c30014915f566dee9130db7 (commit) from 6418eef222304db9a884a3cf101f86c2eabfb503 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ecc392b42e999e3e103eac0c0e28fa63c39167c commit 4ecc392b42e999e3e103eac0c0e28fa63c39167c Merge: 6418eef 65b81da Author: Brad King AuthorDate: Thu Jan 15 09:54:04 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:54:04 2015 -0500 Merge topic 'delete-algorithm' 65b81da4 cmVariableWatch: Use the cmDeleteAll algorithm with for_each. 30d2de9a cmGeneratorExpressionEvaluator: Replace own algorithm with cmDeleteAll. 4a6e795b Use the cmDeleteAll algorithm instead of trivial raw loops. abb4a678 Add a generic algorithm for deleting items in a container. ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGeneratorFactory.cxx | 6 +--- Source/CursesDialog/cmCursesMainForm.cxx | 13 ++------ Source/cmCTest.cxx | 8 +---- Source/cmComputeLinkDepends.cxx | 7 +---- Source/cmDependsC.cxx | 7 +---- Source/cmDocumentation.cxx | 7 +---- Source/cmExportSet.cxx | 5 +--- Source/cmFileLockPool.cxx | 17 ++--------- Source/cmGeneratorExpression.cxx | 10 +------ Source/cmGeneratorExpressionEvaluator.cxx | 27 ++--------------- Source/cmGlobalGenerator.cxx | 20 ++----------- Source/cmInstalledFile.h | 6 +--- Source/cmMakeDepend.cxx | 7 +---- Source/cmMakefile.cxx | 46 +++++------------------------ Source/cmOrderDirectories.cxx | 14 ++------- Source/cmPolicies.cxx | 8 +---- Source/cmStandardIncludes.h | 27 +++++++++++++++++ Source/cmTarget.cxx | 8 +---- Source/cmVariableWatch.cxx | 21 +++++-------- Source/cmake.cxx | 12 ++------ 20 files changed, 68 insertions(+), 208 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:54:07 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:54:07 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-774-g9cdc2f3 Message-ID: <20150115145407.68BBAA9FE2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 9cdc2f38edea4b2d1b4421587bbe9b2a83999d4f (commit) via 74b8f7862291d795eba525f3103f1370b8ec7518 (commit) from 4ecc392b42e999e3e103eac0c0e28fa63c39167c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9cdc2f38edea4b2d1b4421587bbe9b2a83999d4f commit 9cdc2f38edea4b2d1b4421587bbe9b2a83999d4f Merge: 4ecc392 74b8f78 Author: Brad King AuthorDate: Thu Jan 15 09:54:06 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:54:06 2015 -0500 Merge topic 'zlib-suppress-warnings' 74b8f786 zlib: Disable warnings to avoid changing 3rd party code ----------------------------------------------------------------------- Summary of changes: Utilities/cmzlib/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:54:09 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:54:09 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-778-gb4263ab Message-ID: <20150115145409.7B573A9FD9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via b4263abdea04bf445c3e99be3be627dfb6c3047d (commit) via dcd72a740573392b2074bbea3d9d992bcd8959f8 (commit) via 3ad893b5c23566184bc78eafb1446c05bd39a643 (commit) via 98965fb12d0d07deb6d953624529f8b8151dce13 (commit) from 9cdc2f38edea4b2d1b4421587bbe9b2a83999d4f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4263abdea04bf445c3e99be3be627dfb6c3047d commit b4263abdea04bf445c3e99be3be627dfb6c3047d Merge: 9cdc2f3 dcd72a7 Author: Brad King AuthorDate: Thu Jan 15 09:54:08 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:54:08 2015 -0500 Merge topic 'Xcode-clang-compile-features' dcd72a74 Help: Add notes for topic 'Xcode-clang-compile-features' 3ad893b5 Features: Record for historical Xcode clang versions. 98965fb1 Features: Record dialect flags for AppleClang 4.0+. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/Xcode-clang-compile-features.rst | 5 +++ Modules/Compiler/AppleClang-C-FeatureTests.cmake | 2 +- Modules/Compiler/AppleClang-C.cmake | 4 +- Modules/Compiler/AppleClang-CXX-FeatureTests.cmake | 43 +++++++++++++++----- Modules/Compiler/AppleClang-CXX.cmake | 12 ++++-- Tests/CompileFeatures/CMakeLists.txt | 20 +++++++++ 6 files changed, 69 insertions(+), 17 deletions(-) create mode 100644 Help/release/dev/Xcode-clang-compile-features.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:54:11 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:54:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-780-gff1727a Message-ID: <20150115145411.53049A9FDA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via ff1727af778301c2a53007098bd31fe7b9af6c40 (commit) via 68857ccd823088caf240318f2a7b39522fc383da (commit) from b4263abdea04bf445c3e99be3be627dfb6c3047d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff1727af778301c2a53007098bd31fe7b9af6c40 commit ff1727af778301c2a53007098bd31fe7b9af6c40 Merge: b4263ab 68857cc Author: Brad King AuthorDate: Thu Jan 15 09:54:10 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:54:10 2015 -0500 Merge topic 'safer-msmpi-checks' 68857ccd FindMPI: handle trailing slash from $MSMPI_BIN ----------------------------------------------------------------------- Summary of changes: Modules/FindMPI.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:54:13 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:54:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-784-ge7c1836 Message-ID: <20150115145413.3EFB1A9FE4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e7c1836e044689c0a55d9fcacd94d88ef8b9ec19 (commit) via da928d305b10445c2a736597d87fb2a8c4409eb7 (commit) via 1f085e11e40a20f8e8702da7920e950e47deb27c (commit) via 85d3173590e4bae63e8422ac8083a77806491b92 (commit) from ff1727af778301c2a53007098bd31fe7b9af6c40 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e7c1836e044689c0a55d9fcacd94d88ef8b9ec19 commit e7c1836e044689c0a55d9fcacd94d88ef8b9ec19 Merge: ff1727a da928d3 Author: Brad King AuthorDate: Thu Jan 15 09:54:12 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:54:12 2015 -0500 Merge topic 'Apple-compiler-selection' da928d30 Help: Add notes for topic 'Apple-compiler-selection' 1f085e11 OS X: Resolve compiler in /usr/bin to that reported by Xcode xcrun 85d31735 CMakeDetermineCompiler: Factor out xcrun invocation into a macro ----------------------------------------------------------------------- Summary of changes: Help/release/dev/Apple-compiler-selection.rst | 8 +++++++ Modules/CMakeDetermineCompiler.cmake | 31 ++++++++++++++++++------- 2 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 Help/release/dev/Apple-compiler-selection.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:54:15 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:54:15 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-787-g80a6c38 Message-ID: <20150115145415.4F720A9FD2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 80a6c38d98d12f4b5d6411a93e67863f163f0da0 (commit) via ff880ecea13537a45b914fab05ac4a3c26287f2d (commit) via 546906243d21727ac6c1bab0210fc028ff80c3c0 (commit) from e7c1836e044689c0a55d9fcacd94d88ef8b9ec19 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80a6c38d98d12f4b5d6411a93e67863f163f0da0 commit 80a6c38d98d12f4b5d6411a93e67863f163f0da0 Merge: e7c1836 ff880ec Author: Brad King AuthorDate: Thu Jan 15 09:54:14 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:54:14 2015 -0500 Merge topic 'FindGit-local-Github' ff880ece Help: Add notes for topic 'FindGit-local-Github' 54690624 FindGit: Search in 'GitHub for Windows' user directory ----------------------------------------------------------------------- Summary of changes: Help/release/dev/FindGit-local-Github.rst | 5 +++++ Modules/FindGit.cmake | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 Help/release/dev/FindGit-local-Github.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:54:36 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:54:36 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1936-gc776cbd Message-ID: <20150115145436.7B2AEA9FD9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c776cbd2c1e7a05b852a2989c5b959867b6f6340 (commit) via 80a6c38d98d12f4b5d6411a93e67863f163f0da0 (commit) via e7c1836e044689c0a55d9fcacd94d88ef8b9ec19 (commit) via ff1727af778301c2a53007098bd31fe7b9af6c40 (commit) via b4263abdea04bf445c3e99be3be627dfb6c3047d (commit) via 9cdc2f38edea4b2d1b4421587bbe9b2a83999d4f (commit) via 4ecc392b42e999e3e103eac0c0e28fa63c39167c (commit) via 6418eef222304db9a884a3cf101f86c2eabfb503 (commit) via 44612e74075f751b01950dd0f00e86d61f9ba05a (commit) via fa636e19ce42c7523c4858ea697376fe94080097 (commit) via 526a80b32a28bf3a1601ed086bba10f9059d5940 (commit) via 1720869a7e287786e5d4f5c85d07bf418dd81782 (commit) via 49bfaf2bda8368cb8398313bed8f91e3aa8ada14 (commit) via 101a62aacbcc812263439ca42faaf4f2419b6119 (commit) via 23c02d245425ab15d6d0a99941355488ddee8cf5 (commit) from 13da15ff0ad34ec35039acfd6a1f3b343f38dc87 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c776cbd2c1e7a05b852a2989c5b959867b6f6340 commit c776cbd2c1e7a05b852a2989c5b959867b6f6340 Merge: 13da15f 80a6c38 Author: Brad King AuthorDate: Thu Jan 15 09:54:23 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 09:54:23 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 09:57:20 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 09:57:20 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1938-ge75c8ea Message-ID: <20150115145720.53D82AA06D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e75c8ea26cf3c63487877499252dbf3379374578 (commit) via 9c9bc71256000c8bedd391e049150b6a0f3b0dc3 (commit) from c776cbd2c1e7a05b852a2989c5b959867b6f6340 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e75c8ea26cf3c63487877499252dbf3379374578 commit e75c8ea26cf3c63487877499252dbf3379374578 Merge: c776cbd 9c9bc71 Author: Brad King AuthorDate: Thu Jan 15 09:57:19 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 09:57:19 2015 -0500 Merge topic 'fix-qcc-compiler-id' into next 9c9bc712 QNX: Fix detection of QCC compiler id (#15349) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c9bc71256000c8bedd391e049150b6a0f3b0dc3 commit 9c9bc71256000c8bedd391e049150b6a0f3b0dc3 Author: Brad King AuthorDate: Wed Jan 14 10:28:59 2015 -0500 Commit: Brad King CommitDate: Wed Jan 14 10:28:59 2015 -0500 QNX: Fix detection of QCC compiler id (#15349) In commit v3.1.0-rc1~113^2 (Use a more reliable regex for extracting binary INFO strings, 2014-09-03) the matching of INFO: strings was made more strict and no longer matches just "INFO:qnxnto". Use "INFO:qnxnto[]" instead to conform to the new pattern. diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 0221cbd..09ae509 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -18,7 +18,7 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; #endif #ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto"; +char const* qnxnto = "INFO" ":" "qnxnto[]"; #endif @CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@ diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 9ece26d..cc3ab49 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -17,7 +17,7 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; #endif #ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto"; +char const* qnxnto = "INFO" ":" "qnxnto[]"; #endif @CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@ diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 6c6a914..9f92cd0 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -445,7 +445,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) string(REGEX REPLACE "^0+([0-9])" "\\1" SIMULATE_VERSION "${CMAKE_MATCH_1}") string(REGEX REPLACE "\\.0+([0-9])" ".\\1" SIMULATE_VERSION "${SIMULATE_VERSION}") endif() - if("${info}" MATCHES "INFO:qnxnto") + if("${info}" MATCHES "INFO:qnxnto\\[\\]") set(COMPILER_QNXNTO 1) endif() endforeach() ----------------------------------------------------------------------- Summary of changes: Modules/CMakeCCompilerId.c.in | 2 +- Modules/CMakeCXXCompilerId.cpp.in | 2 +- Modules/CMakeDetermineCompilerId.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 10:06:39 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 10:06:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-793-g811a29c Message-ID: <20150115150639.12F79AA1A8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 811a29c9507054e3301d90d5d376d0c6d6caded1 (commit) via 0fcdc57b7b9bbdeaa77c6751b92fd6a14394d1b4 (commit) via a08a444bab783ffe8ca02ddf6a06d3c7be5983e3 (commit) via 86d6ab06edfc000a7d6a405726887562e6e2f338 (commit) via 80025e4c3c373f8457e82b38f7af3c2de1857dca (commit) via 365973cf98c1455fe4571081a8cb10ce260c4f8f (commit) from 80a6c38d98d12f4b5d6411a93e67863f163f0da0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 10:06:39 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 10:06:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1945-gf1c1ed5 Message-ID: <20150115150639.3690AAA1A9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f1c1ed54aa09398e28a04fca7e88b48f15b4283e (commit) via 811a29c9507054e3301d90d5d376d0c6d6caded1 (commit) via 0fcdc57b7b9bbdeaa77c6751b92fd6a14394d1b4 (commit) via a08a444bab783ffe8ca02ddf6a06d3c7be5983e3 (commit) via 86d6ab06edfc000a7d6a405726887562e6e2f338 (commit) via 80025e4c3c373f8457e82b38f7af3c2de1857dca (commit) via 365973cf98c1455fe4571081a8cb10ce260c4f8f (commit) from e75c8ea26cf3c63487877499252dbf3379374578 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f1c1ed54aa09398e28a04fca7e88b48f15b4283e commit f1c1ed54aa09398e28a04fca7e88b48f15b4283e Merge: e75c8ea 811a29c Author: Brad King AuthorDate: Thu Jan 15 10:06:28 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 10:06:28 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 10:06:39 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 10:06:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, release, updated. v3.1.0-58-g0fcdc57 Message-ID: <20150115150639.8A8F1AA1AA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 0fcdc57b7b9bbdeaa77c6751b92fd6a14394d1b4 (commit) via a08a444bab783ffe8ca02ddf6a06d3c7be5983e3 (commit) via 86d6ab06edfc000a7d6a405726887562e6e2f338 (commit) via 80025e4c3c373f8457e82b38f7af3c2de1857dca (commit) via 365973cf98c1455fe4571081a8cb10ce260c4f8f (commit) via 4048f7cde018b2cddb9e6e53b04dbf6f588b3e5f (commit) via 23f3798c7b38ef7274f318ab90f1788b569dbc5d (commit) via dd5d2eb156b7e45ded53f694a12a1e00d19f6cd6 (commit) via 70abf6e780185c9c7041593bc99aff0a26bc9265 (commit) via 802d0aa0b0a0af72fdc95bf1f69afeb362b6ef95 (commit) from 46eae529685bed736736713914d119fcab6e0a5c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Modules/FindBoost.cmake | 2 +- Modules/FindRuby.cmake | 4 +-- Source/CPack/cmCPackPackageMakerGenerator.cxx | 34 ++++++++++++++------ Source/CPack/cmCPackPackageMakerGenerator.h | 2 +- Source/cmTarget.cxx | 1 + .../LOCATION-and-TARGET_OBJECTS-result.txt} | 0 ....txt => LOCATION-and-TARGET_OBJECTS-stderr.txt} | 10 +++--- .../CMP0026/LOCATION-and-TARGET_OBJECTS.cmake | 6 ++++ Tests/RunCMake/CMP0026/RunCMakeTest.cmake | 1 + 9 files changed, 42 insertions(+), 18 deletions(-) copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0026/LOCATION-and-TARGET_OBJECTS-result.txt} (100%) copy Tests/RunCMake/CMP0026/{ObjlibNotDefined-stderr.txt => LOCATION-and-TARGET_OBJECTS-stderr.txt} (50%) create mode 100644 Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 10:34:23 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 10:34:23 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1947-g0be087e Message-ID: <20150115153423.E2C25A94A2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0be087e620e3993145474bb8ee30cb7811d0f83c (commit) via ab8bdd3ba8b14092c30e78a72b599f154d3f850d (commit) from f1c1ed54aa09398e28a04fca7e88b48f15b4283e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0be087e620e3993145474bb8ee30cb7811d0f83c commit 0be087e620e3993145474bb8ee30cb7811d0f83c Merge: f1c1ed5 ab8bdd3 Author: Brad King AuthorDate: Thu Jan 15 10:34:23 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 10:34:23 2015 -0500 Merge topic 'windows-utf-8' into next ab8bdd3b Help: Revise wording of Windows UTF-8 support docs/notes http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab8bdd3ba8b14092c30e78a72b599f154d3f850d commit ab8bdd3ba8b14092c30e78a72b599f154d3f850d Author: Brad King AuthorDate: Thu Jan 15 10:34:13 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 10:34:13 2015 -0500 Help: Revise wording of Windows UTF-8 support docs/notes diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 1d4b09c..5ec5858 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -67,9 +67,10 @@ as input files are read. Note that the implementation is 8-bit clean so source files may be encoded as UTF-8 on platforms with system APIs supporting this -encoding. In addition, CMake 3.2 and above support UTF-8 files on -Windows while using UTF-16 to call system APIs. Furthermore, CMake 3.0 -and above allow a leading UTF-8 `Byte-Order Mark`_ in source files. +encoding. In addition, CMake 3.2 and above support source files +encoded in UTF-8 on Windows (using UTF-16 to call system APIs). +Furthermore, CMake 3.0 and above allow a leading UTF-8 +`Byte-Order Mark`_ in source files. .. _`Byte-Order Mark`: http://en.wikipedia.org/wiki/Byte_order_mark diff --git a/Help/release/dev/windows-utf-8.rst b/Help/release/dev/windows-utf-8.rst index 9438cdc..a4e3ff0 100644 --- a/Help/release/dev/windows-utf-8.rst +++ b/Help/release/dev/windows-utf-8.rst @@ -1,17 +1,17 @@ windows-utf-8 -------------------------- +------------- -* The Windows version of CMake has been enhanced to use Unicode. This - allows using characters from multiple languages in CMake. Because CMake - interoperates with many other tools, there may still be some limitations - when using certain Unicode characters. +* On Windows, CMake learned to support Unicode characters. This allows using + characters from multiple (spoken) languages in CMake code and in paths to + source files. Because CMake interoperates with many other tools, there may + still be some limitations when using certain Unicode characters. - The Visual Studio generators have been enhanced to write solution and - project files in UTF-8 instead of Windows-1252. Windows-1252 supported - Latin 1 languages such as those found in North and South America and Western - Europe. With UTF-8, additional languages are supported. + Files written in the :manual:`cmake-language(7)`, such as ``CMakeLists.txt`` + or ``*.cmake`` files, are expected to be encoded as UTF-8. If files are + already ASCII, they will be compatible. If files were in a different + encoding, including Latin 1, they will need to be converted. - Files written in the :manual:`cmake-language(7)`, such as - ``CMakeLists.txt`` for ``*.cmake`` files are expected to be UTF-8 encoded. - If files are already ASCII, they will be compatible. If files were in a - different encoding, including Latin 1, they will need to be converted. + The Visual Studio generators now write solution and project files in UTF-8 + instead of Windows-1252. Windows-1252 supported Latin 1 languages such as + those found in North and South America and Western Europe. With UTF-8, + additional languages are now supported. ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-language.7.rst | 7 ++++--- Help/release/dev/windows-utf-8.rst | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 16 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 10:58:16 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 10:58:16 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1954-g1133a57 Message-ID: <20150115155816.19BF5A9F9F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1133a57d714ed7ec8fe39c577cd80aed02dc7c4a (commit) via 0fe4d8bb3b9e8074f7efd95ae92fa32fe29a2c02 (commit) via 945571db747fd09036d0efd55b538dd4b3c8b874 (commit) via a32b2245ca8d77da5b8218bcdcc6958016cdbb48 (commit) via 531e75e0b73f921fc02983f19a07141c867a752a (commit) via f3884b47ec64b80ad31da93192188f05f60ae5d8 (commit) via 4ab5c652b663377afcdcaf7cda05ac8746b7d21d (commit) from 0be087e620e3993145474bb8ee30cb7811d0f83c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1133a57d714ed7ec8fe39c577cd80aed02dc7c4a commit 1133a57d714ed7ec8fe39c577cd80aed02dc7c4a Merge: 0be087e 0fe4d8b Author: Brad King AuthorDate: Thu Jan 15 10:58:14 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 10:58:14 2015 -0500 Merge topic 'ExternalData-custom-download' into next 0fe4d8bb ExternalData: Add support for custom download scripts 945571db ExternalData: Improve documentation organization a32b2245 ExternalData: Re-order documentation 531e75e0 ExternalData: Document all variables defined by module f3884b47 ExternalData: Split documentation into sections 4ab5c652 ExternalData: Convert docs to a bracket comment http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fe4d8bb3b9e8074f7efd95ae92fa32fe29a2c02 commit 0fe4d8bb3b9e8074f7efd95ae92fa32fe29a2c02 Author: Brad King AuthorDate: Tue Jan 13 10:03:56 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 10:48:09 2015 -0500 ExternalData: Add support for custom download scripts Add support for a special URL template to map the fetch operation to a project-specified .cmake script insead of using file(DOWNLOAD). Extend the Module.ExternalData test to cover the behavior. Extend the RunCMake.ExternalData test to cover error cases. diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index 4f84d53..2d5088a 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -99,6 +99,12 @@ calling any of the functions provided by this module. default is ``CMAKE_BINARY_DIR``. The directory layout will mirror that of content links under ``ExternalData_SOURCE_ROOT``. +.. variable:: ExternalData_CUSTOM_SCRIPT_ + + Specify a full path to a ``.cmake`` custom fetch script identified by + ```` in entries of the ``ExternalData_URL_TEMPLATES`` list. + See `Custom Fetch Scripts`_. + .. variable:: ExternalData_LINK_CONTENT The ``ExternalData_LINK_CONTENT`` variable may be set to the name of a @@ -246,6 +252,44 @@ The following hash algorithms are supported:: Note that the hashes are used only for unique data identification and download verification. + +Custom Fetch Scripts +^^^^^^^^^^^^^^^^^^^^ + +When a data file must be fetched from one of the URL templates +specified in the ``ExternalData_URL_TEMPLATES`` variable, it is +normally downloaded using the :command:`file(DOWNLOAD)` command. +One may specify usage of a custom fetch script by using a URL +template of the form ``ExternalDataCustomScript:///``. +The ```` must be a C identifier, and the ```` must +contain the ``%(algo)`` and ``%(hash)`` placeholders. +A variable corresponding to the key, ``ExternalData_CUSTOM_SCRIPT_``, +must be set to the full path to a ``.cmake`` script file. The script +will be included to perform the actual fetch, and provided with +the following variables: + +.. variable:: ExternalData_CUSTOM_LOCATION + + When a custom fetch script is loaded, this variable is set to the + location part of the URL, which will contain the substituted hash + algorithm name and content hash value. + +.. variable:: ExternalData_CUSTOM_FILE + + When a custom fetch script is loaded, this variable is set to the + full path to a file in which the script must store the fetched + content. The name of the file is unspecified and should not be + interpreted in any way. + +The custom fetch script is expected to store fetched content in the +file or set a variable: + +.. variable:: ExternalData_CUSTOM_ERROR + + When a custom fetch script fails to fetch the requested content, + it must set this variable to a short one-line message describing + the reason for failure. + #]=======================================================================] #============================================================================= @@ -275,6 +319,37 @@ function(ExternalData_add_target target) if(NOT ExternalData_OBJECT_STORES) set(ExternalData_OBJECT_STORES ${CMAKE_BINARY_DIR}/ExternalData/Objects) endif() + set(_ExternalData_CONFIG_CODE "") + + # Store custom script configuration. + foreach(url_template IN LISTS ExternalData_URL_TEMPLATES) + if("${url_template}" MATCHES "^ExternalDataCustomScript://([^/]*)/(.*)$") + set(key "${CMAKE_MATCH_1}") + if(key MATCHES "^[A-Za-z_][A-Za-z0-9_]*$") + if(ExternalData_CUSTOM_SCRIPT_${key}) + if(IS_ABSOLUTE "${ExternalData_CUSTOM_SCRIPT_${key}}") + string(CONCAT _ExternalData_CONFIG_CODE "${_ExternalData_CONFIG_CODE}\n" + "set(ExternalData_CUSTOM_SCRIPT_${key} \"${ExternalData_CUSTOM_SCRIPT_${key}}\")") + else() + message(FATAL_ERROR + "No ExternalData_CUSTOM_SCRIPT_${key} is not set to a full path:\n" + " ${ExternalData_CUSTOM_SCRIPT_${key}}") + endif() + else() + message(FATAL_ERROR + "No ExternalData_CUSTOM_SCRIPT_${key} is set for URL template:\n" + " ${url_template}") + endif() + else() + message(FATAL_ERROR + "Bad ExternalDataCustomScript key '${key}' in URL template:\n" + " ${url_template}\n" + "The key must be a valid C identifier.") + endif() + endif() + endforeach() + + # Store configuration for use by build-time script. set(config ${CMAKE_CURRENT_BINARY_DIR}/${target}_config.cmake) configure_file(${_ExternalData_SELF_DIR}/ExternalData_config.cmake.in ${config} @ONLY) @@ -781,6 +856,30 @@ function(_ExternalData_download_file url file err_var msg_var) set("${msg_var}" "${msg}" PARENT_SCOPE) endfunction() +function(_ExternalData_custom_fetch key loc file err_var msg_var) + if(NOT ExternalData_CUSTOM_SCRIPT_${key}) + set(err 1) + set(msg "No ExternalData_CUSTOM_SCRIPT_${key} set!") + elseif(NOT EXISTS "${ExternalData_CUSTOM_SCRIPT_${key}}") + set(err 1) + set(msg "No '${ExternalData_CUSTOM_SCRIPT_${key}}' exists!") + else() + set(ExternalData_CUSTOM_LOCATION "${loc}") + set(ExternalData_CUSTOM_FILE "${file}") + unset(ExternalData_CUSTOM_ERROR) + include("${ExternalData_CUSTOM_SCRIPT_${key}}") + if(DEFINED ExternalData_CUSTOM_ERROR) + set(err 1) + set(msg "${ExternalData_CUSTOM_ERROR}") + else() + set(err 0) + set(msg "no error") + endif() + endif() + set("${err_var}" "${err}" PARENT_SCOPE) + set("${msg_var}" "${msg}" PARENT_SCOPE) +endfunction() + function(_ExternalData_download_object name hash algo var_obj) # Search all object stores for an existing object. foreach(dir ${ExternalData_OBJECT_STORES}) @@ -804,7 +903,11 @@ function(_ExternalData_download_object name hash algo var_obj) string(REPLACE "%(hash)" "${hash}" url_tmp "${url_template}") string(REPLACE "%(algo)" "${algo}" url "${url_tmp}") message(STATUS "Fetching \"${url}\"") - _ExternalData_download_file("${url}" "${tmp}" err errMsg) + if(url MATCHES "^ExternalDataCustomScript://([A-Za-z_][A-Za-z0-9_]*)/(.*)$") + _ExternalData_custom_fetch("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}" "${tmp}" err errMsg) + else() + _ExternalData_download_file("${url}" "${tmp}" err errMsg) + endif() set(tried "${tried}\n ${url}") if(err) set(tried "${tried} (${errMsg})") diff --git a/Modules/ExternalData_config.cmake.in b/Modules/ExternalData_config.cmake.in index 0858f53..4434e4b 100644 --- a/Modules/ExternalData_config.cmake.in +++ b/Modules/ExternalData_config.cmake.in @@ -2,3 +2,4 @@ set(ExternalData_OBJECT_STORES "@ExternalData_OBJECT_STORES@") set(ExternalData_URL_TEMPLATES "@ExternalData_URL_TEMPLATES@") set(ExternalData_TIMEOUT_INACTIVITY "@ExternalData_TIMEOUT_INACTIVITY@") set(ExternalData_TIMEOUT_ABSOLUTE "@ExternalData_TIMEOUT_ABSOLUTE@") + at _ExternalData_CONFIG_CODE@ diff --git a/Tests/Module/ExternalData/CMakeLists.txt b/Tests/Module/ExternalData/CMakeLists.txt index ebca48e..f99f6af 100644 --- a/Tests/Module/ExternalData/CMakeLists.txt +++ b/Tests/Module/ExternalData/CMakeLists.txt @@ -10,7 +10,9 @@ if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" MATCHES "^/") endif() set(ExternalData_URL_TEMPLATES "file://${slash}${CMAKE_CURRENT_SOURCE_DIR}/%(algo)/%(hash)" + "ExternalDataCustomScript://MyScript1/%(algo)/%(hash)" ) +set(ExternalData_CUSTOM_SCRIPT_MyScript1 "${CMAKE_CURRENT_SOURCE_DIR}/MyScript1.cmake") set(ExternalData_BINARY_ROOT "${CMAKE_CURRENT_BINARY_DIR}/ExternalData") file(REMOVE_RECURSE ${ExternalData_BINARY_ROOT}) # clean test @@ -23,6 +25,7 @@ ExternalData_Add_Test(Data1 COMMAND ${CMAKE_COMMAND} -D Data=DATA{Data.dat} ${Data1CheckSpaces} + -D DataScript=DATA{DataScript.dat} -D DataMissing=DATA{DataMissing.dat} -D DataMissingWithAssociated=DATA{DataMissing.dat,Data.dat} -D SeriesA=DATA{SeriesA.dat,:} diff --git a/Tests/Module/ExternalData/Data1Check.cmake b/Tests/Module/ExternalData/Data1Check.cmake index 485b5c6..a7aa4ae 100644 --- a/Tests/Module/ExternalData/Data1Check.cmake +++ b/Tests/Module/ExternalData/Data1Check.cmake @@ -8,6 +8,10 @@ if(DEFINED DataSpace) message(SEND_ERROR "Input file:\n ${DataSpace}\ndoes not have expected content, but [[${lines}]]") endif() endif() +file(STRINGS "${DataScript}" lines LIMIT_INPUT 1024) +if(NOT "x${lines}" STREQUAL "xDataScript") + message(SEND_ERROR "Input file:\n ${DataScript}\ndoes not have expected content, but [[${lines}]]") +endif() if(DataMissing) if(EXISTS "${DataMissing}") message(SEND_ERROR diff --git a/Tests/Module/ExternalData/DataScript.dat.md5 b/Tests/Module/ExternalData/DataScript.dat.md5 new file mode 100644 index 0000000..74b4616 --- /dev/null +++ b/Tests/Module/ExternalData/DataScript.dat.md5 @@ -0,0 +1 @@ +fd95c03719e8626c0d10a818f9996dc5 diff --git a/Tests/Module/ExternalData/MyScript1.cmake b/Tests/Module/ExternalData/MyScript1.cmake new file mode 100644 index 0000000..242c64d --- /dev/null +++ b/Tests/Module/ExternalData/MyScript1.cmake @@ -0,0 +1,5 @@ +if(ExternalData_CUSTOM_LOCATION STREQUAL "MD5/fd95c03719e8626c0d10a818f9996dc5") + file(WRITE "${ExternalData_CUSTOM_FILE}" "DataScript") +else() + set(ExternalData_CUSTOM_ERROR "no ${ExternalData_CUSTOM_LOCATION} known") +endif() diff --git a/Tests/RunCMake/ExternalData/BadCustom1-result.txt b/Tests/RunCMake/ExternalData/BadCustom1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/ExternalData/BadCustom1-stderr.txt b/Tests/RunCMake/ExternalData/BadCustom1-stderr.txt new file mode 100644 index 0000000..5d2986d --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom1-stderr.txt @@ -0,0 +1,9 @@ +^CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): + Bad ExternalDataCustomScript key '0BadKey' in URL template: + + ExternalDataCustomScript://0BadKey/%\(algo\)/%\(hash\) + + The key must be a valid C identifier. +Call Stack \(most recent call first\): + BadCustom1.cmake:[0-9]+ \(ExternalData_Add_Target\) + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/ExternalData/BadCustom1.cmake b/Tests/RunCMake/ExternalData/BadCustom1.cmake new file mode 100644 index 0000000..ec94fc1 --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom1.cmake @@ -0,0 +1,5 @@ +include(ExternalData) +set(ExternalData_URL_TEMPLATES + "ExternalDataCustomScript://0BadKey/%(algo)/%(hash)" + ) +ExternalData_Add_Target(Data) diff --git a/Tests/RunCMake/ExternalData/BadCustom2-result.txt b/Tests/RunCMake/ExternalData/BadCustom2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/ExternalData/BadCustom2-stderr.txt b/Tests/RunCMake/ExternalData/BadCustom2-stderr.txt new file mode 100644 index 0000000..4d59ca9 --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom2-stderr.txt @@ -0,0 +1,9 @@ +^CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): + Bad ExternalDataCustomScript key '' in URL template: + + ExternalDataCustomScript:///%\(algo\)/%\(hash\) + + The key must be a valid C identifier. +Call Stack \(most recent call first\): + BadCustom2.cmake:[0-9]+ \(ExternalData_Add_Target\) + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/ExternalData/BadCustom2.cmake b/Tests/RunCMake/ExternalData/BadCustom2.cmake new file mode 100644 index 0000000..1ed7646 --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom2.cmake @@ -0,0 +1,5 @@ +include(ExternalData) +set(ExternalData_URL_TEMPLATES + "ExternalDataCustomScript:///%(algo)/%(hash)" + ) +ExternalData_Add_Target(Data) diff --git a/Tests/RunCMake/ExternalData/BadCustom3-result.txt b/Tests/RunCMake/ExternalData/BadCustom3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/ExternalData/BadCustom3-stderr.txt b/Tests/RunCMake/ExternalData/BadCustom3-stderr.txt new file mode 100644 index 0000000..460814b --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom3-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): + No ExternalData_CUSTOM_SCRIPT_MissingKey is set for URL template: + + ExternalDataCustomScript://MissingKey/%\(algo\)/%\(hash\) +Call Stack \(most recent call first\): + BadCustom3.cmake:[0-9]+ \(ExternalData_Add_Target\) + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/ExternalData/BadCustom3.cmake b/Tests/RunCMake/ExternalData/BadCustom3.cmake new file mode 100644 index 0000000..b4f2fb8 --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom3.cmake @@ -0,0 +1,5 @@ +include(ExternalData) +set(ExternalData_URL_TEMPLATES + "ExternalDataCustomScript://MissingKey/%(algo)/%(hash)" + ) +ExternalData_Add_Target(Data) diff --git a/Tests/RunCMake/ExternalData/BadCustom4-result.txt b/Tests/RunCMake/ExternalData/BadCustom4-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/ExternalData/BadCustom4-stderr.txt b/Tests/RunCMake/ExternalData/BadCustom4-stderr.txt new file mode 100644 index 0000000..b83bcee --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom4-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\): + No ExternalData_CUSTOM_SCRIPT_RelPathKey is not set to a full path: + + RelPathScript.cmake +Call Stack \(most recent call first\): + BadCustom4.cmake:[0-9]+ \(ExternalData_Add_Target\) + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/ExternalData/BadCustom4.cmake b/Tests/RunCMake/ExternalData/BadCustom4.cmake new file mode 100644 index 0000000..0cc5521 --- /dev/null +++ b/Tests/RunCMake/ExternalData/BadCustom4.cmake @@ -0,0 +1,6 @@ +include(ExternalData) +set(ExternalData_URL_TEMPLATES + "ExternalDataCustomScript://RelPathKey/%(algo)/%(hash)" + ) +set(ExternalData_CUSTOM_SCRIPT_RelPathKey "RelPathScript.cmake") +ExternalData_Add_Target(Data) diff --git a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake index 04e3d59..7afd289 100644 --- a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake +++ b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake @@ -1,5 +1,9 @@ include(RunCMake) +run_cmake(BadCustom1) +run_cmake(BadCustom2) +run_cmake(BadCustom3) +run_cmake(BadCustom4) run_cmake(BadHashAlgo1) run_cmake(BadOption1) run_cmake(BadOption2) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=945571db747fd09036d0efd55b538dd4b3c8b874 commit 945571db747fd09036d0efd55b538dd4b3c8b874 Author: Brad King AuthorDate: Mon Jan 12 15:14:45 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 10:48:09 2015 -0500 ExternalData: Improve documentation organization Move the basic DATA{} description to a section just before the file series description. Move all sections on referencing files into subsections of a common "Referencing Files" section. Subsume example usage into the introduction since it gives a high-level starting point to understand the rest of the docs. diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index 313d27d..4f84d53 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -18,16 +18,7 @@ recognize arguments with the syntax ``DATA{}`` as references to external data, replace them with full paths to local copies of those data, and create build rules to fetch and update the local copies. -The ``DATA{}`` syntax is literal and the ```` is a full or relative path -within the source tree. The source tree must contain either a real -data file at ```` or a "content link" at ```` containing a -hash of the real file using a hash algorithm corresponding to ````. -For example, the argument ``DATA{img.png}`` may be satisfied by either a -real ``img.png`` file in the current source directory or a ``img.png.md5`` -file containing its MD5 sum. - -Example Usage -^^^^^^^^^^^^^ +For example: .. code-block:: cmake @@ -166,8 +157,22 @@ calling any of the functions provided by this module. by substituting the hash algorithm name for ``%(algo)`` and the hash value for ``%(hash)``. +Referencing Files +^^^^^^^^^^^^^^^^^ + +Referencing Single Files +"""""""""""""""""""""""" + +The ``DATA{}`` syntax is literal and the ```` is a full or relative path +within the source tree. The source tree must contain either a real +data file at ```` or a "content link" at ```` containing a +hash of the real file using a hash algorithm corresponding to ````. +For example, the argument ``DATA{img.png}`` may be satisfied by either a +real ``img.png`` file in the current source directory or a ``img.png.md5`` +file containing its MD5 sum. + Referencing File Series -^^^^^^^^^^^^^^^^^^^^^^^ +""""""""""""""""""""""" The ``DATA{}`` syntax can be told to fetch a file series using the form ``DATA{,:}``, where the ``:`` is literal. If the source tree @@ -198,7 +203,7 @@ Note that the ```` of a series does not include a hash-algorithm extension. Referencing Associated Files -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +"""""""""""""""""""""""""""" The ``DATA{}`` syntax can alternatively match files associated with the named file and contained in the same directory. Associated files may @@ -214,7 +219,7 @@ will pass ``MyInput.mha`` and ``MyFrames00.png`` on the command line but ensure that the associated files are present next to them. Referencing Directories -^^^^^^^^^^^^^^^^^^^^^^^ +""""""""""""""""""""""" The ``DATA{}`` syntax may reference a directory using a trailing slash and a list of associated files. The form ``DATA{/,,,...}`` http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a32b2245ca8d77da5b8218bcdcc6958016cdbb48 commit a32b2245ca8d77da5b8218bcdcc6958016cdbb48 Author: Brad King AuthorDate: Mon Jan 12 15:10:18 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 10:48:08 2015 -0500 ExternalData: Re-order documentation Put example usage just after the intro. Put hash algos last. Put variables right after functions since they both cover the module API. diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index 20180ae..313d27d 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -26,6 +26,27 @@ For example, the argument ``DATA{img.png}`` may be satisfied by either a real ``img.png`` file in the current source directory or a ``img.png.md5`` file containing its MD5 sum. +Example Usage +^^^^^^^^^^^^^ + +.. code-block:: cmake + + include(ExternalData) + set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)" + "file:////host/share/%(algo)/%(hash)" + "http://data.org/%(algo)/%(hash)") + ExternalData_Add_Test(MyData + NAME MyTest + COMMAND MyExe DATA{MyInput.png} + ) + ExternalData_Add_Target(MyData) + +When test ``MyTest`` runs the ``DATA{MyInput.png}`` argument will be +replaced by the full path to a real instance of the data file +``MyInput.png`` on disk. If the source tree contains a content link +such as ``MyInput.png.md5`` then the ``MyData`` target creates a real +``MyInput.png`` in the build tree. + Module Functions ^^^^^^^^^^^^^^^^ @@ -74,43 +95,76 @@ Module Functions in one of the paths specified in the ``ExternalData_OBJECT_STORES`` variable. -Hash Algorithms -^^^^^^^^^^^^^^^ +Module Variables +^^^^^^^^^^^^^^^^ -The following hash algorithms are supported:: +The following variables configure behavior. They should be set before +calling any of the functions provided by this module. - %(algo) Description - ------- ----- ----------- - MD5 .md5 Message-Digest Algorithm 5, RFC 1321 - SHA1 .sha1 US Secure Hash Algorithm 1, RFC 3174 - SHA224 .sha224 US Secure Hash Algorithms, RFC 4634 - SHA256 .sha256 US Secure Hash Algorithms, RFC 4634 - SHA384 .sha384 US Secure Hash Algorithms, RFC 4634 - SHA512 .sha512 US Secure Hash Algorithms, RFC 4634 +.. variable:: ExternalData_BINARY_ROOT -Note that the hashes are used only for unique data identification and -download verification. + The ``ExternalData_BINARY_ROOT`` variable may be set to the directory to + hold the real data files named by expanded ``DATA{}`` references. The + default is ``CMAKE_BINARY_DIR``. The directory layout will mirror that of + content links under ``ExternalData_SOURCE_ROOT``. -Example Usage -^^^^^^^^^^^^^ +.. variable:: ExternalData_LINK_CONTENT -.. code-block:: cmake + The ``ExternalData_LINK_CONTENT`` variable may be set to the name of a + supported hash algorithm to enable automatic conversion of real data + files referenced by the ``DATA{}`` syntax into content links. For each + such ```` a content link named ```` is created. The + original file is renamed to the form ``.ExternalData__`` to + stage it for future transmission to one of the locations in the list + of URL templates (by means outside the scope of this module). The + data fetch rule created for the content link will use the staged + object if it cannot be found using any URL template. - include(ExternalData) - set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)" - "file:////host/share/%(algo)/%(hash)" - "http://data.org/%(algo)/%(hash)") - ExternalData_Add_Test(MyData - NAME MyTest - COMMAND MyExe DATA{MyInput.png} - ) - ExternalData_Add_Target(MyData) +.. variable:: ExternalData_OBJECT_STORES -When test ``MyTest`` runs the ``DATA{MyInput.png}`` argument will be -replaced by the full path to a real instance of the data file -``MyInput.png`` on disk. If the source tree contains a content link -such as ``MyInput.png.md5`` then the ``MyData`` target creates a real -``MyInput.png`` in the build tree. + The ``ExternalData_OBJECT_STORES`` variable may be set to a list of local + directories that store objects using the layout ``/%(algo)/%(hash)``. + These directories will be searched first for a needed object. If the + object is not available in any store then it will be fetched remotely + using the URL templates and added to the first local store listed. If + no stores are specified the default is a location inside the build + tree. + +.. variable:: ExternalData_SERIES_PARSE + ExternalData_SERIES_PARSE_PREFIX + ExternalData_SERIES_PARSE_NUMBER + ExternalData_SERIES_PARSE_SUFFIX + ExternalData_SERIES_MATCH + + See `Referencing File Series`_. + +.. variable:: ExternalData_SOURCE_ROOT + + The ``ExternalData_SOURCE_ROOT`` variable may be set to the highest source + directory containing any path named by a ``DATA{}`` reference. The + default is ``CMAKE_SOURCE_DIR``. ``ExternalData_SOURCE_ROOT`` and + ``CMAKE_SOURCE_DIR`` must refer to directories within a single source + distribution (e.g. they come together in one tarball). + +.. variable:: ExternalData_TIMEOUT_ABSOLUTE + + The ``ExternalData_TIMEOUT_ABSOLUTE`` variable sets the download + absolute timeout, in seconds, with a default of ``300`` seconds. + Set to ``0`` to disable enforcement. + +.. variable:: ExternalData_TIMEOUT_INACTIVITY + + The ``ExternalData_TIMEOUT_INACTIVITY`` variable sets the download + inactivity timeout, in seconds, with a default of ``60`` seconds. + Set to ``0`` to disable enforcement. + +.. variable:: ExternalData_URL_TEMPLATES + + The ``ExternalData_URL_TEMPLATES`` may be set to provide a list of + of URL templates using the placeholders ``%(algo)`` and ``%(hash)`` + in each template. Data fetch rules try each URL template in order + by substituting the hash algorithm name for ``%(algo)`` and the hash + value for ``%(hash)``. Referencing File Series ^^^^^^^^^^^^^^^^^^^^^^^ @@ -171,76 +225,22 @@ directory on the command line and ensure that the directory contains files corresponding to every file or content link in the ``MyDataDir`` source directory. -Module Variables -^^^^^^^^^^^^^^^^ - -The following variables configure behavior. They should be set before -calling any of the functions provided by this module. - -.. variable:: ExternalData_URL_TEMPLATES - - The ``ExternalData_URL_TEMPLATES`` may be set to provide a list of - of URL templates using the placeholders ``%(algo)`` and ``%(hash)`` - in each template. Data fetch rules try each URL template in order - by substituting the hash algorithm name for ``%(algo)`` and the hash - value for ``%(hash)``. - -.. variable:: ExternalData_LINK_CONTENT - - The ``ExternalData_LINK_CONTENT`` variable may be set to the name of a - supported hash algorithm to enable automatic conversion of real data - files referenced by the ``DATA{}`` syntax into content links. For each - such ```` a content link named ```` is created. The - original file is renamed to the form ``.ExternalData__`` to - stage it for future transmission to one of the locations in the list - of URL templates (by means outside the scope of this module). The - data fetch rule created for the content link will use the staged - object if it cannot be found using any URL template. - -.. variable:: ExternalData_OBJECT_STORES - - The ``ExternalData_OBJECT_STORES`` variable may be set to a list of local - directories that store objects using the layout ``/%(algo)/%(hash)``. - These directories will be searched first for a needed object. If the - object is not available in any store then it will be fetched remotely - using the URL templates and added to the first local store listed. If - no stores are specified the default is a location inside the build - tree. - -.. variable:: ExternalData_SOURCE_ROOT - - The ``ExternalData_SOURCE_ROOT`` variable may be set to the highest source - directory containing any path named by a ``DATA{}`` reference. The - default is ``CMAKE_SOURCE_DIR``. ``ExternalData_SOURCE_ROOT`` and - ``CMAKE_SOURCE_DIR`` must refer to directories within a single source - distribution (e.g. they come together in one tarball). - -.. variable:: ExternalData_BINARY_ROOT - - The ``ExternalData_BINARY_ROOT`` variable may be set to the directory to - hold the real data files named by expanded ``DATA{}`` references. The - default is ``CMAKE_BINARY_DIR``. The directory layout will mirror that of - content links under ``ExternalData_SOURCE_ROOT``. - -.. variable:: ExternalData_TIMEOUT_INACTIVITY - - The ``ExternalData_TIMEOUT_INACTIVITY`` variable sets the download - inactivity timeout, in seconds, with a default of ``60`` seconds. - Set to ``0`` to disable enforcement. - -.. variable:: ExternalData_TIMEOUT_ABSOLUTE +Hash Algorithms +^^^^^^^^^^^^^^^ - The ``ExternalData_TIMEOUT_ABSOLUTE`` variable sets the download - absolute timeout, in seconds, with a default of ``300`` seconds. - Set to ``0`` to disable enforcement. +The following hash algorithms are supported:: -.. variable:: ExternalData_SERIES_PARSE - ExternalData_SERIES_PARSE_PREFIX - ExternalData_SERIES_PARSE_NUMBER - ExternalData_SERIES_PARSE_SUFFIX - ExternalData_SERIES_MATCH + %(algo) Description + ------- ----- ----------- + MD5 .md5 Message-Digest Algorithm 5, RFC 1321 + SHA1 .sha1 US Secure Hash Algorithm 1, RFC 3174 + SHA224 .sha224 US Secure Hash Algorithms, RFC 4634 + SHA256 .sha256 US Secure Hash Algorithms, RFC 4634 + SHA384 .sha384 US Secure Hash Algorithms, RFC 4634 + SHA512 .sha512 US Secure Hash Algorithms, RFC 4634 - See `Referencing File Series`_. +Note that the hashes are used only for unique data identification and +download verification. #]=======================================================================] #============================================================================= http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=531e75e0b73f921fc02983f19a07141c867a752a commit 531e75e0b73f921fc02983f19a07141c867a752a Author: Brad King AuthorDate: Mon Jan 12 14:58:17 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 10:48:08 2015 -0500 ExternalData: Document all variables defined by module Extend the "Module Variables" section to list variables previously mentioned only in text. diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index 5b01294..20180ae 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -68,11 +68,11 @@ Module Functions It creates custom commands in the target as necessary to make data files available for each ``DATA{}`` reference previously evaluated by - other functions provided by this module. A list of URL templates may - be provided in the variable ``ExternalData_URL_TEMPLATES`` using the - placeholders ``%(algo)`` and ``%(hash)`` in each template. Data fetch - rules try each URL template in order by substituting the hash - algorithm name for ``%(algo)`` and the hash value for ``%(hash)``. + other functions provided by this module. + Data files may be fetched from one of the URL templates specified in + the ``ExternalData_URL_TEMPLATES`` variable, or may be found locally + in one of the paths specified in the ``ExternalData_OBJECT_STORES`` + variable. Hash Algorithms ^^^^^^^^^^^^^^^ @@ -177,6 +177,14 @@ Module Variables The following variables configure behavior. They should be set before calling any of the functions provided by this module. +.. variable:: ExternalData_URL_TEMPLATES + + The ``ExternalData_URL_TEMPLATES`` may be set to provide a list of + of URL templates using the placeholders ``%(algo)`` and ``%(hash)`` + in each template. Data fetch rules try each URL template in order + by substituting the hash algorithm name for ``%(algo)`` and the hash + value for ``%(hash)``. + .. variable:: ExternalData_LINK_CONTENT The ``ExternalData_LINK_CONTENT`` variable may be set to the name of a @@ -225,6 +233,14 @@ calling any of the functions provided by this module. The ``ExternalData_TIMEOUT_ABSOLUTE`` variable sets the download absolute timeout, in seconds, with a default of ``300`` seconds. Set to ``0`` to disable enforcement. + +.. variable:: ExternalData_SERIES_PARSE + ExternalData_SERIES_PARSE_PREFIX + ExternalData_SERIES_PARSE_NUMBER + ExternalData_SERIES_PARSE_SUFFIX + ExternalData_SERIES_MATCH + + See `Referencing File Series`_. #]=======================================================================] #============================================================================= http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3884b47ec64b80ad31da93192188f05f60ae5d8 commit f3884b47ec64b80ad31da93192188f05f60ae5d8 Author: Brad King AuthorDate: Mon Jan 12 14:38:22 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 10:48:08 2015 -0500 ExternalData: Split documentation into sections Also explicitly mark functions and variables. diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index b18674f..5b01294 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -2,8 +2,15 @@ ExternalData ------------ +.. only:: html + + .. contents:: + Manage data files stored outside source tree +Introduction +^^^^^^^^^^^^ + Use this module to unambiguously reference data files stored outside the source tree and fetch them at build time from arbitrary local and remote content-addressed locations. Functions provided by this module @@ -19,50 +26,56 @@ For example, the argument ``DATA{img.png}`` may be satisfied by either a real ``img.png`` file in the current source directory or a ``img.png.md5`` file containing its MD5 sum. -The ``ExternalData_Expand_Arguments`` function evaluates ``DATA{}`` -references in its arguments and constructs a new list of arguments: +Module Functions +^^^^^^^^^^^^^^^^ -.. code-block:: cmake +.. command:: ExternalData_Expand_Arguments - ExternalData_Expand_Arguments( - # Name of data management target - # Output variable - [args...] # Input arguments, DATA{} allowed - ) + The ``ExternalData_Expand_Arguments`` function evaluates ``DATA{}`` + references in its arguments and constructs a new list of arguments:: -It replaces each ``DATA{}`` reference in an argument with the full path of -a real data file on disk that will exist after the ```` builds. + ExternalData_Expand_Arguments( + # Name of data management target + # Output variable + [args...] # Input arguments, DATA{} allowed + ) -The ``ExternalData_Add_Test`` function wraps around the CMake -:command:`add_test` command but supports ``DATA{}`` references in -its arguments: + It replaces each ``DATA{}`` reference in an argument with the full path of + a real data file on disk that will exist after the ```` builds. -.. code-block:: cmake +.. command:: ExternalData_Add_Test - ExternalData_Add_Test( - # Name of data management target - ... # Arguments of add_test(), DATA{} allowed - ) + The ``ExternalData_Add_Test`` function wraps around the CMake + :command:`add_test` command but supports ``DATA{}`` references in + its arguments:: -It passes its arguments through ``ExternalData_Expand_Arguments`` and then -invokes the :command:`add_test` command using the results. + ExternalData_Add_Test( + # Name of data management target + ... # Arguments of add_test(), DATA{} allowed + ) -The ``ExternalData_Add_Target`` function creates a custom target to -manage local instances of data files stored externally: + It passes its arguments through ``ExternalData_Expand_Arguments`` and then + invokes the :command:`add_test` command using the results. -.. code-block:: cmake +.. command:: ExternalData_Add_Target - ExternalData_Add_Target( - # Name of data management target - ) + The ``ExternalData_Add_Target`` function creates a custom target to + manage local instances of data files stored externally:: + + ExternalData_Add_Target( + # Name of data management target + ) + + It creates custom commands in the target as necessary to make data + files available for each ``DATA{}`` reference previously evaluated by + other functions provided by this module. A list of URL templates may + be provided in the variable ``ExternalData_URL_TEMPLATES`` using the + placeholders ``%(algo)`` and ``%(hash)`` in each template. Data fetch + rules try each URL template in order by substituting the hash + algorithm name for ``%(algo)`` and the hash value for ``%(hash)``. -It creates custom commands in the target as necessary to make data -files available for each ``DATA{}`` reference previously evaluated by -other functions provided by this module. A list of URL templates may -be provided in the variable ``ExternalData_URL_TEMPLATES`` using the -placeholders ``%(algo)`` and ``%(hash)`` in each template. Data fetch -rules try each URL template in order by substituting the hash -algorithm name for ``%(algo)`` and the hash value for ``%(hash)``. +Hash Algorithms +^^^^^^^^^^^^^^^ The following hash algorithms are supported:: @@ -78,7 +91,8 @@ The following hash algorithms are supported:: Note that the hashes are used only for unique data identification and download verification. -Example usage: +Example Usage +^^^^^^^^^^^^^ .. code-block:: cmake @@ -98,6 +112,9 @@ replaced by the full path to a real instance of the data file such as ``MyInput.png.md5`` then the ``MyData`` target creates a real ``MyInput.png`` in the build tree. +Referencing File Series +^^^^^^^^^^^^^^^^^^^^^^^ + The ``DATA{}`` syntax can be told to fetch a file series using the form ``DATA{,:}``, where the ``:`` is literal. If the source tree contains a group of files or content links named like a series then a @@ -126,6 +143,9 @@ Configure series number matching with a regex that matches the Note that the ```` of a series does not include a hash-algorithm extension. +Referencing Associated Files +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + The ``DATA{}`` syntax can alternatively match files associated with the named file and contained in the same directory. Associated files may be specified by options using the syntax @@ -139,6 +159,9 @@ syntax ``REGEX:``. For example, the arguments:: will pass ``MyInput.mha`` and ``MyFrames00.png`` on the command line but ensure that the associated files are present next to them. +Referencing Directories +^^^^^^^^^^^^^^^^^^^^^^^ + The ``DATA{}`` syntax may reference a directory using a trailing slash and a list of associated files. The form ``DATA{/,,,...}`` adds rules to fetch any files in the directory that match one of the @@ -148,39 +171,60 @@ directory on the command line and ensure that the directory contains files corresponding to every file or content link in the ``MyDataDir`` source directory. -The variable ``ExternalData_LINK_CONTENT`` may be set to the name of a -supported hash algorithm to enable automatic conversion of real data -files referenced by the ``DATA{}`` syntax into content links. For each -such ```` a content link named ```` is created. The -original file is renamed to the form ``.ExternalData__`` to -stage it for future transmission to one of the locations in the list -of URL templates (by means outside the scope of this module). The -data fetch rule created for the content link will use the staged -object if it cannot be found using any URL template. - -The variable ``ExternalData_OBJECT_STORES`` may be set to a list of local -directories that store objects using the layout ``/%(algo)/%(hash)``. -These directories will be searched first for a needed object. If the -object is not available in any store then it will be fetched remotely -using the URL templates and added to the first local store listed. If -no stores are specified the default is a location inside the build -tree. - -The variable ``ExternalData_SOURCE_ROOT`` may be set to the highest source -directory containing any path named by a ``DATA{}`` reference. The -default is ``CMAKE_SOURCE_DIR``. ``ExternalData_SOURCE_ROOT`` and -``CMAKE_SOURCE_DIR`` must refer to directories within a single source -distribution (e.g. they come together in one tarball). - -The variable ``ExternalData_BINARY_ROOT`` may be set to the directory to -hold the real data files named by expanded ``DATA{}`` references. The -default is ``CMAKE_BINARY_DIR``. The directory layout will mirror that of -content links under ``ExternalData_SOURCE_ROOT``. - -Variables ``ExternalData_TIMEOUT_INACTIVITY`` and -``ExternalData_TIMEOUT_ABSOLUTE`` set the download inactivity and absolute -timeouts, in seconds. The defaults are 60 seconds and 300 seconds, -respectively. Set either timeout to 0 seconds to disable enforcement. +Module Variables +^^^^^^^^^^^^^^^^ + +The following variables configure behavior. They should be set before +calling any of the functions provided by this module. + +.. variable:: ExternalData_LINK_CONTENT + + The ``ExternalData_LINK_CONTENT`` variable may be set to the name of a + supported hash algorithm to enable automatic conversion of real data + files referenced by the ``DATA{}`` syntax into content links. For each + such ```` a content link named ```` is created. The + original file is renamed to the form ``.ExternalData__`` to + stage it for future transmission to one of the locations in the list + of URL templates (by means outside the scope of this module). The + data fetch rule created for the content link will use the staged + object if it cannot be found using any URL template. + +.. variable:: ExternalData_OBJECT_STORES + + The ``ExternalData_OBJECT_STORES`` variable may be set to a list of local + directories that store objects using the layout ``/%(algo)/%(hash)``. + These directories will be searched first for a needed object. If the + object is not available in any store then it will be fetched remotely + using the URL templates and added to the first local store listed. If + no stores are specified the default is a location inside the build + tree. + +.. variable:: ExternalData_SOURCE_ROOT + + The ``ExternalData_SOURCE_ROOT`` variable may be set to the highest source + directory containing any path named by a ``DATA{}`` reference. The + default is ``CMAKE_SOURCE_DIR``. ``ExternalData_SOURCE_ROOT`` and + ``CMAKE_SOURCE_DIR`` must refer to directories within a single source + distribution (e.g. they come together in one tarball). + +.. variable:: ExternalData_BINARY_ROOT + + The ``ExternalData_BINARY_ROOT`` variable may be set to the directory to + hold the real data files named by expanded ``DATA{}`` references. The + default is ``CMAKE_BINARY_DIR``. The directory layout will mirror that of + content links under ``ExternalData_SOURCE_ROOT``. + +.. variable:: ExternalData_TIMEOUT_INACTIVITY + + The ``ExternalData_TIMEOUT_INACTIVITY`` variable sets the download + inactivity timeout, in seconds, with a default of ``60`` seconds. + Set to ``0`` to disable enforcement. + +.. variable:: ExternalData_TIMEOUT_ABSOLUTE + + The ``ExternalData_TIMEOUT_ABSOLUTE`` variable sets the download + absolute timeout, in seconds, with a default of ``300`` seconds. + Set to ``0`` to disable enforcement. #]=======================================================================] #============================================================================= http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ab5c652b663377afcdcaf7cda05ac8746b7d21d commit 4ab5c652b663377afcdcaf7cda05ac8746b7d21d Author: Brad King AuthorDate: Mon Jan 12 13:53:33 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 10:48:08 2015 -0500 ExternalData: Convert docs to a bracket comment Use a bracket comment to hold the documentation instead of a block of line comments. This will make further updates easier. diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index 79bb064..b18674f 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -1,189 +1,190 @@ -#.rst: -# ExternalData -# ------------ -# -# Manage data files stored outside source tree -# -# Use this module to unambiguously reference data files stored outside -# the source tree and fetch them at build time from arbitrary local and -# remote content-addressed locations. Functions provided by this module -# recognize arguments with the syntax ``DATA{}`` as references to -# external data, replace them with full paths to local copies of those -# data, and create build rules to fetch and update the local copies. -# -# The ``DATA{}`` syntax is literal and the ```` is a full or relative path -# within the source tree. The source tree must contain either a real -# data file at ```` or a "content link" at ```` containing a -# hash of the real file using a hash algorithm corresponding to ````. -# For example, the argument ``DATA{img.png}`` may be satisfied by either a -# real ``img.png`` file in the current source directory or a ``img.png.md5`` -# file containing its MD5 sum. -# -# The ``ExternalData_Expand_Arguments`` function evaluates ``DATA{}`` -# references in its arguments and constructs a new list of arguments: -# -# .. code-block:: cmake -# -# ExternalData_Expand_Arguments( -# # Name of data management target -# # Output variable -# [args...] # Input arguments, DATA{} allowed -# ) -# -# It replaces each ``DATA{}`` reference in an argument with the full path of -# a real data file on disk that will exist after the ```` builds. -# -# The ``ExternalData_Add_Test`` function wraps around the CMake -# :command:`add_test` command but supports ``DATA{}`` references in -# its arguments: -# -# .. code-block:: cmake -# -# ExternalData_Add_Test( -# # Name of data management target -# ... # Arguments of add_test(), DATA{} allowed -# ) -# -# It passes its arguments through ``ExternalData_Expand_Arguments`` and then -# invokes the :command:`add_test` command using the results. -# -# The ``ExternalData_Add_Target`` function creates a custom target to -# manage local instances of data files stored externally: -# -# .. code-block:: cmake -# -# ExternalData_Add_Target( -# # Name of data management target -# ) -# -# It creates custom commands in the target as necessary to make data -# files available for each ``DATA{}`` reference previously evaluated by -# other functions provided by this module. A list of URL templates may -# be provided in the variable ``ExternalData_URL_TEMPLATES`` using the -# placeholders ``%(algo)`` and ``%(hash)`` in each template. Data fetch -# rules try each URL template in order by substituting the hash -# algorithm name for ``%(algo)`` and the hash value for ``%(hash)``. -# -# The following hash algorithms are supported:: -# -# %(algo) Description -# ------- ----- ----------- -# MD5 .md5 Message-Digest Algorithm 5, RFC 1321 -# SHA1 .sha1 US Secure Hash Algorithm 1, RFC 3174 -# SHA224 .sha224 US Secure Hash Algorithms, RFC 4634 -# SHA256 .sha256 US Secure Hash Algorithms, RFC 4634 -# SHA384 .sha384 US Secure Hash Algorithms, RFC 4634 -# SHA512 .sha512 US Secure Hash Algorithms, RFC 4634 -# -# Note that the hashes are used only for unique data identification and -# download verification. -# -# Example usage: -# -# .. code-block:: cmake -# -# include(ExternalData) -# set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)" -# "file:////host/share/%(algo)/%(hash)" -# "http://data.org/%(algo)/%(hash)") -# ExternalData_Add_Test(MyData -# NAME MyTest -# COMMAND MyExe DATA{MyInput.png} -# ) -# ExternalData_Add_Target(MyData) -# -# When test ``MyTest`` runs the ``DATA{MyInput.png}`` argument will be -# replaced by the full path to a real instance of the data file -# ``MyInput.png`` on disk. If the source tree contains a content link -# such as ``MyInput.png.md5`` then the ``MyData`` target creates a real -# ``MyInput.png`` in the build tree. -# -# The ``DATA{}`` syntax can be told to fetch a file series using the form -# ``DATA{,:}``, where the ``:`` is literal. If the source tree -# contains a group of files or content links named like a series then a -# reference to one member adds rules to fetch all of them. Although all -# members of a series are fetched, only the file originally named by the -# ``DATA{}`` argument is substituted for it. The default configuration -# recognizes file series names ending with ``#.ext``, ``_#.ext``, ``.#.ext``, -# or ``-#.ext`` where ``#`` is a sequence of decimal digits and ``.ext`` is -# any single extension. Configure it with a regex that parses ```` -# and ```` parts from the end of ````:: -# -# ExternalData_SERIES_PARSE = regex of the form ()()$ -# -# For more complicated cases set:: -# -# ExternalData_SERIES_PARSE = regex with at least two () groups -# ExternalData_SERIES_PARSE_PREFIX = regex group number, if any -# ExternalData_SERIES_PARSE_NUMBER = regex group number -# ExternalData_SERIES_PARSE_SUFFIX = regex group number -# -# Configure series number matching with a regex that matches the -# ```` part of series members named ````:: -# -# ExternalData_SERIES_MATCH = regex matching in all series members -# -# Note that the ```` of a series does not include a hash-algorithm -# extension. -# -# The ``DATA{}`` syntax can alternatively match files associated with the -# named file and contained in the same directory. Associated files may -# be specified by options using the syntax -# ``DATA{,,,...}``. Each option may specify one file by -# name or specify a regular expression to match file names using the -# syntax ``REGEX:``. For example, the arguments:: -# -# DATA{MyData/MyInput.mhd,MyInput.img} # File pair -# DATA{MyData/MyFrames00.png,REGEX:MyFrames[0-9]+\\.png} # Series -# -# will pass ``MyInput.mha`` and ``MyFrames00.png`` on the command line but -# ensure that the associated files are present next to them. -# -# The ``DATA{}`` syntax may reference a directory using a trailing slash and -# a list of associated files. The form ``DATA{/,,,...}`` -# adds rules to fetch any files in the directory that match one of the -# associated file options. For example, the argument -# ``DATA{MyDataDir/,REGEX:.*}`` will pass the full path to a ``MyDataDir`` -# directory on the command line and ensure that the directory contains -# files corresponding to every file or content link in the ``MyDataDir`` -# source directory. -# -# The variable ``ExternalData_LINK_CONTENT`` may be set to the name of a -# supported hash algorithm to enable automatic conversion of real data -# files referenced by the ``DATA{}`` syntax into content links. For each -# such ```` a content link named ```` is created. The -# original file is renamed to the form ``.ExternalData__`` to -# stage it for future transmission to one of the locations in the list -# of URL templates (by means outside the scope of this module). The -# data fetch rule created for the content link will use the staged -# object if it cannot be found using any URL template. -# -# The variable ``ExternalData_OBJECT_STORES`` may be set to a list of local -# directories that store objects using the layout ``/%(algo)/%(hash)``. -# These directories will be searched first for a needed object. If the -# object is not available in any store then it will be fetched remotely -# using the URL templates and added to the first local store listed. If -# no stores are specified the default is a location inside the build -# tree. -# -# The variable ``ExternalData_SOURCE_ROOT`` may be set to the highest source -# directory containing any path named by a ``DATA{}`` reference. The -# default is ``CMAKE_SOURCE_DIR``. ``ExternalData_SOURCE_ROOT`` and -# ``CMAKE_SOURCE_DIR`` must refer to directories within a single source -# distribution (e.g. they come together in one tarball). -# -# The variable ``ExternalData_BINARY_ROOT`` may be set to the directory to -# hold the real data files named by expanded ``DATA{}`` references. The -# default is ``CMAKE_BINARY_DIR``. The directory layout will mirror that of -# content links under ``ExternalData_SOURCE_ROOT``. -# -# Variables ``ExternalData_TIMEOUT_INACTIVITY`` and -# ``ExternalData_TIMEOUT_ABSOLUTE`` set the download inactivity and absolute -# timeouts, in seconds. The defaults are 60 seconds and 300 seconds, -# respectively. Set either timeout to 0 seconds to disable enforcement. +#[=======================================================================[.rst: +ExternalData +------------ + +Manage data files stored outside source tree + +Use this module to unambiguously reference data files stored outside +the source tree and fetch them at build time from arbitrary local and +remote content-addressed locations. Functions provided by this module +recognize arguments with the syntax ``DATA{}`` as references to +external data, replace them with full paths to local copies of those +data, and create build rules to fetch and update the local copies. + +The ``DATA{}`` syntax is literal and the ```` is a full or relative path +within the source tree. The source tree must contain either a real +data file at ```` or a "content link" at ```` containing a +hash of the real file using a hash algorithm corresponding to ````. +For example, the argument ``DATA{img.png}`` may be satisfied by either a +real ``img.png`` file in the current source directory or a ``img.png.md5`` +file containing its MD5 sum. + +The ``ExternalData_Expand_Arguments`` function evaluates ``DATA{}`` +references in its arguments and constructs a new list of arguments: + +.. code-block:: cmake + + ExternalData_Expand_Arguments( + # Name of data management target + # Output variable + [args...] # Input arguments, DATA{} allowed + ) + +It replaces each ``DATA{}`` reference in an argument with the full path of +a real data file on disk that will exist after the ```` builds. + +The ``ExternalData_Add_Test`` function wraps around the CMake +:command:`add_test` command but supports ``DATA{}`` references in +its arguments: + +.. code-block:: cmake + + ExternalData_Add_Test( + # Name of data management target + ... # Arguments of add_test(), DATA{} allowed + ) + +It passes its arguments through ``ExternalData_Expand_Arguments`` and then +invokes the :command:`add_test` command using the results. + +The ``ExternalData_Add_Target`` function creates a custom target to +manage local instances of data files stored externally: + +.. code-block:: cmake + + ExternalData_Add_Target( + # Name of data management target + ) + +It creates custom commands in the target as necessary to make data +files available for each ``DATA{}`` reference previously evaluated by +other functions provided by this module. A list of URL templates may +be provided in the variable ``ExternalData_URL_TEMPLATES`` using the +placeholders ``%(algo)`` and ``%(hash)`` in each template. Data fetch +rules try each URL template in order by substituting the hash +algorithm name for ``%(algo)`` and the hash value for ``%(hash)``. + +The following hash algorithms are supported:: + + %(algo) Description + ------- ----- ----------- + MD5 .md5 Message-Digest Algorithm 5, RFC 1321 + SHA1 .sha1 US Secure Hash Algorithm 1, RFC 3174 + SHA224 .sha224 US Secure Hash Algorithms, RFC 4634 + SHA256 .sha256 US Secure Hash Algorithms, RFC 4634 + SHA384 .sha384 US Secure Hash Algorithms, RFC 4634 + SHA512 .sha512 US Secure Hash Algorithms, RFC 4634 + +Note that the hashes are used only for unique data identification and +download verification. + +Example usage: + +.. code-block:: cmake + + include(ExternalData) + set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)" + "file:////host/share/%(algo)/%(hash)" + "http://data.org/%(algo)/%(hash)") + ExternalData_Add_Test(MyData + NAME MyTest + COMMAND MyExe DATA{MyInput.png} + ) + ExternalData_Add_Target(MyData) + +When test ``MyTest`` runs the ``DATA{MyInput.png}`` argument will be +replaced by the full path to a real instance of the data file +``MyInput.png`` on disk. If the source tree contains a content link +such as ``MyInput.png.md5`` then the ``MyData`` target creates a real +``MyInput.png`` in the build tree. + +The ``DATA{}`` syntax can be told to fetch a file series using the form +``DATA{,:}``, where the ``:`` is literal. If the source tree +contains a group of files or content links named like a series then a +reference to one member adds rules to fetch all of them. Although all +members of a series are fetched, only the file originally named by the +``DATA{}`` argument is substituted for it. The default configuration +recognizes file series names ending with ``#.ext``, ``_#.ext``, ``.#.ext``, +or ``-#.ext`` where ``#`` is a sequence of decimal digits and ``.ext`` is +any single extension. Configure it with a regex that parses ```` +and ```` parts from the end of ````:: + + ExternalData_SERIES_PARSE = regex of the form ()()$ + +For more complicated cases set:: + + ExternalData_SERIES_PARSE = regex with at least two () groups + ExternalData_SERIES_PARSE_PREFIX = regex group number, if any + ExternalData_SERIES_PARSE_NUMBER = regex group number + ExternalData_SERIES_PARSE_SUFFIX = regex group number + +Configure series number matching with a regex that matches the +```` part of series members named ````:: + + ExternalData_SERIES_MATCH = regex matching in all series members + +Note that the ```` of a series does not include a hash-algorithm +extension. + +The ``DATA{}`` syntax can alternatively match files associated with the +named file and contained in the same directory. Associated files may +be specified by options using the syntax +``DATA{,,,...}``. Each option may specify one file by +name or specify a regular expression to match file names using the +syntax ``REGEX:``. For example, the arguments:: + + DATA{MyData/MyInput.mhd,MyInput.img} # File pair + DATA{MyData/MyFrames00.png,REGEX:MyFrames[0-9]+\\.png} # Series + +will pass ``MyInput.mha`` and ``MyFrames00.png`` on the command line but +ensure that the associated files are present next to them. + +The ``DATA{}`` syntax may reference a directory using a trailing slash and +a list of associated files. The form ``DATA{/,,,...}`` +adds rules to fetch any files in the directory that match one of the +associated file options. For example, the argument +``DATA{MyDataDir/,REGEX:.*}`` will pass the full path to a ``MyDataDir`` +directory on the command line and ensure that the directory contains +files corresponding to every file or content link in the ``MyDataDir`` +source directory. + +The variable ``ExternalData_LINK_CONTENT`` may be set to the name of a +supported hash algorithm to enable automatic conversion of real data +files referenced by the ``DATA{}`` syntax into content links. For each +such ```` a content link named ```` is created. The +original file is renamed to the form ``.ExternalData__`` to +stage it for future transmission to one of the locations in the list +of URL templates (by means outside the scope of this module). The +data fetch rule created for the content link will use the staged +object if it cannot be found using any URL template. + +The variable ``ExternalData_OBJECT_STORES`` may be set to a list of local +directories that store objects using the layout ``/%(algo)/%(hash)``. +These directories will be searched first for a needed object. If the +object is not available in any store then it will be fetched remotely +using the URL templates and added to the first local store listed. If +no stores are specified the default is a location inside the build +tree. + +The variable ``ExternalData_SOURCE_ROOT`` may be set to the highest source +directory containing any path named by a ``DATA{}`` reference. The +default is ``CMAKE_SOURCE_DIR``. ``ExternalData_SOURCE_ROOT`` and +``CMAKE_SOURCE_DIR`` must refer to directories within a single source +distribution (e.g. they come together in one tarball). + +The variable ``ExternalData_BINARY_ROOT`` may be set to the directory to +hold the real data files named by expanded ``DATA{}`` references. The +default is ``CMAKE_BINARY_DIR``. The directory layout will mirror that of +content links under ``ExternalData_SOURCE_ROOT``. + +Variables ``ExternalData_TIMEOUT_INACTIVITY`` and +``ExternalData_TIMEOUT_ABSOLUTE`` set the download inactivity and absolute +timeouts, in seconds. The defaults are 60 seconds and 300 seconds, +respectively. Set either timeout to 0 seconds to disable enforcement. +#]=======================================================================] #============================================================================= -# Copyright 2010-2013 Kitware, Inc. +# Copyright 2010-2015 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. ----------------------------------------------------------------------- Summary of changes: Modules/ExternalData.cmake | 539 +++++++++++++------- Modules/ExternalData_config.cmake.in | 1 + Tests/Module/ExternalData/CMakeLists.txt | 3 + Tests/Module/ExternalData/Data1Check.cmake | 4 + Tests/Module/ExternalData/DataScript.dat.md5 | 1 + Tests/Module/ExternalData/MyScript1.cmake | 5 + .../BadCustom1-result.txt} | 0 Tests/RunCMake/ExternalData/BadCustom1-stderr.txt | 9 + Tests/RunCMake/ExternalData/BadCustom1.cmake | 5 + .../BadCustom2-result.txt} | 0 Tests/RunCMake/ExternalData/BadCustom2-stderr.txt | 9 + Tests/RunCMake/ExternalData/BadCustom2.cmake | 5 + .../BadCustom3-result.txt} | 0 Tests/RunCMake/ExternalData/BadCustom3-stderr.txt | 7 + Tests/RunCMake/ExternalData/BadCustom3.cmake | 5 + .../BadCustom4-result.txt} | 0 Tests/RunCMake/ExternalData/BadCustom4-stderr.txt | 7 + Tests/RunCMake/ExternalData/BadCustom4.cmake | 6 + Tests/RunCMake/ExternalData/RunCMakeTest.cmake | 4 + 19 files changed, 425 insertions(+), 185 deletions(-) create mode 100644 Tests/Module/ExternalData/DataScript.dat.md5 create mode 100644 Tests/Module/ExternalData/MyScript1.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => ExternalData/BadCustom1-result.txt} (100%) create mode 100644 Tests/RunCMake/ExternalData/BadCustom1-stderr.txt create mode 100644 Tests/RunCMake/ExternalData/BadCustom1.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => ExternalData/BadCustom2-result.txt} (100%) create mode 100644 Tests/RunCMake/ExternalData/BadCustom2-stderr.txt create mode 100644 Tests/RunCMake/ExternalData/BadCustom2.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => ExternalData/BadCustom3-result.txt} (100%) create mode 100644 Tests/RunCMake/ExternalData/BadCustom3-stderr.txt create mode 100644 Tests/RunCMake/ExternalData/BadCustom3.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => ExternalData/BadCustom4-result.txt} (100%) create mode 100644 Tests/RunCMake/ExternalData/BadCustom4-stderr.txt create mode 100644 Tests/RunCMake/ExternalData/BadCustom4.cmake hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 11:03:56 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 11:03:56 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1956-gedfa7aa Message-ID: <20150115160356.83AA9AA19A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via edfa7aab959aed803075501633a9a3ae2770f028 (commit) via 829fc5ad791d6f292d87db5e98c8d5ed2ca9123b (commit) from 1133a57d714ed7ec8fe39c577cd80aed02dc7c4a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=edfa7aab959aed803075501633a9a3ae2770f028 commit edfa7aab959aed803075501633a9a3ae2770f028 Merge: 1133a57 829fc5a Author: Brad King AuthorDate: Thu Jan 15 11:03:55 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 11:03:55 2015 -0500 Merge topic 'ExternalData-custom-download' into next 829fc5ad Help: Add notes for topic 'ExternalData-custom-download' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=829fc5ad791d6f292d87db5e98c8d5ed2ca9123b commit 829fc5ad791d6f292d87db5e98c8d5ed2ca9123b Author: Brad King AuthorDate: Thu Jan 15 11:03:33 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:03:33 2015 -0500 Help: Add notes for topic 'ExternalData-custom-download' diff --git a/Help/release/dev/ExternalData-custom-download.rst b/Help/release/dev/ExternalData-custom-download.rst new file mode 100644 index 0000000..c40f4f7 --- /dev/null +++ b/Help/release/dev/ExternalData-custom-download.rst @@ -0,0 +1,7 @@ +ExternalData-custom-download +---------------------------- + +* The :module:`ExternalData` module learned to support + :ref:`Custom Fetch Scripts `. + This allows projects to specify custom ``.cmake`` scripts for + fetching data objects during the build. diff --git a/Modules/ExternalData.cmake b/Modules/ExternalData.cmake index 2d5088a..741db81 100644 --- a/Modules/ExternalData.cmake +++ b/Modules/ExternalData.cmake @@ -253,6 +253,8 @@ The following hash algorithms are supported:: Note that the hashes are used only for unique data identification and download verification. +.. _`ExternalData Custom Fetch Scripts`: + Custom Fetch Scripts ^^^^^^^^^^^^^^^^^^^^ ----------------------------------------------------------------------- Summary of changes: Help/release/dev/ExternalData-custom-download.rst | 7 +++++++ Modules/ExternalData.cmake | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 Help/release/dev/ExternalData-custom-download.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 11:33:38 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 11:33:38 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1961-ga17fcb5 Message-ID: <20150115163339.08939A8FFF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a17fcb54600b756cf8e62aaee55dffe6073fe413 (commit) via 777f74f60c58d0276ea3ac68258b2d51c54b2fe0 (commit) via dd4098e1f862f2ba054014d12757fe637eb3225c (commit) via bd1bc930142731cefa249d3df0f87e3cb8ff575c (commit) via 3c0aeb32f79f4255ad28b4263dcab1f2dd755301 (commit) from edfa7aab959aed803075501633a9a3ae2770f028 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a17fcb54600b756cf8e62aaee55dffe6073fe413 commit a17fcb54600b756cf8e62aaee55dffe6073fe413 Merge: edfa7aa 777f74f Author: Brad King AuthorDate: Thu Jan 15 11:33:37 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 11:33:37 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 777f74f6 jsoncpp: Provide 'isfinite' implementation on Solaris dd4098e1 jsoncpp: Include C headers since we use APIs without std:: bd1bc930 jsoncpp: Build with KWSys Large File Support configuration 3c0aeb32 jsoncpp: Include "config.h" before system headers http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=777f74f60c58d0276ea3ac68258b2d51c54b2fe0 commit 777f74f60c58d0276ea3ac68258b2d51c54b2fe0 Author: Brad King AuthorDate: Thu Jan 15 11:32:10 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:32:10 2015 -0500 jsoncpp: Provide 'isfinite' implementation on Solaris Solaris provides a 'finite' function in . diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp index 0a42cc4..7f8e6f1 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp @@ -21,6 +21,12 @@ #define snprintf _snprintf #endif +// Solaris +#if defined(__sun) +# include +# define isfinite finite +#endif + // Ancient glibc #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 2 # if !defined(isfinite) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd4098e1f862f2ba054014d12757fe637eb3225c commit dd4098e1f862f2ba054014d12757fe637eb3225c Author: Brad King AuthorDate: Thu Jan 15 11:16:03 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:17:22 2015 -0500 jsoncpp: Include C headers since we use APIs without std:: diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp index c5111f8..41896a7 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp @@ -10,9 +10,9 @@ #include "json_tool.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include -#include -#include -#include +#include +#include +#include #include #if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below diff --git a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp index aabc957..478afe1 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp @@ -14,8 +14,8 @@ #include #include #include -#include -#include +#include +#include #ifdef JSON_USE_CPPTL #include #endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bd1bc930142731cefa249d3df0f87e3cb8ff575c commit bd1bc930142731cefa249d3df0f87e3cb8ff575c Author: Brad King AuthorDate: Thu Jan 15 11:08:17 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:17:18 2015 -0500 jsoncpp: Build with KWSys Large File Support configuration This ensures use of a compatible C++ stream library on AIX with XL. diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt index 9f29558..1c863f8 100644 --- a/Utilities/cmjsoncpp/CMakeLists.txt +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -17,6 +17,9 @@ set(JSONCPP_SOURCES src/lib_json/json_writer.cpp ) -include_directories(${JsonCpp_SOURCE_DIR}/include) +include_directories( + ${JsonCpp_SOURCE_DIR}/include + ${KWSYS_HEADER_ROOT} + ) add_library(cmjsoncpp ${JSONCPP_SOURCES}) diff --git a/Utilities/cmjsoncpp/include/json/config.h b/Utilities/cmjsoncpp/include/json/config.h index 5c711e3..6847ceb 100644 --- a/Utilities/cmjsoncpp/include/json/config.h +++ b/Utilities/cmjsoncpp/include/json/config.h @@ -6,6 +6,9 @@ #ifndef JSON_CONFIG_H_INCLUDED #define JSON_CONFIG_H_INCLUDED +// Include KWSys Large File Support configuration. +#include + #if defined(_MSC_VER) # pragma warning(push,1) #endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c0aeb32f79f4255ad28b4263dcab1f2dd755301 commit 3c0aeb32f79f4255ad28b4263dcab1f2dd755301 Author: Brad King AuthorDate: Thu Jan 15 11:12:07 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:17:14 2015 -0500 jsoncpp: Include "config.h" before system headers diff --git a/Utilities/cmjsoncpp/include/json/assertions.h b/Utilities/cmjsoncpp/include/json/assertions.h index 5ef7e7b..37a3ff5 100644 --- a/Utilities/cmjsoncpp/include/json/assertions.h +++ b/Utilities/cmjsoncpp/include/json/assertions.h @@ -6,12 +6,12 @@ #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED #define CPPTL_JSON_ASSERTIONS_H_INCLUDED -#include - #if !defined(JSON_IS_AMALGAMATION) #include "config.h" #endif // if !defined(JSON_IS_AMALGAMATION) +#include + #if JSON_USE_EXCEPTION #include #define JSON_ASSERT(condition) \ ----------------------------------------------------------------------- Summary of changes: Utilities/cmjsoncpp/CMakeLists.txt | 5 ++++- Utilities/cmjsoncpp/include/json/assertions.h | 4 ++-- Utilities/cmjsoncpp/include/json/config.h | 3 +++ Utilities/cmjsoncpp/src/lib_json/json_reader.cpp | 6 +++--- Utilities/cmjsoncpp/src/lib_json/json_value.cpp | 4 ++-- Utilities/cmjsoncpp/src/lib_json/json_writer.cpp | 6 ++++++ 6 files changed, 20 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 15:04:58 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 15:04:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1963-g97e993b Message-ID: <20150115200458.B1123AA17F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 97e993b0bd69af48d664aa4e77e535d3a85d4bbc (commit) via 6c121924ada1f26c485c628279d6501406d9e3ac (commit) from a17fcb54600b756cf8e62aaee55dffe6073fe413 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97e993b0bd69af48d664aa4e77e535d3a85d4bbc commit 97e993b0bd69af48d664aa4e77e535d3a85d4bbc Merge: a17fcb5 6c12192 Author: Brad King AuthorDate: Thu Jan 15 15:04:57 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 15:04:57 2015 -0500 Merge topic 'tests-RunCMake-report-command' into next 6c121924 Tests: Teach RunCMake to report command-line on failure http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c121924ada1f26c485c628279d6501406d9e3ac commit 6c121924ada1f26c485c628279d6501406d9e3ac Author: Brad King AuthorDate: Thu Jan 15 14:36:10 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 14:46:58 2015 -0500 Tests: Teach RunCMake to report command-line on failure When a test sets RunCMake_TEST_COMMAND, report the command line on failure to make it easier to run by hand for debugging. diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 7b3eda7..1625741 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -93,6 +93,10 @@ function(run_cmake test) if(RunCMake_TEST_FAILED) set(msg "${RunCMake_TEST_FAILED}\n${msg}") endif() + if(msg AND RunCMake_TEST_COMMAND) + string(REPLACE ";" "\" \"" command "\"${RunCMake_TEST_COMMAND}\"") + set(msg "${msg}Command was:\n command> ${command}\n") + endif() if(msg) string(REGEX REPLACE "\n" "\n actual-out> " actual_out " actual-out> ${actual_stdout}") string(REGEX REPLACE "\n" "\n actual-err> " actual_err " actual-err> ${actual_stderr}") ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/RunCMake.cmake | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 15:05:11 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 15:05:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1965-gfb74a6f Message-ID: <20150115200511.9F40AAA199@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fb74a6fbfbbf235ce1c34323825b703ed453af7b (commit) via 6b9a0e17970391d2f7143ed9c600d5ea50dd6b98 (commit) from 97e993b0bd69af48d664aa4e77e535d3a85d4bbc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fb74a6fbfbbf235ce1c34323825b703ed453af7b commit fb74a6fbfbbf235ce1c34323825b703ed453af7b Merge: 97e993b 6b9a0e17 Author: Brad King AuthorDate: Thu Jan 15 15:05:11 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 15:05:11 2015 -0500 Merge topic 'libarchive-constify-internal-get_date' into next 6b9a0e17 libarchive: Constify internal __archive_get_date implementation http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b9a0e17970391d2f7143ed9c600d5ea50dd6b98 commit 6b9a0e17970391d2f7143ed9c600d5ea50dd6b98 Author: Brad King AuthorDate: Wed Jan 14 13:25:56 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:48:10 2015 -0500 libarchive: Constify internal __archive_get_date implementation The caller of this API already re-declares it as const, so update the implementation accordingly. diff --git a/Utilities/cmlibarchive/libarchive/archive_getdate.c b/Utilities/cmlibarchive/libarchive/archive_getdate.c index aaa9d6f..f665e2d 100644 --- a/Utilities/cmlibarchive/libarchive/archive_getdate.c +++ b/Utilities/cmlibarchive/libarchive/archive_getdate.c @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include /* This file defines a single public function. */ -time_t __archive_get_date(time_t now, char *); +time_t __archive_get_date(time_t now, const char *); /* Basic time units. */ #define EPOCH 1970 @@ -782,7 +782,7 @@ RelativeMonth(time_t Start, time_t Timezone, time_t RelMonth) * Tokenizer. */ static int -nexttoken(char **in, time_t *value) +nexttoken(const char **in, time_t *value) { char c; char buff[64]; @@ -809,7 +809,7 @@ nexttoken(char **in, time_t *value) /* Try the next token in the word table first. */ /* This allows us to match "2nd", for example. */ { - char *src = *in; + const char *src = *in; const struct LEXICON *tp; unsigned i = 0; @@ -894,7 +894,7 @@ difftm (struct tm *a, struct tm *b) * TODO: tokens[] array should be dynamically sized. */ time_t -__archive_get_date(time_t now, char *p) +__archive_get_date(time_t now, const char *p) { struct token tokens[256]; struct gdstate _gds; ----------------------------------------------------------------------- Summary of changes: Utilities/cmlibarchive/libarchive/archive_getdate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 15 15:54:21 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 15 Jan 2015 15:54:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1967-gb49af13 Message-ID: <20150115205422.24E6BA983B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b49af13bc15f01dd45f05c331e79d56dbd185d09 (commit) via 06ff525492b32cd3182c185c908c526379766912 (commit) from fb74a6fbfbbf235ce1c34323825b703ed453af7b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b49af13bc15f01dd45f05c331e79d56dbd185d09 commit b49af13bc15f01dd45f05c331e79d56dbd185d09 Merge: fb74a6f 06ff525 Author: Stephen Kelly AuthorDate: Thu Jan 15 15:54:20 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 15:54:20 2015 -0500 Merge topic 'extend-COMPILE_FEATURES-test' into next 06ff5254 Features: Extend the tests for the COMPILE_FEATURES genex. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06ff525492b32cd3182c185c908c526379766912 commit 06ff525492b32cd3182c185c908c526379766912 Author: Stephen Kelly AuthorDate: Mon Jan 12 20:02:17 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 21:51:18 2015 +0100 Features: Extend the tests for the COMPILE_FEATURES genex. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 4308508..5ca1eb7 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -144,11 +144,56 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_definitions(-DEXPECT_OVERRIDE_CONTROL=1) + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=0 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + else() + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + endif() + endif() + add_executable(CompileFeaturesGenex genex_test.cpp) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ + HAVE_INHERITING_CONSTRUCTORS=$ + HAVE_FINAL=$ + HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$ ) add_executable(CompileFeaturesGenex2 genex_test.cpp) @@ -156,6 +201,9 @@ if (CMAKE_CXX_COMPILE_FEATURES) target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ + HAVE_INHERITING_CONSTRUCTORS=$ + HAVE_FINAL=$ + HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$ ) add_library(static_assert_iface INTERFACE) @@ -165,5 +213,8 @@ if (CMAKE_CXX_COMPILE_FEATURES) target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$ HAVE_NULLPTR=$ + HAVE_INHERITING_CONSTRUCTORS=$ + HAVE_FINAL=$ + HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$ ) endif() diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index f667cc4..0389dbd 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -21,6 +21,36 @@ struct B final : A #error "Expect nullptr feature" #else +#if !HAVE_INHERITING_CONSTRUCTORS +# if EXPECT_INHERITING_CONSTRUCTORS +# error Expect cxx_inheriting_constructors support +# endif +#else +# if !EXPECT_INHERITING_CONSTRUCTORS +# error Expect no cxx_inheriting_constructors support +# endif +#endif + +#if !HAVE_FINAL +# if EXPECT_FINAL +# error Expect cxx_final support +# endif +#else +# if !EXPECT_FINAL +# error Expect no cxx_final support +# endif +#endif + +#if !HAVE_INHERITING_CONSTRUCTORS_AND_FINAL +# if EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL +# error Expect cxx_inheriting_constructors and cxx_final support +# endif +#else +# if !EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL +# error Expect no combined cxx_inheriting_constructors and cxx_final support +# endif +#endif + const char* getString() { return nullptr; ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 51 ++++++++++++++++++++++++++++++++++ Tests/CompileFeatures/genex_test.cpp | 30 ++++++++++++++++++++ 2 files changed, 81 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 15 16:25:57 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 15 Jan 2015 16:25:57 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1970-g57eb391 Message-ID: <20150115212557.31800A8C81@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 57eb391335197a75d92530bfcd67ea4087d98066 (commit) via 236d0c878cccdcaf5fd49c790c65340fb89a92a7 (commit) via ffa49bcc1163e22489e67d4204d6371fd68372e5 (commit) from b49af13bc15f01dd45f05c331e79d56dbd185d09 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57eb391335197a75d92530bfcd67ea4087d98066 commit 57eb391335197a75d92530bfcd67ea4087d98066 Merge: b49af13 236d0c8 Author: Brad King AuthorDate: Thu Jan 15 16:25:56 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 16:25:56 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 236d0c87 rename and rework CTestGCOV.cmake to CTestCoverageCollectGCOV.cmake ffa49bcc Fail and return when the upload file does not exist. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=236d0c878cccdcaf5fd49c790c65340fb89a92a7 commit 236d0c878cccdcaf5fd49c790c65340fb89a92a7 Author: Bill Hoffman AuthorDate: Thu Jan 15 15:37:45 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 16:03:23 2015 -0500 rename and rework CTestGCOV.cmake to CTestCoverageCollectGCOV.cmake This creates the function ctest_coverage_collect_gcov. diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index d96b96f..965eede 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -63,7 +63,7 @@ All Modules /module/CPack /module/CPackWIX /module/CTest - /module/CTestGCOV + /module/CTestCoverageCollectGCOV /module/CTestScriptMode /module/CTestUseLaunchers /module/Dart diff --git a/Help/module/CTestCoverageCollectGCOV.rst b/Help/module/CTestCoverageCollectGCOV.rst new file mode 100644 index 0000000..4c5deca --- /dev/null +++ b/Help/module/CTestCoverageCollectGCOV.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/CTestCoverageCollectGCOV.cmake diff --git a/Help/module/CTestGCOV.rst b/Help/module/CTestGCOV.rst deleted file mode 100644 index b1077fe..0000000 --- a/Help/module/CTestGCOV.rst +++ /dev/null @@ -1 +0,0 @@ -.. cmake-module:: ../../Modules/CTestGCOV.cmake diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake new file mode 100644 index 0000000..551fbd0 --- /dev/null +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -0,0 +1,122 @@ +#.rst: +# CTestCoverageCollectGCOV +# ------------------------ +# +# This module provides the function ``ctest_coverage_collect_gcov``. +# The function will run gcov on the .gcda files in a binary tree and then +# package all of the .gcov files into a tar file with a data.json. +# This file can be sent to a CDash server for display with the +# :command:`ctest_submit(CDASH_UPLOAD)` command. +# +# .. command:: cdash_coverage_collect_gcov +# +# :: +# +# ctest_coverage_collect_gcov( +# TARBALL # required +# SOURCE # optional, else CTEST_SOURCE_DIRECTORY +# BUILD # optional, else CTEST_BINARY_DIRECTORY +# GCOV_COMMAND # optional, else CTEST_COVERAGE_COMMAND +# ) +# +# Run gcov and package a tar file for cdash. ```` is the name +# of the tarfile that is created and it will be placed in ````. +# ```` is the source directory for the build and ```` +# is the binary directory for the build. The ```` is a full +# path to ``gcov`` for the machine. + +#============================================================================= +# 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.) +include(CMakeParseArguments) +function(ctest_coverage_collect_gcov) + set(options "") + set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) + set(multiValueArgs "") + cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" + "${multiValueArgs}" "" ${ARGN} ) + if(NOT DEFINED GCOV_TARBALL) + message(FATAL_ERROR + "TARBALL must be specified. for ctest_coverage_collect_gcov") + endif() + if(NOT DEFINED GCOV_SOURCE) + set(source_dir "${CTEST_SOURCE_DIRECTORY}") + else() + set(source_dir "${GCOV_SOURCE}") + endif() + if(NOT DEFINED GCOV_BUILD) + set(binary_dir "${CTEST_BINARY_DIRECTORY}") + else() + set(binary_dir "${GCOV_BUILD}") + endif() + if(NOT DEFINED GCOV_GCOV_COMMAND) + set(gcov_command "${CTEST_COVERAGE_COMMAND}") + else() + set(gcov_command "${GCOV_GCOV_COMMAND}") + endif() + # run gcov on each gcda file in the binary tree + set(gcda_files) + set(label_files) + # look for gcda files in the target directories + # could do a glob from the top of the binary tree but + # this will be faster and only look where the files will be + file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) + foreach(target_dir ${target_dirs}) + file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") + list(LENGTH gfiles len) + # if we have gcda files then also grab the labels file for that target + if(${len} GREATER 0) + file(GLOB_RECURSE lfiles RELATIVE ${binary_dir} + "${target_dir}/Labels.txt") + list(APPEND gcda_files ${gfiles}) + list(APPEND label_files ${lfiles}) + endif() + endforeach() + # return early if no coverage files were found + list(LENGTH gcda_files len) + if(len EQUAL 0) + message("ctest_coverage_collect_gcov: No .gcda files found, " + "ignoring coverage request.") + return() + endif() + # setup the dir for the coverage files + set(coverage_dir "${binary_dir}/Testing/CoverageInfo") + file(MAKE_DIRECTORY "${coverage_dir}") + # call gcov on each .gcda file + foreach (gcda_file ${gcda_files}) + # get the directory of the gcda file + get_filename_component(gcov_dir ${gcda_file} DIRECTORY) + # run gcov, this will produce the .gcov file in the current + # working directory + execute_process(COMMAND + ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${coverage_dir}) + endforeach() + # create json file with project information + file(WRITE ${coverage_dir}/data.json + "{ + \"Source\": \"${source_dir}\", + \"Binary\": \"${binary_dir}\" +}") + # collect the gcov files + set(gcov_files) + file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "${binary_dir}/*.gcov") + # tar up the coverage info with the same date so that the md5 + # sum will be the same for the tar file independent of file time + # stamps + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar cvf ${GCOV_TARBALL} + --mtime=1970-01-01\ 0:0:0\ UTC ${gcov_files} + ${coverage_dir}/data.json ${label_files} + WORKING_DIRECTORY ${binary_dir}) +endfunction() diff --git a/Modules/CTestGCOV.cmake b/Modules/CTestGCOV.cmake deleted file mode 100644 index f505159..0000000 --- a/Modules/CTestGCOV.cmake +++ /dev/null @@ -1,72 +0,0 @@ -#.rst: -# CTestGCOV -# --------- -# -# This module provides the function ``run_gcov_and_package_for_cdash``. -# The function will run gcov on the .gcda files in a binary tree and then -# package all of the .gcov files into a tar file with a data.json. -# This file can be sent to a CDash server for display with the -# :command:`ctest_submit(CDASH_UPLOAD)` command. -# -# .. command:: run_gcov_and_package_for_cdash -# -# :: -# -# run_gcov_and_package_for_cdash( -# ) -# -# Run gcov and package a tar gz file for cdash. ```` is the name -# of the tarfile that is created and it will be placed in ````. -# ```` is the source directory for the build and ```` -# is the binary directory for the build. The ```` is a full -# path to ``gcov`` for the machine. - -#============================================================================= -# 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.) - -function(run_gcov_and_package_for_cdash tarfile source_dir binary_dir - gcov_command) - # run gcov on each gcda file in the binary tree - file(GLOB_RECURSE GCDA_FILES RELATIVE ${binary_dir} "*.gcda") - - # return early if no coverage files were found - list(LENGTH GCDA_FILES len) - if(len EQUAL 0) - message("CTestGCOV: No .gcda files found, ignoring coverage request.") - return() - endif() - - foreach (gcda_file ${GCDA_FILES}) - # get the directory of the gcda file - get_filename_component(gcov_dir ${gcda_file} DIRECTORY) - # run gcov - execute_process(COMMAND - ${gcov_command} -b -o ${gcov_dir} ${gcda_file} - OUTPUT_VARIABLE out - WORKING_DIRECTORY ${binary_dir}) - endforeach() - # create json file with project information - file(WRITE ${binary_dir}/data.json - "{ - \"Source\": \"${source_dir}\", - \"Binary\": \"${binary_dir}\" -}" - ) - # collect the gcov files - file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "*.gcov") - # tar up the coverage info - execute_process(COMMAND - ${CMAKE_COMMAND} -E tar cvf ${tarfile} - --mtime=1970-01-01\ 0:0:0\ UTC ${gcov_files} data.json - WORKING_DIRECTORY ${binary_dir}) -endfunction() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ffa49bcc1163e22489e67d4204d6371fd68372e5 commit ffa49bcc1163e22489e67d4204d6371fd68372e5 Author: Bill Hoffman AuthorDate: Thu Jan 15 15:40:10 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 16:03:22 2015 -0500 Fail and return when the upload file does not exist. diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 3e5fa38..53a8982 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1088,6 +1088,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, { cmCTestLog(this->CTest, ERROR_MESSAGE, "Upload file not found: " << file << "\n"); + return -1; } cmCTestCurl curl(this->CTest); std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-modules.7.rst | 2 +- Help/module/CTestCoverageCollectGCOV.rst | 1 + Help/module/CTestGCOV.rst | 1 - Modules/CTestCoverageCollectGCOV.cmake | 122 ++++++++++++++++++++++++++++++ Modules/CTestGCOV.cmake | 72 ------------------ Source/CTest/cmCTestSubmitHandler.cxx | 1 + 6 files changed, 125 insertions(+), 74 deletions(-) create mode 100644 Help/module/CTestCoverageCollectGCOV.rst delete mode 100644 Help/module/CTestGCOV.rst create mode 100644 Modules/CTestCoverageCollectGCOV.cmake delete mode 100644 Modules/CTestGCOV.cmake hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 15 16:31:28 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 15 Jan 2015 16:31:28 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1982-gea660cf Message-ID: <20150115213128.DF776AA12D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ea660cfeb3d1f9f0fc85e226563d93162b043f83 (commit) via 135fd90a2a3e1f6a700ed59494ee2b54b9d3662c (commit) via 1f19ac4da5af812891be305721f3e3b7eed62cc3 (commit) via 0798d1e5b0a09564b127ae7d26d8c1ea1bc9adad (commit) via 938bd94eb0b34e1b5be12dcceaab641efc8a7e43 (commit) via 462c630b8a6d832dd37562fcd7b00a75e1ec6e82 (commit) via 222ec86f7d9ae838d2e460b89985c797c7c90373 (commit) via 6e909035af73d3ee0ca3e5adef39b4541f0c8be9 (commit) via bfc995cc3b8834281ee86ea2ed248b041d5ad1be (commit) via 1532b9214f79517fe74dc674939601c75f4af300 (commit) via 1f4649e62f6394a6e9af67486e4c41f3e286de47 (commit) via a60027a642f887179513496ef61552db44829652 (commit) from 57eb391335197a75d92530bfcd67ea4087d98066 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea660cfeb3d1f9f0fc85e226563d93162b043f83 commit ea660cfeb3d1f9f0fc85e226563d93162b043f83 Merge: 57eb391 135fd90 Author: Stephen Kelly AuthorDate: Thu Jan 15 16:31:27 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 16:31:27 2015 -0500 Merge topic 'GNU-4.6-compile-features' into next 135fd90a Features: Record for GNU 4.6. 1f19ac4d Features: Adjust cxx_variadic_templates unit test for GNU < 4.7. 0798d1e5 Features: Extend the generalized_initializers test for GNU < 4.7. 938bd94e Features: Test __GXX_EXPERIMENTAL_CXX0X__ macro for GNU < 4.7 compatibility. 462c630b Features: Don't test __cplusplus value for CXX98 on GNU. 222ec86f Features: Test an old value of __STDC_VERSION__ for GNU < 4.7 compatibility. 6e909035 Features: Record C/CXX dialect flags for GNU 4.6. bfc995cc Features: Remove wrong content from else() condition. 1532b921 Features: Make cxx_noexcept available from GNU 4.6. 1f4649e6 Features: Update the default_dialect test for old GNU-like compilers. a60027a6 Features: Ensure appropriate return value from feature test macros. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=135fd90a2a3e1f6a700ed59494ee2b54b9d3662c commit 135fd90a2a3e1f6a700ed59494ee2b54b9d3662c Author: Stephen Kelly AuthorDate: Sat Jan 10 20:05:54 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 22:16:20 2015 +0100 Features: Record for GNU 4.6. Adjust the CompileFeatures genex_test for the expectation of the OVERRIDE_CONTROL feature group. diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake index ddac0e8..7e840aa 100644 --- a/Modules/Compiler/GNU-C-FeatureTests.cmake +++ b/Modules/Compiler/GNU-C-FeatureTests.cmake @@ -1,12 +1,12 @@ -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") # GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it # to 201000L. As the former is strictly greater than the latter, test only # for the latter. If in the future CMake learns about a C feature which was # introduced with GNU 4.7, that should test for the correct version, similar # to the distinction between __cplusplus and __GXX_EXPERIMENTAL_CXX0X__ tests. -set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") +set(GNU46_C11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") set(_cmake_feature_test_c_static_assert "${GNU46_C11}") # Since 4.4 at least: set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 8faf4e4..d5e747d 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -29,7 +29,7 @@ macro(cmake_record_c_compile_features) endmacro() set(_result 0) - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 3c6c663..267d658 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -2,7 +2,7 @@ # Reference: http://gcc.gnu.org/projects/cxx0x.html # http://gcc.gnu.org/projects/cxx1y.html -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L") set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}") @@ -60,7 +60,7 @@ set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") # defined in the future. set(GNU_CXX0X_DEFINED "(__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))") # TODO: Should be supported by GNU 4.6 -set(GNU46_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU46_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index c03cc4b..eeada86 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -45,7 +45,7 @@ macro(cmake_record_cxx_compile_features) if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() - if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 5ca1eb7..106f29c 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -142,23 +142,24 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(IfaceCompileFeatures main.cpp) target_link_libraries(IfaceCompileFeatures iface) - add_definitions(-DEXPECT_OVERRIDE_CONTROL=1) - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=1 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 ) elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=0 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) else() add_definitions( + -DEXPECT_OVERRIDE_CONTROL=0 -DEXPECT_INHERITING_CONSTRUCTORS=0 -DEXPECT_FINAL=0 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 @@ -166,6 +167,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=1 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 @@ -173,12 +175,14 @@ if (CMAKE_CXX_COMPILE_FEATURES) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=1 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 ) else() add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=0 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f19ac4da5af812891be305721f3e3b7eed62cc3 commit 1f19ac4da5af812891be305721f3e3b7eed62cc3 Author: Stephen Kelly AuthorDate: Sun Jan 11 18:44:49 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 22:13:22 2015 +0100 Features: Adjust cxx_variadic_templates unit test for GNU < 4.7. The unit test for this fails with GNU 4.6: Building CXX object CMakeFiles/test_cxx_variadic_templates.dir/cxx_variadic_templates.cpp.o CompileFeatures/cxx_variadic_templates.cpp: In static member function ?static int Interface::accumulate()?: CompileFeatures/cxx_variadic_templates.cpp:18:31: sorry, unimplemented: cannot expand ?Is ...? into a fixed-length argument list CMakeFiles/test_cxx_variadic_templates.dir/build.make:54: recipe for target 'CMakeFiles/test_cxx_variadic_templates.dir/cxx_variadic_templates.cpp.o' failed The workaround is to use a specialization: http://stackoverflow.com/questions/1989552 http://stackoverflow.com/questions/11297376 diff --git a/Tests/CompileFeatures/cxx_variadic_templates.cpp b/Tests/CompileFeatures/cxx_variadic_templates.cpp index 1d5a706..a80e157 100644 --- a/Tests/CompileFeatures/cxx_variadic_templates.cpp +++ b/Tests/CompileFeatures/cxx_variadic_templates.cpp @@ -1,4 +1,4 @@ -template +template struct Interface; template @@ -11,7 +11,7 @@ struct Interface }; template -struct Interface +struct Interface { static int accumulate() { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0798d1e5b0a09564b127ae7d26d8c1ea1bc9adad commit 0798d1e5b0a09564b127ae7d26d8c1ea1bc9adad Author: Stephen Kelly AuthorDate: Sun Jan 11 18:43:31 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 22:13:22 2015 +0100 Features: Extend the generalized_initializers test for GNU < 4.7. That compiler requires a different initializer_list constructor, so update the test to match. diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp index 8013ef5..7bf356b 100644 --- a/Tests/CompileFeatures/cxx_generalized_initializers.cpp +++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp @@ -8,6 +8,7 @@ namespace std { const _E* __begin_; size_t __size_; + initializer_list(const int*, long unsigned int) {} }; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=938bd94eb0b34e1b5be12dcceaab641efc8a7e43 commit 938bd94eb0b34e1b5be12dcceaab641efc8a7e43 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:22:24 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 22:13:22 2015 +0100 Features: Test __GXX_EXPERIMENTAL_CXX0X__ macro for GNU < 4.7 compatibility. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 8f812da..3c6c663 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -54,8 +54,13 @@ set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") # support -std=c++11. Prior to that, support for C++11 features is technically # experiemental and possibly incomplete (see for example the note below about # cxx_variadic_template_template_parameters) +# GNU does not define __cplusplus correctly before version 4.7. +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773 +# __GXX_EXPERIMENTAL_CXX0X__ is defined in prior versions, but may not be +# defined in the future. +set(GNU_CXX0X_DEFINED "(__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))") # TODO: Should be supported by GNU 4.6 -set(GNU46_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU46_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}") @@ -64,13 +69,13 @@ set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}") set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}") # TODO: Should be supported by GNU 4.5 -set(GNU45_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU45_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}") set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}") set(_cmake_feature_test_cxx_local_type_template_args "${GNU45_CXX11}") set(_cmake_feature_test_cxx_raw_string_literals "${GNU45_CXX11}") # TODO: Should be supported by GNU 4.4 -set(GNU44_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU44_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}") set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}") set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}") @@ -90,7 +95,7 @@ set(_cmake_feature_test_cxx_variadic_templates "${GNU44_CXX11}") # templates capability in CMake. See # http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf # TODO: Should be supported by GNU 4.3 -set(GNU43_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(GNU43_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_decltype "${GNU43_CXX11}") set(_cmake_feature_test_cxx_default_function_template_args "${GNU43_CXX11}") set(_cmake_feature_test_cxx_long_long_type "${GNU43_CXX11}") @@ -98,8 +103,8 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${GNU43_CXX11}") set(_cmake_feature_test_cxx_rvalue_references "${GNU43_CXX11}") set(_cmake_feature_test_cxx_static_assert "${GNU43_CXX11}") # TODO: Should be supported since GNU 3.4? -set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") # TODO: Should be supported forever? -set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && __cplusplus >= 201103L") -set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported} && __cplusplus") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=462c630b8a6d832dd37562fcd7b00a75e1ec6e82 commit 462c630b8a6d832dd37562fcd7b00a75e1ec6e82 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:23:34 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 22:13:22 2015 +0100 Features: Don't test __cplusplus value for CXX98 on GNU. The macro is defined to 1 for GNU 4.6, and such a test is only useful for features in language dialects newer than the default (CXX98 for GNU currently). Test only that it has a truthy value. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 03b53e1..8f812da 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -102,4 +102,4 @@ set(_cmake_feature_test_cxx_extern_templates "${_cmake_oldestSupported} && __cpl # TODO: Should be supported forever? set(_cmake_feature_test_cxx_func_identifier "${_cmake_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_variadic_macros "${_cmake_oldestSupported} && __cplusplus >= 201103L") -set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported} && __cplusplus >= 199711L") +set(_cmake_feature_test_cxx_template_template_parameters "${_cmake_oldestSupported} && __cplusplus") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=222ec86f7d9ae838d2e460b89985c797c7c90373 commit 222ec86f7d9ae838d2e460b89985c797c7c90373 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:20:03 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 22:13:22 2015 +0100 Features: Test an old value of __STDC_VERSION__ for GNU < 4.7 compatibility. diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake index dfaeebf..ddac0e8 100644 --- a/Modules/Compiler/GNU-C-FeatureTests.cmake +++ b/Modules/Compiler/GNU-C-FeatureTests.cmake @@ -1,7 +1,12 @@ set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") -set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L") +# GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it +# to 201000L. As the former is strictly greater than the latter, test only +# for the latter. If in the future CMake learns about a C feature which was +# introduced with GNU 4.7, that should test for the correct version, similar +# to the distinction between __cplusplus and __GXX_EXPERIMENTAL_CXX0X__ tests. +set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") set(_cmake_feature_test_c_static_assert "${GNU46_C11}") # Since 4.4 at least: set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e909035af73d3ee0ca3e5adef39b4541f0c8be9 commit 6e909035af73d3ee0ca3e5adef39b4541f0c8be9 Author: Stephen Kelly AuthorDate: Sun Jan 11 16:09:50 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 22:13:22 2015 +0100 Features: Record C/CXX dialect flags for GNU 4.6. This release was prior to standardization of C11/CXX11. diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 8b47880..8faf4e4 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -1,15 +1,20 @@ include(Compiler/GNU) __compiler_gnu(C) -if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99") set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99") +endif() +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") +elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) + set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x") + set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x") endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index 6ade85a..c03cc4b 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -11,7 +11,7 @@ else() endif() endif() -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) # Supported since 4.3 set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98") @@ -20,7 +20,10 @@ endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") +elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) # 4.3 supports 0x variants + set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x") + set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x") endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bfc995cc3b8834281ee86ea2ed248b041d5ad1be commit bfc995cc3b8834281ee86ea2ed248b041d5ad1be Author: Stephen Kelly AuthorDate: Sun Jan 11 16:14:26 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 22:13:22 2015 +0100 Features: Remove wrong content from else() condition. As this is not elseif(), the content has no effect. Rather than changing it to an elseif(), remove the conditional content. All versions of GNU prior to 5.0 default to C90/89. Clang-C.cmake has a similar code block which correctly uses elseif() for setting the default C dialect to C99. That may have been updated from a C90 default at some point, so leave the version condition there in place for now. diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 3404d22..8b47880 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -14,7 +14,7 @@ endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set(CMAKE_C_STANDARD_DEFAULT 11) -else(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) +else() set(CMAKE_C_STANDARD_DEFAULT 90) endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1532b9214f79517fe74dc674939601c75f4af300 commit 1532b9214f79517fe74dc674939601c75f4af300 Author: Stephen Kelly AuthorDate: Sun Jan 11 15:55:09 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 22:13:22 2015 +0100 Features: Make cxx_noexcept available from GNU 4.6. As listed in the reference document. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 6de06dd..03b53e1 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -46,7 +46,6 @@ set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}") set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}") set(_cmake_feature_test_cxx_extended_friend_declarations "${GNU47_CXX11}") set(_cmake_feature_test_cxx_final "${GNU47_CXX11}") -set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}") set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}") set(_cmake_feature_test_cxx_override "${GNU47_CXX11}") set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") @@ -60,6 +59,7 @@ set(GNU46_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}") +set(_cmake_feature_test_cxx_noexcept "${GNU46_CXX11}") set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}") set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f4649e62f6394a6e9af67486e4c41f3e286de47 commit 1f4649e62f6394a6e9af67486e4c41f3e286de47 Author: Stephen Kelly AuthorDate: Fri Jan 9 20:18:24 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 22:13:22 2015 +0100 Features: Update the default_dialect test for old GNU-like compilers. Prior to GNU 4.7, GNU defined __cplusplus incorrectly, and defined __GXX_EXPERIMENTAL_CXX0X__ in C++11 mode. diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp index 8d97926..a2ca268 100644 --- a/Tests/CompileFeatures/default_dialect.cpp +++ b/Tests/CompileFeatures/default_dialect.cpp @@ -14,7 +14,7 @@ Outputter<__cplusplus> o; # if !DEFAULT_CXX98 # error Buildsystem error # endif -# if __cplusplus != 199711L +# if __cplusplus != 199711L && __cplusplus != 1 && !defined(__GXX_EXPERIMENTAL_CXX0X__) Outputter<__cplusplus> o; # endif #endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a60027a642f887179513496ef61552db44829652 commit a60027a642f887179513496ef61552db44829652 Author: Stephen Kelly AuthorDate: Mon Jan 12 21:43:48 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 22:13:21 2015 +0100 Features: Ensure appropriate return value from feature test macros. GNU-CXX already has complex logic and sets the _result to 0 before tests which may set it to something else. Change the other modules to be consistent with that. diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index 0665745..16f420f 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -19,6 +19,7 @@ macro(cmake_record_c_compile_features) record_compiler_features(C "${std_version}" ${list}) endmacro() + set(_result 0) if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) _get_appleclang_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) @@ -27,7 +28,5 @@ macro(cmake_record_c_compile_features) if (_result EQUAL 0) _get_appleclang_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES) endif() - else() - set(_result 0) endif() endmacro() diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index a508623..978c382 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -26,6 +26,7 @@ macro(cmake_record_cxx_compile_features) record_compiler_features(CXX "${std_version}" ${list}) endmacro() + set(_result 0) if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) set(_result 0) if(CMAKE_CXX14_STANDARD_COMPILE_OPTION) @@ -37,7 +38,5 @@ macro(cmake_record_cxx_compile_features) if (_result EQUAL 0) _get_appleclang_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) endif() - else() - set(_result 0) endif() endmacro() diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index ebd5c43..548d0a5 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -28,6 +28,7 @@ macro(cmake_record_c_compile_features) record_compiler_features(C "${std_version}" ${list}) endmacro() + set(_result 0) if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) _get_clang_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) @@ -36,7 +37,5 @@ macro(cmake_record_c_compile_features) if (_result EQUAL 0) _get_clang_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES) endif() - else() - set(_result 0) endif() endmacro() diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 6fe0b56..e07eace 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -38,6 +38,7 @@ macro(cmake_record_cxx_compile_features) record_compiler_features(CXX "${std_version}" ${list}) endmacro() + set(_result 0) if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) _get_clang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) if (_result EQUAL 0) @@ -46,7 +47,5 @@ macro(cmake_record_cxx_compile_features) if (_result EQUAL 0) _get_clang_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) endif() - else() - set(_result 0) endif() endmacro() diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index db9089d..3404d22 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -23,6 +23,7 @@ macro(cmake_record_c_compile_features) record_compiler_features(C "${std_version}" ${list}) endmacro() + set(_result 0) if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) @@ -31,7 +32,5 @@ macro(cmake_record_c_compile_features) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C90_STANDARD_COMPILE_OPTION} CMAKE_C90_COMPILE_FEATURES) endif() - else() - set(_result 0) endif() endmacro() diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index 4a26963..6ade85a 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -49,7 +49,5 @@ macro(cmake_record_cxx_compile_features) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX98_STANDARD_COMPILE_OPTION} CMAKE_CXX98_COMPILE_FEATURES) endif() - else() - set(_result 0) endif() endmacro() ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/AppleClang-C.cmake | 3 +-- Modules/Compiler/AppleClang-CXX.cmake | 3 +-- Modules/Compiler/Clang-C.cmake | 3 +-- Modules/Compiler/Clang-CXX.cmake | 3 +-- Modules/Compiler/GNU-C-FeatureTests.cmake | 9 +++++-- Modules/Compiler/GNU-C.cmake | 14 +++++++---- Modules/Compiler/GNU-CXX-FeatureTests.cmake | 25 ++++++++++++-------- Modules/Compiler/GNU-CXX.cmake | 9 +++---- Tests/CompileFeatures/CMakeLists.txt | 8 +++++-- .../cxx_generalized_initializers.cpp | 1 + Tests/CompileFeatures/cxx_variadic_templates.cpp | 4 ++-- Tests/CompileFeatures/default_dialect.cpp | 2 +- 12 files changed, 50 insertions(+), 34 deletions(-) hooks/post-receive -- CMake From clinton at elemtech.com Thu Jan 15 17:07:45 2015 From: clinton at elemtech.com (Clinton Stimpson) Date: Thu, 15 Jan 2015 17:07:45 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1984-gc4b0c12 Message-ID: <20150115220745.694BDAA0AF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c4b0c12aa0c4745f6995b52c55deb7527a52f43b (commit) via 39c66ed71b96fdbc93215ffd6aee6bd2f3e683cb (commit) from ea660cfeb3d1f9f0fc85e226563d93162b043f83 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4b0c12aa0c4745f6995b52c55deb7527a52f43b commit c4b0c12aa0c4745f6995b52c55deb7527a52f43b Merge: ea660cf 39c66ed Author: Clinton Stimpson AuthorDate: Thu Jan 15 17:07:44 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 17:07:44 2015 -0500 Merge topic 'windows-utf-8' into next 39c66ed7 Clarify docs about UTF-8 support. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=39c66ed71b96fdbc93215ffd6aee6bd2f3e683cb commit 39c66ed71b96fdbc93215ffd6aee6bd2f3e683cb Author: Clinton Stimpson AuthorDate: Thu Jan 15 15:06:34 2015 -0700 Commit: Clinton Stimpson CommitDate: Thu Jan 15 15:06:34 2015 -0700 Clarify docs about UTF-8 support. diff --git a/Help/release/dev/windows-utf-8.rst b/Help/release/dev/windows-utf-8.rst index a4e3ff0..3d984e9 100644 --- a/Help/release/dev/windows-utf-8.rst +++ b/Help/release/dev/windows-utf-8.rst @@ -1,10 +1,12 @@ windows-utf-8 ------------- -* On Windows, CMake learned to support Unicode characters. This allows using - characters from multiple (spoken) languages in CMake code and in paths to - source files. Because CMake interoperates with many other tools, there may - still be some limitations when using certain Unicode characters. +* On Windows, CMake learned to support international characters. This allows using + characters from multiple (spoken) languages in CMake code such as CMakeLists.txt + and .cmake files, in paths to source files, configured files such as .h.in files + and other files read and written by CMake. Because CMake interoperates with many + other tools, there may still be some limitations when using certain international + characters. Files written in the :manual:`cmake-language(7)`, such as ``CMakeLists.txt`` or ``*.cmake`` files, are expected to be encoded as UTF-8. If files are ----------------------------------------------------------------------- Summary of changes: Help/release/dev/windows-utf-8.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 15 18:00:40 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 15 Jan 2015 18:00:40 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1986-g27e9e84 Message-ID: <20150115230040.F15E3AA27F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 27e9e847d18de8df5ddafa72d6db80e9b657fb45 (commit) via dd58a786fc59a5248f9061c27db546ea0bb67aef (commit) from c4b0c12aa0c4745f6995b52c55deb7527a52f43b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27e9e847d18de8df5ddafa72d6db80e9b657fb45 commit 27e9e847d18de8df5ddafa72d6db80e9b657fb45 Merge: c4b0c12 dd58a78 Author: Stephen Kelly AuthorDate: Thu Jan 15 18:00:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 18:00:40 2015 -0500 Merge topic 'GNU-4.6-compile-features' into next dd58a786 Features: Adjust the RunCMake test to use more-common features. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd58a786fc59a5248f9061c27db546ea0bb67aef commit dd58a786fc59a5248f9061c27db546ea0bb67aef Author: Stephen Kelly AuthorDate: Thu Jan 15 23:53:23 2015 +0100 Commit: Stephen Kelly CommitDate: Thu Jan 15 23:53:23 2015 +0100 Features: Adjust the RunCMake test to use more-common features. diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake index 9d56bc0..d2c95ec 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -3,12 +3,12 @@ add_library(empty1 empty.cpp) add_library(empty2 INTERFACE) add_library(empty3 INTERFACE) -target_compile_features(empty3 INTERFACE cxx_constexpr) +target_compile_features(empty3 INTERFACE cxx_static_assert) target_link_libraries(empty1 - # When starting, $ is '0', so 'freeze' the + # When starting, $ is '0', so 'freeze' the # CXX_STANDARD at 98 during computation. - $<$:empty2> + $<$:empty2> # This would add cxx_constexpr, but that would require CXX_STANDARD = 11, # which is not allowed after freeze. Report an error. empty3 diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake index 0df548b..bbcf4e0 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake @@ -3,12 +3,12 @@ add_library(empty1 empty.cpp) add_library(empty2 INTERFACE) add_library(empty3 INTERFACE) -target_compile_features(empty3 INTERFACE cxx_constexpr) +target_compile_features(empty3 INTERFACE cxx_static_assert) target_link_libraries(empty1 - $<$:empty2> + $<$:empty2> empty3 ) # This, or populating the COMPILE_FEATURES property with a feature in the -# same standard as cxx_final, solves the cycle above. +# same standard as cxx_nullptr, solves the cycle above. set_property(TARGET empty1 PROPERTY CXX_STANDARD 11) ----------------------------------------------------------------------- Summary of changes: .../CompileFeatures/LinkImplementationFeatureCycle.cmake | 6 +++--- .../CompileFeatures/LinkImplementationFeatureCycleSolved.cmake | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From bill.hoffman at kitware.com Thu Jan 15 18:08:00 2015 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Thu, 15 Jan 2015 18:08:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1988-g4dc9ac8 Message-ID: <20150115230800.1F939AA879@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4dc9ac8e94e6bfae374b98c6afa3efbb6ca76d58 (commit) via acdab825420512a8bfb5f337faa4a7fe7ded3279 (commit) from 27e9e847d18de8df5ddafa72d6db80e9b657fb45 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4dc9ac8e94e6bfae374b98c6afa3efbb6ca76d58 commit 4dc9ac8e94e6bfae374b98c6afa3efbb6ca76d58 Merge: 27e9e84 acdab82 Author: Bill Hoffman AuthorDate: Thu Jan 15 18:07:58 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 18:07:58 2015 -0500 Merge topic 'cdash_upload_file_mode' into next acdab825 Use the full path to the gcda file, and use bzip2 compress for tar files. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=acdab825420512a8bfb5f337faa4a7fe7ded3279 commit acdab825420512a8bfb5f337faa4a7fe7ded3279 Author: Bill Hoffman AuthorDate: Thu Jan 15 18:05:29 2015 -0500 Commit: Bill Hoffman CommitDate: Thu Jan 15 18:05:29 2015 -0500 Use the full path to the gcda file, and use bzip2 compress for tar files. bzip2 does not put any date stamp in, and CDash can uncompress it, so compress the tar file. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 551fbd0..29fd504 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -94,6 +94,7 @@ function(ctest_coverage_collect_gcov) # call gcov on each .gcda file foreach (gcda_file ${gcda_files}) # get the directory of the gcda file + get_filename_component(gcda_file ${binary_dir}/${gcda_file} ABSOLUTE) get_filename_component(gcov_dir ${gcda_file} DIRECTORY) # run gcov, this will produce the .gcov file in the current # working directory @@ -115,7 +116,7 @@ function(ctest_coverage_collect_gcov) # sum will be the same for the tar file independent of file time # stamps execute_process(COMMAND - ${CMAKE_COMMAND} -E tar cvf ${GCOV_TARBALL} + ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} --mtime=1970-01-01\ 0:0:0\ UTC ${gcov_files} ${coverage_dir}/data.json ${label_files} WORKING_DIRECTORY ${binary_dir}) ----------------------------------------------------------------------- Summary of changes: Modules/CTestCoverageCollectGCOV.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 15 18:11:25 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 15 Jan 2015 18:11:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1991-gd1490cc Message-ID: <20150115231125.2631A25E7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d1490ccd6a4b7efa10e337e8727fb115e6ff0ebd (commit) via b15c008fac22720ccd793b18c235046bc84ecc86 (commit) via f13a2eb118d8b152a897e09fdcf43793f8e1bcca (commit) from 4dc9ac8e94e6bfae374b98c6afa3efbb6ca76d58 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d1490ccd6a4b7efa10e337e8727fb115e6ff0ebd commit d1490ccd6a4b7efa10e337e8727fb115e6ff0ebd Merge: 4dc9ac8 b15c008 Author: Stephen Kelly AuthorDate: Thu Jan 15 18:11:19 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 15 18:11:19 2015 -0500 Merge topic 'GNU-4.6-compile-features' into next b15c008f Features: Record for GNU 4.6. f13a2eb1 Features: Adjust the RunCMake test to use more-common features. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b15c008fac22720ccd793b18c235046bc84ecc86 commit b15c008fac22720ccd793b18c235046bc84ecc86 Author: Stephen Kelly AuthorDate: Sat Jan 10 20:05:54 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 00:11:01 2015 +0100 Features: Record for GNU 4.6. Adjust the CompileFeatures genex_test for the expectation of the OVERRIDE_CONTROL feature group. diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake index ddac0e8..7e840aa 100644 --- a/Modules/Compiler/GNU-C-FeatureTests.cmake +++ b/Modules/Compiler/GNU-C-FeatureTests.cmake @@ -1,12 +1,12 @@ -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") # GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it # to 201000L. As the former is strictly greater than the latter, test only # for the latter. If in the future CMake learns about a C feature which was # introduced with GNU 4.7, that should test for the correct version, similar # to the distinction between __cplusplus and __GXX_EXPERIMENTAL_CXX0X__ tests. -set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") +set(GNU46_C11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") set(_cmake_feature_test_c_static_assert "${GNU46_C11}") # Since 4.4 at least: set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 8faf4e4..d5e747d 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -29,7 +29,7 @@ macro(cmake_record_c_compile_features) endmacro() set(_result 0) - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 3c6c663..267d658 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -2,7 +2,7 @@ # Reference: http://gcc.gnu.org/projects/cxx0x.html # http://gcc.gnu.org/projects/cxx1y.html -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L") set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}") @@ -60,7 +60,7 @@ set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") # defined in the future. set(GNU_CXX0X_DEFINED "(__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))") # TODO: Should be supported by GNU 4.6 -set(GNU46_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU46_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") set(_cmake_feature_test_cxx_enum_forward_declarations "${GNU46_CXX11}") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index c03cc4b..eeada86 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -45,7 +45,7 @@ macro(cmake_record_cxx_compile_features) if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() - if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 5ca1eb7..106f29c 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -142,23 +142,24 @@ if (CMAKE_CXX_COMPILE_FEATURES) add_executable(IfaceCompileFeatures main.cpp) target_link_libraries(IfaceCompileFeatures iface) - add_definitions(-DEXPECT_OVERRIDE_CONTROL=1) - if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=1 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 ) elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=0 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) else() add_definitions( + -DEXPECT_OVERRIDE_CONTROL=0 -DEXPECT_INHERITING_CONSTRUCTORS=0 -DEXPECT_FINAL=0 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 @@ -166,6 +167,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=1 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 @@ -173,12 +175,14 @@ if (CMAKE_CXX_COMPILE_FEATURES) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=1 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 ) else() add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=0 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f13a2eb118d8b152a897e09fdcf43793f8e1bcca commit f13a2eb118d8b152a897e09fdcf43793f8e1bcca Author: Stephen Kelly AuthorDate: Thu Jan 15 23:53:23 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 00:11:01 2015 +0100 Features: Adjust the RunCMake test to use more-common features. diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake index 9d56bc0..d2c95ec 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -3,12 +3,12 @@ add_library(empty1 empty.cpp) add_library(empty2 INTERFACE) add_library(empty3 INTERFACE) -target_compile_features(empty3 INTERFACE cxx_constexpr) +target_compile_features(empty3 INTERFACE cxx_static_assert) target_link_libraries(empty1 - # When starting, $ is '0', so 'freeze' the + # When starting, $ is '0', so 'freeze' the # CXX_STANDARD at 98 during computation. - $<$:empty2> + $<$:empty2> # This would add cxx_constexpr, but that would require CXX_STANDARD = 11, # which is not allowed after freeze. Report an error. empty3 diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake index 0df548b..bbcf4e0 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycleSolved.cmake @@ -3,12 +3,12 @@ add_library(empty1 empty.cpp) add_library(empty2 INTERFACE) add_library(empty3 INTERFACE) -target_compile_features(empty3 INTERFACE cxx_constexpr) +target_compile_features(empty3 INTERFACE cxx_static_assert) target_link_libraries(empty1 - $<$:empty2> + $<$:empty2> empty3 ) # This, or populating the COMPILE_FEATURES property with a feature in the -# same standard as cxx_final, solves the cycle above. +# same standard as cxx_nullptr, solves the cycle above. set_property(TARGET empty1 PROPERTY CXX_STANDARD 11) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jan 16 00:01:21 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 16 Jan 2015 00:01:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-794-gfb354cc Message-ID: <20150116050121.3C3ABAA180@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via fb354cc59c3fdd358f77b2bd97b11db0480c521d (commit) from 811a29c9507054e3301d90d5d376d0c6d6caded1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fb354cc59c3fdd358f77b2bd97b11db0480c521d commit fb354cc59c3fdd358f77b2bd97b11db0480c521d Author: Kitware Robot AuthorDate: Fri Jan 16 00:01:16 2015 -0500 Commit: Kitware Robot CommitDate: Fri Jan 16 00:01:16 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 509a4e0..e510429 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 20150115) +set(CMake_VERSION_PATCH 20150116) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:00:46 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:00:46 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-1993-g278fc06 Message-ID: <20150116140046.C547FA961A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 278fc065365dcb78dc851f4a57aeaf73a737986a (commit) via 6e6e0c4048b1500edfc8c27a0fc567997b494a56 (commit) from d1490ccd6a4b7efa10e337e8727fb115e6ff0ebd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=278fc065365dcb78dc851f4a57aeaf73a737986a commit 278fc065365dcb78dc851f4a57aeaf73a737986a Merge: d1490cc 6e6e0c4 Author: Brad King AuthorDate: Fri Jan 16 09:00:45 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:00:45 2015 -0500 Merge topic 'eclipse-fix-cxx-natures' into next 6e6e0c40 Eclipse: Add org.eclipse.cdt.core.cnature to CXX projects (#15068) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e6e0c4048b1500edfc8c27a0fc567997b494a56 commit 6e6e0c4048b1500edfc8c27a0fc567997b494a56 Author: Andr? Klitzing AuthorDate: Fri Sep 26 14:38:54 2014 +0200 Commit: Brad King CommitDate: Fri Jan 16 08:54:39 2015 -0500 Eclipse: Add org.eclipse.cdt.core.cnature to CXX projects (#15068) Since commit v3.0.0-rc1~335^2~1 (eclipse: Add natures for Eclipse based on enabled languages, 2013-08-29) CXX projects got only "ccnature", but Eclipse itself also adds "cnature" when creating C++ projects. Fix this by adding both for CXX projects. diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 74ba9a6..cef4f10 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") { ----------------------------------------------------------------------- Summary of changes: Source/cmExtraEclipseCDT4Generator.cxx | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:14:33 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:14:33 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2003-g30e0ff9 Message-ID: <20150116141433.8F4A24980@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 30e0ff91b34ca2339625d10f9c921a7adb009199 (commit) via 89cd3d273deadf0b6a1c6b0dc8db153572e75845 (commit) via 7e310624b0973b8f0c529837010f164e486e784e (commit) via 4c49606598ab3089f0cec9be724ae2f3ab4c1ba3 (commit) via 50032bc847a79dc209e6e1ae4dd77a2ec2d52be9 (commit) via ad94b0521eb3a0e05c120b510d047dd18b27c9df (commit) via 7eba04fda156f670f8c84f3d6a9d9b44a472a04a (commit) via 06f41e986c25fc2fd68074fce314a55f5c1d003d (commit) via 1fc556536e0c0475d401e8b5747b46e9f7c32287 (commit) via 84d5674d4e0cfe30f28db2893ad00937deece57c (commit) from 278fc065365dcb78dc851f4a57aeaf73a737986a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=30e0ff91b34ca2339625d10f9c921a7adb009199 commit 30e0ff91b34ca2339625d10f9c921a7adb009199 Merge: 278fc06 89cd3d2 Author: Brad King AuthorDate: Fri Jan 16 09:14:31 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:14:31 2015 -0500 Merge topic 'import-jsoncpp' into next 89cd3d27 jsoncpp: Add README-CMake.txt 7e310624 jsoncpp: Provide 'isfinite' implementation on Solaris 4c496065 jsoncpp: Provide 'isfinite' implementation on ancient glibc 50032bc8 jsoncpp: Add missing assert before strcmp in json_value.cpp ad94b052 jsoncpp: Add missing include in json/writer.h 7eba04fd jsoncpp: Include C headers since we use APIs without std:: 06f41e98 jsoncpp: Disable warnings to avoid changing 3rd party code 1fc55653 jsoncpp: Build the library within CMake 84d5674d jsoncpp: Include "config.h" before system headers http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=89cd3d273deadf0b6a1c6b0dc8db153572e75845 commit 89cd3d273deadf0b6a1c6b0dc8db153572e75845 Author: Brad King AuthorDate: Tue Jan 13 12:00:16 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:39:20 2015 -0500 jsoncpp: Add README-CMake.txt Describe how to update jsoncpp from upstream. diff --git a/Utilities/cmjsoncpp/README-CMake.txt b/Utilities/cmjsoncpp/README-CMake.txt new file mode 100644 index 0000000..bf74094 --- /dev/null +++ b/Utilities/cmjsoncpp/README-CMake.txt @@ -0,0 +1,66 @@ +The Utilities/cmjsoncpp directory contains a reduced distribution +of the jsoncpp source tree with only the library source code and +CMake build system. It is not a submodule; the actual content is part +of our source tree and changes can be made and committed directly. + +We update from upstream using Git's "subtree" merge strategy. A +special branch contains commits of upstream jsoncpp snapshots and +nothing else. No Git ref points explicitly to the head of this +branch, but it is merged into our history. + +Update jsoncpp from upstream as follows. Create a local branch to +explicitly reference the upstream snapshot branch head: + + git branch jsoncpp-upstream 53f6ccb0 + +Use a temporary directory to checkout the branch: + + mkdir jsoncpp-tmp + cd jsoncpp-tmp + git init + git pull .. jsoncpp-upstream + rm -rf * + +Now place the (reduced) jsoncpp content in this directory. See +instructions shown by + + git log 53f6ccb0 + +for help extracting the content from the upstream svn repo. Then run +the following commands to commit the new version. Substitute the +appropriate date and version number: + + git add --all + + GIT_AUTHOR_NAME='JsonCpp Upstream' \ + GIT_AUTHOR_EMAIL='kwrobot at kitware.com' \ + GIT_AUTHOR_DATE='Thu Nov 20 08:45:58 2014 -0600' \ + git commit -m 'JsonCpp 1.0.0 (reduced)' && + git commit --amend + +Edit the commit message to describe the procedure used to obtain the +content. Then push the changes back up to the main local repository: + + git push .. HEAD:jsoncpp-upstream + cd .. + rm -rf jsoncpp-tmp + +Create a topic in the main repository on which to perform the update: + + git checkout -b update-jsoncpp master + +Merge the jsoncpp-upstream branch as a subtree: + + git merge -s recursive -X subtree=Utilities/cmjsoncpp \ + jsoncpp-upstream + +If there are conflicts, resolve them and commit. Build and test the +tree. Commit any additional changes needed to succeed. + +Finally, run + + git rev-parse --short=8 jsoncpp-upstream + +to get the commit from which the jsoncpp-upstream branch must be started +on the next update. Edit the "git branch jsoncpp-upstream" line above to +record it, and commit this file. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e310624b0973b8f0c529837010f164e486e784e commit 7e310624b0973b8f0c529837010f164e486e784e Author: Brad King AuthorDate: Thu Jan 15 11:32:10 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:39:20 2015 -0500 jsoncpp: Provide 'isfinite' implementation on Solaris Solaris provides a 'finite' function in . diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp index 0a42cc4..7f8e6f1 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp @@ -21,6 +21,12 @@ #define snprintf _snprintf #endif +// Solaris +#if defined(__sun) +# include +# define isfinite finite +#endif + // Ancient glibc #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 2 # if !defined(isfinite) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c49606598ab3089f0cec9be724ae2f3ab4c1ba3 commit 4c49606598ab3089f0cec9be724ae2f3ab4c1ba3 Author: Brad King AuthorDate: Tue Jan 13 11:54:06 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:39:04 2015 -0500 jsoncpp: Provide 'isfinite' implementation on ancient glibc The glibc 2.1 headers provide isfinite only in C99 mode. Add its definition ourselves. diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp index 89964ea..0a42cc4 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp @@ -21,6 +21,13 @@ #define snprintf _snprintf #endif +// Ancient glibc +#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 2 +# if !defined(isfinite) +# define isfinite __finite +# endif +#endif + #if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0 // Disable warning about strdup being deprecated. #pragma warning(disable : 4996) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=50032bc847a79dc209e6e1ae4dd77a2ec2d52be9 commit 50032bc847a79dc209e6e1ae4dd77a2ec2d52be9 Author: Brad King AuthorDate: Tue Jan 13 15:08:32 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:39:03 2015 -0500 jsoncpp: Add missing assert before strcmp in json_value.cpp The strcmp function does not allow NULL pointers, so add an assert to tell Clang scan-build that the code does not expect a NULL pointer. diff --git a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp index 8f46d3b..478afe1 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp @@ -195,14 +195,18 @@ Value::CZString& Value::CZString::operator=(CZString other) { } bool Value::CZString::operator<(const CZString& other) const { - if (cstr_) + if (cstr_) { + assert(other.cstr_); return strcmp(cstr_, other.cstr_) < 0; + } return index_ < other.index_; } bool Value::CZString::operator==(const CZString& other) const { - if (cstr_) + if (cstr_) { + assert(other.cstr_); return strcmp(cstr_, other.cstr_) == 0; + } return index_ == other.index_; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ad94b0521eb3a0e05c120b510d047dd18b27c9df commit ad94b0521eb3a0e05c120b510d047dd18b27c9df Author: Brad King AuthorDate: Tue Jan 13 11:27:43 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:39:03 2015 -0500 jsoncpp: Add missing include in json/writer.h The header uses std::ostream, so it must be declared. diff --git a/Utilities/cmjsoncpp/include/json/writer.h b/Utilities/cmjsoncpp/include/json/writer.h index dc9e46f..397bf6a 100644 --- a/Utilities/cmjsoncpp/include/json/writer.h +++ b/Utilities/cmjsoncpp/include/json/writer.h @@ -9,6 +9,7 @@ #if !defined(JSON_IS_AMALGAMATION) #include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) +#include #include #include http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7eba04fda156f670f8c84f3d6a9d9b44a472a04a commit 7eba04fda156f670f8c84f3d6a9d9b44a472a04a Author: Brad King AuthorDate: Thu Jan 15 11:16:03 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:39:03 2015 -0500 jsoncpp: Include C headers since we use APIs without std:: diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp index c5111f8..41896a7 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp @@ -10,9 +10,9 @@ #include "json_tool.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include -#include -#include -#include +#include +#include +#include #include #if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below diff --git a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp index b73deac..8f46d3b 100644 --- a/Utilities/cmjsoncpp/src/lib_json/json_value.cpp +++ b/Utilities/cmjsoncpp/src/lib_json/json_value.cpp @@ -14,8 +14,8 @@ #include #include #include -#include -#include +#include +#include #ifdef JSON_USE_CPPTL #include #endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=06f41e986c25fc2fd68074fce314a55f5c1d003d commit 06f41e986c25fc2fd68074fce314a55f5c1d003d Author: Brad King AuthorDate: Tue Jan 13 10:45:23 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:39:01 2015 -0500 jsoncpp: Disable warnings to avoid changing 3rd party code Add '-w' or equivalent flag on compilers supporting it. Tell MSVC to use its lowest warning level inside jsoncpp sources. diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt index 0ff8820..1c863f8 100644 --- a/Utilities/cmjsoncpp/CMakeLists.txt +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -1,5 +1,13 @@ project(JsonCpp CXX) +# Disable warnings to avoid changing 3rd party code. +if(CMAKE_CXX_COMPILER_ID MATCHES + "^(GNU|Clang|AppleClang|XL|VisualAge|SunPro|MIPSpro|HP|Intel)$") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PathScale") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -woffall") +endif() + set(JSONCPP_SOURCES src/lib_json/json_batchallocator.h src/lib_json/json_reader.cpp diff --git a/Utilities/cmjsoncpp/include/json/config.h b/Utilities/cmjsoncpp/include/json/config.h index 4d31797..6847ceb 100644 --- a/Utilities/cmjsoncpp/include/json/config.h +++ b/Utilities/cmjsoncpp/include/json/config.h @@ -9,6 +9,10 @@ // Include KWSys Large File Support configuration. #include +#if defined(_MSC_VER) +# pragma warning(push,1) +#endif + /// If defined, indicates that json library is embedded in CppTL library. //# define JSON_IN_CPPTL 1 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1fc556536e0c0475d401e8b5747b46e9f7c32287 commit 1fc556536e0c0475d401e8b5747b46e9f7c32287 Author: Brad King AuthorDate: Tue Jan 13 10:45:04 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:37:17 2015 -0500 jsoncpp: Build the library within CMake Update json/json.h to account for our lack of autolink.h. Update json/config.h to include KWSys Large File Support configuration so that consistent stream libraries are used (on AIX with XL). Add a cm_jsoncpp_reader.h header to include the CMake-provided copy of the json/reader.h header from CMake sources. diff --git a/CMakeLists.txt b/CMakeLists.txt index 1812b27..1847600 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -372,6 +372,11 @@ macro (CMAKE_BUILD_UTILITIES) endif() #--------------------------------------------------------------------- + # Build jsoncpp library. + add_subdirectory(Utilities/cmjsoncpp) + CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty") + + #--------------------------------------------------------------------- # Build XMLRPC library for CMake and CTest. if(CTEST_USE_XMLRPC) find_package(XMLRPC QUIET REQUIRED libwww-client) diff --git a/Utilities/cm_jsoncpp_reader.h b/Utilities/cm_jsoncpp_reader.h new file mode 100644 index 0000000..d7cb50e --- /dev/null +++ b/Utilities/cm_jsoncpp_reader.h @@ -0,0 +1,18 @@ +/*============================================================================ + 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_reader_h +#define cm_jsoncpp_reader_h + +/* Use the jsoncpp library configured for CMake. */ +#include + +#endif diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt new file mode 100644 index 0000000..0ff8820 --- /dev/null +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -0,0 +1,17 @@ +project(JsonCpp CXX) + +set(JSONCPP_SOURCES + src/lib_json/json_batchallocator.h + src/lib_json/json_reader.cpp + src/lib_json/json_tool.h + src/lib_json/json_value.cpp + src/lib_json/json_valueiterator.inl + src/lib_json/json_writer.cpp + ) + +include_directories( + ${JsonCpp_SOURCE_DIR}/include + ${KWSYS_HEADER_ROOT} + ) + +add_library(cmjsoncpp ${JSONCPP_SOURCES}) diff --git a/Utilities/cmjsoncpp/include/json/config.h b/Utilities/cmjsoncpp/include/json/config.h index afd3a45..4d31797 100644 --- a/Utilities/cmjsoncpp/include/json/config.h +++ b/Utilities/cmjsoncpp/include/json/config.h @@ -6,6 +6,9 @@ #ifndef JSON_CONFIG_H_INCLUDED #define JSON_CONFIG_H_INCLUDED +// Include KWSys Large File Support configuration. +#include + /// If defined, indicates that json library is embedded in CppTL library. //# define JSON_IN_CPPTL 1 diff --git a/Utilities/cmjsoncpp/include/json/json.h b/Utilities/cmjsoncpp/include/json/json.h index 8f10ac2..f89bc62 100644 --- a/Utilities/cmjsoncpp/include/json/json.h +++ b/Utilities/cmjsoncpp/include/json/json.h @@ -6,7 +6,6 @@ #ifndef JSON_JSON_H_INCLUDED #define JSON_JSON_H_INCLUDED -#include "autolink.h" #include "value.h" #include "reader.h" #include "writer.h" http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=84d5674d4e0cfe30f28db2893ad00937deece57c commit 84d5674d4e0cfe30f28db2893ad00937deece57c Author: Brad King AuthorDate: Thu Jan 15 11:12:07 2015 -0500 Commit: Brad King CommitDate: Thu Jan 15 11:36:49 2015 -0500 jsoncpp: Include "config.h" before system headers diff --git a/Utilities/cmjsoncpp/include/json/assertions.h b/Utilities/cmjsoncpp/include/json/assertions.h index 5ef7e7b..37a3ff5 100644 --- a/Utilities/cmjsoncpp/include/json/assertions.h +++ b/Utilities/cmjsoncpp/include/json/assertions.h @@ -6,12 +6,12 @@ #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED #define CPPTL_JSON_ASSERTIONS_H_INCLUDED -#include - #if !defined(JSON_IS_AMALGAMATION) #include "config.h" #endif // if !defined(JSON_IS_AMALGAMATION) +#include + #if JSON_USE_EXCEPTION #include #define JSON_ASSERT(condition) \ ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:32:59 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:32:59 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2005-gaf12181 Message-ID: <20150116143259.56B62AA28F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via af12181cadb48791c21269c2717011ea098dc3c2 (commit) via 335f416f9c80152c6a644a6c208c15cdb6169ecb (commit) from 30e0ff91b34ca2339625d10f9c921a7adb009199 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af12181cadb48791c21269c2717011ea098dc3c2 commit af12181cadb48791c21269c2717011ea098dc3c2 Merge: 30e0ff9 335f416 Author: Brad King AuthorDate: Fri Jan 16 09:32:58 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:32:58 2015 -0500 Merge topic 'windows-utf-8' into next 335f416f Help: Revise notes for topic 'windows-utf-8' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=335f416f9c80152c6a644a6c208c15cdb6169ecb commit 335f416f9c80152c6a644a6c208c15cdb6169ecb Author: Brad King AuthorDate: Fri Jan 16 09:32:48 2015 -0500 Commit: Brad King CommitDate: Fri Jan 16 09:32:48 2015 -0500 Help: Revise notes for topic 'windows-utf-8' diff --git a/Help/release/dev/windows-utf-8.rst b/Help/release/dev/windows-utf-8.rst index 3d984e9..64cd616 100644 --- a/Help/release/dev/windows-utf-8.rst +++ b/Help/release/dev/windows-utf-8.rst @@ -1,19 +1,22 @@ windows-utf-8 ------------- -* On Windows, CMake learned to support international characters. This allows using - characters from multiple (spoken) languages in CMake code such as CMakeLists.txt - and .cmake files, in paths to source files, configured files such as .h.in files - and other files read and written by CMake. Because CMake interoperates with many - other tools, there may still be some limitations when using certain international +* On Windows, CMake learned to support international characters. + This allows use of characters from multiple (spoken) languages + in CMake code, paths to source files, configured files such as + ``.h.in`` files, and other files read and written by CMake. + Because CMake interoperates with many other tools, there may + still be some limitations when using certain international characters. - Files written in the :manual:`cmake-language(7)`, such as ``CMakeLists.txt`` - or ``*.cmake`` files, are expected to be encoded as UTF-8. If files are - already ASCII, they will be compatible. If files were in a different - encoding, including Latin 1, they will need to be converted. + Files written in the :manual:`cmake-language(7)`, such as + ``CMakeLists.txt`` or ``*.cmake`` files, are expected to be + encoded as UTF-8. If files are already ASCII, they will be + compatible. If files were in a different encoding, including + Latin 1, they will need to be converted. - The Visual Studio generators now write solution and project files in UTF-8 - instead of Windows-1252. Windows-1252 supported Latin 1 languages such as - those found in North and South America and Western Europe. With UTF-8, - additional languages are now supported. + The Visual Studio generators now write solution and project + files in UTF-8 instead of Windows-1252. Windows-1252 supported + Latin 1 languages such as those found in North and South America + and Western Europe. With UTF-8, additional languages are now + supported. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/windows-utf-8.rst | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:41:04 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:41:04 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2007-g3367e6d Message-ID: <20150116144104.0C9BE21E2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3367e6de2c9b36af963b25af2b778828598ec948 (commit) via cdc29c36084ccfa447f171a25de2336b0bd74edd (commit) from af12181cadb48791c21269c2717011ea098dc3c2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3367e6de2c9b36af963b25af2b778828598ec948 commit 3367e6de2c9b36af963b25af2b778828598ec948 Merge: af12181 cdc29c3 Author: Brad King AuthorDate: Fri Jan 16 09:41:03 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:41:03 2015 -0500 Merge topic 'windows-utf-8' into next cdc29c36 Encoding: Switch to use UTF-8 internally by default on Windows. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cdc29c36084ccfa447f171a25de2336b0bd74edd commit cdc29c36084ccfa447f171a25de2336b0bd74edd Author: Clinton Stimpson AuthorDate: Fri Dec 26 21:25:20 2014 -0700 Commit: Brad King CommitDate: Fri Jan 16 09:39:32 2015 -0500 Encoding: Switch to use UTF-8 internally by default on Windows. This fixes several reported bugs about CMake not handling non-ascii paths on Windows. Practically, the use of some unicode characters may still be limited by the build or compiler tools. For example, a user may be limited by the build tools to using characters within the Windows ANSI code page (which can include non-ascii characters in the current system language). diff --git a/CMakeLists.txt b/CMakeLists.txt index 1812b27..33d2ce6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ if(NOT DEFINED CMAKE_CXX_STANDARD) endif() # option to set the internal encoding of CMake to UTF-8 -option(CMAKE_ENCODING_UTF8 "Use UTF-8 encoding internally (experimental)." OFF) +option(CMAKE_ENCODING_UTF8 "Use UTF-8 encoding internally." ON) mark_as_advanced(CMAKE_ENCODING_UTF8) if(CMAKE_ENCODING_UTF8) set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8) diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 15c101f..5ec5858 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -60,14 +60,16 @@ Syntax Encoding -------- -A CMake Language source file must be written in 7-bit ASCII text -to be portable across all supported platforms. Newlines may be +A CMake Language source file may be written in 7-bit ASCII text for +maximum portability across all supported platforms. Newlines may be encoded as either ``\n`` or ``\r\n`` but will be converted to ``\n`` as input files are read. Note that the implementation is 8-bit clean so source files may be encoded as UTF-8 on platforms with system APIs supporting this -encoding. Furthermore, CMake 3.0 and above allow a leading UTF-8 +encoding. In addition, CMake 3.2 and above support source files +encoded in UTF-8 on Windows (using UTF-16 to call system APIs). +Furthermore, CMake 3.0 and above allow a leading UTF-8 `Byte-Order Mark`_ in source files. .. _`Byte-Order Mark`: http://en.wikipedia.org/wiki/Byte_order_mark diff --git a/Help/release/dev/windows-utf-8.rst b/Help/release/dev/windows-utf-8.rst new file mode 100644 index 0000000..64cd616 --- /dev/null +++ b/Help/release/dev/windows-utf-8.rst @@ -0,0 +1,22 @@ +windows-utf-8 +------------- + +* On Windows, CMake learned to support international characters. + This allows use of characters from multiple (spoken) languages + in CMake code, paths to source files, configured files such as + ``.h.in`` files, and other files read and written by CMake. + Because CMake interoperates with many other tools, there may + still be some limitations when using certain international + characters. + + Files written in the :manual:`cmake-language(7)`, such as + ``CMakeLists.txt`` or ``*.cmake`` files, are expected to be + encoded as UTF-8. If files are already ASCII, they will be + compatible. If files were in a different encoding, including + Latin 1, they will need to be converted. + + The Visual Studio generators now write solution and project + files in UTF-8 instead of Windows-1252. Windows-1252 supported + Latin 1 languages such as those found in North and South America + and Western Europe. With UTF-8, additional languages are now + supported. ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:43:48 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:43:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-796-ged4b95e Message-ID: <20150116144348.457FD2289@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via ed4b95e12fc9c9bade9b25d117254863dbad9e2f (commit) via 509f2713bfa0a289851dfd8d6e45a356adf233b7 (commit) from fb354cc59c3fdd358f77b2bd97b11db0480c521d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed4b95e12fc9c9bade9b25d117254863dbad9e2f commit ed4b95e12fc9c9bade9b25d117254863dbad9e2f Merge: fb354cc 509f271 Author: Brad King AuthorDate: Fri Jan 16 09:43:46 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:43:46 2015 -0500 Merge topic 'fix-ctest_build-output-processing-regression' 509f2713 ctest_build: Fix logic regression in parent that clips build output ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestBuildHandler.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:43:51 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:43:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-804-gcc475e8 Message-ID: <20150116144351.4795A228D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via cc475e812949b1824ba7bbf7dd1a417a0962b77b (commit) via 829fc5ad791d6f292d87db5e98c8d5ed2ca9123b (commit) via 0fe4d8bb3b9e8074f7efd95ae92fa32fe29a2c02 (commit) via 945571db747fd09036d0efd55b538dd4b3c8b874 (commit) via a32b2245ca8d77da5b8218bcdcc6958016cdbb48 (commit) via 531e75e0b73f921fc02983f19a07141c867a752a (commit) via f3884b47ec64b80ad31da93192188f05f60ae5d8 (commit) via 4ab5c652b663377afcdcaf7cda05ac8746b7d21d (commit) from ed4b95e12fc9c9bade9b25d117254863dbad9e2f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cc475e812949b1824ba7bbf7dd1a417a0962b77b commit cc475e812949b1824ba7bbf7dd1a417a0962b77b Merge: ed4b95e 829fc5a Author: Brad King AuthorDate: Fri Jan 16 09:43:49 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:43:49 2015 -0500 Merge topic 'ExternalData-custom-download' 829fc5ad Help: Add notes for topic 'ExternalData-custom-download' 0fe4d8bb ExternalData: Add support for custom download scripts 945571db ExternalData: Improve documentation organization a32b2245 ExternalData: Re-order documentation 531e75e0 ExternalData: Document all variables defined by module f3884b47 ExternalData: Split documentation into sections 4ab5c652 ExternalData: Convert docs to a bracket comment ----------------------------------------------------------------------- Summary of changes: Help/release/dev/ExternalData-custom-download.rst | 7 + Modules/ExternalData.cmake | 541 +++++++++++++------- Modules/ExternalData_config.cmake.in | 1 + Tests/Module/ExternalData/CMakeLists.txt | 3 + Tests/Module/ExternalData/Data1Check.cmake | 4 + Tests/Module/ExternalData/DataScript.dat.md5 | 1 + Tests/Module/ExternalData/MyScript1.cmake | 5 + .../BadCustom1-result.txt} | 0 Tests/RunCMake/ExternalData/BadCustom1-stderr.txt | 9 + Tests/RunCMake/ExternalData/BadCustom1.cmake | 5 + .../BadCustom2-result.txt} | 0 Tests/RunCMake/ExternalData/BadCustom2-stderr.txt | 9 + Tests/RunCMake/ExternalData/BadCustom2.cmake | 5 + .../BadCustom3-result.txt} | 0 Tests/RunCMake/ExternalData/BadCustom3-stderr.txt | 7 + Tests/RunCMake/ExternalData/BadCustom3.cmake | 5 + .../BadCustom4-result.txt} | 0 Tests/RunCMake/ExternalData/BadCustom4-stderr.txt | 7 + Tests/RunCMake/ExternalData/BadCustom4.cmake | 6 + Tests/RunCMake/ExternalData/RunCMakeTest.cmake | 4 + 20 files changed, 434 insertions(+), 185 deletions(-) create mode 100644 Help/release/dev/ExternalData-custom-download.rst create mode 100644 Tests/Module/ExternalData/DataScript.dat.md5 create mode 100644 Tests/Module/ExternalData/MyScript1.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => ExternalData/BadCustom1-result.txt} (100%) create mode 100644 Tests/RunCMake/ExternalData/BadCustom1-stderr.txt create mode 100644 Tests/RunCMake/ExternalData/BadCustom1.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => ExternalData/BadCustom2-result.txt} (100%) create mode 100644 Tests/RunCMake/ExternalData/BadCustom2-stderr.txt create mode 100644 Tests/RunCMake/ExternalData/BadCustom2.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => ExternalData/BadCustom3-result.txt} (100%) create mode 100644 Tests/RunCMake/ExternalData/BadCustom3-stderr.txt create mode 100644 Tests/RunCMake/ExternalData/BadCustom3.cmake copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => ExternalData/BadCustom4-result.txt} (100%) create mode 100644 Tests/RunCMake/ExternalData/BadCustom4-stderr.txt create mode 100644 Tests/RunCMake/ExternalData/BadCustom4.cmake hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:43:53 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:43:53 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-817-g9d4ef58 Message-ID: <20150116144353.555B02287@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 9d4ef584626c4efc882f362e7d46e9b2d8c66045 (commit) via 89cd3d273deadf0b6a1c6b0dc8db153572e75845 (commit) via 7e310624b0973b8f0c529837010f164e486e784e (commit) via 4c49606598ab3089f0cec9be724ae2f3ab4c1ba3 (commit) via 50032bc847a79dc209e6e1ae4dd77a2ec2d52be9 (commit) via ad94b0521eb3a0e05c120b510d047dd18b27c9df (commit) via 7eba04fda156f670f8c84f3d6a9d9b44a472a04a (commit) via 06f41e986c25fc2fd68074fce314a55f5c1d003d (commit) via 1fc556536e0c0475d401e8b5747b46e9f7c32287 (commit) via 84d5674d4e0cfe30f28db2893ad00937deece57c (commit) via a263d519fffab082fc31f8e3f454726e3fbd8363 (commit) via 53f6ccb0ee76a2b9ac40abd5ec5e07aa55fbb393 (commit) via 32fd56b066c28758e31ae97d4b16216b3633a843 (commit) from cc475e812949b1824ba7bbf7dd1a417a0962b77b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d4ef584626c4efc882f362e7d46e9b2d8c66045 commit 9d4ef584626c4efc882f362e7d46e9b2d8c66045 Merge: cc475e8 89cd3d2 Author: Brad King AuthorDate: Fri Jan 16 09:43:52 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:43:52 2015 -0500 Merge topic 'import-jsoncpp' 89cd3d27 jsoncpp: Add README-CMake.txt 7e310624 jsoncpp: Provide 'isfinite' implementation on Solaris 4c496065 jsoncpp: Provide 'isfinite' implementation on ancient glibc 50032bc8 jsoncpp: Add missing assert before strcmp in json_value.cpp ad94b052 jsoncpp: Add missing include in json/writer.h 7eba04fd jsoncpp: Include C headers since we use APIs without std:: 06f41e98 jsoncpp: Disable warnings to avoid changing 3rd party code 1fc55653 jsoncpp: Build the library within CMake 84d5674d jsoncpp: Include "config.h" before system headers a263d519 Merge branch 'jsoncpp-upstream' into import-jsoncpp 53f6ccb0 JsonCpp 1.0.0 (reduced) 32fd56b0 jsoncpp: Add .gitattributes to skip whitespace checks ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 5 + Utilities/cm_jsoncpp_reader.h | 18 + Utilities/{cmcurl => cmjsoncpp}/.gitattributes | 0 Utilities/cmjsoncpp/CMakeLists.txt | 25 + Utilities/cmjsoncpp/LICENSE | 55 + Utilities/cmjsoncpp/README-CMake.txt | 66 + Utilities/cmjsoncpp/include/json/assertions.h | 41 + Utilities/cmjsoncpp/include/json/config.h | 119 ++ Utilities/cmjsoncpp/include/json/features.h | 57 + Utilities/cmjsoncpp/include/json/forwards.h | 43 + Utilities/cmjsoncpp/include/json/json.h | 14 + Utilities/cmjsoncpp/include/json/reader.h | 276 ++++ Utilities/cmjsoncpp/include/json/value.h | 1088 ++++++++++++++ Utilities/cmjsoncpp/include/json/version.h | 14 + Utilities/cmjsoncpp/include/json/writer.h | 214 +++ .../cmjsoncpp/src/lib_json/json_batchallocator.h | 121 ++ .../cmjsoncpp/src/lib_json/json_internalarray.inl | 360 +++++ .../cmjsoncpp/src/lib_json/json_internalmap.inl | 473 +++++++ Utilities/cmjsoncpp/src/lib_json/json_reader.cpp | 885 ++++++++++++ Utilities/cmjsoncpp/src/lib_json/json_tool.h | 87 ++ Utilities/cmjsoncpp/src/lib_json/json_value.cpp | 1482 ++++++++++++++++++++ .../cmjsoncpp/src/lib_json/json_valueiterator.inl | 241 ++++ Utilities/cmjsoncpp/src/lib_json/json_writer.cpp | 703 ++++++++++ 23 files changed, 6387 insertions(+) create mode 100644 Utilities/cm_jsoncpp_reader.h copy Utilities/{cmcurl => cmjsoncpp}/.gitattributes (100%) create mode 100644 Utilities/cmjsoncpp/CMakeLists.txt create mode 100644 Utilities/cmjsoncpp/LICENSE create mode 100644 Utilities/cmjsoncpp/README-CMake.txt create mode 100644 Utilities/cmjsoncpp/include/json/assertions.h create mode 100644 Utilities/cmjsoncpp/include/json/config.h create mode 100644 Utilities/cmjsoncpp/include/json/features.h create mode 100644 Utilities/cmjsoncpp/include/json/forwards.h create mode 100644 Utilities/cmjsoncpp/include/json/json.h create mode 100644 Utilities/cmjsoncpp/include/json/reader.h create mode 100644 Utilities/cmjsoncpp/include/json/value.h create mode 100644 Utilities/cmjsoncpp/include/json/version.h create mode 100644 Utilities/cmjsoncpp/include/json/writer.h create mode 100644 Utilities/cmjsoncpp/src/lib_json/json_batchallocator.h create mode 100644 Utilities/cmjsoncpp/src/lib_json/json_internalarray.inl create mode 100644 Utilities/cmjsoncpp/src/lib_json/json_internalmap.inl create mode 100644 Utilities/cmjsoncpp/src/lib_json/json_reader.cpp create mode 100644 Utilities/cmjsoncpp/src/lib_json/json_tool.h create mode 100644 Utilities/cmjsoncpp/src/lib_json/json_value.cpp create mode 100644 Utilities/cmjsoncpp/src/lib_json/json_valueiterator.inl create mode 100644 Utilities/cmjsoncpp/src/lib_json/json_writer.cpp hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:43:55 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:43:55 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-819-g3cca39b Message-ID: <20150116144355.9103725EE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 3cca39b46db715bcfdc7fc4a02210c8ab4cf572f (commit) via 6b9a0e17970391d2f7143ed9c600d5ea50dd6b98 (commit) from 9d4ef584626c4efc882f362e7d46e9b2d8c66045 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3cca39b46db715bcfdc7fc4a02210c8ab4cf572f commit 3cca39b46db715bcfdc7fc4a02210c8ab4cf572f Merge: 9d4ef58 6b9a0e17 Author: Brad King AuthorDate: Fri Jan 16 09:43:54 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:43:54 2015 -0500 Merge topic 'libarchive-constify-internal-get_date' 6b9a0e17 libarchive: Constify internal __archive_get_date implementation ----------------------------------------------------------------------- Summary of changes: Utilities/cmlibarchive/libarchive/archive_getdate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:43:57 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:43:57 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-821-gc15a2fd Message-ID: <20150116144357.C529625EF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via c15a2fdd2ee3552024c3892bb798bb956b4677d9 (commit) via 6c121924ada1f26c485c628279d6501406d9e3ac (commit) from 3cca39b46db715bcfdc7fc4a02210c8ab4cf572f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c15a2fdd2ee3552024c3892bb798bb956b4677d9 commit c15a2fdd2ee3552024c3892bb798bb956b4677d9 Merge: 3cca39b 6c12192 Author: Brad King AuthorDate: Fri Jan 16 09:43:56 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:43:56 2015 -0500 Merge topic 'tests-RunCMake-report-command' 6c121924 Tests: Teach RunCMake to report command-line on failure ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/RunCMake.cmake | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:44:00 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:44:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-823-g36428fc Message-ID: <20150116144400.285CF228D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 36428fc5273fcdc4a4c227a932de9e07c8f9d2c8 (commit) via 9c9bc71256000c8bedd391e049150b6a0f3b0dc3 (commit) from c15a2fdd2ee3552024c3892bb798bb956b4677d9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=36428fc5273fcdc4a4c227a932de9e07c8f9d2c8 commit 36428fc5273fcdc4a4c227a932de9e07c8f9d2c8 Merge: c15a2fd 9c9bc71 Author: Brad King AuthorDate: Fri Jan 16 09:43:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:43:59 2015 -0500 Merge topic 'fix-qcc-compiler-id' 9c9bc712 QNX: Fix detection of QCC compiler id (#15349) ----------------------------------------------------------------------- Summary of changes: Modules/CMakeCCompilerId.c.in | 2 +- Modules/CMakeCXXCompilerId.cpp.in | 2 +- Modules/CMakeDetermineCompilerId.cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:44:03 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:44:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-825-g287070c Message-ID: <20150116144403.E79D84881@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 287070ceb8eda82cf58595c9ea2dde57b0d6d45e (commit) via cdc29c36084ccfa447f171a25de2336b0bd74edd (commit) from 36428fc5273fcdc4a4c227a932de9e07c8f9d2c8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=287070ceb8eda82cf58595c9ea2dde57b0d6d45e commit 287070ceb8eda82cf58595c9ea2dde57b0d6d45e Merge: 36428fc cdc29c3 Author: Brad King AuthorDate: Fri Jan 16 09:44:01 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:44:01 2015 -0500 Merge topic 'windows-utf-8' cdc29c36 Encoding: Switch to use UTF-8 internally by default on Windows. ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 2 +- Help/manual/cmake-language.7.rst | 8 +++++--- Help/release/dev/windows-utf-8.rst | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 Help/release/dev/windows-utf-8.rst hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:47:03 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:47:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2016-gcd80dc5 Message-ID: <20150116144703.ED3B249AC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via cd80dc58e67eacb7e256670cd15962a624f76bd5 (commit) via 287070ceb8eda82cf58595c9ea2dde57b0d6d45e (commit) via 36428fc5273fcdc4a4c227a932de9e07c8f9d2c8 (commit) via c15a2fdd2ee3552024c3892bb798bb956b4677d9 (commit) via 3cca39b46db715bcfdc7fc4a02210c8ab4cf572f (commit) via 9d4ef584626c4efc882f362e7d46e9b2d8c66045 (commit) via cc475e812949b1824ba7bbf7dd1a417a0962b77b (commit) via ed4b95e12fc9c9bade9b25d117254863dbad9e2f (commit) via fb354cc59c3fdd358f77b2bd97b11db0480c521d (commit) from 3367e6de2c9b36af963b25af2b778828598ec948 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd80dc58e67eacb7e256670cd15962a624f76bd5 commit cd80dc58e67eacb7e256670cd15962a624f76bd5 Merge: 3367e6d 287070c Author: Brad King AuthorDate: Fri Jan 16 09:46:38 2015 -0500 Commit: Brad King CommitDate: Fri Jan 16 09:46:38 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 09:56:25 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 09:56:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2018-g3425056 Message-ID: <20150116145625.546BAA922F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 342505665bd8bdc82ae5ceb3429ba5625564669a (commit) via 764b578d06dc02c9a2ff350a231de903933a1b0a (commit) from cd80dc58e67eacb7e256670cd15962a624f76bd5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=342505665bd8bdc82ae5ceb3429ba5625564669a commit 342505665bd8bdc82ae5ceb3429ba5625564669a Merge: cd80dc5 764b578 Author: Brad King AuthorDate: Fri Jan 16 09:56:24 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 09:56:24 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 764b578d Add support to ctest_submit to upload files to cdash with CDASH_UPLOAD. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=764b578d06dc02c9a2ff350a231de903933a1b0a commit 764b578d06dc02c9a2ff350a231de903933a1b0a Author: Bill Hoffman AuthorDate: Tue Dec 23 11:03:14 2014 -0500 Commit: Brad King CommitDate: Fri Jan 16 09:55:31 2015 -0500 Add support to ctest_submit to upload files to cdash with CDASH_UPLOAD. This adds support for the new cdash API where arbitrary files can be uploaded to the CDash server. This CDash API communicates via json files so the json parser jsoncpp was added to the Utilities directory. In addition since CDash tracks the md5 sum of the files uploaded the --mtime option was added to cmake -E tar so that tar files could be created that would have the same md5sum with the same content. The first supported file upload type to CDash is a GCOV with branches coverage tar file. To support this a Modules/CTestCoverageCollectGCOV.cmake was added to run gcov for a project via a CMake function. diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index d9b0b78..316a43d 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -37,3 +37,14 @@ timed-out submission before attempting to re-submit. The RETRY_COUNT option specifies how many times to retry a timed-out submission. + +:: + + ctest_submit([CDASH_UPLOAD file] + [CDASH_UPLOAD_TYPE type_string]) + +This second signature is used to upload files to CDash via the CDash +file upload API. The api first sends a request to upload to CDash along +with the md5 sum of the file. If CDash does not already have the file, +then it is uploaded. Along with the file, a CDash type string is specified +to tell CDash which handler to use to process the data. diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index 5196485..965eede 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -63,6 +63,7 @@ All Modules /module/CPack /module/CPackWIX /module/CTest + /module/CTestCoverageCollectGCOV /module/CTestScriptMode /module/CTestUseLaunchers /module/Dart diff --git a/Help/module/CTestCoverageCollectGCOV.rst b/Help/module/CTestCoverageCollectGCOV.rst new file mode 100644 index 0000000..4c5deca --- /dev/null +++ b/Help/module/CTestCoverageCollectGCOV.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/CTestCoverageCollectGCOV.cmake diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake new file mode 100644 index 0000000..29fd504 --- /dev/null +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -0,0 +1,123 @@ +#.rst: +# CTestCoverageCollectGCOV +# ------------------------ +# +# This module provides the function ``ctest_coverage_collect_gcov``. +# The function will run gcov on the .gcda files in a binary tree and then +# package all of the .gcov files into a tar file with a data.json. +# This file can be sent to a CDash server for display with the +# :command:`ctest_submit(CDASH_UPLOAD)` command. +# +# .. command:: cdash_coverage_collect_gcov +# +# :: +# +# ctest_coverage_collect_gcov( +# TARBALL # required +# SOURCE # optional, else CTEST_SOURCE_DIRECTORY +# BUILD # optional, else CTEST_BINARY_DIRECTORY +# GCOV_COMMAND # optional, else CTEST_COVERAGE_COMMAND +# ) +# +# Run gcov and package a tar file for cdash. ```` is the name +# of the tarfile that is created and it will be placed in ````. +# ```` is the source directory for the build and ```` +# is the binary directory for the build. The ```` is a full +# path to ``gcov`` for the machine. + +#============================================================================= +# 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.) +include(CMakeParseArguments) +function(ctest_coverage_collect_gcov) + set(options "") + set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) + set(multiValueArgs "") + cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" + "${multiValueArgs}" "" ${ARGN} ) + if(NOT DEFINED GCOV_TARBALL) + message(FATAL_ERROR + "TARBALL must be specified. for ctest_coverage_collect_gcov") + endif() + if(NOT DEFINED GCOV_SOURCE) + set(source_dir "${CTEST_SOURCE_DIRECTORY}") + else() + set(source_dir "${GCOV_SOURCE}") + endif() + if(NOT DEFINED GCOV_BUILD) + set(binary_dir "${CTEST_BINARY_DIRECTORY}") + else() + set(binary_dir "${GCOV_BUILD}") + endif() + if(NOT DEFINED GCOV_GCOV_COMMAND) + set(gcov_command "${CTEST_COVERAGE_COMMAND}") + else() + set(gcov_command "${GCOV_GCOV_COMMAND}") + endif() + # run gcov on each gcda file in the binary tree + set(gcda_files) + set(label_files) + # look for gcda files in the target directories + # could do a glob from the top of the binary tree but + # this will be faster and only look where the files will be + file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) + foreach(target_dir ${target_dirs}) + file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") + list(LENGTH gfiles len) + # if we have gcda files then also grab the labels file for that target + if(${len} GREATER 0) + file(GLOB_RECURSE lfiles RELATIVE ${binary_dir} + "${target_dir}/Labels.txt") + list(APPEND gcda_files ${gfiles}) + list(APPEND label_files ${lfiles}) + endif() + endforeach() + # return early if no coverage files were found + list(LENGTH gcda_files len) + if(len EQUAL 0) + message("ctest_coverage_collect_gcov: No .gcda files found, " + "ignoring coverage request.") + return() + endif() + # setup the dir for the coverage files + set(coverage_dir "${binary_dir}/Testing/CoverageInfo") + file(MAKE_DIRECTORY "${coverage_dir}") + # call gcov on each .gcda file + foreach (gcda_file ${gcda_files}) + # get the directory of the gcda file + get_filename_component(gcda_file ${binary_dir}/${gcda_file} ABSOLUTE) + get_filename_component(gcov_dir ${gcda_file} DIRECTORY) + # run gcov, this will produce the .gcov file in the current + # working directory + execute_process(COMMAND + ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${coverage_dir}) + endforeach() + # create json file with project information + file(WRITE ${coverage_dir}/data.json + "{ + \"Source\": \"${source_dir}\", + \"Binary\": \"${binary_dir}\" +}") + # collect the gcov files + set(gcov_files) + file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "${binary_dir}/*.gcov") + # tar up the coverage info with the same date so that the md5 + # sum will be the same for the tar file independent of file time + # stamps + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} + --mtime=1970-01-01\ 0:0:0\ UTC ${gcov_files} + ${coverage_dir}/data.json ${label_files} + WORKING_DIRECTORY ${binary_dir}) +endfunction() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 96f4709..78bef91 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -533,6 +533,7 @@ set(CTEST_SRCS cmCTest.cxx CTest/cmCTestConfigureHandler.cxx CTest/cmCTestCoverageCommand.cxx CTest/cmCTestCoverageHandler.cxx + CTest/cmCTestCurl.cxx CTest/cmParseMumpsCoverage.cxx CTest/cmParseCacheCoverage.cxx CTest/cmParseGTMCoverage.cxx @@ -583,7 +584,7 @@ set(CTEST_SRCS cmCTest.cxx # Build CTestLib add_library(CTestLib ${CTEST_SRCS}) -target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) +target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES} cmjsoncpp) # # Sources for CPack diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx new file mode 100644 index 0000000..b354592 --- /dev/null +++ b/Source/CTest/cmCTestCurl.cxx @@ -0,0 +1,258 @@ +#include "cmCTestCurl.h" +#include "cmSystemTools.h" +#include "cmCTest.h" + +cmCTestCurl::cmCTestCurl(cmCTest* ctest) +{ + this->CTest = ctest; + this->SetProxyType(); + this->UseHttp10 = false; + // In windows, this will init the winsock stuff + ::curl_global_init(CURL_GLOBAL_ALL); + // default is to verify https + this->VerifyPeerOff = false; + this->VerifyHostOff = false; + this->TimeOutSeconds = 0; +} + +namespace +{ +static size_t +curlWriteMemoryCallback(void *ptr, size_t size, size_t nmemb, + void *data) +{ + int realsize = (int)(size * nmemb); + + std::vector *vec + = static_cast* >(data); + const char* chPtr = static_cast(ptr); + vec->insert(vec->end(), chPtr, chPtr + realsize); + return realsize; +} + +static size_t +curlDebugCallback(CURL *, curl_infotype, char *chPtr, + size_t size, void *data) +{ + std::vector *vec + = static_cast* >(data); + vec->insert(vec->end(), chPtr, chPtr + size); + + return size; +} + +} +void cmCTestCurl::SetCurlOptions(std::vector const& args) +{ + for( std::vector::const_iterator i = args.begin(); + i != args.end(); ++i) + { + if(*i == "CURLOPT_SSL_VERIFYPEER_OFF") + { + this->VerifyPeerOff = true; + } + if(*i == "CURLOPT_SSL_VERIFYHOST_OFF") + { + this->VerifyHostOff = true; + } + } +} + +bool cmCTestCurl::InitCurl() +{ + this->Curl = curl_easy_init(); + if(!this->Curl) + { + return false; + } + if(this->VerifyPeerOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYPEER, 0); + } + if(this->VerifyHostOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYHOST, 0); + } + if(this->HTTPProxy.size()) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXY, this->HTTPProxy.c_str()); + curl_easy_setopt(this->Curl, CURLOPT_PROXYTYPE, this->HTTPProxyType); + if (this->HTTPProxyAuth.size() > 0) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXYUSERPWD, + this->HTTPProxyAuth.c_str()); + } + } + if(this->UseHttp10) + { + curl_easy_setopt(this->Curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + } + // enable HTTP ERROR parsing + curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + return true; +} + + +bool cmCTestCurl::UploadFile(std::string const& local_file, + std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + /* enable uploading */ + curl_easy_setopt(this->Curl, CURLOPT_UPLOAD, 1); + // if there is little to no activity for too long stop submitting + if(this->TimeOutSeconds) + { + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_LIMIT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_TIME, + this->TimeOutSeconds); + } + /* HTTP PUT please */ + ::curl_easy_setopt(this->Curl, CURLOPT_PUT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_VERBOSE, 1); + + FILE* ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); + if(!ftpfile) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not open file for upload: " << local_file << "\n"); + return false; + } + // set the url + std::string upload_url = url; + upload_url += "?"; + upload_url += fields; + ::curl_easy_setopt(this->Curl, CURLOPT_URL, upload_url.c_str()); + // now specify which file to upload + ::curl_easy_setopt(this->Curl, CURLOPT_INFILE, ftpfile); + unsigned long filelen = cmSystemTools::FileLength(local_file); + // and give the size of the upload (optional) + ::curl_easy_setopt(this->Curl, CURLOPT_INFILESIZE, + static_cast(filelen)); + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + // Now run off and do what you've been told! + ::curl_easy_perform(this->Curl); + ::fclose(ftpfile); + ::curl_global_cleanup(); + + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Curl response: [" << response << "]\n"); + } + std::string curlDebug; + if ( debugData.size() > 0 ) + { + curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + if(response.size() == 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "No response from server.\n" << + curlDebug); + return false; + } + return true; +} + +bool cmCTestCurl::HttpRequest(std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + cmCTestLog(this->CTest, DEBUG, "HttpRequest\n" + << "url: " << url << "\n" + << "fields " << fields << "\n"); + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + curl_easy_setopt(this->Curl, CURLOPT_POST, 1); + curl_easy_setopt(this->Curl, CURLOPT_POSTFIELDS, fields.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_URL, url.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_FOLLOWLOCATION, 1); + //set response options + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + + CURLcode res = ::curl_easy_perform(this->Curl); + + ::curl_easy_cleanup(this->Curl); + ::curl_global_cleanup(); + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl response: [" << response << "]\n"); + } + if ( debugData.size() > 0 ) + { + std::string curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + cmCTestLog(this->CTest, DEBUG, "Curl res: " << res << "\n"); + return (res == 0); +} + +void cmCTestCurl::SetProxyType() +{ + if ( cmSystemTools::GetEnv("HTTP_PROXY") ) + { + this->HTTPProxy = cmSystemTools::GetEnv("HTTP_PROXY"); + if ( cmSystemTools::GetEnv("HTTP_PROXY_PORT") ) + { + this->HTTPProxy += ":"; + this->HTTPProxy += cmSystemTools::GetEnv("HTTP_PROXY_PORT"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_TYPE") ) + { + // this is the default + this->HTTPProxyType = CURLPROXY_HTTP; + std::string type = cmSystemTools::GetEnv("HTTP_PROXY_TYPE"); + // HTTP/SOCKS4/SOCKS5 + if ( type == "HTTP" ) + { + this->HTTPProxyType = CURLPROXY_HTTP; + } + else if ( type == "SOCKS4" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS4; + } + else if ( type == "SOCKS5" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS5; + } + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_USER") ) + { + this->HTTPProxyAuth = cmSystemTools::GetEnv("HTTP_PROXY_USER"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_PASSWD") ) + { + this->HTTPProxyAuth += ":"; + this->HTTPProxyAuth += cmSystemTools::GetEnv("HTTP_PROXY_PASSWD"); + } + } +} diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h new file mode 100644 index 0000000..bb5c74a --- /dev/null +++ b/Source/CTest/cmCTestCurl.h @@ -0,0 +1,50 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 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 cmCTestCurl_h +#define cmCTestCurl_h +#include "cm_curl.h" +#include "cmStandardIncludes.h" +class cmCTest; + +class cmCTestCurl +{ +public: + cmCTestCurl(cmCTest*); + bool UploadFile(std::string const& url, + std::string const& file, + std::string const& fields, + std::string& response); + bool HttpRequest(std::string const& url, + std::string const& fields, + std::string& response); + // currently only supports CURLOPT_SSL_VERIFYPEER_OFF + // and CURLOPT_SSL_VERIFYHOST_OFF + void SetCurlOptions(std::vector const& args); + void SetUseHttp10On() { this->UseHttp10 = true;} + void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s;} +protected: + void SetProxyType(); + bool InitCurl(); +private: + cmCTest* CTest; + CURL* Curl; + std::string HTTPProxyAuth; + std::string HTTPProxy; + curl_proxytype HTTPProxyType; + bool VerifyHostOff; + bool VerifyPeerOff; + bool UseHttp10; + int TimeOutSeconds; +}; + + +#endif diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 4005a63..dcd7982 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -27,7 +27,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() = this->Makefile->GetDefinition("CTEST_TRIGGER_SITE"); bool ctestDropSiteCDash = this->Makefile->IsOn("CTEST_DROP_SITE_CDASH"); - + const char* ctestProjectName + = this->Makefile->GetDefinition("CTEST_PROJECT_NAME"); if ( !ctestDropMethod ) { ctestDropMethod = "http"; @@ -43,7 +44,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() // error: CDash requires CTEST_DROP_LOCATION definition // in CTestConfig.cmake } - + this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName); this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod); this->CTest->SetCTestConfiguration("DropSite", ctestDropSite); this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation); @@ -144,6 +145,13 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() static_cast(handler)->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF"); + if(this->CDashUploadFile.size()) + { + static_cast(handler)-> + SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); + static_cast(handler)-> + SetOption("CDashUploadType", this->CDashUploadType.c_str()); + } return handler; } @@ -178,6 +186,16 @@ bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg) return true; } + if(arg == "CDASH_UPLOAD") + { + this->ArgumentDoing = ArgumentDoingCDashUpload; + return true; + } + if(arg == "CDASH_UPLOAD_TYPE") + { + this->ArgumentDoing = ArgumentDoingCDashUploadType; + return true; + } if(arg == "INTERNAL_TEST_CHECKSUM") { this->InternalTest = true; @@ -240,6 +258,17 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) return true; } + if(this->ArgumentDoing == ArgumentDoingCDashUpload) + { + this->CDashUploadFile = arg; + return true; + } + if(this->ArgumentDoing == ArgumentDoingCDashUploadType) + { + this->CDashUploadType = arg; + return true; + } + // Look for other arguments. return this->Superclass::CheckArgumentValue(arg); } diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index 3673fbd..cb0ac61 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -64,6 +64,8 @@ protected: ArgumentDoingFiles, ArgumentDoingRetryDelay, ArgumentDoingRetryCount, + ArgumentDoingCDashUpload, + ArgumentDoingCDashUploadType, ArgumentDoingLast2 }; @@ -74,6 +76,8 @@ protected: cmCTest::SetOfStrings Files; std::string RetryCount; std::string RetryDelay; + std::string CDashUploadFile; + std::string CDashUploadType; }; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index fea94ba..53a8982 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -10,7 +10,8 @@ See the License for more information. ============================================================================*/ #include "cmCTestSubmitHandler.h" - +#include "cmCTestScriptHandler.h" +#include "cmake.h" #include "cmSystemTools.h" #include "cmVersion.h" #include "cmGeneratedFileStream.h" @@ -23,8 +24,10 @@ // For XML-RPC submission #include "cm_xmlrpc.h" +#include // For curl submission #include "cm_curl.h" +#include "cmCTestCurl.h" #include @@ -1055,9 +1058,165 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(std::string const&, } #endif +void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod, + std::string& url) +{ + dropMethod = this->CTest->GetCTestConfiguration("DropMethod"); + url = dropMethod; + url += "://"; + if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 ) + { + url += this->CTest->GetCTestConfiguration("DropSiteUser"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + this->CTest->GetCTestConfiguration("DropSiteUser").c_str()); + if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 ) + { + url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******"); + } + url += "@"; + } + url += this->CTest->GetCTestConfiguration("DropSite") + + this->CTest->GetCTestConfiguration("DropLocation"); +} + + +int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, + std::string const& typeString) +{ + if(!cmSystemTools::FileExists(file)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Upload file not found: " << file << "\n"); + return -1; + } + cmCTestCurl curl(this->CTest); + std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); + std::vector args; + cmSystemTools::ExpandListArgument(curlopt, args); + curl.SetCurlOptions(args); + curl.SetTimeOutSeconds(SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT); + std::string dropMethod; + std::string url; + this->ConstructCDashURL(dropMethod, url); + std::string::size_type pos = url.find("submit.php?"); + url = url.substr(0, pos+10); + if ( ! (dropMethod == "http" || dropMethod == "https" ) ) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Only http and https are supported for CDASH_UPLOAD\n"); + return -1; + } + char md5sum[33]; + md5sum[32] = 0; + cmSystemTools::ComputeFileMD5(file, md5sum); + // 1. request the buildid and check to see if the file + // has already been uploaded + // TODO I added support for subproject. You would need to add + // a "&subproject=subprojectname" to the first POST. + cmCTestScriptHandler* ch = + static_cast(this->CTest->GetHandler("script")); + cmake* cm = ch->GetCMake(); + const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + std::ostringstream str; + str << "project=" + << this->CTest->GetCTestConfiguration("ProjectName") << "&"; + if(subproject) + { + str << "subproject=" << subproject << "&"; + } + str << "stamp=" << this->CTest->GetCurrentTag() << "-" + << this->CTest->GetTestModelString() << "&" + << "model=" << this->CTest->GetTestModelString() << "&" + << "build=" << this->CTest->GetCTestConfiguration("BuildName") << "&" + << "site=" << this->CTest->GetCTestConfiguration("Site") << "&" + << "track=" << this->CTest->GetTestModelString() << "&" + << "starttime=" << (int)cmSystemTools::GetTime() << "&" + << "endtime=" << (int)cmSystemTools::GetTime() << "&" + << "datafilesmd5[0]=" << md5sum << "&" + << "type=" << typeString; + std::string fields = str.str(); + cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:" + << url << "\nfile: " << file << "\n"); + std::string response; + if(!curl.HttpRequest(url, fields, response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error in HttpRequest\n" << response); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Request upload response: [" << response << "]\n"); + Json::Value json; + Json::Reader reader; + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + if(json["status"].asInt() != 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Bad status returned from CDash: " + << json["status"].asInt()); + return -1; + } + if(json["datafilesmd5"].isArray()) + { + int datares = json["datafilesmd5"][0].asInt(); + if(datares == 1) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "File already exists on CDash, skip upload " + << file << "\n"); + return 0; + } + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "bad datafilesmd5 value in response " + << response << "\n"); + return -1; + } + + std::string upload_as = cmSystemTools::GetFilenameName(file); + std::ostringstream fstr; + fstr << "type=" << typeString << "&" + << "md5=" << md5sum << "&" + << "filename=" << upload_as << "&" + << "buildid=" << json["buildid"].asString(); + if(!curl.UploadFile(file, url, fstr.str(), response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error uploading to CDash. " + << file << " " << url << " " << fstr.str()); + return -1; + } + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Upload file response: [" << response << "]\n"); + return 0; +} + //---------------------------------------------------------------------------- int cmCTestSubmitHandler::ProcessHandler() { + const char* cdashUploadFile = this->GetOption("CDashUploadFile"); + const char* cdashUploadType = this->GetOption("CDashUploadType"); + if(cdashUploadFile && cdashUploadType) + { + return this->HandleCDashUploadFile(std::string(cdashUploadFile), + std::string(cdashUploadType)); + } std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); // cdash does not need to trigger so just return true if(iscdash.size()) diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index accabd1..f9cd894 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -41,6 +41,11 @@ public: /** Specify a set of files to submit. */ void SelectFiles(cmCTest::SetOfStrings const& files); + // handle the cdash file upload protocol + int HandleCDashUploadFile(std::string const& file, std::string const& type); + + void ConstructCDashURL(std::string& dropMethod, std::string& url); + private: void SetLogFile(std::ostream* ost) { this->LogFile = ost; } diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index a2aecac..fc4c40d 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -247,6 +247,11 @@ bool cmArchiveWrite::AddPath(const char* path, return true; } +// function from libarchive +extern "C" +{ + time_t __archive_get_date(time_t, const char*); +} //---------------------------------------------------------------------------- bool cmArchiveWrite::AddFile(const char* file, size_t skip, const char* prefix) @@ -275,6 +280,17 @@ bool cmArchiveWrite::AddFile(const char* file, this->Error += cm_archive_error_string(this->Disk); return false; } + if(this->MTime.size()) + { + time_t t = __archive_get_date(0, this->MTime.c_str()); + if (t == -1) + { + this->Error = "__archive_get_date: Unable to parse mtime: "; + this->Error += "[" + this->MTime + "]"; + 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..987e95c 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(const char* t) { if(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/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c769154..372d41c 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1469,7 +1469,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, - bool verbose) + bool verbose, const char* mtime) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); @@ -1501,6 +1501,10 @@ bool cmSystemTools::CreateTar(const char* outFileName, } cmArchiveWrite a(fout, compress, cmArchiveWrite::TypeTAR); + if(mtime) + { + a.SetMTime(mtime); + } a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); i != files.end(); ++i) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 09ceea6..1c7208f 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& files, - cmTarCompression compressType, bool verbose); - static bool ExtractTar(const char* inFileName, - bool verbose); + cmTarCompression compressType, bool verbose, + const char* mtime=0); + 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/cmcmd.cxx b/Source/cmcmd.cxx index 70d98d2..3465e55 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -729,9 +729,21 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) std::string flags = args[2]; std::string outFile = args[3]; std::vector files; + std::string mtime; for (std::string::size_type cc = 4; cc < args.size(); cc ++) { - files.push_back(args[cc]); + // if the first 8 chars of an arg are --mtime= and that arg + // is not a file on disk, treat it is the --mtime= flag and + // not a file + if( (args[cc].substr(0, 8) == "--mtime=") && + !cmSystemTools::FileExists(args[cc])) + { + mtime = args[cc].substr(8); + } + else + { + files.push_back(args[cc]); + } } cmSystemTools::cmTarCompression compress = cmSystemTools::TarCompressNone; @@ -773,8 +785,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) } else if ( flags.find_first_of('c') != flags.npos ) { + const char* mtimestr = 0; + if(mtime.size()) + { + mtimestr = mtime.c_str(); + } if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, compress, verbose) ) + outFile.c_str(), files, compress, verbose, mtimestr) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 10:48:22 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 10:48:22 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2020-g53d1e3a Message-ID: <20150116154822.684D049B9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 53d1e3a5f07f4cbd977bfaec4b4932eae2a38f97 (commit) via 3c807ed1c137eb01a6475070c9d0811b3fab54de (commit) from 342505665bd8bdc82ae5ceb3429ba5625564669a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53d1e3a5f07f4cbd977bfaec4b4932eae2a38f97 commit 53d1e3a5f07f4cbd977bfaec4b4932eae2a38f97 Merge: 3425056 3c807ed Author: Brad King AuthorDate: Fri Jan 16 10:48:21 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 10:48:21 2015 -0500 Merge topic 'test-ctest_submit-fail-with-RunCMake' into next 3c807ed1 Tests: Add RunCMake.CTestSubmit cases covering ctest_submit failures http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c807ed1c137eb01a6475070c9d0811b3fab54de commit 3c807ed1c137eb01a6475070c9d0811b3fab54de Author: Brad King AuthorDate: Thu Jan 15 13:41:39 2015 -0500 Commit: Brad King CommitDate: Fri Jan 16 10:31:25 2015 -0500 Tests: Add RunCMake.CTestSubmit cases covering ctest_submit failures Cover command invocation argument errors and failed drop cases. For now leave curl errors out of expected stderr. They can be ported over from CTestTestFailedSubmit-* tests later. 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 at 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..f0e1653 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in @@ -0,0 +1,5 @@ +set(CTEST_PROJECT_NAME "CTestSubmit at 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@") 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..7cab3f3 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake @@ -0,0 +1,48 @@ +include(RunCMake) + +# Default case parameters. +set(CASE_DROP_METHOD "http") +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 at -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}) ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CMakeLists.txt | 1 + .../BadArg-result.txt} | 0 Tests/RunCMake/CTestSubmit/BadArg-stderr.txt | 2 + .../BadFILES-result.txt} | 0 Tests/RunCMake/CTestSubmit/BadFILES-stderr.txt | 2 + .../BadPARTS-result.txt} | 0 Tests/RunCMake/CTestSubmit/BadPARTS-stderr.txt | 2 + Tests/RunCMake/CTestSubmit/CMakeLists.txt.in | 4 ++ Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in | 5 ++ .../FailDrop-cp-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt | 4 ++ Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt | 1 + .../FailDrop-ftp-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt | 3 ++ Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt | 3 ++ .../FailDrop-http-result.txt} | 0 .../RunCMake/CTestSubmit/FailDrop-http-stderr.txt | 3 ++ .../RunCMake/CTestSubmit/FailDrop-http-stdout.txt | 3 ++ .../FailDrop-https-result.txt} | 0 .../RunCMake/CTestSubmit/FailDrop-https-stderr.txt | 3 ++ .../RunCMake/CTestSubmit/FailDrop-https-stdout.txt | 3 ++ .../FailDrop-scp-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt | 2 + Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt | 1 + .../FailDrop-xmlrpc-result.txt} | 0 .../CTestSubmit/FailDrop-xmlrpc-stderr.txt | 2 + .../CTestSubmit/FailDrop-xmlrpc-stdout.txt | 1 + .../RepeatRETURN_VALUE-result.txt} | 0 .../CTestSubmit/RepeatRETURN_VALUE-stderr.txt | 2 + Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake | 48 ++++++++++++++++++++ Tests/RunCMake/CTestSubmit/test.cmake.in | 16 +++++++ 31 files changed, 111 insertions(+) copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/BadArg-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/BadArg-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/BadFILES-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/BadFILES-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/BadPARTS-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/BadPARTS-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/CMakeLists.txt.in create mode 100644 Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-cp-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-ftp-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-http-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-https-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-scp-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-xmlrpc-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/RepeatRETURN_VALUE-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/CTestSubmit/test.cmake.in hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 10:54:56 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 10:54:56 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2022-g99835e1 Message-ID: <20150116155456.48CFDA7CA0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 99835e1e8b96942366275446d67356edc24d3f49 (commit) via 770ba876997d1038acdc1d54419152abd0970312 (commit) from 53d1e3a5f07f4cbd977bfaec4b4932eae2a38f97 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=99835e1e8b96942366275446d67356edc24d3f49 commit 99835e1e8b96942366275446d67356edc24d3f49 Merge: 53d1e3a 770ba87 Author: Brad King AuthorDate: Fri Jan 16 10:54:55 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 10:54:55 2015 -0500 Merge topic 'GNU-4.6-compile-features' into next 770ba876 Help: Add notes for topic 'GNU-4.6-compile-features' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=770ba876997d1038acdc1d54419152abd0970312 commit 770ba876997d1038acdc1d54419152abd0970312 Author: Brad King AuthorDate: Fri Jan 16 10:54:27 2015 -0500 Commit: Brad King CommitDate: Fri Jan 16 10:54:27 2015 -0500 Help: Add notes for topic 'GNU-4.6-compile-features' diff --git a/Help/release/dev/GNU-4.6-compile-features.rst b/Help/release/dev/GNU-4.6-compile-features.rst new file mode 100644 index 0000000..059a075 --- /dev/null +++ b/Help/release/dev/GNU-4.6-compile-features.rst @@ -0,0 +1,5 @@ +GNU-4.6-compile-features +------------------------ + +* The :manual:`Compile Features ` functionality + is now aware of features supported by GNU 4.6 compilers. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/GNU-4.6-compile-features.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Help/release/dev/GNU-4.6-compile-features.rst hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 11:07:13 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 11:07:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-827-gba7227a Message-ID: <20150116160713.D32A4AA08E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via ba7227a0affed01c67f7a8994bd9373b212314ea (commit) via 06ff525492b32cd3182c185c908c526379766912 (commit) from 287070ceb8eda82cf58595c9ea2dde57b0d6d45e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ba7227a0affed01c67f7a8994bd9373b212314ea commit ba7227a0affed01c67f7a8994bd9373b212314ea Merge: 287070c 06ff525 Author: Brad King AuthorDate: Fri Jan 16 11:07:12 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 11:07:12 2015 -0500 Merge topic 'extend-COMPILE_FEATURES-test' 06ff5254 Features: Extend the tests for the COMPILE_FEATURES genex. ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 51 ++++++++++++++++++++++++++++++++++ Tests/CompileFeatures/genex_test.cpp | 30 ++++++++++++++++++++ 2 files changed, 81 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 11:07:16 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 11:07:16 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-841-g8b7db43 Message-ID: <20150116160716.18B7AA7ED1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 8b7db43bc694c2b89b1309fc875bbdb907a90ceb (commit) via 770ba876997d1038acdc1d54419152abd0970312 (commit) via b15c008fac22720ccd793b18c235046bc84ecc86 (commit) via f13a2eb118d8b152a897e09fdcf43793f8e1bcca (commit) via 1f19ac4da5af812891be305721f3e3b7eed62cc3 (commit) via 0798d1e5b0a09564b127ae7d26d8c1ea1bc9adad (commit) via 938bd94eb0b34e1b5be12dcceaab641efc8a7e43 (commit) via 462c630b8a6d832dd37562fcd7b00a75e1ec6e82 (commit) via 222ec86f7d9ae838d2e460b89985c797c7c90373 (commit) via 6e909035af73d3ee0ca3e5adef39b4541f0c8be9 (commit) via bfc995cc3b8834281ee86ea2ed248b041d5ad1be (commit) via 1532b9214f79517fe74dc674939601c75f4af300 (commit) via 1f4649e62f6394a6e9af67486e4c41f3e286de47 (commit) via a60027a642f887179513496ef61552db44829652 (commit) from ba7227a0affed01c67f7a8994bd9373b212314ea (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b7db43bc694c2b89b1309fc875bbdb907a90ceb commit 8b7db43bc694c2b89b1309fc875bbdb907a90ceb Merge: ba7227a 770ba87 Author: Brad King AuthorDate: Fri Jan 16 11:07:14 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 11:07:14 2015 -0500 Merge topic 'GNU-4.6-compile-features' 770ba876 Help: Add notes for topic 'GNU-4.6-compile-features' b15c008f Features: Record for GNU 4.6. f13a2eb1 Features: Adjust the RunCMake test to use more-common features. 1f19ac4d Features: Adjust cxx_variadic_templates unit test for GNU < 4.7. 0798d1e5 Features: Extend the generalized_initializers test for GNU < 4.7. 938bd94e Features: Test __GXX_EXPERIMENTAL_CXX0X__ macro for GNU < 4.7 compatibility. 462c630b Features: Don't test __cplusplus value for CXX98 on GNU. 222ec86f Features: Test an old value of __STDC_VERSION__ for GNU < 4.7 compatibility. 6e909035 Features: Record C/CXX dialect flags for GNU 4.6. bfc995cc Features: Remove wrong content from else() condition. 1532b921 Features: Make cxx_noexcept available from GNU 4.6. 1f4649e6 Features: Update the default_dialect test for old GNU-like compilers. a60027a6 Features: Ensure appropriate return value from feature test macros. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/GNU-4.6-compile-features.rst | 5 ++++ Modules/Compiler/AppleClang-C.cmake | 3 +-- Modules/Compiler/AppleClang-CXX.cmake | 3 +-- Modules/Compiler/Clang-C.cmake | 3 +-- Modules/Compiler/Clang-CXX.cmake | 3 +-- Modules/Compiler/GNU-C-FeatureTests.cmake | 9 +++++-- Modules/Compiler/GNU-C.cmake | 14 +++++++---- Modules/Compiler/GNU-CXX-FeatureTests.cmake | 25 ++++++++++++-------- Modules/Compiler/GNU-CXX.cmake | 9 +++---- Tests/CompileFeatures/CMakeLists.txt | 8 +++++-- .../cxx_generalized_initializers.cpp | 1 + Tests/CompileFeatures/cxx_variadic_templates.cpp | 4 ++-- Tests/CompileFeatures/default_dialect.cpp | 2 +- .../LinkImplementationFeatureCycle.cmake | 6 ++--- .../LinkImplementationFeatureCycleSolved.cmake | 6 ++--- 15 files changed, 61 insertions(+), 40 deletions(-) create mode 100644 Help/release/dev/GNU-4.6-compile-features.rst hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 11:07:35 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 11:07:35 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2025-geef7820 Message-ID: <20150116160735.59E6EA7D3C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via eef78202042c69e102612aa158b4f070fd0e87b4 (commit) via 8b7db43bc694c2b89b1309fc875bbdb907a90ceb (commit) via ba7227a0affed01c67f7a8994bd9373b212314ea (commit) from 99835e1e8b96942366275446d67356edc24d3f49 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eef78202042c69e102612aa158b4f070fd0e87b4 commit eef78202042c69e102612aa158b4f070fd0e87b4 Merge: 99835e1 8b7db43 Author: Brad King AuthorDate: Fri Jan 16 11:07:25 2015 -0500 Commit: Brad King CommitDate: Fri Jan 16 11:07:25 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Fri Jan 16 13:27:19 2015 From: steveire at gmail.com (Stephen Kelly) Date: Fri, 16 Jan 2015 13:27:19 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2030-g5f64769 Message-ID: <20150116182719.7285BAA054@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5f6476915690e0c21429f9fb4f0dac05ca0f961a (commit) via 44a0ffb2c5f11f7d3d0b6653de138ae19a1911be (commit) via 7b9e7f815c192d8302592a3c486998f3d0f145dc (commit) via 96ce7525d5f710d3ffed07b9e8d51c0662902a17 (commit) via 17286b875d478719ce52a0e550c58ee86cd7c865 (commit) from eef78202042c69e102612aa158b4f070fd0e87b4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f6476915690e0c21429f9fb4f0dac05ca0f961a commit 5f6476915690e0c21429f9fb4f0dac05ca0f961a Merge: eef7820 44a0ffb Author: Stephen Kelly AuthorDate: Fri Jan 16 13:27:18 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 13:27:18 2015 -0500 Merge topic 'SolarisStudio-compile-features' into next 44a0ffb2 Features: Record for SolarisStudio 12.4. 7b9e7f81 Features: Adjust cxx_variadic_templates unit test for SolarisStudio. 96ce7525 Features: Use variable in cxx_inheriting_constructors test. 17286b87 Features: Ensure that the cxx_auto_type test is correct. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44a0ffb2c5f11f7d3d0b6653de138ae19a1911be commit 44a0ffb2c5f11f7d3d0b6653de138ae19a1911be Author: Stephen Kelly AuthorDate: Fri Jan 16 19:26:37 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:26:37 2015 +0100 Features: Record for SolarisStudio 12.4. It has similar C++11 capabilities compared to GCC 4.8. 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 " -S - set(CMAKE_CXX_CREATE_STATIC_LIBRARY " -xar -o " " ") + +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/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 106f29c..182954e 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.8) # The cxx_alignof feature happens to work (for *this* testcase) with @@ -188,6 +199,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) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b9e7f815c192d8302592a3c486998f3d0f145dc commit 7b9e7f815c192d8302592a3c486998f3d0f145dc Author: Stephen Kelly AuthorDate: Fri Jan 16 19:21:36 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:26:25 2015 +0100 Features: Adjust cxx_variadic_templates unit test for SolarisStudio. The change in commit 1f19ac4d (Features: Adjust cxx_variadic_templates unit test for GNU < 4.7., 2015-01-11) pacified GNU 4.6, but leaves SolarisStudio 12.4 complaining: "cxx_variadic_templates.cpp", line 5: Error: Partial specialization for Interface has identical arguments. 1 Error(s) detected. Implement a preprocessor test for using the partial specialization workaround needed by GNU 4.6. 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 struct Interface; +#endif -template -struct Interface +template +struct Interface +#ifdef OLD_GNU + +#endif { static int accumulate() { - return I; + return I + Interface::accumulate(); } }; -template -struct Interface +template +struct Interface { static int accumulate() { - return I + Interface::accumulate(); + return I; } }; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96ce7525d5f710d3ffed07b9e8d51c0662902a17 commit 96ce7525d5f710d3ffed07b9e8d51c0662902a17 Author: Stephen Kelly AuthorDate: Mon Jan 12 21:49:56 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 18:54:18 2015 +0100 Features: Use variable in cxx_inheriting_constructors test. Avoid warning with SolarisStudio. 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); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=17286b875d478719ce52a0e550c58ee86cd7c865 commit 17286b875d478719ce52a0e550c58ee86cd7c865 Author: Stephen Kelly AuthorDate: Mon Jan 12 21:47:01 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 18:54:18 2015 +0100 Features: Ensure that the cxx_auto_type test is correct. SolarisStudio considers 'auto' to be a storage class specifier in C++98 mode (as appropriate), and considers variables without a specified type to be of type int. So, it treats auto x = 3.14; as auto int x = 3.14; which in C++98 mode is equivalent to int x = 3.14; and it does not fail to compile as expected. Change the test to use a reference so that the type must be known. 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(); } ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/SunPro-CXX-FeatureTests.cmake | 52 ++++++++++++++++++++ Modules/Compiler/SunPro-CXX.cmake | 21 ++++++++ Tests/CompileFeatures/CMakeLists.txt | 18 +++++++ Tests/CompileFeatures/cxx_auto_type.cpp | 9 +++- .../cxx_inheriting_constructors.cpp | 2 +- Tests/CompileFeatures/cxx_variadic_templates.cpp | 21 +++++--- 6 files changed, 115 insertions(+), 8 deletions(-) create mode 100644 Modules/Compiler/SunPro-CXX-FeatureTests.cmake hooks/post-receive -- CMake From steveire at gmail.com Fri Jan 16 13:29:51 2015 From: steveire at gmail.com (Stephen Kelly) Date: Fri, 16 Jan 2015 13:29:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2041-g8a926e6 Message-ID: <20150116182951.6B1D3AA10A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8a926e6a7877ec1544a277698fc77670fa7c7a88 (commit) via c705b7f9c498882e42a43670082f96a449c99cbf (commit) via 939b7ce4fb8fff3384edd33d2f993a36320b5b39 (commit) via f447c3ad1bc5f308f2f8109aec3c3ea45e9c5a26 (commit) via 5883dd856c2c9621d1d542a97b305f25840e176f (commit) via 4f00f245a4edebe5e71c35799cba02bba388e3da (commit) via e5faa735a4e8350da0eb71566e28c608faee1631 (commit) via 861c7fa5d154f548f881fbe1a91a4b32448d680f (commit) via 487998e19c905bbec06f908e830b0c8a54ed6ecd (commit) via acba575bef8e7f2f841cdf0a6d0634c4584b2fb2 (commit) via 1c3cf0e98be07bf118f81886c492a7991968bac3 (commit) from 5f6476915690e0c21429f9fb4f0dac05ca0f961a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a926e6a7877ec1544a277698fc77670fa7c7a88 commit 8a926e6a7877ec1544a277698fc77670fa7c7a88 Merge: 5f64769 c705b7f Author: Stephen Kelly AuthorDate: Fri Jan 16 13:29:48 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 13:29:48 2015 -0500 Merge topic 'consistent-empty-method' into next c705b7f9 Replace foo.length() pattern with !foo.empty(). 939b7ce4 Replace 'foo.length() >= 1' pattern with !foo.empty() f447c3ad Replace 'foo.length() > 0' pattern with !foo.empty(). 5883dd85 Replace 'foo.length() == 0' pattern with foo.empty(). 4f00f245 Replace foo.size() pattern with !foo.empty(). e5faa735 Replace !foo.size() pattern with foo.empty(). 861c7fa5 cmListCommand: Use empty() and expand whitespace. 487998e1 Replace 'foo.size() != 0' pattern with !foo.empty(). acba575b Replace 'foo.size() == 0' pattern with foo.empty(). 1c3cf0e9 Replace 'foo.size() > 0' pattern with !foo.empty(). diff --cc Source/CTest/cmCTestSubmitHandler.cxx index 53a8982,bc6fb31..0e19259 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@@ -1210,16 -1058,9 +1210,16 @@@ int cmCTestSubmitHandler::HandleCDashUp //---------------------------------------------------------------------------- int cmCTestSubmitHandler::ProcessHandler() { + const char* cdashUploadFile = this->GetOption("CDashUploadFile"); + const char* cdashUploadType = this->GetOption("CDashUploadType"); + if(cdashUploadFile && cdashUploadType) + { + return this->HandleCDashUploadFile(std::string(cdashUploadFile), + std::string(cdashUploadType)); + } 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; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c705b7f9c498882e42a43670082f96a449c99cbf commit c705b7f9c498882e42a43670082f96a449c99cbf Author: Stephen Kelly AuthorDate: Thu Jan 15 23:39:38 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:28:55 2015 +0100 Replace foo.length() pattern with !foo.empty(). 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/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index adf29b1..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()); } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 427e29d..540dd3b 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -160,7 +160,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector const& args) } } } - if(line.length()) + if(!line.empty()) { // Partial last line. this->CheckLine(line.c_str()); @@ -184,7 +184,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 0cbbdab..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) 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; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=939b7ce4fb8fff3384edd33d2f993a36320b5b39 commit 939b7ce4fb8fff3384edd33d2f993a36320b5b39 Author: Stephen Kelly AuthorDate: Thu Jan 15 22:58:10 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:28:54 2015 +0100 Replace 'foo.length() >= 1' pattern with !foo.empty() diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index aab256a..2c92db2 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -745,7 +745,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector 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(s.size()) + 1; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7accec2..29d8206 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -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)) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f447c3ad1bc5f308f2f8109aec3c3ea45e9c5a26 commit f447c3ad1bc5f308f2f8109aec3c3ea45e9c5a26 Author: Stephen Kelly AuthorDate: Thu Jan 15 22:39:38 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:28:54 2015 +0100 Replace 'foo.length() > 0' pattern with !foo.empty(). diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index b7ef090..f21fcf6 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -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/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/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index d4ba89a..84b34d9 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2297,7 +2297,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/cmStringCommand.cxx b/Source/cmStringCommand.cxx index ddfb748..3e606d7 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -386,7 +386,7 @@ bool cmStringCommand::RegexMatchAll(std::vector const& args) this->SetError(e); return false; } - if(output.length() > 0) + if(!output.empty()) { output += ";"; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2a2f2ab..7accec2 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -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); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5883dd856c2c9621d1d542a97b305f25840e176f commit 5883dd856c2c9621d1d542a97b305f25840e176f Author: Stephen Kelly AuthorDate: Thu Jan 15 22:36:31 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:28:54 2015 +0100 Replace 'foo.length() == 0' pattern with foo.empty(). 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."; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f00f245a4edebe5e71c35799cba02bba388e3da commit 4f00f245a4edebe5e71c35799cba02bba388e3da Author: Stephen Kelly AuthorDate: Thu Jan 15 23:04:33 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:28:54 2015 +0100 Replace foo.size() pattern with !foo.empty(). diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 9699d0d..d90aeb7 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -62,7 +62,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, std::vector 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; @@ -212,7 +212,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) std::ostringstream out; if ( this->CTest->GetConfigType().empty() && - this->ConfigSample.size()) + !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()); } @@ -340,7 +340,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) std::string resultingConfig; std::vector 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 4032499..8f087ab 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -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/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index f821724..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); @@ -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 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 68c5a92..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) @@ -848,7 +848,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( { resultFound = sanitizerWarning.match(1); } - if(resultFound.size()) + if(!resultFound.empty()) { std::vector::size_type idx = this->FindOrAddWarning(resultFound); if(result.empty() || idx > result.size()-1) diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 8da9886..f9e8a3c 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -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/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 056554e..314c8ad 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -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"; 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 2ed4b57..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()); } @@ -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: [" @@ -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()) @@ -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: " @@ -1060,7 +1060,7 @@ 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; } diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 2896a50..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 @@ -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 @@ -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) { @@ -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 &passed, p.Timeout = this->CTest->GetGlobalTimeout(); } - if(p.Depends.size()) + if(!p.Depends.empty()) { for(std::vector::iterator i = p.Depends.begin(); i != p.Depends.end(); ++i) @@ -1192,7 +1192,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os) << "name=\"Execution Time\">" << result->ExecutionTime << "\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, 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/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/cmProcess.cxx b/Source/CTest/cmProcess.cxx index ca1ed8b..e1bd02b 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -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/cmCTest.cxx b/Source/cmCTest.cxx index b7e049d..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; } @@ -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()); } @@ -3136,7 +3136,7 @@ double cmCTest::GetRemainingTimeAllowed() void cmCTest::OutputTestErrors(std::vector 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/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 5850338..60d8dd9 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -201,13 +201,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector 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 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) @@ -547,7 +547,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector 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 264a323..f93d3df 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/Source/cmCreateTestSourceList.cxx @@ -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/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 29c806d..adf29b1 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -201,7 +201,7 @@ void cmDocumentationFormatter for(std::vector::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 3828468..e021d0b 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -84,7 +84,7 @@ bool cmExecProgramCommand } std::string command; - if(arguments.size()) + if(!arguments.empty()) { command = cmSystemTools::ConvertToRunCommandPath(args[0].c_str()); command += " "; 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/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 416dd3e..aab256a 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2992,7 +2992,7 @@ cmFileCommand::HandleDownloadCommand(std::vector 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 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 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) << "\""; @@ -3172,14 +3172,14 @@ cmFileCommand::HandleDownloadCommand(std::vector 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 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 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 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 const& args) log += "\n"; } - if(chunkDebug.size()) + if(!chunkDebug.empty()) { chunkDebug.push_back(0); log += "Debug:\n"; diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 28640fe..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 "_FIND_MODULE" to true // while inside it. diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 1490710..49fbf45 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -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 files = globIt.GetFiles(); - if(files.size()) + if(!files.empty()) { std::string fheader = cmSystemTools::CollapseFullPath(files[0]); if(this->IncludeFileInPath) 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 5ebc7cc..f8eaf8a 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -276,7 +276,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()); } @@ -426,7 +426,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& 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; } @@ -1636,7 +1636,7 @@ void cmGlobalGenerator::CheckLocalGenerators() static_cast(this->LocalGenerators.size())); } - if(notFoundMap.size()) + if(!notFoundMap.empty()) { std::string notFoundVars; for(std::map::const_iterator @@ -2460,19 +2460,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; } 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 a867ab3..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 (this->LocalGenerators[0]); diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index da62eca..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; @@ -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 d434331..c15d46e 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -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/cmListCommand.cxx b/Source/cmListCommand.cxx index 98a2632..85413ca 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -257,7 +257,7 @@ bool cmListCommand::HandleAppendCommand(std::vector const& args) size_t cc; for ( cc = 2; cc < args.size(); ++ cc ) { - if(listString.size()) + if(!listString.empty()) { listString += ";"; } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index cb52ffb..0cbbdab 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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 << "\""; } @@ -2514,7 +2514,7 @@ void cmLocalGenerator::AppendFlags(std::string& flags, { if(!newFlags.empty()) { - if(flags.size()) + if(!flags.empty()) { flags += " "; } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index ebaee37..d4ba89a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1160,7 +1160,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 +2173,7 @@ cmLocalUnixMakefileGenerator3 cmd += " "; // Pass down verbosity level. - if(this->GetMakeSilentFlag().size()) + if(!this->GetMakeSilentFlag().empty()) { cmd += this->GetMakeSilentFlag(); cmd += " "; diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 462e888..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; } 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 67efdc5..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); 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/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index a2f079a..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; } @@ -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/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 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 8c230a4..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; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index c03f01d..2a2f2ab 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -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; } @@ -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 += ";"; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e5faa735a4e8350da0eb71566e28c608faee1631 commit e5faa735a4e8350da0eb71566e28c608faee1631 Author: Stephen Kelly AuthorDate: Thu Jan 15 23:13:44 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:28:53 2015 +0100 Replace !foo.size() pattern with foo.empty(). diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index e5d5988..9699d0d 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -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) { @@ -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; } diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 87c7e8f..f821724 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -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; } @@ -1627,7 +1627,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage( cnt ++; // Skip empty lines - if ( !nl.size() ) + if (nl.empty()) { continue; } @@ -1813,7 +1813,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage( cnt ++; // Skip empty lines - if ( !nl.size() ) + if (nl.empty()) { continue; } diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 1d50788..2ed4b57 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -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" 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/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 1f08629..a867ab3 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -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/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/cmStringCommand.cxx b/Source/cmStringCommand.cxx index fe962ba..ddfb748 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -898,7 +898,7 @@ bool cmStringCommand } } } - if ( !alphabet.size() ) + if (alphabet.empty()) { alphabet = cmStringCommandDefaultAlphabet; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=861c7fa5d154f548f881fbe1a91a4b32448d680f commit 861c7fa5d154f548f881fbe1a91a4b32448d680f Author: Stephen Kelly AuthorDate: Thu Jan 15 00:48:02 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:28:24 2015 +0100 cmListCommand: Use empty() and expand whitespace. diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 01ae300..98a2632 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -340,7 +340,7 @@ bool cmListCommand::HandleInsertCommand(std::vector 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; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=487998e19c905bbec06f908e830b0c8a54ed6ecd commit 487998e19c905bbec06f908e830b0c8a54ed6ecd Author: Stephen Kelly AuthorDate: Thu Jan 15 00:59:13 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:28:24 2015 +0100 Replace 'foo.size() != 0' pattern with !foo.empty(). diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 594f53a..8da9886 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) { diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index b6b0357..2896a50 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -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::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::iterator l = p.Labels.begin(); l != p.Labels.end(); ++l) 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/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index f4cc4c2..1490710 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(), diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index c82d278..01ae300 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -328,7 +328,7 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) return false; } - if ( varArgsExpanded.size() != 0 ) + if (!varArgsExpanded.empty()) { size_t nitem = varArgsExpanded.size(); if ( item < 0 ) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8e060c4..c193f20 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1513,7 +1513,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 +1653,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") { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=acba575bef8e7f2f841cdf0a6d0634c4584b2fb2 commit acba575bef8e7f2f841cdf0a6d0634c4584b2fb2 Author: Stephen Kelly AuthorDate: Thu Jan 15 00:31:49 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:28:24 2015 +0100 Replace 'foo.size() == 0' pattern with foo.empty(). 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/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 8499846..e5d5988 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -211,7 +211,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) static_cast(captureRAII); std::ostringstream out; - if ( this->CTest->GetConfigType().size() == 0 && + if ( this->CTest->GetConfigType().empty() && this->ConfigSample.size()) { // use the config sample to set the ConfigType @@ -269,7 +269,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) // do the build std::vector::iterator tarIt; - if ( this->BuildTargets.size() == 0 ) + if (this->BuildTargets.empty()) { this->BuildTargets.push_back(""); } diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 5ddc75f..4032499 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" 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 8a1b724..87c7e8f 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -1037,7 +1037,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( this->FindGCovFiles(files); std::vector::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 } @@ -1456,7 +1456,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage( this->FindLCovFiles(files); std::vector::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 } @@ -1759,7 +1759,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage( gl.FindFiles(daGlob); std::vector files = gl.GetFiles(); - if ( files.size() == 0 ) + if (files.empty()) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Cannot find any Python Trace.py coverage files." @@ -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; diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index fd0388a..68c5a92 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -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) " @@ -851,7 +851,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( if(resultFound.size()) { std::vector::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 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..594f53a 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -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; } 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 &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 ... at 1111111,2222222 diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 07bd413..1d50788 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1067,7 +1067,7 @@ int cmCTestSubmitHandler::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" diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index ca8f09f..b6b0357 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -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; } @@ -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/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 82194b3..4dfdfac 100644 --- a/Source/CTest/cmParseDelphiCoverage.cxx +++ b/Source/CTest/cmParseDelphiCoverage.cxx @@ -147,7 +147,7 @@ public: std::string glob = Coverage.SourceDir + "*/" + filename; gl.FindFiles(glob); std::vector const& files = gl.GetFiles(); - if(files.size() == 0) + if(files.empty()) { /* * If that doesn't find any matching files diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 167b992..ca1ed8b 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -39,7 +39,7 @@ void cmProcess::SetCommandArguments(std::vector const& args) bool cmProcess::StartProcess() { - if(this->Command.size() == 0) + if(this->Command.empty()) { return false; } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 944d506..b7e049d 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -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; } @@ -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; } 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& 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 d7d052e..3c02325 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -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(); diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 862d1ca..416dd3e 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -3151,7 +3151,7 @@ cmFileCommand::HandleDownloadCommand(std::vector 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; 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 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/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/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 6373235..5ebc7cc 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -174,7 +174,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 +265,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, " @@ -383,7 +383,7 @@ void cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, cmMakefile *mf, bool optional) { - if(languages.size() == 0) + if(languages.empty()) { cmSystemTools::Error("EnableLanguage must have a lang specified!"); cmSystemTools::SetFatalErrorOccured(); diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index b8e30b7..da62eca 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -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; 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/cmListCommand.cxx b/Source/cmListCommand.cxx index c3f0f57..c82d278 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -98,7 +98,7 @@ bool cmListCommand::GetList(std::vector& 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& list, for(std::vector::iterator i = list.begin(); i != list.end(); ++i) { - if(i->size() == 0) + if(i->empty()) { hasEmpty = true; break; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 04106dc..cb52ffb 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2968,7 +2968,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector& 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 "./"; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c6181aa..67efdc5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3852,7 +3852,7 @@ 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; } 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/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c769154..7d938c5 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 = "/"; } diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 8f2deeb..a2f079a 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -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()); } 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 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/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 47edb03..8c230a4 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -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/cmake.cxx b/Source/cmake.cxx index b6aac3c..c03f01d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -316,7 +316,7 @@ bool cmake::SetCacheArgs(const std::vector& 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& 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& 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& 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& 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& 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& 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()) @@ -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) { @@ -2395,7 +2395,7 @@ int cmake::GetSystemInformation(std::vector& 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& args) } // do we write to a file or to stdout? - if (resultFile.size() == 0) + if (resultFile.empty()) { resultFile = cwd; resultFile += "/__cmake_systeminformation/results.txt"; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 61b175e..f3e54d3 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -203,7 +203,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; diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 70d98d2..ecf4650 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1228,7 +1228,7 @@ int cmcmd::ParseVisualStudioLinkCommand(std::vector& 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); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c3cf0e98be07bf118f81886c492a7991968bac3 commit 1c3cf0e98be07bf118f81886c492a7991968bac3 Author: Stephen Kelly AuthorDate: Thu Jan 15 00:06:11 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 16 19:28:24 2015 +0100 Replace 'foo.size() > 0' pattern with !foo.empty(). diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 9cd53ea..b7ef090 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 >::iterator symlinkedIt; std::string curDir = cmSystemTools::GetCurrentWorkingDirectory(); 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/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..8499846 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -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(); } @@ -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(); } diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 0c3f206..5ddc75f 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -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" << cm->SourceFile << "" << std::endl; } - if ( cm->SourceFileTail.size() > 0 ) + if (!cm->SourceFileTail.empty()) { os << "\t\t" << cm->SourceFileTail << "" << std::endl; diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 6598111..8a1b724 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -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 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); diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 2a39051..056554e 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(); @@ -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/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index fea94ba..07bd413 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -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()) << "]" @@ -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()) << "]" @@ -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()); @@ -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()) @@ -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..ca8f09f 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -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; } diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx index 3afbfac..82194b3 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); 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/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/cmCTest.cxx b/Source/cmCTest.cxx index 76873ad..944d506 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -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 += ";"; } @@ -1266,7 +1266,7 @@ int cmCTest::RunTest(std::vector argv, std::ostream* log, double testTimeOut, std::vector* environment) { - bool modifyEnv = (environment && environment->size()>0); + bool modifyEnv = (environment && !environment->empty()); // determine how much time we have double timeout = this->GetRemainingTimeAllowed() - 120; @@ -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()); } diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 002e75a..5850338 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -537,7 +537,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) "Result of TRY_COMPILE", cmCacheManager::INTERNAL); - if ( outputVariable.size() > 0 ) + if (!outputVariable.empty()) { this->Makefile->AddDefinition(outputVariable, output.c_str()); } diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index 02fb8cb..264a323 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); diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index 02f2d21..d7d052e 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 ) @@ -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::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::iterator it; for ( it = this->ClassesFound.begin(); diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index 9b59088..3828468 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; @@ -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/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 2f69882..387cea6 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -1179,7 +1179,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..862d1ca 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -336,14 +336,14 @@ bool cmFileCommand::HandleReadCommand(std::vector 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()); } @@ -899,7 +899,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector const& args, { std::string expr = this->Makefile->GetCurrentDirectory(); // Handle script mode - if ( expr.size() > 0 ) + if (!expr.empty()) { expr += "/" + *i; g.FindFiles(expr); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 72737b7..28640fe 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -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/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/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 &result, std::vector::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 &result, static void extendResult(std::vector &result, const std::vector &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 vars = this->Makefile->GetDefinitions(cacheonly); - if (vars.size()>0) + if (!vars.empty()) { output = vars[0]; } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index d17710e..6373235 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2318,7 +2318,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::iterator it; 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 ignoreTargetsRegExVector; cmSystemTools::ExpandListArgument(ignoreTargetsRegexes, diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 9d44db1..d434331 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"); 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/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 7b54b88..04106dc 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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] = ' '; } @@ -2906,7 +2906,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector& 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())) @@ -2998,7 +2998,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector& 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/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 567403f..462e888 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -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::const_iterator eit; for(eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit) { - if ( argvDef.size() > 0 ) + if (!argvDef.empty()) { argvDef += ";"; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c96c6da..c6181aa 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3857,7 +3857,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const 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/cmake.cxx b/Source/cmake.cxx index 4244b25..b6aac3c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1608,7 +1608,7 @@ void cmake::PreLoadCMakeFiles() { std::vector 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()) ) ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 6 ++-- Source/CPack/cmCPackLog.cxx | 10 +++--- Source/CPack/cpack.cxx | 2 +- Source/CTest/cmCTestBatchTestHandler.cxx | 2 +- Source/CTest/cmCTestBuildAndTestHandler.cxx | 24 ++++++------- Source/CTest/cmCTestBuildHandler.cxx | 10 +++--- Source/CTest/cmCTestConfigureHandler.cxx | 4 +-- Source/CTest/cmCTestCoverageHandler.cxx | 38 ++++++++++---------- Source/CTest/cmCTestLaunch.cxx | 2 +- Source/CTest/cmCTestMemCheckHandler.cxx | 14 ++++---- Source/CTest/cmCTestMultiProcessHandler.cxx | 10 +++--- Source/CTest/cmCTestP4.cxx | 4 +-- Source/CTest/cmCTestRunTest.cxx | 8 ++--- Source/CTest/cmCTestScriptHandler.cxx | 2 +- Source/CTest/cmCTestSubmitHandler.cxx | 52 +++++++++++++-------------- Source/CTest/cmCTestTestHandler.cxx | 42 +++++++++++----------- Source/CTest/cmCTestUpdateHandler.cxx | 2 +- Source/CTest/cmParseCacheCoverage.cxx | 4 +-- Source/CTest/cmParseDelphiCoverage.cxx | 6 ++-- Source/CTest/cmParseGTMCoverage.cxx | 2 +- Source/CTest/cmParseJacocoCoverage.cxx | 2 +- Source/CTest/cmProcess.cxx | 4 +-- Source/CursesDialog/cmCursesMainForm.cxx | 8 ++--- Source/cmAddSubDirectoryCommand.cxx | 2 +- Source/cmAuxSourceDirectoryCommand.cxx | 2 +- Source/cmBuildNameCommand.cxx | 2 +- Source/cmCTest.cxx | 24 ++++++------- Source/cmCacheManager.cxx | 2 +- Source/cmCommand.h | 2 +- Source/cmCoreTryCompile.cxx | 10 +++--- Source/cmCreateTestSourceList.cxx | 8 ++--- Source/cmDependsC.cxx | 4 +-- Source/cmDependsJavaParserHelper.cxx | 10 +++--- Source/cmDocumentation.cxx | 4 +-- Source/cmDocumentationFormatter.cxx | 6 ++-- Source/cmExecProgramCommand.cxx | 12 +++---- Source/cmExecuteProcessCommand.cxx | 4 +-- Source/cmExtraEclipseCDT4Generator.cxx | 2 +- Source/cmExtraKateGenerator.cxx | 2 +- Source/cmFileCommand.cxx | 30 ++++++++-------- Source/cmFindBase.cxx | 4 +-- Source/cmFindPackageCommand.cxx | 4 +-- Source/cmFindPathCommand.cxx | 6 ++-- Source/cmFunctionCommand.cxx | 4 +-- Source/cmGeneratorExpressionEvaluator.cxx | 6 ++-- Source/cmGeneratorExpressionParser.cxx | 6 ++-- Source/cmGetCMakePropertyCommand.cxx | 2 +- Source/cmGetFilenameComponentCommand.cxx | 4 +-- Source/cmGlobalGenerator.cxx | 20 +++++------ Source/cmGlobalKdevelopGenerator.cxx | 2 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 4 +-- Source/cmGraphVizWriter.cxx | 2 +- Source/cmIfCommand.cxx | 6 ++-- Source/cmIncludeCommand.cxx | 6 ++-- Source/cmIncludeDirectoryCommand.cxx | 2 +- Source/cmInstallFilesCommand.cxx | 2 +- Source/cmInstallTargetGenerator.cxx | 2 +- Source/cmListCommand.cxx | 10 +++--- Source/cmLoadCacheCommand.cxx | 4 +-- Source/cmLocalGenerator.cxx | 18 +++++----- Source/cmLocalUnixMakefileGenerator3.cxx | 6 ++-- Source/cmMacroCommand.cxx | 6 ++-- Source/cmMakeDepend.cxx | 6 ++-- Source/cmMakefile.cxx | 12 +++---- Source/cmRemoveCommand.cxx | 2 +- Source/cmSetCommand.cxx | 2 +- Source/cmSetTargetPropertiesCommand.cxx | 2 +- Source/cmSetTestsPropertiesCommand.cxx | 2 +- Source/cmSiteNameCommand.cxx | 4 +-- Source/cmStringCommand.cxx | 4 +-- Source/cmSystemTools.cxx | 2 +- Source/cmTarget.cxx | 4 +-- Source/cmTryRunCommand.cxx | 18 +++++----- Source/cmUseMangledMesaCommand.cxx | 2 +- Source/cmUtilitySourceCommand.cxx | 2 +- Source/cmUuid.cxx | 2 +- Source/cmWhileCommand.cxx | 4 +-- Source/cmake.cxx | 36 +++++++++---------- Source/cmakemain.cxx | 2 +- Source/cmcmd.cxx | 2 +- Source/ctest.cxx | 2 +- 81 files changed, 310 insertions(+), 310 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 14:40:46 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 14:40:46 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2043-gd7952dc Message-ID: <20150116194046.ABDC721E3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d7952dc486a91974f61b00248e54ffe7b61afb6c (commit) via 1e893813f96e08ba939b5278af32dc2ffe627534 (commit) from 8a926e6a7877ec1544a277698fc77670fa7c7a88 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7952dc486a91974f61b00248e54ffe7b61afb6c commit d7952dc486a91974f61b00248e54ffe7b61afb6c Merge: 8a926e6 1e89381 Author: Brad King AuthorDate: Fri Jan 16 14:40:45 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 14:40:45 2015 -0500 Merge topic 'add-FindJsonCpp' into next 1e893813 FindJsonCpp: Add module to find JsonCpp package http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e893813f96e08ba939b5278af32dc2ffe627534 commit 1e893813f96e08ba939b5278af32dc2ffe627534 Author: Brad King AuthorDate: Fri Jan 16 14:11:38 2015 -0500 Commit: Brad King CommitDate: Fri Jan 16 14:39:50 2015 -0500 FindJsonCpp: Add module to find JsonCpp package 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/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/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 ` 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/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/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 $ + --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 $ + ) 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..3606660 --- /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(); +} ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-modules.7.rst | 1 + Help/module/FindJsonCpp.rst | 1 + Help/release/dev/add-FindJsonCpp.rst | 5 ++ Modules/FindJsonCpp.cmake | 117 +++++++++++++++++++++++++++++++++ Tests/CMakeLists.txt | 3 + Tests/FindJsonCpp/CMakeLists.txt | 10 +++ Tests/FindJsonCpp/Test/CMakeLists.txt | 14 ++++ Tests/FindJsonCpp/Test/main.cxx | 8 +++ 8 files changed, 159 insertions(+) create mode 100644 Help/module/FindJsonCpp.rst create mode 100644 Help/release/dev/add-FindJsonCpp.rst create mode 100644 Modules/FindJsonCpp.cmake create mode 100644 Tests/FindJsonCpp/CMakeLists.txt create mode 100644 Tests/FindJsonCpp/Test/CMakeLists.txt create mode 100644 Tests/FindJsonCpp/Test/main.cxx hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 15:30:41 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 15:30:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2045-gd875307 Message-ID: <20150116203041.9F396AA05D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d875307328b9b04481d9e3466449ef31493dfc41 (commit) via 4bff21c3d53e0a8197c0654e9d5e5cbbc9668a69 (commit) from d7952dc486a91974f61b00248e54ffe7b61afb6c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d875307328b9b04481d9e3466449ef31493dfc41 commit d875307328b9b04481d9e3466449ef31493dfc41 Merge: d7952dc 4bff21c Author: Brad King AuthorDate: Fri Jan 16 15:30:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 15:30:40 2015 -0500 Merge topic 'add-FindJsonCpp' into next 4bff21c3 FindJsonCpp: Fix test to use <> for includes http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bff21c3d53e0a8197c0654e9d5e5cbbc9668a69 commit 4bff21c3d53e0a8197c0654e9d5e5cbbc9668a69 Author: Brad King AuthorDate: Fri Jan 16 15:30:23 2015 -0500 Commit: Brad King CommitDate: Fri Jan 16 15:30:23 2015 -0500 FindJsonCpp: Fix test to use <> for includes diff --git a/Tests/FindJsonCpp/Test/main.cxx b/Tests/FindJsonCpp/Test/main.cxx index 3606660..0fefe32 100644 --- a/Tests/FindJsonCpp/Test/main.cxx +++ b/Tests/FindJsonCpp/Test/main.cxx @@ -1,4 +1,4 @@ -#include "json/json.h" +#include int main() { ----------------------------------------------------------------------- Summary of changes: Tests/FindJsonCpp/Test/main.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From domen.vrankar at gmail.com Fri Jan 16 15:44:16 2015 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Fri, 16 Jan 2015 15:44:16 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2047-gb2b55d4 Message-ID: <20150116204416.22C202289@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b2b55d49dcd0474b12bdc175d1852301440935c5 (commit) via c908ba3707fcf8cf43df0c5cd90f8ea6d98d7c29 (commit) from d875307328b9b04481d9e3466449ef31493dfc41 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b2b55d49dcd0474b12bdc175d1852301440935c5 commit b2b55d49dcd0474b12bdc175d1852301440935c5 Merge: d875307 c908ba3 Author: Domen Vrankar AuthorDate: Fri Jan 16 15:44:15 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 15:44:15 2015 -0500 Merge topic 'rpm_multi_prefix' into next c908ba37 multiple path relocation prefixes http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c908ba3707fcf8cf43df0c5cd90f8ea6d98d7c29 commit c908ba3707fcf8cf43df0c5cd90f8ea6d98d7c29 Author: Domen Vrankar AuthorDate: Wed Dec 31 01:43:59 2014 +0100 Commit: Domen Vrankar CommitDate: Wed Dec 31 01:43:59 2014 +0100 multiple path relocation prefixes Allow multiple path relocation prefixes for a single rpm package. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index d2cb2ee..5328b8c 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -379,6 +379,39 @@ # # May be used to add more exclude path (directories or files) from the initial # default list of excluded paths. See CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST. +# +# .. variable:: CPACK_PACKAGING_INSTALL_FULL_ +# +# * Mandatory : NO +# * Default : - +# +# May be used to specify more than one relocation path per relocatable RPM. +# Variables are not component based as they can be used to set a different +# path prefix for e.g. binary dir and documentation dir at the same time. +# Only prefixes that are required by a certain component are added to that +# component - component must contain at least one file/directory/symbolic link +# with CPACK_PACKAGING_INSTALL_FULL_ prefix for a certain relocation path +# to be added. Package will not contain any relocation paths if there are no +# files/directories/symbolic links on any of the provided prefix locations. +# Packages that either do not contain any relocation paths or contain +# files/directories/symbolic links that are outside relocation paths print +# out an AUTHOR_WARNING that RPM will be partially relocatable. +# Variables can be set automatically by including GNUInstallDirs module and +# using corresponding CMAKE_INSTALL_* variables from the same module +# in install() command DESTINATION paths. +# For a list of values see :module:`GNUInstallDirs` module. +# +# .. variable:: CPACK_RPM__PACKAGE_PREFIX +# +# * Mandatory : NO +# * Default : CPACK_PACKAGING_INSTALL_PREFIX +# +# May be used to set per component CPACK_PACKAGING_INSTALL_PREFIX for +# relocatable RPM packages. +# If CPACK_PACKAGING_INSTALL_FULL_ paths are used and +# CPACK_RPM__PACKAGE_PREFIX is set then +# CPACK_PACKAGING_INSTALL_PREFIX prefix path is replaced by +# CPACK_RPM__PACKAGE_PREFIX prefix path where found. #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -395,6 +428,83 @@ # Author: Eric Noulard with the help of Alexander Neundorf. +function(cpack_rpm_prepare_relocation_paths) + set(RPM_RELOCATION_PATH_VARS + CPACK_PACKAGING_INSTALL_FULL_BINDIR CPACK_PACKAGING_INSTALL_FULL_SBINDIR + CPACK_PACKAGING_INSTALL_FULL_LIBEXECDIR CPACK_PACKAGING_INSTALL_FULL_SYSCONFDIR + CPACK_PACKAGING_INSTALL_FULL_SHAREDSTATEDIR CPACK_PACKAGING_INSTALL_FULL_LOCALSTATEDIR + CPACK_PACKAGING_INSTALL_FULL_LIBDIR CPACK_PACKAGING_INSTALL_FULL_INCLUDEDIR + CPACK_PACKAGING_INSTALL_FULL_OLDINCLUDEDIR CPACK_PACKAGING_INSTALL_FULL_DATAROOTDIR + CPACK_PACKAGING_INSTALL_FULL_DATADIR CPACK_PACKAGING_INSTALL_FULL_INFODIR + CPACK_PACKAGING_INSTALL_FULL_LOCALEDIR CPACK_PACKAGING_INSTALL_FULL_MANDIR + CPACK_PACKAGING_INSTALL_FULL_DOCDIR) + file(TO_CMAKE_PATH "${CPACK_PACKAGING_INSTALL_PREFIX}" RPM_PACKAGE_PREFIX_PART) + + if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX) + # remove possible trailing slash and convert backslashes to slashes + file(TO_CMAKE_PATH "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX}" RPM_COMPONENT_PREFIX_) + string(LENGTH "${RPM_PACKAGE_PREFIX_PART}" RPM_PACKAGE_PREFIX_PART_LEN) + set(RPM_PACKAGE_PREFIXES "${RPM_COMPONENT_PREFIX_}") + + foreach(RELOCATE_PATH_VAR ${RPM_RELOCATION_PATH_VARS}) + if(${RELOCATE_PATH_VAR}) + # check if path is a subpath of CPACK_PACKAGING_INSTALL_PREFIX + file(RELATIVE_PATH REL_PATH_ "${RPM_PACKAGE_PREFIX_PART}" "${${RELOCATE_PATH_VAR}}") + string(SUBSTRING "${REL_PATH_}" 0 2 PREFIX_) + + if("${PREFIX_}" STREQUAL "..") # not a subpath - leave it as is + file(TO_CMAKE_PATH "${${RELOCATE_PATH_VAR}}" RELOCATE_PATH) + list(APPEND RPM_PACKAGE_PREFIXES "${RELOCATE_PATH}") + else() # a subpath - it should be replaced with component path + list(APPEND RPM_PACKAGE_PREFIXES "${RPM_COMPONENT_PREFIX_}/${REL_PATH_}") + endif() + endif() + endforeach() + else() + set(RPM_PACKAGE_PREFIXES "${RPM_PACKAGE_PREFIX_PART}") + foreach(RELOCATE_PATH_VAR ${RPM_RELOCATION_PATH_VARS}) + if(${RELOCATE_PATH_VAR}) + file(TO_CMAKE_PATH "${${RELOCATE_PATH_VAR}}" RELOCATE_PATH) + list(APPEND RPM_PACKAGE_PREFIXES "${RELOCATE_PATH}") + endif() + endforeach() + endif() + + list(REMOVE_DUPLICATES RPM_PACKAGE_PREFIXES) + + # remove all the paths that are not used + foreach(RELOCATION_PATH ${RPM_PACKAGE_PREFIXES}) + if(EXISTS "${WDIR}/${RELOCATION_PATH}") + set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}Prefix: ${RELOCATION_PATH}\n") + list(APPEND RPM_USED_PACKAGE_PREFIXES "${RELOCATION_PATH}") + endif() + endforeach() + + # warn about all the paths that are not relocatable + file(GLOB_RECURSE FILE_PATHS_ "${WDIR}/*") + foreach(TMP_PATH ${FILE_PATHS_}) + string(LENGTH "${WDIR}" WDIR_LEN) + string(SUBSTRING "${TMP_PATH}" ${WDIR_LEN} -1 TMP_PATH) + unset(TMP_PATH_FOUND_) + + foreach(RELOCATION_PATH ${RPM_USED_PACKAGE_PREFIXES}) + file(RELATIVE_PATH REL_PATH_ "${RELOCATION_PATH}" "${TMP_PATH}") + string(SUBSTRING "${REL_PATH_}" 0 2 PREFIX_) + + if(NOT "${PREFIX_}" STREQUAL "..") + set(TPM_PATH_FOUND_ TRUE) + break() + endif() + endforeach() + + if(NOT TPM_PATH_FOUND_) + message(AUTHOR_WARNING "CPackRPM:Warning: Path ${TMP_PATH} is not on one of the relocatable paths! Package will be partially relocatable.") + endif() + endforeach() + + set(TMP_RPM_PREFIXES ${TMP_RPM_PREFIXES} PARENT_SCOPE) +endfunction() + if(CMAKE_BINARY_DIR) message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.") endif() @@ -636,13 +746,16 @@ if(CPACK_PACKAGE_RELOCATABLE) set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE) endif() if(CPACK_RPM_PACKAGE_RELOCATABLE) + unset(TMP_RPM_PREFIXES) + if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: Trying to build a relocatable package") endif() if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.") else() - set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) + set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) # kept for back compatibility (provided external RPM spec files) + cpack_rpm_prepare_relocation_paths() endif() endif() @@ -856,15 +969,21 @@ if(CPACK_RPM_PACKAGE_RELOCATABLE) # get a list of the elements in CPACK_RPM_PACKAGE_PREFIX and remove # the final element (so the install-prefix dir itself is not omitted # from the RPM's content-list) - string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${CPACK_RPM_PACKAGE_PREFIX}") - list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1) - # Now generate all of the parent dirs of CPACK_RPM_PACKAGE_PREFIX - foreach(_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS}) - list(APPEND _TMP_LIST "${_ELEM}") - string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}") - set(_OMIT_DIR "-o -path ${_OMIT_DIR}") - separate_arguments(_OMIT_DIR) - list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR}) + foreach(CPACK_RPM_PACKAGE_PREFIX ${RPM_PACKAGE_PREFIXES}) + string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${CPACK_RPM_PACKAGE_PREFIX}") + list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1) + unset(_TMP_LIST) + # Now generate all of the parent dirs of CPACK_RPM_PACKAGE_PREFIX + foreach(_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS}) + list(APPEND _TMP_LIST "${_ELEM}") + string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}") + list(FIND _RPM_DIRS_TO_OMIT "${_OMIT_DIR}" _DUPLICATE_FOUND) + if(_DUPLICATE_FOUND EQUAL -1) + set(_OMIT_DIR "-o -path ${_OMIT_DIR}") + separate_arguments(_OMIT_DIR) + list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR}) + endif() + endforeach() endforeach() endif() @@ -1101,7 +1220,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_AUTOREQ\@ \@TMP_RPM_AUTOREQPROV\@ \@TMP_RPM_BUILDARCH\@ -\@TMP_RPM_PREFIX\@ +\@TMP_RPM_PREFIXES\@ %define _rpmdir \@CPACK_RPM_DIRECTORY\@ %define _rpmfilename \@CPACK_RPM_FILE_NAME\@ diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake index c61e7e9..37c781b 100644 --- a/Modules/GNUInstallDirs.cmake +++ b/Modules/GNUInstallDirs.cmake @@ -14,6 +14,9 @@ # destination for files of a given type # ``CMAKE_INSTALL_FULL_`` # corresponding absolute path +# ``CPACK_PACKAGING_INSTALL_FULL_`` +# CMAKE_INSTALL_ prepended (if path is relateive) by +# CPACK_PACKAGING_INSTALL_PREFIX for use in CPack (relocatable RPM) # # where is one of: # @@ -276,7 +279,9 @@ foreach(dir ) if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}}) set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") + set(CPACK_PACKAGING_INSTALL_FULL_${dir} "${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") else() set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") + set(CPACK_PACKAGING_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") endif() endforeach() diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in index 8c01b32..6d6b619 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -6,15 +6,19 @@ if(CPACK_GENERATOR MATCHES "ZIP") endif() if(CPACK_GENERATOR MATCHES "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") + # set gnu install prefixes + set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") + include(GNUInstallDirs) - # test package summary override - set(CPACK_RPM_PACKAGE_SUMMARY "default summary") - set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") + set(CPACK_RPM_COMPONENT_INSTALL "ON") + set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") - # test package description override - set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") + # test package summary override + set(CPACK_RPM_PACKAGE_SUMMARY "default summary") + set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") + + # test package description override + set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") endif() if(CPACK_GENERATOR MATCHES "DEB") diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 4d56218..d856c44 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -140,6 +140,10 @@ if(CPackGen MATCHES "RPM") "C/C\\+\\+ header files for use with MyLib") if(${CPackComponentWay} STREQUAL "IgnoreGroup") + # set gnu install prefixes to what they are set during rpm creation + set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") + include(GNUInstallDirs) + foreach(check_file ${expected_file}) string(REGEX MATCH ".*libraries.*" check_file_libraries_match ${check_file}) string(REGEX MATCH ".*headers.*" check_file_headers_match ${check_file}) @@ -154,15 +158,19 @@ if(CPackGen MATCHES "RPM") if(check_file_libraries_match) set(check_file_match_expected_summary ".*${CPACK_RPM_libraries_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_RPM_libraries_PACKAGE_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_FULL_LIBDIR}") elseif(check_file_headers_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_HEADERS_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_FULL_INCLUDEDIR}") elseif(check_file_applications_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_APPLICATIONS_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_FULL_BINDIR}") elseif(check_file_Unspecified_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*DESCRIPTION.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_FULL_BINDIR}") else() message(FATAL_ERROR "error: unexpected rpm package '${check_file}'") endif() @@ -170,13 +178,19 @@ if(CPackGen MATCHES "RPM") string(REGEX MATCH ${check_file_match_expected_summary} check_file_match_summary ${check_file_content}) if(NOT check_file_match_summary) - message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'") + message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'") endif() string(REGEX MATCH ${check_file_match_expected_description} check_file_match_description ${check_file_content}) if(NOT check_file_match_description) - message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'") + message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'") + endif() + + string(REGEX MATCH ${check_file_match_expected_relocation_path} check_file_match_relocation_path ${check_file_content}) + + if(NOT check_file_match_relocation_path) + message(FATAL_ERROR "error: '${check_file}' rpm package relocation path does not match expected value - regex '${check_file_match_expected_relocation_path}'") endif() endforeach() elseif(${CPackComponentWay} STREQUAL "IgnoreGroup") ----------------------------------------------------------------------- Summary of changes: Modules/CPackRPM.cmake | 141 ++++++++++++++++++-- Modules/GNUInstallDirs.cmake | 5 + .../MyLibCPackConfig-IgnoreGroup.cmake.in | 18 ++- .../RunCPackVerifyResult.cmake | 18 ++- 4 files changed, 162 insertions(+), 20 deletions(-) hooks/post-receive -- CMake From eike at sf-mail.de Fri Jan 16 15:44:57 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Fri, 16 Jan 2015 15:44:57 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2050-ga54d83b Message-ID: <20150116204457.78D3C25EA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a54d83b3219f774e1382ba038e411b2268ec572e (commit) via 889c683b0315728adb5de3c622863b2111d6f99b (commit) via 8a742485fd29c0db0c0eb975fde6116c8b1e3756 (commit) from b2b55d49dcd0474b12bdc175d1852301440935c5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a54d83b3219f774e1382ba038e411b2268ec572e commit a54d83b3219f774e1382ba038e411b2268ec572e Merge: b2b55d4 889c683 Author: Rolf Eike Beer AuthorDate: Fri Jan 16 15:44:56 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 15:44:56 2015 -0500 Merge topic 'FindQt-fixes' into next 889c683b FindQt: fix variable name in error message 8a742485 FindQt: fix setting DESIRED_QT_VERSION if "find_package(Qt VVV)" was called http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=889c683b0315728adb5de3c622863b2111d6f99b commit 889c683b0315728adb5de3c622863b2111d6f99b Author: Rolf Eike Beer AuthorDate: Fri Jan 16 20:59:12 2015 +0100 Commit: Rolf Eike Beer CommitDate: Fri Jan 16 21:44:40 2015 +0100 FindQt: fix variable name in error message diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 9d99581..9921a38 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -183,9 +183,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() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a742485fd29c0db0c0eb975fde6116c8b1e3756 commit 8a742485fd29c0db0c0eb975fde6116c8b1e3756 Author: Rolf Eike Beer AuthorDate: Fri Jan 16 20:50:15 2015 +0100 Commit: Rolf Eike Beer CommitDate: Fri Jan 16 21:44:39 2015 +0100 FindQt: fix setting DESIRED_QT_VERSION if "find_package(Qt VVV)" was called In case the given version was not only "3" or "4", but something like "4.8" DESIRED_QT_VERSION was set to an unsupported value. While at it also check that the version passed in is really in the range of 3.x and 4.x. Also suggest switching to the more specific find modules if possible. diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 1bc0940..9d99581 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -79,7 +79,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 ----------------------------------------------------------------------- Summary of changes: Modules/FindQt.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 16 15:51:27 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 16 Jan 2015 15:51:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2052-g109d9a8 Message-ID: <20150116205127.7D8D449D3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 109d9a8cd63f604fcf0e668c6e3c2426c74ae5da (commit) via 91fbcda28fff000f8ece00ba7b23cc4fa4889cef (commit) from a54d83b3219f774e1382ba038e411b2268ec572e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=109d9a8cd63f604fcf0e668c6e3c2426c74ae5da commit 109d9a8cd63f604fcf0e668c6e3c2426c74ae5da Merge: a54d83b 91fbcda Author: Brad King AuthorDate: Fri Jan 16 15:51:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 15:51:26 2015 -0500 Merge topic 'fix-cmake-org-links' into next 91fbcda2 Help: Update cmake.org links to avoid redirects http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91fbcda28fff000f8ece00ba7b23cc4fa4889cef commit 91fbcda28fff000f8ece00ba7b23cc4fa4889cef Author: William Lynch AuthorDate: Fri Jan 16 12:39:55 2015 -0500 Commit: Brad King CommitDate: Fri Jan 16 15:50:44 2015 -0500 Help: Update cmake.org links to avoid redirects Some links to cmake.org now redirect, so link to the new pages directly. 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-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/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 at cmake.org. The list is member-post-only but one ----------------------------------------------------------------------- Summary of changes: Auxiliary/cmake-indent.vim | 2 +- Auxiliary/cmake-syntax.vim | 2 +- Help/manual/LINKS.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From eike at sf-mail.de Fri Jan 16 16:06:05 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Fri, 16 Jan 2015 16:06:05 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2055-g3ec60de Message-ID: <20150116210605.2CE0FA9787@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3ec60de0889433dbbb526f8ff916588a188c5746 (commit) via c74d1e84a8070c8d0220d3a5eec2df20b0d02af8 (commit) via 990b063d7ccec6e912acd951f4cbca70d31548e1 (commit) from 109d9a8cd63f604fcf0e668c6e3c2426c74ae5da (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3ec60de0889433dbbb526f8ff916588a188c5746 commit 3ec60de0889433dbbb526f8ff916588a188c5746 Merge: 109d9a8 c74d1e8 Author: Rolf Eike Beer AuthorDate: Fri Jan 16 16:06:04 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 16:06:04 2015 -0500 Merge topic 'FindQt-fixes' into next c74d1e84 FindQt: explicitely mention that it cannot Qt5 or later 990b063d FindQt-fixup http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c74d1e84a8070c8d0220d3a5eec2df20b0d02af8 commit c74d1e84a8070c8d0220d3a5eec2df20b0d02af8 Author: Rolf Eike Beer AuthorDate: Fri Jan 16 22:04:29 2015 +0100 Commit: Rolf Eike Beer CommitDate: Fri Jan 16 22:04:29 2015 +0100 FindQt: explicitely mention that it cannot Qt5 or later diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 8014768..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 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=990b063d7ccec6e912acd951f4cbca70d31548e1 commit 990b063d7ccec6e912acd951f4cbca70d31548e1 Author: Rolf Eike Beer AuthorDate: Fri Jan 16 22:03:21 2015 +0100 Commit: Rolf Eike Beer CommitDate: Fri Jan 16 22:03:21 2015 +0100 FindQt-fixup diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 9921a38..8014768 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -79,7 +79,7 @@ endif() set(GLOB_TEMP_VAR) if (Qt_FIND_VERSION) - if (Qt_FIND_VERSION MATCHES "^([34])(\\.[0-9]+.*)$") + 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.") ----------------------------------------------------------------------- Summary of changes: Modules/FindQt.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From eike at sf-mail.de Fri Jan 16 16:06:41 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Fri, 16 Jan 2015 16:06:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2059-g017d7c3 Message-ID: <20150116210641.80F0EA98F4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 017d7c3c8c666fbb5c43c266e7af9957cf710f6e (commit) via b937f7537943e56998f1f4630e3684ca7417442b (commit) via 6af8cbf214c7de6ef4bb036cb9f6c4bc147fd511 (commit) via 49d05a4713729d7531192ae16fc94511dac9b8ec (commit) from 3ec60de0889433dbbb526f8ff916588a188c5746 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=017d7c3c8c666fbb5c43c266e7af9957cf710f6e commit 017d7c3c8c666fbb5c43c266e7af9957cf710f6e Merge: 3ec60de b937f75 Author: Rolf Eike Beer AuthorDate: Fri Jan 16 16:06:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 16:06:40 2015 -0500 Merge topic 'FindQt-fixes' into next b937f753 FindQt: explicitely mention that it cannot Qt5 or later 6af8cbf2 FindQt: fix variable name in error message 49d05a47 FindQt: fix setting DESIRED_QT_VERSION if "find_package(Qt VVV)" was called http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b937f7537943e56998f1f4630e3684ca7417442b commit b937f7537943e56998f1f4630e3684ca7417442b Author: Rolf Eike Beer AuthorDate: Fri Jan 16 22:04:29 2015 +0100 Commit: Rolf Eike Beer CommitDate: Fri Jan 16 22:06:22 2015 +0100 FindQt: explicitely mention that it cannot Qt5 or later diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 8014768..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 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6af8cbf214c7de6ef4bb036cb9f6c4bc147fd511 commit 6af8cbf214c7de6ef4bb036cb9f6c4bc147fd511 Author: Rolf Eike Beer AuthorDate: Fri Jan 16 20:59:12 2015 +0100 Commit: Rolf Eike Beer CommitDate: Fri Jan 16 22:06:21 2015 +0100 FindQt: fix variable name in error message diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 19f1773..8014768 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -183,9 +183,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() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=49d05a4713729d7531192ae16fc94511dac9b8ec commit 49d05a4713729d7531192ae16fc94511dac9b8ec Author: Rolf Eike Beer AuthorDate: Fri Jan 16 20:50:15 2015 +0100 Commit: Rolf Eike Beer CommitDate: Fri Jan 16 22:06:21 2015 +0100 FindQt: fix setting DESIRED_QT_VERSION if "find_package(Qt VVV)" was called In case the given version was not only "3" or "4", but something like "4.8" DESIRED_QT_VERSION was set to an unsupported value. While at it also check that the version passed in is really in the range of 3.x and 4.x. Also suggest switching to the more specific find modules if possible. diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake index 1bc0940..19f1773 100644 --- a/Modules/FindQt.cmake +++ b/Modules/FindQt.cmake @@ -79,7 +79,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 ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From ben.boeckel at kitware.com Fri Jan 16 17:40:46 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Fri, 16 Jan 2015 17:40:46 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2061-g5528f24 Message-ID: <20150116224046.1557221DA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5528f24229ee49e2bb5fab3e7b4e4d117099021f (commit) via a7cb6054223c6717c1c49378bd7446e12a5000b5 (commit) from 017d7c3c8c666fbb5c43c266e7af9957cf710f6e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5528f24229ee49e2bb5fab3e7b4e4d117099021f commit 5528f24229ee49e2bb5fab3e7b4e4d117099021f Merge: 017d7c3 a7cb605 Author: Ben Boeckel AuthorDate: Fri Jan 16 17:40:45 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 16 17:40:45 2015 -0500 Merge topic 'xcode-target-sort' into next a7cb6054 cmGlobalXCodeGenerator: sort targets http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a7cb6054223c6717c1c49378bd7446e12a5000b5 commit a7cb6054223c6717c1c49378bd7446e12a5000b5 Author: Ben Boeckel AuthorDate: Fri Jan 16 17:37:26 2015 -0500 Commit: Ben Boeckel CommitDate: Fri Jan 16 17:38:35 2015 -0500 cmGlobalXCodeGenerator: sort targets The default target in XCode is the first one in the file. Sort targets so that ALL_BUILD is always first. diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 13e6988..0899614 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -966,6 +966,23 @@ struct cmSourceFilePathCompare }; //---------------------------------------------------------------------------- +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; + } +}; + +//---------------------------------------------------------------------------- void cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, std::vector& @@ -973,9 +990,16 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, { this->SetCurrentLocalGenerator(gen); cmTargets &tgts = this->CurrentMakefile->GetTargets(); + typedef std::map 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 ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalXCodeGenerator.cxx | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jan 17 00:01:18 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 17 Jan 2015 00:01:18 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-842-gf8c416f Message-ID: <20150117050118.5C780A8C5B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f8c416f00c9d263556cca9d9dfc0c71913bdd7f3 (commit) from 8b7db43bc694c2b89b1309fc875bbdb907a90ceb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f8c416f00c9d263556cca9d9dfc0c71913bdd7f3 commit f8c416f00c9d263556cca9d9dfc0c71913bdd7f3 Author: Kitware Robot AuthorDate: Sat Jan 17 00:01:12 2015 -0500 Commit: Kitware Robot CommitDate: Sat Jan 17 00:01:12 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e510429..2821174 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 20150116) +set(CMake_VERSION_PATCH 20150117) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 17 08:47:43 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 17 Jan 2015 08:47:43 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2066-g9fc3a06 Message-ID: <20150117134744.88F7849BF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9fc3a06c31fe89f9ee3cebe9d4f971398a366633 (commit) via 652e4a00e7e0da981915e509baf69c74a93e3225 (commit) via 025fdb46f909cfccb003ac3ae6c69b2e371fc13b (commit) via 9072a6898d628d13518eedec5bf6496d6c1cde78 (commit) via 467662dee413f413049d036446023606e067144d (commit) from 5528f24229ee49e2bb5fab3e7b4e4d117099021f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9fc3a06c31fe89f9ee3cebe9d4f971398a366633 commit 9fc3a06c31fe89f9ee3cebe9d4f971398a366633 Merge: 5528f24 652e4a0 Author: Stephen Kelly AuthorDate: Sat Jan 17 08:47:42 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 17 08:47:42 2015 -0500 Merge topic 'SolarisStudio-compile-features' into next 652e4a00 SunPro WCDH. 025fdb46 WCDH: Generate per-language files in multi-file mode. 9072a689 WCDH: Allow compilers to specify features for one language but not the other. 467662de WCDH: Find a language-specific DetermineCompiler.cmake if present. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=652e4a00e7e0da981915e509baf69c74a93e3225 commit 652e4a00e7e0da981915e509baf69c74a93e3225 Author: Stephen Kelly AuthorDate: Sat Jan 17 14:44:38 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:44:38 2015 +0100 SunPro WCDH. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index a6ff475..e81bc08 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + SunPro ) set(_hex_compilers ADSP Borland Embarcadero SunPro) diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 401de95..b725919 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" @@ -58,7 +58,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) @@ -81,7 +82,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} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=025fdb46f909cfccb003ac3ae6c69b2e371fc13b commit 025fdb46f909cfccb003ac3ae6c69b2e371fc13b Author: Stephen Kelly AuthorDate: Sat Jan 17 14:42:08 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:43:38 2015 +0100 WCDH: Generate per-language files in multi-file mode. Otherwise we generate defines for C/CXX features unguarded by the presence of the __cplusplus macro and available to the wrong compiler. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index d9ab9fb..a6ff475 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -419,12 +419,12 @@ function(write_compiler_detection_header 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() @@ -627,16 +627,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() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9072a6898d628d13518eedec5bf6496d6c1cde78 commit 9072a6898d628d13518eedec5bf6496d6c1cde78 Author: Stephen Kelly AuthorDate: Sat Jan 17 14:10:26 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:10:26 2015 +0100 WCDH: Allow compilers to specify features for one language but not the other. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 0464e66..d9ab9fb 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -386,6 +386,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}) @@ -408,8 +415,7 @@ 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) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=467662dee413f413049d036446023606e067144d commit 467662dee413f413049d036446023606e067144d Author: Stephen Kelly AuthorDate: Sat Jan 17 14:08:47 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:08:47 2015 +0100 WCDH: Find a language-specific DetermineCompiler.cmake if present. The SolarisStudio compiler module uses language specific files. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index d61358f..0464e66 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() ----------------------------------------------------------------------- Summary of changes: Modules/WriteCompilerDetectionHeader.cmake | 45 +++++++++++++------- .../WriteCompilerDetectionHeader/CMakeLists.txt | 7 +-- 2 files changed, 34 insertions(+), 18 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 17 08:49:26 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 17 Jan 2015 08:49:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2074-ga785b96 Message-ID: <20150117134926.09EB8513B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a785b969514ce61d9298050f8758e7c064cd1feb (commit) via bcb04783f7abd1e7781eda7499b53118fdbe8000 (commit) via 536c535cb0cf245a1785d436b0662f7fe59ef1e4 (commit) via 5d57970dd9ddea70163bdd3c64fbf365a15af9fb (commit) via 69182ce4ed95c62d51e208c8620ff4e6599dee2e (commit) via 54156d723a3fde678ed7f884364ad0449d23ad2b (commit) via d84d6ed409c663573a02efa7d2692b6829d27c46 (commit) via 7dcdfec97fdefa90bded7868a638277d7c9903f1 (commit) from 9fc3a06c31fe89f9ee3cebe9d4f971398a366633 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a785b969514ce61d9298050f8758e7c064cd1feb commit a785b969514ce61d9298050f8758e7c064cd1feb Merge: 9fc3a06 bcb0478 Author: Stephen Kelly AuthorDate: Sat Jan 17 08:49:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 17 08:49:25 2015 -0500 Merge topic 'SolarisStudio-compile-features' into next bcb04783 Features: Record for SolarisStudio 12.4. 536c535c Features: Adjust cxx_variadic_templates unit test for SolarisStudio. 5d57970d Features: Use variable in cxx_inheriting_constructors test. 69182ce4 Features: Ensure that the cxx_auto_type test is correct. 54156d72 WCDH: Generate per-language files in multi-file mode. d84d6ed4 WCDH: Allow compilers to specify features for one language but not the other. 7dcdfec9 WCDH: Find a language-specific DetermineCompiler.cmake if present. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bcb04783f7abd1e7781eda7499b53118fdbe8000 commit bcb04783f7abd1e7781eda7499b53118fdbe8000 Author: Stephen Kelly AuthorDate: Fri Jan 16 19:26:37 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:48:28 2015 +0100 Features: Record for SolarisStudio 12.4. It has similar C++11 capabilities compared to GCC 4.8. 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 " -S - set(CMAKE_CXX_CREATE_STATIC_LIBRARY " -xar -o " " ") + +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/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index a6ff475..e81bc08 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + SunPro ) set(_hex_compilers ADSP Borland Embarcadero SunPro) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 106f29c..182954e 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.8) # The cxx_alignof feature happens to work (for *this* testcase) with @@ -188,6 +199,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/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 401de95..b725919 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" @@ -58,7 +58,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) @@ -81,7 +82,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} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=536c535cb0cf245a1785d436b0662f7fe59ef1e4 commit 536c535cb0cf245a1785d436b0662f7fe59ef1e4 Author: Stephen Kelly AuthorDate: Fri Jan 16 19:21:36 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:48:27 2015 +0100 Features: Adjust cxx_variadic_templates unit test for SolarisStudio. The change in commit 1f19ac4d (Features: Adjust cxx_variadic_templates unit test for GNU < 4.7., 2015-01-11) pacified GNU 4.6, but leaves SolarisStudio 12.4 complaining: "cxx_variadic_templates.cpp", line 5: Error: Partial specialization for Interface has identical arguments. 1 Error(s) detected. Implement a preprocessor test for using the partial specialization workaround needed by GNU 4.6. 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 struct Interface; +#endif -template -struct Interface +template +struct Interface +#ifdef OLD_GNU + +#endif { static int accumulate() { - return I; + return I + Interface::accumulate(); } }; -template -struct Interface +template +struct Interface { static int accumulate() { - return I + Interface::accumulate(); + return I; } }; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d57970dd9ddea70163bdd3c64fbf365a15af9fb commit 5d57970dd9ddea70163bdd3c64fbf365a15af9fb Author: Stephen Kelly AuthorDate: Mon Jan 12 21:49:56 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:48:27 2015 +0100 Features: Use variable in cxx_inheriting_constructors test. Avoid warning with SolarisStudio. 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); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=69182ce4ed95c62d51e208c8620ff4e6599dee2e commit 69182ce4ed95c62d51e208c8620ff4e6599dee2e Author: Stephen Kelly AuthorDate: Mon Jan 12 21:47:01 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:48:27 2015 +0100 Features: Ensure that the cxx_auto_type test is correct. SolarisStudio considers 'auto' to be a storage class specifier in C++98 mode (as appropriate), and considers variables without a specified type to be of type int. So, it treats auto x = 3.14; as auto int x = 3.14; which in C++98 mode is equivalent to int x = 3.14; and it does not fail to compile as expected. Change the test to use a reference so that the type must be known. 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(); } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54156d723a3fde678ed7f884364ad0449d23ad2b commit 54156d723a3fde678ed7f884364ad0449d23ad2b Author: Stephen Kelly AuthorDate: Sat Jan 17 14:42:08 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:48:27 2015 +0100 WCDH: Generate per-language files in multi-file mode. Otherwise we generate defines for C/CXX features unguarded by the presence of the __cplusplus macro and available to the wrong compiler. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index d9ab9fb..a6ff475 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -419,12 +419,12 @@ function(write_compiler_detection_header 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() @@ -627,16 +627,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() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d84d6ed409c663573a02efa7d2692b6829d27c46 commit d84d6ed409c663573a02efa7d2692b6829d27c46 Author: Stephen Kelly AuthorDate: Sat Jan 17 14:10:26 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:48:27 2015 +0100 WCDH: Allow compilers to specify features for one language but not the other. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 0464e66..d9ab9fb 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -386,6 +386,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}) @@ -408,8 +415,7 @@ 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) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7dcdfec97fdefa90bded7868a638277d7c9903f1 commit 7dcdfec97fdefa90bded7868a638277d7c9903f1 Author: Stephen Kelly AuthorDate: Sat Jan 17 14:08:47 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:48:27 2015 +0100 WCDH: Find a language-specific DetermineCompiler.cmake if present. The SolarisStudio compiler module uses language specific files. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index d61358f..0464e66 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() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 17 08:53:35 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 17 Jan 2015 08:53:35 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2076-gcf9070e Message-ID: <20150117135338.A1899A7A00@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via cf9070e1601fed0d2d0a3d286e2c58e731f851bf (commit) via 59e6e15cde911e182e471df5b99746e0e203ba43 (commit) from a785b969514ce61d9298050f8758e7c064cd1feb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cf9070e1601fed0d2d0a3d286e2c58e731f851bf commit cf9070e1601fed0d2d0a3d286e2c58e731f851bf Merge: a785b96 59e6e15 Author: Stephen Kelly AuthorDate: Sat Jan 17 08:53:34 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 17 08:53:34 2015 -0500 Merge topic 'WriteCompilerDetectionHeader-multi-file-lang' into next 59e6e15c Help: Add notes for topic 'WriteCompilerDetectionHeader-multi-file-lang' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59e6e15cde911e182e471df5b99746e0e203ba43 commit 59e6e15cde911e182e471df5b99746e0e203ba43 Author: Stephen Kelly AuthorDate: Sat Jan 17 14:52:27 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:52:27 2015 +0100 Help: Add notes for topic 'WriteCompilerDetectionHeader-multi-file-lang' 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. ----------------------------------------------------------------------- Summary of changes: .../release/dev/WriteCompilerDetectionHeader-multi-file-lang.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Help/release/dev/WriteCompilerDetectionHeader-multi-file-lang.rst hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 17 08:55:48 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 17 Jan 2015 08:55:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2079-g32eb91f Message-ID: <20150117135549.0327FA895E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 32eb91fc491e33178c95e7532e9d1987ed0653ba (commit) via e11f8d6446badeb0f1af99f567e4cd9c5c65783f (commit) via f8c416f00c9d263556cca9d9dfc0c71913bdd7f3 (commit) from cf9070e1601fed0d2d0a3d286e2c58e731f851bf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32eb91fc491e33178c95e7532e9d1987ed0653ba commit 32eb91fc491e33178c95e7532e9d1987ed0653ba Merge: cf9070e e11f8d6 Author: Stephen Kelly AuthorDate: Sat Jan 17 08:55:48 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 17 08:55:48 2015 -0500 Merge topic 'remove-AppleClang-51-release-notes' into next e11f8d64 Remove AppleClang-5.1-features.rst release notes. f8c416f0 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e11f8d6446badeb0f1af99f567e4cd9c5c65783f commit e11f8d6446badeb0f1af99f567e4cd9c5c65783f Author: Stephen Kelly AuthorDate: Sat Jan 17 14:54:31 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 14:54:48 2015 +0100 Remove AppleClang-5.1-features.rst release notes. It is redundant after Xcode-clang-compile-features.rst. 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 ` functionality - is now aware of features supported by Apple Clang 5.1 (``AppleClang``). ----------------------------------------------------------------------- Summary of changes: Help/release/dev/AppleClang-5.1-features.rst | 5 ----- Source/CMakeVersion.cmake | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 Help/release/dev/AppleClang-5.1-features.rst hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 17 09:43:11 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 17 Jan 2015 09:43:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2081-g8b5991e Message-ID: <20150117144311.A199D227E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8b5991ea9e5da7aea8fd2437bb980cc10dd55e69 (commit) via 04fdcfec6e357be7a17ae0c5e741472fb8a337c4 (commit) from 32eb91fc491e33178c95e7532e9d1987ed0653ba (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b5991ea9e5da7aea8fd2437bb980cc10dd55e69 commit 8b5991ea9e5da7aea8fd2437bb980cc10dd55e69 Merge: 32eb91f 04fdcfe Author: Stephen Kelly AuthorDate: Sat Jan 17 09:43:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 17 09:43:09 2015 -0500 Merge topic 'consistent-empty-method' into next 04fdcfec Revert topic. diff --cc Source/CTest/cmCTestSubmitHandler.cxx index 0e19259,fea94ba..53a8982 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@@ -1210,16 -1058,9 +1210,16 @@@ int cmCTestSubmitHandler::HandleCDashUp //---------------------------------------------------------------------------- int cmCTestSubmitHandler::ProcessHandler() { + const char* cdashUploadFile = this->GetOption("CDashUploadFile"); + const char* cdashUploadType = this->GetOption("CDashUploadType"); + if(cdashUploadFile && cdashUploadType) + { + return this->HandleCDashUploadFile(std::string(cdashUploadFile), + std::string(cdashUploadType)); + } std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); // cdash does not need to trigger so just return true - if(!iscdash.empty()) + if(iscdash.size()) { this->CDash = true; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=04fdcfec6e357be7a17ae0c5e741472fb8a337c4 commit 04fdcfec6e357be7a17ae0c5e741472fb8a337c4 Author: Stephen Kelly AuthorDate: Sat Jan 17 15:42:27 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 15:42:43 2015 +0100 Revert topic. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index f21fcf6..9cd53ea 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.empty()) + if (symlinkedFiles.size()>0) { std::list< std::pair >::iterator symlinkedIt; std::string curDir = cmSystemTools::GetCurrentWorkingDirectory(); @@ -926,7 +926,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( } if (NULL !=mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) { - if (!absoluteDestFiles.empty()) { + if (absoluteDestFiles.length()>0) { absoluteDestFiles +=";"; } absoluteDestFiles += @@ -1356,7 +1356,7 @@ int cmCPackGenerator::PrepareGroupingKind() groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING"); } - if (!groupingType.empty()) + if (groupingType.length()>0) { cmCPackLogger(cmCPackLog::LOG_VERBOSE, "[" << this->Name << "]" diff --git a/Source/CPack/cmCPackLog.cxx b/Source/CPack/cmCPackLog.cxx index 7633ac2..7befca0 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.empty()) { tagString += ","; } + if ( tagString.size() > 0 ) { tagString += ","; } tagString = "VERBOSE"; } } @@ -112,7 +112,7 @@ void cmCPackLog::Log(int tag, const char* file, int line, display = true; if ( needTagString ) { - if (!tagString.empty()) { tagString += ","; } + if ( tagString.size() > 0 ) { tagString += ","; } tagString = "WARNING"; } } @@ -122,7 +122,7 @@ void cmCPackLog::Log(int tag, const char* file, int line, display = true; if ( needTagString ) { - if (!tagString.empty()) { tagString += ","; } + if ( tagString.size() > 0 ) { tagString += ","; } tagString = "ERROR"; } } @@ -132,7 +132,7 @@ void cmCPackLog::Log(int tag, const char* file, int line, display = true; if ( needTagString ) { - if (!tagString.empty()) { tagString += ","; } + if ( tagString.size() > 0 ) { 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.empty()) { tagString += ","; } + if ( tagString.size() > 0 ) { tagString += ","; } tagString = "VERBOSE"; } } diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 00bfe5b..b1b122d 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().empty()) + if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 ) { 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 d62c260..7f966aa 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].empty()) + /*if(this->Tests[test].size() > 0) { fout << "-P=afterany"; for(TestSet::iterator i = this->Tests[test].begin(); diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index d90aeb7..b1fb02d 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -62,7 +62,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, std::vector args; args.push_back(cmSystemTools::GetCMakeCommand()); args.push_back(this->SourceDir); - if(!this->BuildGenerator.empty()) + if(this->BuildGenerator.size()) { 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.empty()) + if(this->BuildGeneratorToolset.size()) { 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().empty()) + if ( this->CTest->GetConfigType().size() > 0 ) { 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.empty()) + if (!this->BuildGenerator.size()) { if(outstring) { @@ -211,8 +211,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) static_cast(captureRAII); std::ostringstream out; - if ( this->CTest->GetConfigType().empty() && - !this->ConfigSample.empty()) + if ( this->CTest->GetConfigType().size() == 0 && + this->ConfigSample.size()) { // 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.empty() && !resultingConfig.empty()) + if (fullPath.size() && resultingConfig.size()) { this->CTest->SetConfigType(resultingConfig.c_str()); } @@ -269,7 +269,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) // do the build std::vector::iterator tarIt; - if (this->BuildTargets.empty()) + if ( this->BuildTargets.size() == 0 ) { 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().empty()) + if ( this->CTest->GetConfigType().size() > 0 ) { 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.empty()) + if (!this->TestCommand.size()) { return 0; } @@ -340,7 +340,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) std::string resultingConfig; std::vector extraPaths; // if this->ExecutableDirectory is set try that as well - if (!this->ExecutableDirectory.empty()) + if (this->ExecutableDirectory.size()) { 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.empty()) + if(this->BuildRunDir.size()) { 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 8f087ab..0c3f206 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.empty()) + if ( makeCommand.size() == 0 ) { 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.empty()) + if ( buildDirectory.size() == 0 ) { 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.empty()) + if ( cm->SourceFile.size() > 0 ) { os << "\t\t" << cm->SourceFile << "" << std::endl; } - if (!cm->SourceFileTail.empty()) + if ( cm->SourceFileTail.size() > 0 ) { os << "\t\t" << cm->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.empty() && + if ( this->ErrorsAndWarnings.size() && this->LastErrorOrWarning != this->ErrorsAndWarnings.end() && this->PostContextCount < this->MaxPostContext ) { diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx index 506433f..c492bf0 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.empty()) + if ( cCommand.size() == 0 ) { 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.empty()) + if ( buildDirectory.size() == 0 ) { 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 08b7c66..6598111 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.empty()) + if(this->WorkingDirectory.size()) { 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.empty()) + if ( ndc.size() ) { 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.empty()) + if(checkDir.size() ) { 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.empty()) + if ( ndc.size() ) { 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.empty()) + if ( errorsWhileAccumulating.size() > 0 ) { 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.empty()) + if (files.size() > 0) { 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.empty()) + if (files.size() > 0) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found Delphi HTML Files, Performing Coverage" << std::endl); @@ -973,7 +973,7 @@ int cmCTestCoverageHandler::HandleBlanketJSCoverage( std::vector files; g.FindFiles(coverageFile); files=g.GetFiles(); - if (!files.empty()) + if (files.size() > 0) { 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::iterator it; - if (files.empty()) + if ( files.size() == 0 ) { 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->empty()) + if ( line->size() == 0 ) { // 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.empty()) + if ( !nl.size() ) { continue; } @@ -1456,7 +1456,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage( this->FindLCovFiles(files); std::vector::iterator it; - if (files.empty()) + if ( files.size() == 0 ) { 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->empty()) + if ( line->size() == 0 ) { // Ignore empty line } @@ -1627,7 +1627,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage( cnt ++; // Skip empty lines - if (nl.empty()) + if ( !nl.size() ) { continue; } @@ -1759,7 +1759,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage( gl.FindFiles(daGlob); std::vector files = gl.GetFiles(); - if (files.empty()) + if ( files.size() == 0 ) { 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.empty()) + if ( !nl.size() ) { continue; } @@ -2076,7 +2076,7 @@ int cmCTestCoverageHandler::RunBullseyeCommand( std::string& outputFile) { std::string program = cmSystemTools::FindProgram(cmd); - if(program.empty()) + if(program.size() == 0) { 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.empty()) + if(stdline.size()) { // parse the comma separated output this->ParseBullsEyeCovsrcLine(stdline, @@ -2596,7 +2596,7 @@ std::set cmCTestCoverageHandler::FindUncoveredFiles( } } - if(!extraMatches.empty()) + if(extraMatches.size()) { 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 62fa2be..77c5d57 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.empty() && cmSystemTools::StringStartsWith( + if(this->OptionFilterPrefix.size() && cmSystemTools::StringStartsWith( line.c_str(), this->OptionFilterPrefix.c_str())) { return true; diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index d4ff24f..fd0388a 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.empty()) + if(memTesterEnvironmentVariable.size()) { // 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.empty()) + if(memTesterEnvironmentVariable.size()) { 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.empty()) + if(this->MemoryTester.size() == 0 ) { cmCTestLog(this->CTest, WARNING, "Memory checker (MemoryCheckCommand) " @@ -848,10 +848,10 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( { resultFound = sanitizerWarning.match(1); } - if(!resultFound.empty()) + if(resultFound.size()) { std::vector::size_type idx = this->FindOrAddWarning(resultFound); - if(result.empty() || idx > result.size()-1) + if(result.size() == 0 || idx > result.size()-1) { result.push_back(1); } @@ -1197,7 +1197,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res, << res.Name << std::endl); std::vector files; this->TestOutputFileNames(test, files); - if (files.empty()) + if ( files.size() == 0 ) { return; } @@ -1280,7 +1280,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(int test, ofile += ".*"; cmsys::Glob g; g.FindFiles(ofile); - if(g.GetFiles().empty()) + if(g.GetFiles().size() == 0) { std::string log = "Cannot find memory tester output file: " + ofile; diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index f9e8a3c..b32d47b 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.empty()) + while(this->Tests.size() != 0) { if(this->StopTimePassed) { @@ -265,7 +265,7 @@ void cmCTestMultiProcessHandler::StartNextTests() bool cmCTestMultiProcessHandler::CheckOutput() { // no more output we are done - if(this->RunningTests.empty()) + if(this->RunningTests.size() == 0) { return false; } @@ -636,7 +636,7 @@ void cmCTestMultiProcessHandler::PrintTestList() testRun.SetTestProperties(&p); testRun.ComputeArguments(); //logs the command in verbose mode - if(!p.Labels.empty()) //print the labels + if(p.Labels.size()) //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.empty()) //print the labels + if(p.Labels.size()) //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.empty()) + if(allLabels.size()) { cmCTestLog(this->CTest, HANDLER_OUTPUT, "All Labels:" << std::endl); } diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index 31002a6..52b98d7 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -324,7 +324,7 @@ private: //---------------------------------------------------------------------------- void cmCTestP4::SetP4Options(std::vector &CommandOptions) { - if(P4Options.empty()) + if(P4Options.size() == 0) { 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.empty()) + if(ChangeLists.size() == 0) return; //p4 describe -s ... at 1111111,2222222 diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 314c8ad..2a39051 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.empty()) + if ( this->TestProperties->RequiredRegularExpressions.size() > 0 ) { 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.empty()) + if ( this->TestProperties->ErrorRegularExpressions.size() > 0 ) { 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.empty()) + if(this->TestResult.Reason.size()) { *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->empty()) + if (environment && environment->size()>0) { cmSystemTools::AppendEnv(*environment); } diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 8184bb4..71edd5b 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.empty()) + if (script_arg.size()) { this->Makefile->AddDefinition("CTEST_SCRIPT_ARG", script_arg.c_str()); } diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index bc6fb31..fea94ba 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.empty()) + if(this->CurrentValue.size()) { 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.empty()) + if ( chunk.size() > 0 ) { cmCTestLog(this->CTest, DEBUG, "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl); } - if (!chunkDebug.empty()) + if ( chunkDebug.size() > 0 ) { 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.empty()) + if(chunk.size()) { *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.empty()) + if (this->HTTPProxyAuth.size() > 0) { 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.empty()) + if ( chunk.size() > 0 ) { cmCTestLog(this->CTest, DEBUG, "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl); this->ParseResponse(chunk); } - if (!chunkDebug.empty()) + if ( chunkDebug.size() > 0 ) { 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.empty()) + if ( chunk.size() > 0 ) { 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.empty()) + if(chunk.size()) { *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.empty()) + if (this->HTTPProxyAuth.size() > 0) { 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.empty()) + if(chunk.size()) { *this->LogFile << " Curl output was: " @@ -780,13 +780,13 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP( return false; } - if (!chunk.empty()) + if ( chunk.size() > 0 ) { cmCTestLog(this->CTest, DEBUG, "CURL output: [" << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" << std::endl); } - if (!chunkDebug.empty()) + if ( chunkDebug.size() > 0 ) { 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.empty() || localprefix.empty() || - files.empty() || remoteprefix.empty() || url.empty() ) + if ( !scp_command.size() || !localprefix.size() || + !files.size() || !remoteprefix.size() || !url.size() ) { return 0; } @@ -912,8 +912,8 @@ bool cmCTestSubmitHandler::SubmitUsingCP( const std::string& remoteprefix, const std::string& destination) { - if ( localprefix.empty() || - files.empty() || remoteprefix.empty() || destination.empty() ) + if ( !localprefix.size() || + !files.size() || !remoteprefix.size() || !destination.size() ) { 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.empty()) + if(iscdash.size()) { this->CDash = true; } const std::string &buildDirectory = this->CTest->GetCTestConfiguration("BuildDirectory"); - if (buildDirectory.empty()) + if ( buildDirectory.size() == 0 ) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find BuildDirectory key in the DartConfiguration.tcl" @@ -1140,12 +1140,12 @@ int cmCTestSubmitHandler::ProcessHandler() } } - if (!this->HTTPProxy.empty()) + if ( this->HTTPProxy.size() > 0 ) { cmCTestLog(this->CTest, HANDLER_OUTPUT, " Use HTTP Proxy: " << this->HTTPProxy << std::endl); } - if (!this->FTPProxy.empty()) + if ( this->FTPProxy.size() > 0 ) { 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").empty()) + if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 ) { cmCTestLog(this->CTest, HANDLER_OUTPUT, this->CTest->GetCTestConfiguration( "DropSiteUser").c_str()); - if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty()) + if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 ) { 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").empty()) + if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 ) { url += this->CTest->GetCTestConfiguration("DropSiteUser"); cmCTestLog(this->CTest, HANDLER_OUTPUT, this->CTest->GetCTestConfiguration("DropSiteUser").c_str()); - if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty()) + if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 ) { 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").empty()) + if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 ) { url += this->CTest->GetCTestConfiguration("DropSiteUser") + "@"; } diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 925e3c9..cfb0274 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -564,7 +564,7 @@ int cmCTestTestHandler::ProcessHandler() } else { - if (this->HandlerVerbose && !passed.empty() && + if (this->HandlerVerbose && passed.size() && (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.empty() && percent > 99) + if ( failed.size() > 0 && percent > 99) { percent = 99; } @@ -596,7 +596,7 @@ int cmCTestTestHandler::ProcessHandler() cmCTestLog(this->CTest, HANDLER_OUTPUT, "\nTotal Test time (real) = " << realBuf << "\n" ); - if (!failed.empty()) + if (failed.size()) { 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.empty()) + if(p.Labels.size() != 0) { for(std::vector::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.empty()) + if(p.Labels.size() != 0) { for(std::vector::iterator l = p.Labels.begin(); l != p.Labels.end(); ++l) @@ -698,7 +698,7 @@ void cmCTestTestHandler::PrintLabelSummary() } } // now print times - if(!labels.empty()) + if(labels.size()) { cmCTestLog(this->CTest, HANDLER_OUTPUT, "\nLabel Time Summary:"); } @@ -717,7 +717,7 @@ void cmCTestTestHandler::PrintLabelSummary() << buf << "\n"; } } - if(!labels.empty()) + if(labels.size()) { 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.empty()) + if(it.Labels.size() == 0 ) { 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.empty()) + if(it.Labels.size() == 0 ) { 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.empty() && + if ((this->TestsToRun.size() && 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.empty() && + if ((this->TestsToRun.size() && 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.empty() && + if ((this->TestsToRun.size() && std::find(this->TestsToRun.begin(), this->TestsToRun.end(), cnt) == this->TestsToRun.end())) { @@ -1094,7 +1094,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector &passed, p.Timeout = this->CTest->GetGlobalTimeout(); } - if(!p.Depends.empty()) + if(p.Depends.size()) { for(std::vector::iterator i = p.Depends.begin(); i != p.Depends.end(); ++i) @@ -1192,7 +1192,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os) << "name=\"Execution Time\">" << result->ExecutionTime << "\n"; - if(!result->Reason.empty()) + if(result->Reason.size()) { const char* reasonType = "Pass Reason"; if(result->Status != cmCTestTestHandler::COMPLETED && @@ -1376,7 +1376,7 @@ void cmCTestTestHandler { std::string tempPath; - if (!filepath.empty() && + if (filepath.size() && filepath[filepath.size()-1] != '/') { filepath += "/"; @@ -1385,7 +1385,7 @@ void cmCTestTestHandler attempted.push_back(tempPath); attemptedConfigs.push_back(""); - if(!ctest->GetConfigType().empty()) + if(ctest->GetConfigType().size()) { 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.empty() && filepath[0] == '/') + if (filepath.size() && 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.empty()) + if (filepath.size() == 0) { 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.empty(); ++ai) + ai < attempted.size() && fullPath.size() == 0; ++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.empty() && filepath.empty()) + if (fullPath.size() == 0 && filepath.size() == 0) { std::string path = cmSystemTools::FindProgram(filename.c_str()); if (path != "") @@ -1533,7 +1533,7 @@ std::string cmCTestTestHandler return path; } } - if(fullPath.empty()) + if(fullPath.size() == 0) { cmCTestLog(ctest, HANDLER_OUTPUT, "Could not find executable " << testCommand << "\n" diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 4c37c8b..772c9aa 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.empty()) + if(saveLCMessages.size()) { std::string put = "LC_MESSAGES="; put += saveLCMessages; diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx index 3642308..97454a8 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.empty()) + if(routine.size() == 0) { 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.empty()) + if(filepath.size() == 0) { continue; } diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx index 4dfdfac..3afbfac 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.empty()) + && (beginSet.size() > 0)) { 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.empty() && line != "" && !blockComFlag + if((beginSet.size() > 0) && line != "" && !blockComFlag && !lineComFlag) { coverageVector.push_back(0); @@ -147,7 +147,7 @@ public: std::string glob = Coverage.SourceDir + "*/" + filename; gl.FindFiles(glob); std::vector const& files = gl.GetFiles(); - if(files.empty()) + if(files.size() == 0) { /* * If that doesn't find any matching files diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index f3f8008..d77244a 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.empty()) + if(lastpath.size()) { this->Coverage.TotalCoverage[lastpath][lastoffset + linenumber] += count; diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx index 780debc..f270adb 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.empty()) + if(curFileLines.size() > 0) { curFileLines[nr-1] = ci; } diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index e1bd02b..167b992 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -39,7 +39,7 @@ void cmProcess::SetCommandArguments(std::vector const& args) bool cmProcess::StartProcess() { - if(this->Command.empty()) + if(this->Command.size() == 0) { 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.empty()) + if(this->WorkingDirectory.size()) { cmsysProcess_SetWorkingDirectory(this->Process, this->WorkingDirectory.c_str()); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index dcd0b6c..248efaf 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.empty()) + if ( this->SearchString.size() > 0 ) { 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.empty()) + if ( this->SearchString.size() > 0 ) { this->SearchString.resize(this->SearchString.size()-1); } @@ -1067,7 +1067,7 @@ void cmCursesMainForm::HandleInput() } else if ( key == 'n' ) { - if (!this->OldSearchString.empty()) + if ( this->OldSearchString.size() > 0 ) { this->JumpToCacheEntry(this->OldSearchString.c_str()); } @@ -1201,7 +1201,7 @@ void cmCursesMainForm::JumpToCacheEntry(const char* astr) int findex = start_index; for(;;) { - if (!str.empty()) + if ( str.size() > 0 ) { cmCursesWidget* lbl = 0; if ( findex >= 0 ) diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 01598bc..8db5078 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -37,7 +37,7 @@ bool cmAddSubDirectoryCommand::InitialPass excludeFromAll = true; continue; } - else if (binArg.empty()) + else if (!binArg.size()) { binArg = *i; } diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index a30d992..d8c3c43 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.empty() + if( base.size() != 0 && 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 171ed0f..c64209f 100644 --- a/Source/cmBuildNameCommand.cxx +++ b/Source/cmBuildNameCommand.cxx @@ -50,7 +50,7 @@ bool cmBuildNameCommand { buildname = ""; cmSystemTools::RunSingleCommand("uname -a", &buildname); - if(!buildname.empty()) + if(buildname.length()) { std::string RegExp = "([^ ]*) [^ ]* ([^ ]*) "; cmsys::RegularExpression reg( RegExp.c_str() ); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 1ef4c92..76873ad 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.empty()) + if(fields.size()) { url += "?" + fields; } @@ -580,7 +580,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) } tfin.close(); } - if (tag.empty() || (0 != command) || this->Parts[PartStart]) + if (tag.size() == 0 || (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.empty()) + if(line.size() == 0) { continue; } @@ -872,7 +872,7 @@ bool cmCTest::OpenOutputFile(const std::string& path, bool compress) { std::string testingDir = this->BinaryDir + "/Testing"; - if (!path.empty()) + if ( path.size() > 0 ) { testingDir += "/" + path; } @@ -1067,7 +1067,7 @@ int cmCTest::ProcessTests() if ( cmSystemTools::FileExists(fullname.c_str()) && !cmSystemTools::FileIsDirectory(fullname) ) { - if (!this->NotesFiles.empty()) + if ( this->NotesFiles.size() > 0 ) { this->NotesFiles += ";"; } @@ -1080,7 +1080,7 @@ int cmCTest::ProcessTests() if (this->Parts[PartNotes]) { this->UpdateCTestConfiguration(); - if (!this->NotesFiles.empty()) + if ( this->NotesFiles.size() ) { this->GenerateNotesFile(this->NotesFiles.c_str()); } @@ -1266,7 +1266,7 @@ int cmCTest::RunTest(std::vector argv, std::ostream* log, double testTimeOut, std::vector* environment) { - bool modifyEnv = (environment && !environment->empty()); + bool modifyEnv = (environment && environment->size()>0); // 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.empty()) + if ( files.size() == 0 ) { 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.empty()) + if ( files.size() == 0 ) { return 1; } @@ -2936,11 +2936,11 @@ bool cmCTest::RunCommand( } cmsysProcess_WaitForExit(cp, 0); - if (!tempOutput.empty()) + if ( tempOutput.size() > 0 ) { stdOut->append(&*tempOutput.begin(), tempOutput.size()); } - if (!tempError.empty()) + if ( tempError.size() > 0 ) { stdErr->append(&*tempError.begin(), tempError.size()); } @@ -3136,7 +3136,7 @@ double cmCTest::GetRemainingTimeAllowed() void cmCTest::OutputTestErrors(std::vector const &process_output) { std::string test_outputs("\n*** Test Failed:\n"); - if(!process_output.empty()) + if(process_output.size()) { test_outputs.append(&*process_output.begin(), process_output.size()); } diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 45e92ce..6a47ea7 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.empty() && + if (value.size() && (value[value.size() - 1] == ' ' || value[value.size() - 1] == '\t')) { diff --git a/Source/cmCommand.h b/Source/cmCommand.h index 6689243..a34ea71 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -155,7 +155,7 @@ public: */ const char* GetError() { - if(this->Error.empty()) + if(this->Error.length() == 0) { this->Error = this->GetName(); this->Error += " unknown error."; diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 60d8dd9..002e75a 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -201,13 +201,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) else { // only valid for srcfile signatures - if (!compileDefs.empty()) + if (compileDefs.size()) { this->Makefile->IssueMessage(cmake::FATAL_ERROR, "COMPILE_DEFINITIONS specified on a srcdir type TRY_COMPILE"); return -1; } - if (!copyFile.empty()) + if (copyFile.size()) { this->Makefile->IssueMessage(cmake::FATAL_ERROR, "COPY_FILE specified on a srcdir type TRY_COMPILE"); @@ -371,7 +371,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector 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.empty()) + if (compileDefs.size()) { fprintf(fout, "add_definitions( "); for (size_t i = 0; i < compileDefs.size(); ++i) @@ -537,7 +537,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) "Result of TRY_COMPILE", cmCacheManager::INTERNAL); - if (!outputVariable.empty()) + if ( outputVariable.size() > 0 ) { this->Makefile->AddDefinition(outputVariable, output.c_str()); } @@ -547,7 +547,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) std::string copyFileErrorMessage; this->FindOutputFile(targetName); - if ((res==0) && !copyFile.empty()) + if ((res==0) && (copyFile.size())) { if(this->OutputFile.empty() || !cmSystemTools::CopyFileAlways(this->OutputFile, diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index f93d3df..02fb8cb 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/Source/cmCreateTestSourceList.cxx @@ -101,7 +101,7 @@ bool cmCreateTestSourceList break; } std::string func_name; - if (!cmSystemTools::GetFilenamePath(*i).empty()) + if (cmSystemTools::GetFilenamePath(*i).size() > 0) { 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).empty()) + if (cmSystemTools::GetFilenamePath(*i).size() > 0) { func_name = cmSystemTools::GetFilenamePath(*i) + "/" + cmSystemTools::GetFilenameWithoutLastExtension(*i); @@ -145,12 +145,12 @@ bool cmCreateTestSourceList " },\n"; numTests++; } - if(!extraInclude.empty()) + if(extraInclude.size()) { this->Makefile->AddDefinition("CMAKE_TESTDRIVER_EXTRA_INCLUDES", extraInclude.c_str()); } - if(!function.empty()) + if(function.size()) { this->Makefile->AddDefinition("CMAKE_TESTDRIVER_ARGVC_FUNCTION", function.c_str()); diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 6dde349..5ae065e 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -285,7 +285,7 @@ bool cmDependsC::WriteDependencies(const std::set& sources, //---------------------------------------------------------------------------- void cmDependsC::ReadCacheFile() { - if(this->CacheFileName.empty()) + if(this->CacheFileName.size() == 0) { return; } @@ -374,7 +374,7 @@ void cmDependsC::ReadCacheFile() //---------------------------------------------------------------------------- void cmDependsC::WriteCacheFile() const { - if(this->CacheFileName.empty()) + if(this->CacheFileName.size() == 0) { return; } diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index 3c02325..02f2d21 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.empty()) + if ( this->ClassStack.size() > 0 ) { current = &(*(this->ClassStack.end() - 1)); if ( this->ClassStack.size() > 1 ) @@ -251,7 +251,7 @@ void cmDependsJavaParserHelper::EndClass() void cmDependsJavaParserHelper::PrintClasses() { - if (this->ClassStack.empty()) + if ( this->ClassStack.size() == 0 ) { 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.empty()) + if ( this->CurrentPackage.size() > 0 ) { std::cout << "Current package is: " << this->CurrentPackage << std::endl; } std::cout << "Imports packages:"; - if (!this->PackagesImport.empty()) + if ( this->PackagesImport.size() > 0 ) { std::vector::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.empty()) + if ( this->ClassesFound.size() > 0 ) { std::vector::iterator it; for ( it = this->ClassesFound.begin(); diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx index f4e3a75..a268d12 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.empty()) + if(i->Filename.length() > 0) { 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.empty()) + if(this->NameString.length() > 0) { return this->NameString.c_str(); } diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 4de59c0..29c806d 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.empty()) + if(preformatted.length()) { this->PrintPreformatted(os, preformatted.c_str()); } @@ -62,7 +62,7 @@ void cmDocumentationFormatter::PrintFormatted(std::ostream& os, ++ptr; paragraph.append(1, '\n'); } - if(!paragraph.empty()) + if(paragraph.length()) { this->PrintParagraph(os, paragraph.c_str()); } @@ -201,7 +201,7 @@ void cmDocumentationFormatter for(std::vector::const_iterator op = entries.begin(); op != entries.end(); ++op) { - if(!op->Name.empty()) + if(op->Name.size()) { os << " " << op->Name; this->TextIndent = " "; diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index e021d0b..9b59088 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -41,7 +41,7 @@ bool cmExecProgramCommand } else if ( haveoutput_variable ) { - if (!output_variable.empty()) + if ( output_variable.size() > 0 ) { this->SetError("called with incorrect number of arguments"); return false; @@ -59,7 +59,7 @@ bool cmExecProgramCommand } else if ( havereturn_variable ) { - if (!return_variable.empty()) + if ( return_variable.size() > 0 ) { this->SetError("called with incorrect number of arguments"); return false; @@ -84,7 +84,7 @@ bool cmExecProgramCommand } std::string command; - if(!arguments.empty()) + if(arguments.size()) { command = cmSystemTools::ConvertToRunCommandPath(args[0].c_str()); command += " "; @@ -95,7 +95,7 @@ bool cmExecProgramCommand command = args[0]; } bool verbose = true; - if(!output_variable.empty()) + if(output_variable.size() > 0) { verbose = false; } @@ -118,7 +118,7 @@ bool cmExecProgramCommand retVal = -1; } - if (!output_variable.empty()) + if ( output_variable.size() > 0 ) { 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.empty()) + if ( return_variable.size() > 0 ) { char buffer[100]; sprintf(buffer, "%d", retVal); diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx index 1225992..0707906 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.empty()) + if(!output_variable.empty() && tempOutput.size()) { this->Makefile->AddDefinition(output_variable, &*tempOutput.begin()); } - if(!merge_output && !error_variable.empty() && !tempError.empty()) + if(!merge_output && !error_variable.empty() && tempError.size()) { this->Makefile->AddDefinition(error_variable, &*tempError.begin()); diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 387cea6..2f69882 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -1179,7 +1179,7 @@ std::string cmExtraEclipseCDT4Generator::GetPathBasename(const std::string& path) { std::string outputBasename = path; - while (!outputBasename.empty() && + while (outputBasename.size() > 0 && (outputBasename[outputBasename.size() - 1] == '/' || outputBasename[outputBasename.size() - 1] == '\\')) { diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx index 9645d0e..567542e 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.empty() && + while (outputBasename.size() > 0 && (outputBasename[outputBasename.size() - 1] == '/' || outputBasename[outputBasename.size() - 1] == '\\')) { diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 2c92db2..0306f18 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -336,14 +336,14 @@ bool cmFileCommand::HandleReadCommand(std::vector const& args) // is there a limit? long sizeLimit = -1; - if (!limitArg.GetString().empty()) + if (limitArg.GetString().size() > 0) { sizeLimit = atoi(limitArg.GetCString()); } // is there an offset? long offset = 0; - if (!offsetArg.GetString().empty()) + if (offsetArg.GetString().size() > 0) { offset = atoi(offsetArg.GetCString()); } @@ -745,7 +745,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector 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.empty() && + if(s.length() >= minlen && s.length() >= 1 && (!have_regex || regex.find(s.c_str()))) { output_size += static_cast(s.size()) + 1; @@ -899,7 +899,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector const& args, { std::string expr = this->Makefile->GetCurrentDirectory(); // Handle script mode - if (!expr.empty()) + if ( expr.size() > 0 ) { expr += "/" + *i; g.FindFiles(expr); @@ -2992,7 +2992,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) msg = "returning early; file already exists with expected "; msg += hashMatchMSG; msg += "\""; - if(!statusVar.empty()) + if(statusVar.size()) { std::ostringstream result; result << (int)0 << ";\"" << msg; @@ -3085,7 +3085,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); check_curl_result(res, "DOWNLOAD cannot set follow-redirect option: "); - if(!verboseLog.empty()) + if(verboseLog.size()) { res = ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); check_curl_result(res, "DOWNLOAD cannot set verbose: "); @@ -3131,7 +3131,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) g_curl.release(); ::curl_easy_cleanup(curl); - if(!statusVar.empty()) + if(statusVar.size()) { std::ostringstream result; result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\""; @@ -3151,7 +3151,7 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) if (hash.get()) { std::string actualHash = hash->HashFile(file); - if (actualHash.empty()) + if (actualHash.size() == 0) { this->SetError("DOWNLOAD cannot compute hash on downloaded file"); return false; @@ -3172,14 +3172,14 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) } } - if(!chunkDebug.empty()) + if(chunkDebug.size()) { chunkDebug.push_back(0); if(CURLE_OPERATION_TIMEOUTED == res) { std::string output = &*chunkDebug.begin(); - if(!verboseLog.empty()) + if(verboseLog.size()) { this->Makefile->AddDefinition(verboseLog, &*chunkDebug.begin()); @@ -3335,7 +3335,7 @@ cmFileCommand::HandleUploadCommand(std::vector const& args) res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); check_curl_result(res, "UPLOAD cannot set follow-redirect option: "); - if(!logVar.empty()) + if(logVar.size()) { res = ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); check_curl_result(res, "UPLOAD cannot set verbose: "); @@ -3390,7 +3390,7 @@ cmFileCommand::HandleUploadCommand(std::vector const& args) g_curl.release(); ::curl_easy_cleanup(curl); - if(!statusVar.empty()) + if(statusVar.size()) { std::ostringstream result; result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\""; @@ -3403,11 +3403,11 @@ cmFileCommand::HandleUploadCommand(std::vector const& args) fclose(fin); fin = NULL; - if(!logVar.empty()) + if(logVar.size()) { std::string log; - if(!chunkResponse.empty()) + if(chunkResponse.size()) { chunkResponse.push_back(0); log += "Response:\n"; @@ -3415,7 +3415,7 @@ cmFileCommand::HandleUploadCommand(std::vector const& args) log += "\n"; } - if(!chunkDebug.empty()) + if(chunkDebug.size()) { chunkDebug.push_back(0); log += "Debug:\n"; diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 69991d5..013724e 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -152,10 +152,10 @@ bool cmFindBase::ParseArguments(std::vector const& argsIn) } } - if(this->VariableDocumentation.empty()) + if(this->VariableDocumentation.size() == 0) { this->VariableDocumentation = "Where can "; - if(this->Names.empty()) + if(this->Names.size() == 0) { this->VariableDocumentation += "the (unknown) library be found"; } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 7746980..72737b7 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.empty()) + if ( mfile.size() ) { // Load the module we found, and set "_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.empty()) + else if (this->ConsideredConfigs.size() > 0) { e << "Could not find a configuration file for package \"" << this->Name << "\" that " diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 49fbf45..f4cc4c2 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -48,7 +48,7 @@ bool cmFindPathCommand } std::string result = this->FindHeader(); - if(!result.empty()) + if(result.size() != 0) { this->Makefile->AddCacheDefinition (this->VariableName, result.c_str(), @@ -108,7 +108,7 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file, fileName = file; frameWorkName = ""; } - if(!frameWorkName.empty()) + if(frameWorkName.size()) { std::string fpath = dir; fpath += frameWorkName; @@ -134,7 +134,7 @@ cmFindPathCommand::FindHeaderInFramework(std::string const& file, cmsys::Glob globIt; globIt.FindFiles(glob); std::vector files = globIt.GetFiles(); - if(!files.empty()) + if(files.size()) { std::string fheader = cmSystemTools::CollapseFullPath(files[0]); if(this->IncludeFileInPath) diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index c33048c..b213e80 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.empty()) + if ( argvDef.size() > 0 ) { argvDef += ";"; } argvDef += *eit; if ( cnt >= this->Args.size()-1 ) { - if (!argnDef.empty()) + if ( argnDef.size() > 0 ) { argnDef += ";"; } diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 5f246f9..3b1e9c2 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.empty()) + if (parameters.size() == 0) { return compilerId ? compilerId : ""; } @@ -534,7 +534,7 @@ struct CompilerVersionNode : public cmGeneratorExpressionNode { const char *compilerVersion = context->Makefile->GetSafeDefinition( "CMAKE_" + lang + "_COMPILER_VERSION"); - if (parameters.empty()) + if (parameters.size() == 0) { return compilerVersion ? compilerVersion : ""; } @@ -616,7 +616,7 @@ struct PlatformIdNode : public cmGeneratorExpressionNode { const char *platformId = context->Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME"); - if (parameters.empty()) + if (parameters.size() == 0) { return platformId ? platformId : ""; } diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx index a17da8c..ec15daf 100644 --- a/Source/cmGeneratorExpressionParser.cxx +++ b/Source/cmGeneratorExpressionParser.cxx @@ -39,7 +39,7 @@ void cmGeneratorExpressionParser::Parse( static void extendText(std::vector &result, std::vector::const_iterator it) { - if (!result.empty() + if (result.size() > 0 && (*(result.end() - 1))->GetType() == cmGeneratorExpressionEvaluator::Text) { @@ -57,7 +57,7 @@ static void extendText(std::vector &result, static void extendResult(std::vector &result, const std::vector &contents) { - if (!result.empty() + if (result.size() > 0 && (*(result.end() - 1))->GetType() == cmGeneratorExpressionEvaluator::Text && (*contents.begin())->GetType() @@ -256,7 +256,7 @@ void cmGeneratorExpressionParser::ParseContent( { if (this->NestingLevel == 0) { - if (!result.empty() + if (result.size() > 0 && (*(result.end() - 1))->GetType() == cmGeneratorExpressionEvaluator::Text) { diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx index e193cf5..e88f498 100644 --- a/Source/cmGetCMakePropertyCommand.cxx +++ b/Source/cmGetCMakePropertyCommand.cxx @@ -33,7 +33,7 @@ bool cmGetCMakePropertyCommand { int cacheonly = 0; std::vector vars = this->Makefile->GetDefinitions(cacheonly); - if (!vars.empty()) + if (vars.size()>0) { output = vars[0]; } diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 9aceb39..e7d2857 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -113,7 +113,7 @@ bool cmGetFilenameComponentCommand if(args.size() == 4 && args[3] == "CACHE") { - if(!programArgs.empty() && !storeArgs.empty()) + if(programArgs.size() && storeArgs.size()) { this->Makefile->AddCacheDefinition (storeArgs, programArgs.c_str(), @@ -127,7 +127,7 @@ bool cmGetFilenameComponentCommand } else { - if(!programArgs.empty() && !storeArgs.empty()) + if(programArgs.size() && storeArgs.size()) { this->Makefile->AddDefinition(storeArgs, programArgs.c_str()); } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index f8eaf8a..d17710e 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -174,7 +174,7 @@ void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang, { path = name; } - if((path.empty() || !cmSystemTools::FileExists(path.c_str())) + if((path.size() == 0 || !cmSystemTools::FileExists(path.c_str())) && (optional==false)) { return; @@ -265,7 +265,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.empty()) + if(this->FindMakeProgramFile.size() == 0) { cmSystemTools::Error( "Generator implementation error, " @@ -276,7 +276,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) { std::string setMakeProgram = mf->GetModulesFile(this->FindMakeProgramFile.c_str()); - if(!setMakeProgram.empty()) + if(setMakeProgram.size()) { mf->ReadListFile(0, setMakeProgram.c_str()); } @@ -383,7 +383,7 @@ void cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, cmMakefile *mf, bool optional) { - if(languages.empty()) + if(languages.size() == 0) { cmSystemTools::Error("EnableLanguage must have a lang specified!"); cmSystemTools::SetFatalErrorOccured(); @@ -426,7 +426,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& 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.empty()) + if(this->ConfiguredFilesPath.size()) { rootBin = this->ConfiguredFilesPath; } @@ -1636,7 +1636,7 @@ void cmGlobalGenerator::CheckLocalGenerators() static_cast(this->LocalGenerators.size())); } - if(!notFoundMap.empty()) + if(notFoundMap.size()) { std::string notFoundVars; for(std::map::const_iterator @@ -2318,7 +2318,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) cpackCommandLines.end()); depends.erase(depends.begin(), depends.end()); std::ostringstream ostr; - if (!componentsSet->empty()) + if ( componentsSet->size() > 0 ) { ostr << "Available install components are:"; std::set::iterator it; @@ -2460,19 +2460,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.empty()) + if(tgcc.size()) { gcc = tgcc; } std::string tgxx = cmSystemTools::FindProgram("g++", locations); std::string gxx = "g++.exe"; - if(!tgxx.empty()) + if(tgxx.size()) { gxx = tgxx; } std::string trc = cmSystemTools::FindProgram("windres", locations); std::string rc = "windres.exe"; - if(!trc.empty()) + if(trc.size()) { rc = trc; } diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index b9c01fa..ee0c583 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.empty() && tmp[0] != '/') + if (tmp.size() && tmp[0] != '/') { fout << tmp.c_str() <<"\n"; } diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 5f1bb83..1f08629 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -572,7 +572,7 @@ void cmGlobalUnixMakefileGenerator3 if (!targetName.empty()) { cmLocalUnixMakefileGenerator3 *lg; - if (!this->LocalGenerators.empty()) + if (this->LocalGenerators.size()) { lg = static_cast (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.empty()) + if (!this->LocalGenerators.size()) { delete lg; } diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index af88d1c..11a5466 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.empty()) + if (ignoreTargetsRegexes.size() > 0) { std::vector ignoreTargetsRegExVector; cmSystemTools::ExpandListArgument(ignoreTargetsRegexes, diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index 3362abb..b8e30b7 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.empty()) + if (errorString.size()) { 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.empty() || + if (lff.Arguments.size() == 0 || lff.Arguments == this->Args) { return true; @@ -204,7 +204,7 @@ bool cmIfCommand bool isTrue = conditionEvaluator.IsTrue( expandedArguments, errorString, status); - if (!errorString.empty()) + if (errorString.size()) { std::string err = cmIfCommandError(this->Makefile, expandedArguments); err += errorString; diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index c15d46e..9d44db1 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -40,7 +40,7 @@ bool cmIncludeCommand } else if(args[i] == "RESULT_VARIABLE") { - if (!resultVarName.empty()) + if (resultVarName.size() > 0) { 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.empty()) + if ( mfile.size() ) { 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.empty()) + if (resultVarName.size()) { this->Makefile->AddDefinition(resultVarName, readit?fullFilePath.c_str():"NOTFOUND"); diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index 464b4c2..f37d8bc 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -47,7 +47,7 @@ bool cmIncludeDirectoryCommand system = true; continue; } - if(i->empty()) + if(i->size() == 0) { this->SetError("given empty-string as include directory."); return false; diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index 06a78e5..a007693 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).empty()) + if (cmSystemTools::GetFilenamePath(temps).size() > 0) { testf = cmSystemTools::GetFilenamePath(temps) + "/" + cmSystemTools::GetFilenameWithoutLastExtension(temps) + ext; diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 6d69f54..8701b73 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.empty()) + if(!installNameTool.size()) { return; } diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 85413ca..c3f0f57 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -98,7 +98,7 @@ bool cmListCommand::GetList(std::vector& list, return false; } // if the size of the list - if(listString.empty()) + if(listString.size() == 0) { return true; } @@ -109,7 +109,7 @@ bool cmListCommand::GetList(std::vector& list, for(std::vector::iterator i = list.begin(); i != list.end(); ++i) { - if(i->empty()) + if(i->size() == 0) { hasEmpty = true; break; @@ -257,7 +257,7 @@ bool cmListCommand::HandleAppendCommand(std::vector const& args) size_t cc; for ( cc = 2; cc < args.size(); ++ cc ) { - if(!listString.empty()) + if(listString.size()) { listString += ";"; } @@ -328,7 +328,7 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) return false; } - if (!varArgsExpanded.empty()) + if ( varArgsExpanded.size() != 0 ) { size_t nitem = varArgsExpanded.size(); if ( item < 0 ) @@ -340,7 +340,7 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) std::ostringstream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " - << (varArgsExpanded.empty() ? 0 : (varArgsExpanded.size() - 1)) << ")"; + << (varArgsExpanded.size() == 0?0:(varArgsExpanded.size()-1)) << ")"; this->SetError(str.str()); return false; } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 540dd3b..427e29d 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -160,7 +160,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector const& args) } } } - if(!line.empty()) + if(line.length()) { // Partial last line. this->CheckLine(line.c_str()); @@ -184,7 +184,7 @@ void cmLoadCacheCommand::CheckLine(const char* line) // This was requested. Set this variable locally with the given // prefix. var = this->Prefix + var; - if(!value.empty()) + if(value.length()) { this->Makefile->AddDefinition(var, value.c_str()); } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 834f705..7b54b88 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -335,7 +335,7 @@ void cmLocalGenerator::GenerateTestFiles() { (*gi)->Generate(fout, config, configurationTypes); } - if (!this->Children.empty()) + if ( this->Children.size()) { 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.empty() && targetQuoted[0] != '\"') + if(targetQuoted.size() && 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.empty() && includePath[0] != '\"') + if(quotePaths && includePath.size() && includePath[0] != '\"') { includeFlags << "\""; } includeFlags << includePath; - if(quotePaths && !includePath.empty() && includePath[0] != '\"') + if(quotePaths && includePath.size() && includePath[0] != '\"') { includeFlags << "\""; } @@ -1427,7 +1427,7 @@ std::string cmLocalGenerator::GetIncludeFlags( } std::string flags = includeFlags.str(); // remove trailing separators - if((sep[0] != ' ') && !flags.empty() && flags[flags.size()-1] == sep[0]) + if((sep[0] != ' ') && flags.size()>0 && 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.empty()) + if(flags.size()) { flags += " "; } @@ -2906,7 +2906,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector& local, assert(in_remote[0] != '\"'); // The local path should never have a trailing slash. - assert(!local.empty() && !(local[local.size()-1] == "")); + assert(local.size() > 0 && !(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& local, // If the entire path is in common except for a trailing slash then // just return a "./". if(common+1 == remote.size() && - remote[common].empty() && + remote[common].size() == 0 && common == local.size()) { return "./"; @@ -2998,7 +2998,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector& local, // the trailing slash in the output. for(unsigned int i=common; i < remote.size(); ++i) { - if(!relative.empty()) + if(relative.size() > 0) { relative += "/"; } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 84b34d9..ebaee37 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1160,7 +1160,7 @@ cmLocalUnixMakefileGenerator3 { // Build the command line in a single string. std::string cmd = ccg.GetCommand(c); - if (!cmd.empty()) + if (cmd.size()) { // Use "call " before any invocations of .bat or .cmd files // invoked as custom commands in the WindowsShell. @@ -2173,7 +2173,7 @@ cmLocalUnixMakefileGenerator3 cmd += " "; // Pass down verbosity level. - if(!this->GetMakeSilentFlag().empty()) + if(this->GetMakeSilentFlag().size()) { cmd += this->GetMakeSilentFlag(); cmd += " "; @@ -2297,7 +2297,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].empty() || (i == (components.size()-1))) + if(components[i].length() > 0 || (i == (components.size()-1))) { if(!first) { diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 69fcca7..567403f 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.empty()) + if( this->Functions.size()) { this->FilePath = this->Functions[0].FilePath; } @@ -170,7 +170,7 @@ bool cmMacroHelperCommand::InvokeInitialPass { if ( cnt >= this->Args.size()-1 ) { - if (!argnDef.empty()) + if ( argnDef.size() > 0 ) { argnDef += ";"; } @@ -195,7 +195,7 @@ bool cmMacroHelperCommand::InvokeInitialPass std::vector::const_iterator eit; for(eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit) { - if (!argvDef.empty()) + if ( argvDef.size() > 0 ) { argvDef += ";"; } diff --git a/Source/cmMakeDepend.cxx b/Source/cmMakeDepend.cxx index 31bbb73..54b8535 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.empty() && incpath[incpath.size() - 1] != '/') + if (incpath.size() && 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.empty() && path[path.size() - 1] != '/') + if (path.size() && 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.empty() && path[path.size() - 1] != '/') + if (path.size() && path[path.size() - 1] != '/') { path = path + "/"; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 87e62d7..c96c6da 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.empty() && + if (this->Internal->VarUsageStack.size() && 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.empty() && + if (this->Internal->VarUsageStack.size() && 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.empty()) + if (this->CallStack.size()) { 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.empty() && + if (this->Internal->VarUsageStack.size() && 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.empty()) + if (result.size() == 0) { result = moduleInCMakeRoot; } - if (!moduleInCMakeModulePath.empty() && !moduleInCMakeRoot.empty()) + if ((moduleInCMakeModulePath.size()>0) && (moduleInCMakeRoot.size()>0)) { 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 bad38be..d8aa1cb 100644 --- a/Source/cmRemoveCommand.cxx +++ b/Source/cmRemoveCommand.cxx @@ -57,7 +57,7 @@ bool cmRemoveCommand } if (!found) { - if (!value.empty()) + if (value.size()) { value += ";"; } diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 90d7b03..176a08d 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].empty()) + if (args.size() > 1 && args[1].size()) { // 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 aeb8077..bf3519c 100644 --- a/Source/cmSetTargetPropertiesCommand.cxx +++ b/Source/cmSetTargetPropertiesCommand.cxx @@ -61,7 +61,7 @@ bool cmSetTargetPropertiesCommand return false; } } - if(propertyPairs.empty()) + if(propertyPairs.size() == 0) { this->SetError("called with illegal arguments, maybe missing " "a PROPERTIES specifier?"); diff --git a/Source/cmSetTestsPropertiesCommand.cxx b/Source/cmSetTestsPropertiesCommand.cxx index e66d13d..b026ff3 100644 --- a/Source/cmSetTestsPropertiesCommand.cxx +++ b/Source/cmSetTestsPropertiesCommand.cxx @@ -62,7 +62,7 @@ bool cmSetTestsPropertiesCommand return false; } } - if(propertyPairs.empty()) + if(propertyPairs.size() == 0) { this->SetError("called with illegal arguments, maybe " "missing a PROPERTIES specifier?"); diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx index 927888b..e61caab 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.empty()) + if (host.length()) { // 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.empty()) + if(host.length()) { siteName = host; } diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 3e606d7..fe962ba 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -386,7 +386,7 @@ bool cmStringCommand::RegexMatchAll(std::vector const& args) this->SetError(e); return false; } - if(!output.empty()) + if(output.length() > 0) { output += ";"; } @@ -898,7 +898,7 @@ bool cmStringCommand } } } - if (alphabet.empty()) + if ( !alphabet.size() ) { alphabet = cmStringCommandDefaultAlphabet; } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 7d938c5..c769154 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.empty()) + if ( path.size() == 0 ) { path = "/"; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index c193f20..8e060c4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1513,7 +1513,7 @@ cmTarget::AnalyzeLibDependenciesForVS6( const cmMakefile& mf ) { // skip zero size library entries, this may happen // if a variable expands to nothing. - if (!lib->first.empty()) + if (lib->first.size() != 0) { this->EmitForVS6( *lib, dep_map, done, visited, newLinkLibrariesForVS6 ); } @@ -1653,7 +1653,7 @@ void cmTarget::GatherDependenciesForVS6( const cmMakefile& mf, while( end != std::string::npos ) { std::string l = depline.substr( start, end-start ); - if(!l.empty()) + if( l.size() != 0 ) { if (l == "debug") { diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 3daf61e..8f2deeb 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.empty() - || !this->CompileOutputVariable.empty())) + && ((this->RunOutputVariable.size()) + || (this->CompileOutputVariable.size()))) { cmSystemTools::Error( "You cannot use OUTPUT_VARIABLE together with COMPILE_OUTPUT_VARIABLE " @@ -115,18 +115,18 @@ bool cmTryRunCommand } bool captureRunOutput = false; - if (!this->OutputVariable.empty()) + if (this->OutputVariable.size()) { captureRunOutput = true; tryCompile.push_back("OUTPUT_VARIABLE"); tryCompile.push_back(this->OutputVariable); } - if (!this->CompileOutputVariable.empty()) + if (this->CompileOutputVariable.size()) { tryCompile.push_back("OUTPUT_VARIABLE"); tryCompile.push_back(this->CompileOutputVariable); } - if (!this->RunOutputVariable.empty()) + if (this->RunOutputVariable.size()) { captureRunOutput = true; } @@ -140,7 +140,7 @@ bool cmTryRunCommand // now try running the command if it compiled if (!res) { - if (this->OutputFile.empty()) + if (this->OutputFile.size() == 0) { cmSystemTools::Error(this->FindErrorMessage.c_str()); } @@ -160,13 +160,13 @@ bool cmTryRunCommand } // now put the output into the variables - if(!this->RunOutputVariable.empty()) + if(this->RunOutputVariable.size()) { this->Makefile->AddDefinition(this->RunOutputVariable, runOutputContents.c_str()); } - if(!this->OutputVariable.empty()) + if(this->OutputVariable.size()) { // 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.empty()) + if (runArgs.size()) { finalCommand += runArgs; } diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx index 2ee664f..8d26f86 100644 --- a/Source/cmUseMangledMesaCommand.cxx +++ b/Source/cmUseMangledMesaCommand.cxx @@ -44,7 +44,7 @@ bool cmUseMangledMesaCommand const char* destDir = args[1].c_str(); std::vector files; cmSystemTools::Glob(inputDir, "\\.h$", files); - if(files.empty()) + if(files.size() == 0) { cmSystemTools::Error("Could not open Mesa Directory ", inputDir); return false; diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index ee1ff29..ba6b4ac 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -95,7 +95,7 @@ bool cmUtilitySourceCommand { exePath = this->Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); } - if(!exePath.empty()) + if(exePath.size()) { utilityDirectory = exePath; } diff --git a/Source/cmUuid.cxx b/Source/cmUuid.cxx index e2d0049..8b5b7ae 100644 --- a/Source/cmUuid.cxx +++ b/Source/cmUuid.cxx @@ -66,7 +66,7 @@ void cmUuid::CreateHashInput(std::vector const& uuidNamespace, { output = uuidNamespace; - if(!name.empty()) + if(name.size()) { output.resize(output.size() + name.size()); diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 5170ead..47edb03 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -47,7 +47,7 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf, while (isTrue) { - if (!errorString.empty()) + if (errorString.size()) { 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.empty() || + if (lff.Arguments.size() == 0 || lff.Arguments == this->Args) { return true; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 29d8206..4244b25 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -316,7 +316,7 @@ bool cmake::SetCacheArgs(const std::vector& args) if(arg.find("-D",0) == 0) { std::string entry = arg.substr(2); - if(entry.empty()) + if(entry.size() == 0) { ++i; if(i < args.size()) @@ -380,7 +380,7 @@ bool cmake::SetCacheArgs(const std::vector& args) else if(arg.find("-U",0) == 0) { std::string entryPattern = arg.substr(2); - if(entryPattern.empty()) + if(entryPattern.size() == 0) { ++i; if(i < args.size()) @@ -424,7 +424,7 @@ bool cmake::SetCacheArgs(const std::vector& args) else if(arg.find("-C",0) == 0) { std::string path = arg.substr(2); - if (path.empty()) + if ( path.size() == 0 ) { ++i; if(i < args.size()) @@ -449,7 +449,7 @@ bool cmake::SetCacheArgs(const std::vector& args) return false; } std::string path = args[i]; - if (path.empty()) + if ( path.size() == 0 ) { cmSystemTools::Error("No cmake script provided."); return false; @@ -763,7 +763,7 @@ void cmake::SetArgs(const std::vector& args, else if(arg.find("-A",0) == 0) { std::string value = arg.substr(2); - if(value.empty()) + if(value.size() == 0) { ++i; if(i >= args.size()) @@ -784,7 +784,7 @@ void cmake::SetArgs(const std::vector& args, else if(arg.find("-T",0) == 0) { std::string value = arg.substr(2); - if(value.empty()) + if(value.size() == 0) { ++i; if(i >= args.size()) @@ -805,7 +805,7 @@ void cmake::SetArgs(const std::vector& args, else if(arg.find("-G",0) == 0) { std::string value = arg.substr(2); - if(value.empty()) + if(value.size() == 0) { ++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.empty()) + if(cachePath.length() > 0) { 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.empty()) + if(listPath.length() > 0) { 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.empty()) + if(this->CCEnvironment.size()) { env += this->CCEnvironment; } cmSystemTools::PutEnv(env); env = "CXX="; - if(!this->CXXEnvironment.empty()) + if(this->CXXEnvironment.size()) { env += this->CXXEnvironment; } @@ -1608,7 +1608,7 @@ void cmake::PreLoadCMakeFiles() { std::vector args; std::string pre_load = this->GetHomeDirectory(); - if (!pre_load.empty()) + if ( pre_load.size() > 0 ) { 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.empty()) + if ( pre_load.size() > 0 ) { 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.empty()) + if(this->CheckBuildSystemArgument.size() == 0) { 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.empty()) + if ( output.size() ) { output += ";"; } @@ -2395,7 +2395,7 @@ int cmake::GetSystemInformation(std::vector& args) else if(arg.find("-G",0) == 0) { std::string value = arg.substr(2); - if(value.empty()) + if(value.size() == 0) { ++i; if(i >= args.size()) @@ -2450,7 +2450,7 @@ int cmake::GetSystemInformation(std::vector& args) } // do we write to a file or to stdout? - if (resultFile.empty()) + if (resultFile.size() == 0) { 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.empty() && dep[0] != '#' && + if(dep.length() >= 1 && dep[0] != '#' && (!ftc.FileTimeCompare(stampDepends.c_str(), dep.c_str(), &result) || result < 0)) { diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index f3e54d3..61b175e 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -203,7 +203,7 @@ int main(int ac, char const* const* av) int do_cmake(int ac, char const* const* av) { - if (cmSystemTools::GetCurrentWorkingDirectory().empty()) + if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 ) { std::cerr << "Current working directory cannot be established." << std::endl; diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index ecf4650..70d98d2 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1228,7 +1228,7 @@ int cmcmd::ParseVisualStudioLinkCommand(std::vector& args, targetName = i->substr(5); } } - if(targetName.empty() || command.empty()) + if(targetName.size() == 0 || command.size() == 0) { return -1; } diff --git a/Source/ctest.cxx b/Source/ctest.cxx index b77c231..fb97af6 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().empty()) + if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 ) { cmCTestLog(&inst, ERROR_MESSAGE, "Current working directory cannot be established." << std::endl); ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 6 ++-- Source/CPack/cmCPackLog.cxx | 10 +++--- Source/CPack/cpack.cxx | 2 +- Source/CTest/cmCTestBatchTestHandler.cxx | 2 +- Source/CTest/cmCTestBuildAndTestHandler.cxx | 24 ++++++------- Source/CTest/cmCTestBuildHandler.cxx | 10 +++--- Source/CTest/cmCTestConfigureHandler.cxx | 4 +-- Source/CTest/cmCTestCoverageHandler.cxx | 38 ++++++++++---------- Source/CTest/cmCTestLaunch.cxx | 2 +- Source/CTest/cmCTestMemCheckHandler.cxx | 14 ++++---- Source/CTest/cmCTestMultiProcessHandler.cxx | 10 +++--- Source/CTest/cmCTestP4.cxx | 4 +-- Source/CTest/cmCTestRunTest.cxx | 8 ++--- Source/CTest/cmCTestScriptHandler.cxx | 2 +- Source/CTest/cmCTestSubmitHandler.cxx | 52 +++++++++++++-------------- Source/CTest/cmCTestTestHandler.cxx | 42 +++++++++++----------- Source/CTest/cmCTestUpdateHandler.cxx | 2 +- Source/CTest/cmParseCacheCoverage.cxx | 4 +-- Source/CTest/cmParseDelphiCoverage.cxx | 6 ++-- Source/CTest/cmParseGTMCoverage.cxx | 2 +- Source/CTest/cmParseJacocoCoverage.cxx | 2 +- Source/CTest/cmProcess.cxx | 4 +-- Source/CursesDialog/cmCursesMainForm.cxx | 8 ++--- Source/cmAddSubDirectoryCommand.cxx | 2 +- Source/cmAuxSourceDirectoryCommand.cxx | 2 +- Source/cmBuildNameCommand.cxx | 2 +- Source/cmCTest.cxx | 24 ++++++------- Source/cmCacheManager.cxx | 2 +- Source/cmCommand.h | 2 +- Source/cmCoreTryCompile.cxx | 10 +++--- Source/cmCreateTestSourceList.cxx | 8 ++--- Source/cmDependsC.cxx | 4 +-- Source/cmDependsJavaParserHelper.cxx | 10 +++--- Source/cmDocumentation.cxx | 4 +-- Source/cmDocumentationFormatter.cxx | 6 ++-- Source/cmExecProgramCommand.cxx | 12 +++---- Source/cmExecuteProcessCommand.cxx | 4 +-- Source/cmExtraEclipseCDT4Generator.cxx | 2 +- Source/cmExtraKateGenerator.cxx | 2 +- Source/cmFileCommand.cxx | 30 ++++++++-------- Source/cmFindBase.cxx | 4 +-- Source/cmFindPackageCommand.cxx | 4 +-- Source/cmFindPathCommand.cxx | 6 ++-- Source/cmFunctionCommand.cxx | 4 +-- Source/cmGeneratorExpressionEvaluator.cxx | 6 ++-- Source/cmGeneratorExpressionParser.cxx | 6 ++-- Source/cmGetCMakePropertyCommand.cxx | 2 +- Source/cmGetFilenameComponentCommand.cxx | 4 +-- Source/cmGlobalGenerator.cxx | 20 +++++------ Source/cmGlobalKdevelopGenerator.cxx | 2 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 4 +-- Source/cmGraphVizWriter.cxx | 2 +- Source/cmIfCommand.cxx | 6 ++-- Source/cmIncludeCommand.cxx | 6 ++-- Source/cmIncludeDirectoryCommand.cxx | 2 +- Source/cmInstallFilesCommand.cxx | 2 +- Source/cmInstallTargetGenerator.cxx | 2 +- Source/cmListCommand.cxx | 10 +++--- Source/cmLoadCacheCommand.cxx | 4 +-- Source/cmLocalGenerator.cxx | 18 +++++----- Source/cmLocalUnixMakefileGenerator3.cxx | 6 ++-- Source/cmMacroCommand.cxx | 6 ++-- Source/cmMakeDepend.cxx | 6 ++-- Source/cmMakefile.cxx | 12 +++---- Source/cmRemoveCommand.cxx | 2 +- Source/cmSetCommand.cxx | 2 +- Source/cmSetTargetPropertiesCommand.cxx | 2 +- Source/cmSetTestsPropertiesCommand.cxx | 2 +- Source/cmSiteNameCommand.cxx | 4 +-- Source/cmStringCommand.cxx | 4 +-- Source/cmSystemTools.cxx | 2 +- Source/cmTarget.cxx | 4 +-- Source/cmTryRunCommand.cxx | 18 +++++----- Source/cmUseMangledMesaCommand.cxx | 2 +- Source/cmUtilitySourceCommand.cxx | 2 +- Source/cmUuid.cxx | 2 +- Source/cmWhileCommand.cxx | 4 +-- Source/cmake.cxx | 36 +++++++++---------- Source/cmakemain.cxx | 2 +- Source/cmcmd.cxx | 2 +- Source/ctest.cxx | 2 +- 81 files changed, 310 insertions(+), 310 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 17 10:12:30 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 17 Jan 2015 10:12:30 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2085-gfec6f0b Message-ID: <20150117151230.C505021FE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fec6f0b5b3866451c68bc9da7eda95fef58e25d6 (commit) via 150932e57a7db01bbcf62d5601114d8d5057f3aa (commit) via 782591350ced90d4289d220f91bdbdb4acec2ba6 (commit) via 7b9fc88b045fd34df73e3cc864c9ac924a449cd3 (commit) from 8b5991ea9e5da7aea8fd2437bb980cc10dd55e69 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fec6f0b5b3866451c68bc9da7eda95fef58e25d6 commit fec6f0b5b3866451c68bc9da7eda95fef58e25d6 Merge: 8b5991e 150932e Author: Stephen Kelly AuthorDate: Sat Jan 17 10:12:29 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 17 10:12:29 2015 -0500 Merge topic 'GNU-4.4-compile-features' into next 150932e5 Features: Record for GNU 4.4. 78259135 Features: Test presence of cxx_auto_type with genex. 7b9fc88b Features: Remove outdated comment. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=150932e57a7db01bbcf62d5601114d8d5057f3aa commit 150932e57a7db01bbcf62d5601114d8d5057f3aa Author: Stephen Kelly AuthorDate: Sat Jan 17 16:05:53 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 16:11:58 2015 +0100 Features: Record for GNU 4.4. diff --git a/Help/release/dev/GNU-4.6-compile-features.rst b/Help/release/dev/GNU-4.4-compile-features.rst similarity index 52% rename from Help/release/dev/GNU-4.6-compile-features.rst rename to Help/release/dev/GNU-4.4-compile-features.rst index 059a075..d5c1356 100644 --- a/Help/release/dev/GNU-4.6-compile-features.rst +++ b/Help/release/dev/GNU-4.4-compile-features.rst @@ -1,5 +1,5 @@ -GNU-4.6-compile-features +GNU-4.4-compile-features ------------------------ * The :manual:`Compile Features ` functionality - is now aware of features supported by GNU 4.6 compilers. + is now aware of features supported by GNU 4.4 to 4.6 compilers. diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake index 7e840aa..d8e456c 100644 --- a/Modules/Compiler/GNU-C-FeatureTests.cmake +++ b/Modules/Compiler/GNU-C-FeatureTests.cmake @@ -1,5 +1,5 @@ -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404") # GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it # to 201000L. As the former is strictly greater than the latter, test only @@ -9,7 +9,7 @@ set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") set(GNU46_C11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") set(_cmake_feature_test_c_static_assert "${GNU46_C11}") # Since 4.4 at least: -set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") +set(GNU44_C99 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") set(_cmake_feature_test_c_restrict "${GNU44_C99}") set(_cmake_feature_test_c_variadic_macros "${GNU44_C99}") diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index d5e747d..3036057 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -1,7 +1,7 @@ include(Compiler/GNU) __compiler_gnu(C) -if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") @@ -12,7 +12,7 @@ endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") -elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) +elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x") endif() @@ -29,7 +29,7 @@ macro(cmake_record_c_compile_features) endmacro() set(_result 0) - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index c265e73..5fc3deb 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -2,7 +2,7 @@ # Reference: http://gcc.gnu.org/projects/cxx0x.html # http://gcc.gnu.org/projects/cxx1y.html -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404") set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L") set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}") @@ -67,14 +67,12 @@ set(_cmake_feature_test_cxx_noexcept "${GNU46_CXX11}") set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}") set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}") -# TODO: Should be supported by GNU 4.5 -set(GNU45_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU45_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}") set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}") set(_cmake_feature_test_cxx_local_type_template_args "${GNU45_CXX11}") set(_cmake_feature_test_cxx_raw_string_literals "${GNU45_CXX11}") -# TODO: Should be supported by GNU 4.4 -set(GNU44_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU44_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}") set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}") set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index eeada86..c471daf 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -11,7 +11,7 @@ else() endif() endif() -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) # Supported since 4.3 set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98") @@ -20,7 +20,7 @@ endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") -elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) +elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) # 4.3 supports 0x variants set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x") @@ -45,7 +45,7 @@ macro(cmake_record_cxx_compile_features) if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() - if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=782591350ced90d4289d220f91bdbdb4acec2ba6 commit 782591350ced90d4289d220f91bdbdb4acec2ba6 Author: Stephen Kelly AuthorDate: Sat Jan 17 15:58:45 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 16:07:53 2015 +0100 Features: Test presence of cxx_auto_type with genex. The purpose of that test is to cover the case where the genex reports '1', and the feature is chosen to be present on all/most supported compilers. GNU 4.4 does not support cxx_nullptr. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 106f29c..9de0da2 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -194,7 +194,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11) target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$ - HAVE_NULLPTR=$ + HAVE_AUTO_TYPE=$ HAVE_INHERITING_CONSTRUCTORS=$ HAVE_FINAL=$ HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$ @@ -204,7 +204,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_static_assert) target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$ - HAVE_NULLPTR=$ + HAVE_AUTO_TYPE=$ HAVE_INHERITING_CONSTRUCTORS=$ HAVE_FINAL=$ HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$ @@ -216,7 +216,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) target_link_libraries(CompileFeaturesGenex3 PRIVATE static_assert_iface) target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$ - HAVE_NULLPTR=$ + HAVE_AUTO_TYPE=$ HAVE_INHERITING_CONSTRUCTORS=$ HAVE_FINAL=$ HAVE_INHERITING_CONSTRUCTORS_AND_FINAL=$ diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index 0389dbd..d9c8eec 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -17,9 +17,9 @@ struct B final : A #endif -#if !HAVE_NULLPTR -#error "Expect nullptr feature" -#else +#if !HAVE_AUTO_TYPE +# error Expect cxx_auto_type support +#endif #if !HAVE_INHERITING_CONSTRUCTORS # if EXPECT_INHERITING_CONSTRUCTORS @@ -51,13 +51,6 @@ struct B final : A # endif #endif -const char* getString() -{ - return nullptr; -} - -#endif - int main() { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b9fc88b045fd34df73e3cc864c9ac924a449cd3 commit 7b9fc88b045fd34df73e3cc864c9ac924a449cd3 Author: Stephen Kelly AuthorDate: Sat Jan 17 16:06:51 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 16:07:53 2015 +0100 Features: Remove outdated comment. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 267d658..c265e73 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -59,7 +59,6 @@ set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}") # __GXX_EXPERIMENTAL_CXX0X__ is defined in prior versions, but may not be # defined in the future. set(GNU_CXX0X_DEFINED "(__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))") -# TODO: Should be supported by GNU 4.6 set(GNU46_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_defaulted_move_initializers "${GNU46_CXX11}") ----------------------------------------------------------------------- Summary of changes: ...-compile-features.rst => GNU-4.4-compile-features.rst} | 4 ++-- Modules/Compiler/GNU-C-FeatureTests.cmake | 4 ++-- Modules/Compiler/GNU-C.cmake | 6 +++--- Modules/Compiler/GNU-CXX-FeatureTests.cmake | 9 +++------ Modules/Compiler/GNU-CXX.cmake | 6 +++--- Tests/CompileFeatures/CMakeLists.txt | 6 +++--- Tests/CompileFeatures/genex_test.cpp | 13 +++---------- 7 files changed, 19 insertions(+), 29 deletions(-) rename Help/release/dev/{GNU-4.6-compile-features.rst => GNU-4.4-compile-features.rst} (52%) hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 17 10:27:07 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 17 Jan 2015 10:27:07 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2088-g41b3991 Message-ID: <20150117152707.4D015A90B1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 41b39919f8ec6c50d5a009337d340f2a088a65d9 (commit) via 681d965df18fa55a9eaa615515015ac088ea0805 (commit) via 4dc0c488f94a5f0c7ae04fd15b46a92c20fb03fa (commit) from fec6f0b5b3866451c68bc9da7eda95fef58e25d6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41b39919f8ec6c50d5a009337d340f2a088a65d9 commit 41b39919f8ec6c50d5a009337d340f2a088a65d9 Merge: fec6f0b 681d965 Author: Stephen Kelly AuthorDate: Sat Jan 17 10:27:06 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 17 10:27:06 2015 -0500 Merge topic 'delete-algorithm' into next 681d965d Use the cmDeleteAll algorithm for types derived from std::map. 4dc0c488 cmDeleteAll: Generalize deletion specialization for map types. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=681d965df18fa55a9eaa615515015ac088ea0805 commit 681d965df18fa55a9eaa615515015ac088ea0805 Author: Stephen Kelly AuthorDate: Sun Jan 4 15:06:37 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 16:22:58 2015 +0100 Use the cmDeleteAll algorithm for types derived from std::map. 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::iterator it = this->begin(); - it != this->end(); - ++ it) - { - delete it->second; - } + cmDeleteAll(*this); this->derived::clear(); } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index d17710e..f282bad 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1510,11 +1510,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); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8e060c4..8d0271a 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(); } @@ -6874,10 +6869,7 @@ cmTargetLinkInformationMap //---------------------------------------------------------------------------- cmTargetLinkInformationMap::~cmTargetLinkInformationMap() { - for(derived::iterator i = this->begin(); i != this->end(); ++i) - { - delete i->second; - } + cmDeleteAll(*this); } //---------------------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4dc0c488f94a5f0c7ae04fd15b46a92c20fb03fa commit 4dc0c488f94a5f0c7ae04fd15b46a92c20fb03fa Author: Stephen Kelly AuthorDate: Sun Jan 4 15:16:56 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 17 16:22:58 2015 +0100 cmDeleteAll: Generalize deletion specialization for map types. Assume that a container whose value_type is a std::pair should have its second member deleted. 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 +template +struct cmIsPair +{ + enum { value = false }; +}; + +template +struct cmIsPair > +{ + enum { value = true }; +}; + +template::value> struct DefaultDeleter { void operator()(typename Container::value_type value) { @@ -247,10 +260,10 @@ struct DefaultDeleter } }; -template -struct DefaultDeleter > +template +struct DefaultDeleter { - void operator()(typename std::map::value_type value) { + void operator()(typename Container::value_type value) { delete value.second; } }; ----------------------------------------------------------------------- Summary of changes: Source/cmExportSetMap.cxx | 7 +------ Source/cmGlobalGenerator.cxx | 6 +----- Source/cmStandardIncludes.h | 21 +++++++++++++++++---- Source/cmTarget.cxx | 12 ++---------- 4 files changed, 21 insertions(+), 25 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jan 18 00:01:18 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 18 Jan 2015 00:01:18 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-843-gf3e92d2 Message-ID: <20150118050134.D4593A9B11@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f3e92d281682ee482b1425675b9fccd372cd01f3 (commit) from f8c416f00c9d263556cca9d9dfc0c71913bdd7f3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3e92d281682ee482b1425675b9fccd372cd01f3 commit f3e92d281682ee482b1425675b9fccd372cd01f3 Author: Kitware Robot AuthorDate: Sun Jan 18 00:01:09 2015 -0500 Commit: Kitware Robot CommitDate: Sun Jan 18 00:01:09 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2821174..4a4ef50 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 20150118) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 18 08:25:12 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 18 Jan 2015 08:25:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2090-gfeacb0f Message-ID: <20150118132512.C9886A8EB2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via feacb0fe45bdb67fa88fd5ee16031b1552e423a2 (commit) via 0ab8227656129842b8458980041c3d11b78a70f1 (commit) from 41b39919f8ec6c50d5a009337d340f2a088a65d9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=feacb0fe45bdb67fa88fd5ee16031b1552e423a2 commit feacb0fe45bdb67fa88fd5ee16031b1552e423a2 Merge: 41b3991 0ab8227 Author: Stephen Kelly AuthorDate: Sun Jan 18 08:25:10 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 18 08:25:10 2015 -0500 Merge topic 'consistent-empty-method' into next 0ab82276 Revert "Revert topic." diff --cc Source/CTest/cmCTestSubmitHandler.cxx index 53a8982,bc6fb31..0e19259 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@@ -1210,16 -1058,9 +1210,16 @@@ int cmCTestSubmitHandler::HandleCDashUp //---------------------------------------------------------------------------- int cmCTestSubmitHandler::ProcessHandler() { + const char* cdashUploadFile = this->GetOption("CDashUploadFile"); + const char* cdashUploadType = this->GetOption("CDashUploadType"); + if(cdashUploadFile && cdashUploadType) + { + return this->HandleCDashUploadFile(std::string(cdashUploadFile), + std::string(cdashUploadType)); + } 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; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0ab8227656129842b8458980041c3d11b78a70f1 commit 0ab8227656129842b8458980041c3d11b78a70f1 Author: Stephen Kelly AuthorDate: Sun Jan 18 14:24:38 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:24:38 2015 +0100 Revert "Revert topic." This reverts commit 04fdcfec6e357be7a17ae0c5e741472fb8a337c4. Dashboard failures were not caused by this topic. 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 >::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 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(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::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 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" << cm->SourceFile << "" << std::endl; } - if ( cm->SourceFileTail.size() > 0 ) + if (!cm->SourceFileTail.empty()) { os << "\t\t" << cm->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 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::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::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 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 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::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 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 &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 ... at 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::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::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 &passed, p.Timeout = this->CTest->GetGlobalTimeout(); } - if(p.Depends.size()) + if(!p.Depends.empty()) { for(std::vector::iterator i = p.Depends.begin(); i != p.Depends.end(); ++i) @@ -1192,7 +1192,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os) << "name=\"Execution Time\">" << result->ExecutionTime << "\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 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 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/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 argv, std::ostream* log, double testTimeOut, std::vector* 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 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/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 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 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 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 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& 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::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::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::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/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 2f69882..387cea6 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -1179,7 +1179,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 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 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(s.size()) + 1; @@ -899,7 +899,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector 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 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 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 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 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 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 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 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 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 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 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 "_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 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/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 &result, std::vector::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 &result, static void extendResult(std::vector &result, const std::vector &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 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..f8eaf8a 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -174,7 +174,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 +265,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 +276,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 +383,7 @@ void cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, cmMakefile *mf, bool optional) { - if(languages.size() == 0) + if(languages.empty()) { cmSystemTools::Error("EnableLanguage must have a lang specified!"); cmSystemTools::SetFatalErrorOccured(); @@ -426,7 +426,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& 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; } @@ -1636,7 +1636,7 @@ void cmGlobalGenerator::CheckLocalGenerators() static_cast(this->LocalGenerators.size())); } - if(notFoundMap.size()) + if(!notFoundMap.empty()) { std::string notFoundVars; for(std::map::const_iterator @@ -2318,7 +2318,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::iterator it; @@ -2460,19 +2460,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; } 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 (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/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 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..85413ca 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -98,7 +98,7 @@ bool cmListCommand::GetList(std::vector& 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& list, for(std::vector::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 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 const& args) return false; } - if ( varArgsExpanded.size() != 0 ) + if (!varArgsExpanded.empty()) { size_t nitem = varArgsExpanded.size(); if ( item < 0 ) @@ -340,7 +340,7 @@ bool cmListCommand::HandleInsertCommand(std::vector 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; } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 427e29d..540dd3b 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -160,7 +160,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector const& args) } } } - if(line.length()) + if(!line.empty()) { // Partial last line. this->CheckLine(line.c_str()); @@ -184,7 +184,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& 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& 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& 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..84b34d9 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1160,7 +1160,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 +2173,7 @@ cmLocalUnixMakefileGenerator3 cmd += " "; // Pass down verbosity level. - if(this->GetMakeSilentFlag().size()) + if(!this->GetMakeSilentFlag().empty()) { cmd += this->GetMakeSilentFlag(); cmd += " "; @@ -2297,7 +2297,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::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/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 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..7d938c5 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 = "/"; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8e060c4..c193f20 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1513,7 +1513,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 +1653,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") { 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 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 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/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& 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& 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& 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& 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& 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& 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& 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 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& 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& 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..f3e54d3 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -203,7 +203,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; diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 70d98d2..ecf4650 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1228,7 +1228,7 @@ int cmcmd::ParseVisualStudioLinkCommand(std::vector& 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); ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 6 ++-- Source/CPack/cmCPackLog.cxx | 10 +++--- Source/CPack/cpack.cxx | 2 +- Source/CTest/cmCTestBatchTestHandler.cxx | 2 +- Source/CTest/cmCTestBuildAndTestHandler.cxx | 24 ++++++------- Source/CTest/cmCTestBuildHandler.cxx | 10 +++--- Source/CTest/cmCTestConfigureHandler.cxx | 4 +-- Source/CTest/cmCTestCoverageHandler.cxx | 38 ++++++++++---------- Source/CTest/cmCTestLaunch.cxx | 2 +- Source/CTest/cmCTestMemCheckHandler.cxx | 14 ++++---- Source/CTest/cmCTestMultiProcessHandler.cxx | 10 +++--- Source/CTest/cmCTestP4.cxx | 4 +-- Source/CTest/cmCTestRunTest.cxx | 8 ++--- Source/CTest/cmCTestScriptHandler.cxx | 2 +- Source/CTest/cmCTestSubmitHandler.cxx | 52 +++++++++++++-------------- Source/CTest/cmCTestTestHandler.cxx | 42 +++++++++++----------- Source/CTest/cmCTestUpdateHandler.cxx | 2 +- Source/CTest/cmParseCacheCoverage.cxx | 4 +-- Source/CTest/cmParseDelphiCoverage.cxx | 6 ++-- Source/CTest/cmParseGTMCoverage.cxx | 2 +- Source/CTest/cmParseJacocoCoverage.cxx | 2 +- Source/CTest/cmProcess.cxx | 4 +-- Source/CursesDialog/cmCursesMainForm.cxx | 8 ++--- Source/cmAddSubDirectoryCommand.cxx | 2 +- Source/cmAuxSourceDirectoryCommand.cxx | 2 +- Source/cmBuildNameCommand.cxx | 2 +- Source/cmCTest.cxx | 24 ++++++------- Source/cmCacheManager.cxx | 2 +- Source/cmCommand.h | 2 +- Source/cmCoreTryCompile.cxx | 10 +++--- Source/cmCreateTestSourceList.cxx | 8 ++--- Source/cmDependsC.cxx | 4 +-- Source/cmDependsJavaParserHelper.cxx | 10 +++--- Source/cmDocumentation.cxx | 4 +-- Source/cmDocumentationFormatter.cxx | 6 ++-- Source/cmExecProgramCommand.cxx | 12 +++---- Source/cmExecuteProcessCommand.cxx | 4 +-- Source/cmExtraEclipseCDT4Generator.cxx | 2 +- Source/cmExtraKateGenerator.cxx | 2 +- Source/cmFileCommand.cxx | 30 ++++++++-------- Source/cmFindBase.cxx | 4 +-- Source/cmFindPackageCommand.cxx | 4 +-- Source/cmFindPathCommand.cxx | 6 ++-- Source/cmFunctionCommand.cxx | 4 +-- Source/cmGeneratorExpressionEvaluator.cxx | 6 ++-- Source/cmGeneratorExpressionParser.cxx | 6 ++-- Source/cmGetCMakePropertyCommand.cxx | 2 +- Source/cmGetFilenameComponentCommand.cxx | 4 +-- Source/cmGlobalGenerator.cxx | 20 +++++------ Source/cmGlobalKdevelopGenerator.cxx | 2 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 4 +-- Source/cmGraphVizWriter.cxx | 2 +- Source/cmIfCommand.cxx | 6 ++-- Source/cmIncludeCommand.cxx | 6 ++-- Source/cmIncludeDirectoryCommand.cxx | 2 +- Source/cmInstallFilesCommand.cxx | 2 +- Source/cmInstallTargetGenerator.cxx | 2 +- Source/cmListCommand.cxx | 10 +++--- Source/cmLoadCacheCommand.cxx | 4 +-- Source/cmLocalGenerator.cxx | 18 +++++----- Source/cmLocalUnixMakefileGenerator3.cxx | 6 ++-- Source/cmMacroCommand.cxx | 6 ++-- Source/cmMakeDepend.cxx | 6 ++-- Source/cmMakefile.cxx | 12 +++---- Source/cmRemoveCommand.cxx | 2 +- Source/cmSetCommand.cxx | 2 +- Source/cmSetTargetPropertiesCommand.cxx | 2 +- Source/cmSetTestsPropertiesCommand.cxx | 2 +- Source/cmSiteNameCommand.cxx | 4 +-- Source/cmStringCommand.cxx | 4 +-- Source/cmSystemTools.cxx | 2 +- Source/cmTarget.cxx | 4 +-- Source/cmTryRunCommand.cxx | 18 +++++----- Source/cmUseMangledMesaCommand.cxx | 2 +- Source/cmUtilitySourceCommand.cxx | 2 +- Source/cmUuid.cxx | 2 +- Source/cmWhileCommand.cxx | 4 +-- Source/cmake.cxx | 36 +++++++++---------- Source/cmakemain.cxx | 2 +- Source/cmcmd.cxx | 2 +- Source/ctest.cxx | 2 +- 81 files changed, 310 insertions(+), 310 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 18 08:26:01 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 18 Jan 2015 08:26:01 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2102-g6961e24 Message-ID: <20150118132601.56F6EA8FD7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 6961e240b4b856326ac91ecb37169c71277cd597 (commit) via 5f69314ea65ebd0de23484e7c91bd12a8bf861f6 (commit) via fd0c036c0c3e5e6be685e64caecdcbad4b3e744c (commit) via f09fde2d21ef0c97f0ed1b8c6849f0d7055bc24e (commit) via 86b5bdfa0874a0eb97d726fa9dc2f534e5a67c7e (commit) via fd7b37129360364531ddfeda7edb6e34ba773d00 (commit) via aa773035b7f4a1aefd860d0b9e80f134bd4a4547 (commit) via 64592633773004df83cdd790b9cb1838503ca854 (commit) via 607e19384f19fcf8713ccf0377e0255084ede785 (commit) via 930bd4781694ea85a876c08c34a2dd8243688920 (commit) via d92887efabad6a91e221588d0dc7a0bffd91a9f7 (commit) via f3e92d281682ee482b1425675b9fccd372cd01f3 (commit) from feacb0fe45bdb67fa88fd5ee16031b1552e423a2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6961e240b4b856326ac91ecb37169c71277cd597 commit 6961e240b4b856326ac91ecb37169c71277cd597 Merge: feacb0f 5f69314 Author: Stephen Kelly AuthorDate: Sun Jan 18 08:25:58 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 18 08:25:58 2015 -0500 Merge topic 'consistent-empty-method' into next 5f69314e Replace foo.length() pattern with !foo.empty(). fd0c036c Replace 'foo.length() >= 1' pattern with !foo.empty() f09fde2d Replace 'foo.length() > 0' pattern with !foo.empty(). 86b5bdfa Replace 'foo.length() == 0' pattern with foo.empty(). fd7b3712 Replace foo.size() pattern with !foo.empty(). aa773035 Replace !foo.size() pattern with foo.empty(). 64592633 cmListCommand: Use empty() and expand whitespace. 607e1938 Replace 'foo.size() != 0' pattern with !foo.empty(). 930bd478 Replace 'foo.size() == 0' pattern with foo.empty(). d92887ef Replace 'foo.size() > 0' pattern with !foo.empty(). f3e92d28 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f69314ea65ebd0de23484e7c91bd12a8bf861f6 commit 5f69314ea65ebd0de23484e7c91bd12a8bf861f6 Author: Stephen Kelly AuthorDate: Thu Jan 15 23:39:38 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:25:25 2015 +0100 Replace foo.length() pattern with !foo.empty(). 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/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index adf29b1..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()); } diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 427e29d..540dd3b 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -160,7 +160,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector const& args) } } } - if(line.length()) + if(!line.empty()) { // Partial last line. this->CheckLine(line.c_str()); @@ -184,7 +184,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 0cbbdab..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) 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; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd0c036c0c3e5e6be685e64caecdcbad4b3e744c commit fd0c036c0c3e5e6be685e64caecdcbad4b3e744c Author: Stephen Kelly AuthorDate: Thu Jan 15 22:58:10 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:25:25 2015 +0100 Replace 'foo.length() >= 1' pattern with !foo.empty() diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index aab256a..2c92db2 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -745,7 +745,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector 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(s.size()) + 1; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7accec2..29d8206 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -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)) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f09fde2d21ef0c97f0ed1b8c6849f0d7055bc24e commit f09fde2d21ef0c97f0ed1b8c6849f0d7055bc24e Author: Stephen Kelly AuthorDate: Thu Jan 15 22:39:38 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:25:25 2015 +0100 Replace 'foo.length() > 0' pattern with !foo.empty(). diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index b7ef090..f21fcf6 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -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/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/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index d4ba89a..84b34d9 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2297,7 +2297,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/cmStringCommand.cxx b/Source/cmStringCommand.cxx index ddfb748..3e606d7 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -386,7 +386,7 @@ bool cmStringCommand::RegexMatchAll(std::vector const& args) this->SetError(e); return false; } - if(output.length() > 0) + if(!output.empty()) { output += ";"; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 2a2f2ab..7accec2 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -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); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86b5bdfa0874a0eb97d726fa9dc2f534e5a67c7e commit 86b5bdfa0874a0eb97d726fa9dc2f534e5a67c7e Author: Stephen Kelly AuthorDate: Thu Jan 15 22:36:31 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:25:24 2015 +0100 Replace 'foo.length() == 0' pattern with foo.empty(). 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."; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd7b37129360364531ddfeda7edb6e34ba773d00 commit fd7b37129360364531ddfeda7edb6e34ba773d00 Author: Stephen Kelly AuthorDate: Thu Jan 15 23:04:33 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:25:24 2015 +0100 Replace foo.size() pattern with !foo.empty(). diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 9699d0d..d90aeb7 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -62,7 +62,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, std::vector 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; @@ -212,7 +212,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) std::ostringstream out; if ( this->CTest->GetConfigType().empty() && - this->ConfigSample.size()) + !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()); } @@ -340,7 +340,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) std::string resultingConfig; std::vector 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 4032499..8f087ab 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -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/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index f821724..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); @@ -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 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 68c5a92..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) @@ -848,7 +848,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( { resultFound = sanitizerWarning.match(1); } - if(resultFound.size()) + if(!resultFound.empty()) { std::vector::size_type idx = this->FindOrAddWarning(resultFound); if(result.empty() || idx > result.size()-1) diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 8da9886..f9e8a3c 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -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/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 056554e..314c8ad 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -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"; 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 2ed4b57..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()); } @@ -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: [" @@ -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()) @@ -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: " @@ -1060,7 +1060,7 @@ 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; } diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 2896a50..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 @@ -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 @@ -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) { @@ -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 &passed, p.Timeout = this->CTest->GetGlobalTimeout(); } - if(p.Depends.size()) + if(!p.Depends.empty()) { for(std::vector::iterator i = p.Depends.begin(); i != p.Depends.end(); ++i) @@ -1192,7 +1192,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os) << "name=\"Execution Time\">" << result->ExecutionTime << "\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, 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/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/cmProcess.cxx b/Source/CTest/cmProcess.cxx index ca1ed8b..e1bd02b 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -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/cmCTest.cxx b/Source/cmCTest.cxx index b7e049d..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; } @@ -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()); } @@ -3136,7 +3136,7 @@ double cmCTest::GetRemainingTimeAllowed() void cmCTest::OutputTestErrors(std::vector 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/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 5850338..60d8dd9 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -201,13 +201,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector 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 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) @@ -547,7 +547,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector 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 264a323..f93d3df 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/Source/cmCreateTestSourceList.cxx @@ -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/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 29c806d..adf29b1 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -201,7 +201,7 @@ void cmDocumentationFormatter for(std::vector::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 3828468..e021d0b 100644 --- a/Source/cmExecProgramCommand.cxx +++ b/Source/cmExecProgramCommand.cxx @@ -84,7 +84,7 @@ bool cmExecProgramCommand } std::string command; - if(arguments.size()) + if(!arguments.empty()) { command = cmSystemTools::ConvertToRunCommandPath(args[0].c_str()); command += " "; 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/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 416dd3e..aab256a 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2992,7 +2992,7 @@ cmFileCommand::HandleDownloadCommand(std::vector 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 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 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) << "\""; @@ -3172,14 +3172,14 @@ cmFileCommand::HandleDownloadCommand(std::vector 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 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 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 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 const& args) log += "\n"; } - if(chunkDebug.size()) + if(!chunkDebug.empty()) { chunkDebug.push_back(0); log += "Debug:\n"; diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 28640fe..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 "_FIND_MODULE" to true // while inside it. diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index 1490710..49fbf45 100644 --- a/Source/cmFindPathCommand.cxx +++ b/Source/cmFindPathCommand.cxx @@ -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 files = globIt.GetFiles(); - if(files.size()) + if(!files.empty()) { std::string fheader = cmSystemTools::CollapseFullPath(files[0]); if(this->IncludeFileInPath) 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 5ebc7cc..f8eaf8a 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -276,7 +276,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()); } @@ -426,7 +426,7 @@ cmGlobalGenerator::EnableLanguage(std::vectorconst& 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; } @@ -1636,7 +1636,7 @@ void cmGlobalGenerator::CheckLocalGenerators() static_cast(this->LocalGenerators.size())); } - if(notFoundMap.size()) + if(!notFoundMap.empty()) { std::string notFoundVars; for(std::map::const_iterator @@ -2460,19 +2460,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; } 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 a867ab3..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 (this->LocalGenerators[0]); diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index da62eca..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; @@ -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 d434331..c15d46e 100644 --- a/Source/cmIncludeCommand.cxx +++ b/Source/cmIncludeCommand.cxx @@ -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/cmListCommand.cxx b/Source/cmListCommand.cxx index 98a2632..85413ca 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -257,7 +257,7 @@ bool cmListCommand::HandleAppendCommand(std::vector const& args) size_t cc; for ( cc = 2; cc < args.size(); ++ cc ) { - if(listString.size()) + if(!listString.empty()) { listString += ";"; } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index cb52ffb..0cbbdab 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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 << "\""; } @@ -2514,7 +2514,7 @@ void cmLocalGenerator::AppendFlags(std::string& flags, { if(!newFlags.empty()) { - if(flags.size()) + if(!flags.empty()) { flags += " "; } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index ebaee37..d4ba89a 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1160,7 +1160,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 +2173,7 @@ cmLocalUnixMakefileGenerator3 cmd += " "; // Pass down verbosity level. - if(this->GetMakeSilentFlag().size()) + if(!this->GetMakeSilentFlag().empty()) { cmd += this->GetMakeSilentFlag(); cmd += " "; diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 462e888..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; } 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 67efdc5..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); 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/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index a2f079a..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; } @@ -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/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 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 8c230a4..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; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index c03f01d..2a2f2ab 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -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; } @@ -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 += ";"; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa773035b7f4a1aefd860d0b9e80f134bd4a4547 commit aa773035b7f4a1aefd860d0b9e80f134bd4a4547 Author: Stephen Kelly AuthorDate: Thu Jan 15 23:13:44 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:25:24 2015 +0100 Replace !foo.size() pattern with foo.empty(). diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index e5d5988..9699d0d 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -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) { @@ -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; } diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 87c7e8f..f821724 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -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; } @@ -1627,7 +1627,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage( cnt ++; // Skip empty lines - if ( !nl.size() ) + if (nl.empty()) { continue; } @@ -1813,7 +1813,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage( cnt ++; // Skip empty lines - if ( !nl.size() ) + if (nl.empty()) { continue; } diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 1d50788..2ed4b57 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -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" 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/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 1f08629..a867ab3 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -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/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/cmStringCommand.cxx b/Source/cmStringCommand.cxx index fe962ba..ddfb748 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -898,7 +898,7 @@ bool cmStringCommand } } } - if ( !alphabet.size() ) + if (alphabet.empty()) { alphabet = cmStringCommandDefaultAlphabet; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=64592633773004df83cdd790b9cb1838503ca854 commit 64592633773004df83cdd790b9cb1838503ca854 Author: Stephen Kelly AuthorDate: Thu Jan 15 00:48:02 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:25:24 2015 +0100 cmListCommand: Use empty() and expand whitespace. diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 01ae300..98a2632 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -340,7 +340,7 @@ bool cmListCommand::HandleInsertCommand(std::vector 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; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=607e19384f19fcf8713ccf0377e0255084ede785 commit 607e19384f19fcf8713ccf0377e0255084ede785 Author: Stephen Kelly AuthorDate: Thu Jan 15 00:59:13 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:25:24 2015 +0100 Replace 'foo.size() != 0' pattern with !foo.empty(). diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 594f53a..8da9886 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) { diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index b6b0357..2896a50 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -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::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::iterator l = p.Labels.begin(); l != p.Labels.end(); ++l) 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/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx index f4cc4c2..1490710 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(), diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index c82d278..01ae300 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -328,7 +328,7 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) return false; } - if ( varArgsExpanded.size() != 0 ) + if (!varArgsExpanded.empty()) { size_t nitem = varArgsExpanded.size(); if ( item < 0 ) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 8e060c4..c193f20 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1513,7 +1513,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 +1653,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") { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=930bd4781694ea85a876c08c34a2dd8243688920 commit 930bd4781694ea85a876c08c34a2dd8243688920 Author: Stephen Kelly AuthorDate: Thu Jan 15 00:31:49 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:25:24 2015 +0100 Replace 'foo.size() == 0' pattern with foo.empty(). 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/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 8499846..e5d5988 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -211,7 +211,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) static_cast(captureRAII); std::ostringstream out; - if ( this->CTest->GetConfigType().size() == 0 && + if ( this->CTest->GetConfigType().empty() && this->ConfigSample.size()) { // use the config sample to set the ConfigType @@ -269,7 +269,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) // do the build std::vector::iterator tarIt; - if ( this->BuildTargets.size() == 0 ) + if (this->BuildTargets.empty()) { this->BuildTargets.push_back(""); } diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 5ddc75f..4032499 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" 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 8a1b724..87c7e8f 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -1037,7 +1037,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( this->FindGCovFiles(files); std::vector::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 } @@ -1456,7 +1456,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage( this->FindLCovFiles(files); std::vector::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 } @@ -1759,7 +1759,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage( gl.FindFiles(daGlob); std::vector files = gl.GetFiles(); - if ( files.size() == 0 ) + if (files.empty()) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Cannot find any Python Trace.py coverage files." @@ -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; diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index fd0388a..68c5a92 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -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) " @@ -851,7 +851,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput( if(resultFound.size()) { std::vector::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 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..594f53a 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -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; } 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 &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 ... at 1111111,2222222 diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 07bd413..1d50788 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1067,7 +1067,7 @@ int cmCTestSubmitHandler::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" diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index ca8f09f..b6b0357 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -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; } @@ -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/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 82194b3..4dfdfac 100644 --- a/Source/CTest/cmParseDelphiCoverage.cxx +++ b/Source/CTest/cmParseDelphiCoverage.cxx @@ -147,7 +147,7 @@ public: std::string glob = Coverage.SourceDir + "*/" + filename; gl.FindFiles(glob); std::vector const& files = gl.GetFiles(); - if(files.size() == 0) + if(files.empty()) { /* * If that doesn't find any matching files diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 167b992..ca1ed8b 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -39,7 +39,7 @@ void cmProcess::SetCommandArguments(std::vector const& args) bool cmProcess::StartProcess() { - if(this->Command.size() == 0) + if(this->Command.empty()) { return false; } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 944d506..b7e049d 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -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; } @@ -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; } 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& 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 d7d052e..3c02325 100644 --- a/Source/cmDependsJavaParserHelper.cxx +++ b/Source/cmDependsJavaParserHelper.cxx @@ -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(); diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 862d1ca..416dd3e 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -3151,7 +3151,7 @@ cmFileCommand::HandleDownloadCommand(std::vector 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; 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 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/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/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 6373235..5ebc7cc 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -174,7 +174,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 +265,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, " @@ -383,7 +383,7 @@ void cmGlobalGenerator::EnableLanguage(std::vectorconst& languages, cmMakefile *mf, bool optional) { - if(languages.size() == 0) + if(languages.empty()) { cmSystemTools::Error("EnableLanguage must have a lang specified!"); cmSystemTools::SetFatalErrorOccured(); diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index b8e30b7..da62eca 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -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; 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/cmListCommand.cxx b/Source/cmListCommand.cxx index c3f0f57..c82d278 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -98,7 +98,7 @@ bool cmListCommand::GetList(std::vector& 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& list, for(std::vector::iterator i = list.begin(); i != list.end(); ++i) { - if(i->size() == 0) + if(i->empty()) { hasEmpty = true; break; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 04106dc..cb52ffb 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2968,7 +2968,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector& 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 "./"; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c6181aa..67efdc5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3852,7 +3852,7 @@ 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; } 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/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c769154..7d938c5 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 = "/"; } diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 8f2deeb..a2f079a 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -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()); } 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 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/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 47edb03..8c230a4 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -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/cmake.cxx b/Source/cmake.cxx index b6aac3c..c03f01d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -316,7 +316,7 @@ bool cmake::SetCacheArgs(const std::vector& 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& 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& 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& 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& 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& 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& 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()) @@ -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) { @@ -2395,7 +2395,7 @@ int cmake::GetSystemInformation(std::vector& 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& args) } // do we write to a file or to stdout? - if (resultFile.size() == 0) + if (resultFile.empty()) { resultFile = cwd; resultFile += "/__cmake_systeminformation/results.txt"; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 61b175e..f3e54d3 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -203,7 +203,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; diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 70d98d2..ecf4650 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1228,7 +1228,7 @@ int cmcmd::ParseVisualStudioLinkCommand(std::vector& 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); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d92887efabad6a91e221588d0dc7a0bffd91a9f7 commit d92887efabad6a91e221588d0dc7a0bffd91a9f7 Author: Stephen Kelly AuthorDate: Thu Jan 15 00:06:11 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:25:24 2015 +0100 Replace 'foo.size() > 0' pattern with !foo.empty(). diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 9cd53ea..b7ef090 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 >::iterator symlinkedIt; std::string curDir = cmSystemTools::GetCurrentWorkingDirectory(); 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/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..8499846 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -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(); } @@ -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(); } diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 0c3f206..5ddc75f 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -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" << cm->SourceFile << "" << std::endl; } - if ( cm->SourceFileTail.size() > 0 ) + if (!cm->SourceFileTail.empty()) { os << "\t\t" << cm->SourceFileTail << "" << std::endl; diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 6598111..8a1b724 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -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 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); diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 2a39051..056554e 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(); @@ -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/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index fea94ba..07bd413 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -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()) << "]" @@ -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()) << "]" @@ -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()); @@ -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()) @@ -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..ca8f09f 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -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; } diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx index 3afbfac..82194b3 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); 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/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/cmCTest.cxx b/Source/cmCTest.cxx index 76873ad..944d506 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -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 += ";"; } @@ -1266,7 +1266,7 @@ int cmCTest::RunTest(std::vector argv, std::ostream* log, double testTimeOut, std::vector* environment) { - bool modifyEnv = (environment && environment->size()>0); + bool modifyEnv = (environment && !environment->empty()); // determine how much time we have double timeout = this->GetRemainingTimeAllowed() - 120; @@ -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()); } diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 002e75a..5850338 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -537,7 +537,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) "Result of TRY_COMPILE", cmCacheManager::INTERNAL); - if ( outputVariable.size() > 0 ) + if (!outputVariable.empty()) { this->Makefile->AddDefinition(outputVariable, output.c_str()); } diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index 02fb8cb..264a323 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); diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx index 02f2d21..d7d052e 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 ) @@ -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::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::iterator it; for ( it = this->ClassesFound.begin(); diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx index 9b59088..3828468 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; @@ -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/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 2f69882..387cea6 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -1179,7 +1179,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..862d1ca 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -336,14 +336,14 @@ bool cmFileCommand::HandleReadCommand(std::vector 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()); } @@ -899,7 +899,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector const& args, { std::string expr = this->Makefile->GetCurrentDirectory(); // Handle script mode - if ( expr.size() > 0 ) + if (!expr.empty()) { expr += "/" + *i; g.FindFiles(expr); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 72737b7..28640fe 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -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/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/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 &result, std::vector::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 &result, static void extendResult(std::vector &result, const std::vector &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 vars = this->Makefile->GetDefinitions(cacheonly); - if (vars.size()>0) + if (!vars.empty()) { output = vars[0]; } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index d17710e..6373235 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2318,7 +2318,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::iterator it; 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 ignoreTargetsRegExVector; cmSystemTools::ExpandListArgument(ignoreTargetsRegexes, diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx index 9d44db1..d434331 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"); 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/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 7b54b88..04106dc 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -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] = ' '; } @@ -2906,7 +2906,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector& 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())) @@ -2998,7 +2998,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector& 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/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 567403f..462e888 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -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::const_iterator eit; for(eit = expandedArgs.begin(); eit != expandedArgs.end(); ++eit) { - if ( argvDef.size() > 0 ) + if (!argvDef.empty()) { argvDef += ";"; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c96c6da..c6181aa 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3857,7 +3857,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const 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/cmake.cxx b/Source/cmake.cxx index 4244b25..b6aac3c 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1608,7 +1608,7 @@ void cmake::PreLoadCMakeFiles() { std::vector 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()) ) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 18 08:39:11 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 18 Jan 2015 08:39:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2105-g48ff2e8 Message-ID: <20150118133912.023FD1352@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 48ff2e8cee3b0f28f2e65b59092682daa3930c45 (commit) via 7650c1b181904927d484fa41c2e80a347639e23d (commit) via f4ce62450e1952803947eeb8dbcb00ada9d2d3fe (commit) from 6961e240b4b856326ac91ecb37169c71277cd597 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=48ff2e8cee3b0f28f2e65b59092682daa3930c45 commit 48ff2e8cee3b0f28f2e65b59092682daa3930c45 Merge: 6961e24 7650c1b Author: Stephen Kelly AuthorDate: Sun Jan 18 08:39:10 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 18 08:39:10 2015 -0500 Merge topic 'GNU-4.4-compile-features' into next 7650c1b1 Features: Use a more-common feature in cycle-test. f4ce6245 Features: Update comment in test to match the code. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7650c1b181904927d484fa41c2e80a347639e23d commit 7650c1b181904927d484fa41c2e80a347639e23d Author: Stephen Kelly AuthorDate: Sun Jan 18 14:37:34 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:37:34 2015 +0100 Features: Use a more-common feature in cycle-test. We require that the $<$:empty2> generates a '1' when CXX11 is enabled. GNU 4.4 does not support cxx_nullptr, but does support cxx_auto_type. diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake index 684fb2b..09594bd 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -6,9 +6,9 @@ add_library(empty3 INTERFACE) target_compile_features(empty3 INTERFACE cxx_static_assert) target_link_libraries(empty1 - # When starting, $ is '0', so 'freeze' the + # When starting, $ is '0', so 'freeze' the # CXX_STANDARD at 98 during computation. - $<$:empty2> + $<$:empty2> # This would add cxx_static_assert, but that would require CXX_STANDARD = 11, # which is not allowed after freeze. Report an error. empty3 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4ce62450e1952803947eeb8dbcb00ada9d2d3fe commit f4ce62450e1952803947eeb8dbcb00ada9d2d3fe Author: Stephen Kelly AuthorDate: Sun Jan 18 14:36:01 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:36:25 2015 +0100 Features: Update comment in test to match the code. After commit f13a2eb1 (Features: Adjust the RunCMake test to use more-common features., 2015-01-15). diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake index d2c95ec..684fb2b 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -9,7 +9,7 @@ target_link_libraries(empty1 # When starting, $ is '0', so 'freeze' the # CXX_STANDARD at 98 during computation. $<$:empty2> - # This would add cxx_constexpr, but that would require CXX_STANDARD = 11, + # This would add cxx_static_assert, but that would require CXX_STANDARD = 11, # which is not allowed after freeze. Report an error. empty3 ) ----------------------------------------------------------------------- Summary of changes: .../CompileFeatures/LinkImplementationFeatureCycle.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 18 08:44:54 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 18 Jan 2015 08:44:54 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2107-g446f851 Message-ID: <20150118134454.85DFD4987@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 446f851e1e87e24b0a60601a8fc20b52f58659d7 (commit) via dc9a621e83c391d80274d6f99f5098500a0bf88e (commit) from 48ff2e8cee3b0f28f2e65b59092682daa3930c45 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=446f851e1e87e24b0a60601a8fc20b52f58659d7 commit 446f851e1e87e24b0a60601a8fc20b52f58659d7 Merge: 48ff2e8 dc9a621 Author: Stephen Kelly AuthorDate: Sun Jan 18 08:44:53 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 18 08:44:53 2015 -0500 Merge topic 'GNU-4.4-compile-features' into next dc9a621e Features: Blacklist cxx_constexpr test for GNU 4.5. diff --cc Tests/CompileFeatures/CMakeLists.txt index c55856e,e086032..fb5f042 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -51,18 -51,15 +51,26 @@@ if (CMAKE_CXX_COMPILER_ID STREQUAL "App ) 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.4) + # The cxx_constexpr feature happens to work (for *this* testcase) with + # GNU 4.5, but it is first documented as available with GNU 4.6. + list(REMOVE_ITEM CXX_non_features + cxx_constexpr + ) + endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) # The cxx_alignof feature happens to work (for *this* testcase) with # GNU 4.7, but it is first documented as available with GNU 4.8. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc9a621e83c391d80274d6f99f5098500a0bf88e commit dc9a621e83c391d80274d6f99f5098500a0bf88e Author: Stephen Kelly AuthorDate: Sun Jan 18 14:44:13 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:44:13 2015 +0100 Features: Blacklist cxx_constexpr test for GNU 4.5. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9de0da2..e086032 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -52,6 +52,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) + # The cxx_constexpr feature happens to work (for *this* testcase) with + # GNU 4.5, but it is first documented as available with GNU 4.6. + list(REMOVE_ITEM CXX_non_features + cxx_constexpr + ) +endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) # The cxx_alignof feature happens to work (for *this* testcase) with # GNU 4.7, but it is first documented as available with GNU 4.8. ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 18 08:46:16 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 18 Jan 2015 08:46:16 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2109-ge33e646 Message-ID: <20150118134616.88ABD4998@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e33e646f3cad70b68ec9c47b9da3ce5c991e87eb (commit) via aed26795976e7c81b15fd89ec23fe0afe8c47593 (commit) from 446f851e1e87e24b0a60601a8fc20b52f58659d7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e33e646f3cad70b68ec9c47b9da3ce5c991e87eb commit e33e646f3cad70b68ec9c47b9da3ce5c991e87eb Merge: 446f851 aed2679 Author: Stephen Kelly AuthorDate: Sun Jan 18 08:46:15 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 18 08:46:15 2015 -0500 Merge topic 'GNU-4.4-compile-features' into next aed26795 Fix version. diff --cc Tests/CompileFeatures/CMakeLists.txt index fb5f042,ccd6f30..5cd0836 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -51,19 -51,8 +51,19 @@@ if (CMAKE_CXX_COMPILER_ID STREQUAL "App ) 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.4) + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) # The cxx_constexpr feature happens to work (for *this* testcase) with # GNU 4.5, but it is first documented as available with GNU 4.6. list(REMOVE_ITEM CXX_non_features http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aed26795976e7c81b15fd89ec23fe0afe8c47593 commit aed26795976e7c81b15fd89ec23fe0afe8c47593 Author: Stephen Kelly AuthorDate: Sun Jan 18 14:46:02 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:46:02 2015 +0100 Fix version. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index e086032..ccd6f30 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -52,7 +52,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" - AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) # The cxx_constexpr feature happens to work (for *this* testcase) with # GNU 4.5, but it is first documented as available with GNU 4.6. list(REMOVE_ITEM CXX_non_features ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 18 08:47:42 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 18 Jan 2015 08:47:42 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2114-gd35bb00 Message-ID: <20150118134742.36B0D49D0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d35bb00a0232595417de3f4669dc8380a135ab66 (commit) via 5895f5fe2efb241e2fe12a5327fa193c2dbfce48 (commit) via 1ae2c6b2c9def9f0d0db3a808290d485eccf062c (commit) via c66e3317492709ab3b830024f67021dde67a7fe5 (commit) via c43a6dc5ec2ac57d8334beeabf90de43e8ddb829 (commit) from e33e646f3cad70b68ec9c47b9da3ce5c991e87eb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d35bb00a0232595417de3f4669dc8380a135ab66 commit d35bb00a0232595417de3f4669dc8380a135ab66 Merge: e33e646 5895f5f Author: Stephen Kelly AuthorDate: Sun Jan 18 08:47:41 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 18 08:47:41 2015 -0500 Merge topic 'GNU-4.4-compile-features' into next 5895f5fe Features: Record for GNU 4.4. 1ae2c6b2 Features: Blacklist cxx_constexpr test for GNU 4.5. c66e3317 Features: Use a more-common feature in cycle-test. c43a6dc5 Features: Update comment in test to match the code. diff --cc Tests/CompileFeatures/CMakeLists.txt index 5cd0836,ccd6f30..2c1074d --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -51,26 -51,15 +51,34 @@@ if (CMAKE_CXX_COMPILER_ID STREQUAL "App ) 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 + # GNU 4.5, but it is first documented as available with GNU 4.6. + list(REMOVE_ITEM CXX_non_features + cxx_constexpr + ) +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 + # GNU 4.5, but it is first documented as available with GNU 4.6. + list(REMOVE_ITEM CXX_non_features + cxx_constexpr + ) + endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) # The cxx_alignof feature happens to work (for *this* testcase) with # GNU 4.7, but it is first documented as available with GNU 4.8. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5895f5fe2efb241e2fe12a5327fa193c2dbfce48 commit 5895f5fe2efb241e2fe12a5327fa193c2dbfce48 Author: Stephen Kelly AuthorDate: Sat Jan 17 16:05:53 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:46:55 2015 +0100 Features: Record for GNU 4.4. diff --git a/Help/release/dev/GNU-4.6-compile-features.rst b/Help/release/dev/GNU-4.4-compile-features.rst similarity index 52% rename from Help/release/dev/GNU-4.6-compile-features.rst rename to Help/release/dev/GNU-4.4-compile-features.rst index 059a075..d5c1356 100644 --- a/Help/release/dev/GNU-4.6-compile-features.rst +++ b/Help/release/dev/GNU-4.4-compile-features.rst @@ -1,5 +1,5 @@ -GNU-4.6-compile-features +GNU-4.4-compile-features ------------------------ * The :manual:`Compile Features ` functionality - is now aware of features supported by GNU 4.6 compilers. + is now aware of features supported by GNU 4.4 to 4.6 compilers. diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake index 7e840aa..d8e456c 100644 --- a/Modules/Compiler/GNU-C-FeatureTests.cmake +++ b/Modules/Compiler/GNU-C-FeatureTests.cmake @@ -1,5 +1,5 @@ -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404") # GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it # to 201000L. As the former is strictly greater than the latter, test only @@ -9,7 +9,7 @@ set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") set(GNU46_C11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") set(_cmake_feature_test_c_static_assert "${GNU46_C11}") # Since 4.4 at least: -set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") +set(GNU44_C99 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") set(_cmake_feature_test_c_restrict "${GNU44_C99}") set(_cmake_feature_test_c_variadic_macros "${GNU44_C99}") diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index d5e747d..3036057 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -1,7 +1,7 @@ include(Compiler/GNU) __compiler_gnu(C) -if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") @@ -12,7 +12,7 @@ endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") -elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) +elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x") endif() @@ -29,7 +29,7 @@ macro(cmake_record_c_compile_features) endmacro() set(_result 0) - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index c265e73..5fc3deb 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -2,7 +2,7 @@ # Reference: http://gcc.gnu.org/projects/cxx0x.html # http://gcc.gnu.org/projects/cxx1y.html -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404") set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L") set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}") @@ -67,14 +67,12 @@ set(_cmake_feature_test_cxx_noexcept "${GNU46_CXX11}") set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}") set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}") -# TODO: Should be supported by GNU 4.5 -set(GNU45_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU45_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}") set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}") set(_cmake_feature_test_cxx_local_type_template_args "${GNU45_CXX11}") set(_cmake_feature_test_cxx_raw_string_literals "${GNU45_CXX11}") -# TODO: Should be supported by GNU 4.4 -set(GNU44_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU44_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}") set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}") set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index eeada86..c471daf 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -11,7 +11,7 @@ else() endif() endif() -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) # Supported since 4.3 set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98") @@ -20,7 +20,7 @@ endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") -elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) +elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) # 4.3 supports 0x variants set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x") @@ -45,7 +45,7 @@ macro(cmake_record_cxx_compile_features) if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() - if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ae2c6b2c9def9f0d0db3a808290d485eccf062c commit 1ae2c6b2c9def9f0d0db3a808290d485eccf062c Author: Stephen Kelly AuthorDate: Sun Jan 18 14:44:13 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:46:55 2015 +0100 Features: Blacklist cxx_constexpr test for GNU 4.5. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9de0da2..ccd6f30 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -52,6 +52,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" 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 + # GNU 4.5, but it is first documented as available with GNU 4.6. + list(REMOVE_ITEM CXX_non_features + cxx_constexpr + ) +endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) # The cxx_alignof feature happens to work (for *this* testcase) with # GNU 4.7, but it is first documented as available with GNU 4.8. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c66e3317492709ab3b830024f67021dde67a7fe5 commit c66e3317492709ab3b830024f67021dde67a7fe5 Author: Stephen Kelly AuthorDate: Sun Jan 18 14:37:34 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:46:45 2015 +0100 Features: Use a more-common feature in cycle-test. We require that the $<$:empty2> generates a '1' when CXX11 is enabled. GNU 4.4 does not support cxx_nullptr, but does support cxx_auto_type. diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake index 684fb2b..09594bd 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -6,9 +6,9 @@ add_library(empty3 INTERFACE) target_compile_features(empty3 INTERFACE cxx_static_assert) target_link_libraries(empty1 - # When starting, $ is '0', so 'freeze' the + # When starting, $ is '0', so 'freeze' the # CXX_STANDARD at 98 during computation. - $<$:empty2> + $<$:empty2> # This would add cxx_static_assert, but that would require CXX_STANDARD = 11, # which is not allowed after freeze. Report an error. empty3 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c43a6dc5ec2ac57d8334beeabf90de43e8ddb829 commit c43a6dc5ec2ac57d8334beeabf90de43e8ddb829 Author: Stephen Kelly AuthorDate: Sun Jan 18 14:36:01 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:46:45 2015 +0100 Features: Update comment in test to match the code. After commit f13a2eb1 (Features: Adjust the RunCMake test to use more-common features., 2015-01-15). diff --git a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake index d2c95ec..684fb2b 100644 --- a/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake +++ b/Tests/RunCMake/CompileFeatures/LinkImplementationFeatureCycle.cmake @@ -9,7 +9,7 @@ target_link_libraries(empty1 # When starting, $ is '0', so 'freeze' the # CXX_STANDARD at 98 during computation. $<$:empty2> - # This would add cxx_constexpr, but that would require CXX_STANDARD = 11, + # This would add cxx_static_assert, but that would require CXX_STANDARD = 11, # which is not allowed after freeze. Report an error. empty3 ) ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 18 09:01:03 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 18 Jan 2015 09:01:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2116-g62809a3 Message-ID: <20150118140103.A5AE1AA038@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 62809a37acf2da6d452c49aacf6963aa60214d02 (commit) via 623df63fd4d87bb03cea55a874a3b6cec2deb1e6 (commit) from d35bb00a0232595417de3f4669dc8380a135ab66 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=62809a37acf2da6d452c49aacf6963aa60214d02 commit 62809a37acf2da6d452c49aacf6963aa60214d02 Merge: d35bb00 623df63 Author: Stephen Kelly AuthorDate: Sun Jan 18 09:01:02 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 18 09:01:02 2015 -0500 Merge topic 'GNU-4.4-compile-features' into next 623df63f Features: Wrap failure-test in UNIX condition. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=623df63fd4d87bb03cea55a874a3b6cec2deb1e6 commit 623df63fd4d87bb03cea55a874a3b6cec2deb1e6 Author: Stephen Kelly AuthorDate: Sun Jan 18 14:59:40 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 14:59:40 2015 +0100 Features: Wrap failure-test in UNIX condition. The use of GNU on non-UNIX for 'compile features' is not tested and is not well defined. diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 401de95..5849417 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -25,12 +25,14 @@ if (NOT CMAKE_CXX_COMPILE_FEATURES AND NOT CMAKE_C_COMPILE_FEATURES) ) add_executable(WriteCompilerDetectionHeader "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp") - include(CheckCXXSourceCompiles) - check_cxx_source_compiles("#include \"${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h\"\nint main() { return 0; }\n" - file_include_works - ) - if (file_include_works) - message(SEND_ERROR "Inclusion of ${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h was expected to cause an error, but did not.") + if(UNIX OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + include(CheckCXXSourceCompiles) + check_cxx_source_compiles("#include \"${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h\"\nint main() { return 0; }\n" + file_include_works + ) + if (file_include_works) + message(SEND_ERROR "Inclusion of ${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h was expected to cause an error, but did not.") + endif() endif() return() endif() ----------------------------------------------------------------------- Summary of changes: Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 18 09:01:26 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 18 Jan 2015 09:01:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2119-ga9a2dbf Message-ID: <20150118140126.7513AAA03A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a9a2dbf8dbdc3935ceab3ef560d4185503c98ead (commit) via 004e1540e0870e9b3bde19ad16c4f50b7d22df73 (commit) via 2a5ca650c9f973c83fe3d5b070f6313e1bd536c1 (commit) from 62809a37acf2da6d452c49aacf6963aa60214d02 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a9a2dbf8dbdc3935ceab3ef560d4185503c98ead commit a9a2dbf8dbdc3935ceab3ef560d4185503c98ead Merge: 62809a3 004e154 Author: Stephen Kelly AuthorDate: Sun Jan 18 09:01:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 18 09:01:25 2015 -0500 Merge topic 'GNU-4.4-compile-features' into next 004e1540 Features: Record for GNU 4.4. 2a5ca650 Features: Wrap failure-test in UNIX condition. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=004e1540e0870e9b3bde19ad16c4f50b7d22df73 commit 004e1540e0870e9b3bde19ad16c4f50b7d22df73 Author: Stephen Kelly AuthorDate: Sat Jan 17 16:05:53 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 15:01:15 2015 +0100 Features: Record for GNU 4.4. diff --git a/Help/release/dev/GNU-4.6-compile-features.rst b/Help/release/dev/GNU-4.4-compile-features.rst similarity index 52% rename from Help/release/dev/GNU-4.6-compile-features.rst rename to Help/release/dev/GNU-4.4-compile-features.rst index 059a075..d5c1356 100644 --- a/Help/release/dev/GNU-4.6-compile-features.rst +++ b/Help/release/dev/GNU-4.4-compile-features.rst @@ -1,5 +1,5 @@ -GNU-4.6-compile-features +GNU-4.4-compile-features ------------------------ * The :manual:`Compile Features ` functionality - is now aware of features supported by GNU 4.6 compilers. + is now aware of features supported by GNU 4.4 to 4.6 compilers. diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake index 7e840aa..d8e456c 100644 --- a/Modules/Compiler/GNU-C-FeatureTests.cmake +++ b/Modules/Compiler/GNU-C-FeatureTests.cmake @@ -1,5 +1,5 @@ -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404") # GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it # to 201000L. As the former is strictly greater than the latter, test only @@ -9,7 +9,7 @@ set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") set(GNU46_C11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L") set(_cmake_feature_test_c_static_assert "${GNU46_C11}") # Since 4.4 at least: -set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") +set(GNU44_C99 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L") set(_cmake_feature_test_c_restrict "${GNU44_C99}") set(_cmake_feature_test_c_variadic_macros "${GNU44_C99}") diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index d5e747d..3036057 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -1,7 +1,7 @@ include(Compiler/GNU) __compiler_gnu(C) -if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") @@ -12,7 +12,7 @@ endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") -elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) +elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x") endif() @@ -29,7 +29,7 @@ macro(cmake_record_c_compile_features) endmacro() set(_result 0) - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index c265e73..5fc3deb 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -2,7 +2,7 @@ # Reference: http://gcc.gnu.org/projects/cxx0x.html # http://gcc.gnu.org/projects/cxx1y.html -set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406") +set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404") set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L") set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}") @@ -67,14 +67,12 @@ set(_cmake_feature_test_cxx_noexcept "${GNU46_CXX11}") set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}") set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}") -# TODO: Should be supported by GNU 4.5 -set(GNU45_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU45_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}") set(_cmake_feature_test_cxx_lambdas "${GNU45_CXX11}") set(_cmake_feature_test_cxx_local_type_template_args "${GNU45_CXX11}") set(_cmake_feature_test_cxx_raw_string_literals "${GNU45_CXX11}") -# TODO: Should be supported by GNU 4.4 -set(GNU44_CXX11 "${_cmake_oldestSupported} && ${GNU_CXX0X_DEFINED}") +set(GNU44_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && ${GNU_CXX0X_DEFINED}") set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}") set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}") set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index eeada86..c471daf 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -11,7 +11,7 @@ else() endif() endif() -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) # Supported since 4.3 set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98") @@ -20,7 +20,7 @@ endif() if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") -elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) +elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) # 4.3 supports 0x variants set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x") @@ -45,7 +45,7 @@ macro(cmake_record_cxx_compile_features) if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() - if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2a5ca650c9f973c83fe3d5b070f6313e1bd536c1 commit 2a5ca650c9f973c83fe3d5b070f6313e1bd536c1 Author: Stephen Kelly AuthorDate: Sun Jan 18 14:59:40 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 15:01:14 2015 +0100 Features: Wrap failure-test in UNIX condition. The use of GNU on non-UNIX for 'compile features' is not tested and is not well defined. diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 401de95..5849417 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -25,12 +25,14 @@ if (NOT CMAKE_CXX_COMPILE_FEATURES AND NOT CMAKE_C_COMPILE_FEATURES) ) add_executable(WriteCompilerDetectionHeader "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp") - include(CheckCXXSourceCompiles) - check_cxx_source_compiles("#include \"${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h\"\nint main() { return 0; }\n" - file_include_works - ) - if (file_include_works) - message(SEND_ERROR "Inclusion of ${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h was expected to cause an error, but did not.") + if(UNIX OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + include(CheckCXXSourceCompiles) + check_cxx_source_compiles("#include \"${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h\"\nint main() { return 0; }\n" + file_include_works + ) + if (file_include_works) + message(SEND_ERROR "Inclusion of ${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h was expected to cause an error, but did not.") + endif() endif() return() endif() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 18 09:29:26 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 18 Jan 2015 09:29:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2123-gbc08c11 Message-ID: <20150118142926.6DFF4A9F99@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via bc08c11db52548e4ccac239d3204b83256f3fba2 (commit) via b54225732f6b46c8f2ab0b2dd76ffa04d173b2f0 (commit) via 92a37f92791f801d378b49fd86f097391facd02e (commit) via aac44e71e6a6c2630f1c1e61b34cf91aa775dc02 (commit) from a9a2dbf8dbdc3935ceab3ef560d4185503c98ead (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bc08c11db52548e4ccac239d3204b83256f3fba2 commit bc08c11db52548e4ccac239d3204b83256f3fba2 Merge: a9a2dbf b542257 Author: Stephen Kelly AuthorDate: Sun Jan 18 09:29:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 18 09:29:25 2015 -0500 Merge topic 'use-member-insert' into next b5422573 cmListCommand: Replace loop with member algorithm. 92a37f92 Convert raw loops to set member insert. aac44e71 Convert raw loops to vector member insert. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b54225732f6b46c8f2ab0b2dd76ffa04d173b2f0 commit b54225732f6b46c8f2ab0b2dd76ffa04d173b2f0 Author: Stephen Kelly AuthorDate: Thu Jan 15 02:59:09 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 15:15:17 2015 +0100 cmListCommand: Replace loop with member algorithm. diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index c3f0f57..5a0eee3 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -345,13 +345,9 @@ bool cmListCommand::HandleInsertCommand(std::vector const& args) 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()); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=92a37f92791f801d378b49fd86f097391facd02e commit 92a37f92791f801d378b49fd86f097391facd02e Author: Stephen Kelly AuthorDate: Thu Jan 15 03:09:43 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 15:14:47 2015 +0100 Convert raw loops to set member insert. 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::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/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 427e29d..4f6e0c3 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -110,10 +110,7 @@ bool cmLoadCacheCommand::ReadWithPrefix(std::vector 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()); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aac44e71e6a6c2630f1c1e61b34cf91aa775dc02 commit aac44e71e6a6c2630f1c1e61b34cf91aa775dc02 Author: Stephen Kelly AuthorDate: Wed Jan 14 21:26:44 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 15:14:36 2015 +0100 Convert raw loops to vector member insert. 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/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index ebaee37..46279fa 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::const_iterator i = outputs.begin(); - i != outputs.end(); ++i) - { - this->LocalHelp.push_back(*i); - } + this->LocalHelp.insert(this->LocalHelp.end(), + outputs.begin(), outputs.end()); } } ----------------------------------------------------------------------- Summary of changes: Source/cmComputeLinkDepends.cxx | 7 ++----- Source/cmGeneratorExpression.cxx | 8 ++------ Source/cmListCommand.cxx | 10 +++------- Source/cmLoadCacheCommand.cxx | 5 +---- Source/cmLocalUnixMakefileGenerator3.cxx | 7 ++----- 5 files changed, 10 insertions(+), 27 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 18 11:25:57 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 18 Jan 2015 11:25:57 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2125-gc8dbde2 Message-ID: <20150118162557.614C6AA014@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c8dbde2a28d518a59867d116ebf93ed4a8704a1e (commit) via aec4a3fa6c2185a166377a27f08aa6a7aea8f13a (commit) from bc08c11db52548e4ccac239d3204b83256f3fba2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c8dbde2a28d518a59867d116ebf93ed4a8704a1e commit c8dbde2a28d518a59867d116ebf93ed4a8704a1e Merge: bc08c11 aec4a3f Author: Brad King AuthorDate: Sun Jan 18 11:25:56 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 18 11:25:56 2015 -0500 Merge topic 'xcode-target-sort' into next aec4a3fa Revert "cmGlobalXCodeGenerator: sort targets" http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aec4a3fa6c2185a166377a27f08aa6a7aea8f13a commit aec4a3fa6c2185a166377a27f08aa6a7aea8f13a Author: Brad King AuthorDate: Sun Jan 18 11:19:55 2015 -0500 Commit: Brad King CommitDate: Sun Jan 18 11:19:55 2015 -0500 Revert "cmGlobalXCodeGenerator: sort targets" This reverts commit a7cb6054223c6717c1c49378bd7446e12a5000b5. This somehow causes the RunCMake.TargetSources test to crash and will need further investigation. diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 0899614..13e6988 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -966,23 +966,6 @@ struct cmSourceFilePathCompare }; //---------------------------------------------------------------------------- -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; - } -}; - -//---------------------------------------------------------------------------- void cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, std::vector& @@ -990,16 +973,9 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, { this->SetCurrentLocalGenerator(gen); cmTargets &tgts = this->CurrentMakefile->GetTargets(); - typedef std::map cmSortedTargets; - cmSortedTargets sortedTargets; for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++) { - sortedTargets[l->first] = &l->second; - } - for(cmSortedTargets::iterator l = sortedTargets.begin(); - l != sortedTargets.end(); l++) - { - cmTarget& cmtarget = *l->second; + cmTarget& cmtarget = l->second; cmGeneratorTarget* gtgt = this->GetGeneratorTarget(&cmtarget); // make sure ALL_BUILD, INSTALL, etc are only done once ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalXCodeGenerator.cxx | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Sun Jan 18 12:24:33 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sun, 18 Jan 2015 12:24:33 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2128-geaaf5aa Message-ID: <20150118172433.23C71A9F64@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via eaaf5aab1a9c286a3d7470880e0c1590fd6bb9a7 (commit) via fa889c4d2f49ed4b3edc8e7820b4d9bbfeeeb2a3 (commit) via 8211010c3f0d262cd7d300856f34a3af01f766b3 (commit) from c8dbde2a28d518a59867d116ebf93ed4a8704a1e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eaaf5aab1a9c286a3d7470880e0c1590fd6bb9a7 commit eaaf5aab1a9c286a3d7470880e0c1590fd6bb9a7 Merge: c8dbde2 fa889c4 Author: Stephen Kelly AuthorDate: Sun Jan 18 12:24:32 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 18 12:24:32 2015 -0500 Merge topic 'use-member-insert' into next fa889c4d cmakemain: Initialize vector content with iterators directly. 8211010c cmakemain: Use member insert in command line handling code. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fa889c4d2f49ed4b3edc8e7820b4d9bbfeeeb2a3 commit fa889c4d2f49ed4b3edc8e7820b4d9bbfeeeb2a3 Author: Stephen Kelly AuthorDate: Sun Jan 18 18:18:54 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 18:24:04 2015 +0100 cmakemain: Initialize vector content with iterators directly. diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 83ba72f..9e84e68 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -219,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 args; - for(int i =0; i < ac; ++i) - { - args.push_back(av[i]); - } + std::vector args(av, av + ac); hcm.SetCacheArgs(args); std::vector generators; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8211010c3f0d262cd7d300856f34a3af01f766b3 commit 8211010c3f0d262cd7d300856f34a3af01f766b3 Author: Stephen Kelly AuthorDate: Sun Jan 18 18:05:28 2015 +0100 Commit: Stephen Kelly CommitDate: Sun Jan 18 18:18:43 2015 +0100 cmakemain: Use member insert in command line handling code. diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 61b175e..83ba72f 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 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); } ----------------------------------------------------------------------- Summary of changes: Source/cmakemain.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jan 19 00:01:12 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 19 Jan 2015 00:01:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-844-g6164f7c Message-ID: <20150119050112.AAED0AA437@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 6164f7cef637a226fe1c08cc0cce428a8931ccb1 (commit) from f3e92d281682ee482b1425675b9fccd372cd01f3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6164f7cef637a226fe1c08cc0cce428a8931ccb1 commit 6164f7cef637a226fe1c08cc0cce428a8931ccb1 Author: Kitware Robot AuthorDate: Mon Jan 19 00:01:10 2015 -0500 Commit: Kitware Robot CommitDate: Mon Jan 19 00:01:10 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 4a4ef50..daae107 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 20150118) +set(CMake_VERSION_PATCH 20150119) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 08:40:26 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 08:40:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2131-g7cf7cc6 Message-ID: <20150119134026.CAC672202@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7cf7cc664af24a7ca8e74dfad2d655183e0f85e3 (commit) via 9e0176e2b37b93f34718b6333edd73302b5c5350 (commit) via c0ff542c58e48ac91714d9dc44058c9cb42fb828 (commit) from eaaf5aab1a9c286a3d7470880e0c1590fd6bb9a7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7cf7cc664af24a7ca8e74dfad2d655183e0f85e3 commit 7cf7cc664af24a7ca8e74dfad2d655183e0f85e3 Merge: eaaf5aa 9e0176e Author: Brad King AuthorDate: Mon Jan 19 08:40:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 08:40:25 2015 -0500 Merge topic 'xcode-target-sort' into next 9e0176e2 Xcode: Sort targets deterministically and with ALL_BUILD first (#15346) c0ff542c Xcode: Fix early termination on per-config source file error http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e0176e2b37b93f34718b6333edd73302b5c5350 commit 9e0176e2b37b93f34718b6333edd73302b5c5350 Author: Ben Boeckel AuthorDate: Fri Jan 16 17:37:26 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 08:36:45 2015 -0500 Xcode: Sort targets deterministically and with ALL_BUILD first (#15346) The default target in XCode is the first one in the file. In commit v3.1.0-rc1~286^2 (cmTarget: use a hash_map for cmTargets typedef, 2014-06-10) the order of the targets stored in cmMakefile was made non-deterministic instead of lexicographic. Teach the Xcode generator to do its own sorting to restore a predictable order. While at it, place ALL_BUILD first (as is done in VS IDE generators) explicitly in the comparison function so that it is the default target even if other targets sort earlier lexicographically (e.g. "AAA"). diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 09d5c79..637e60d 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -966,6 +966,23 @@ struct cmSourceFilePathCompare }; //---------------------------------------------------------------------------- +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& @@ -973,9 +990,16 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, { this->SetCurrentLocalGenerator(gen); cmTargets &tgts = this->CurrentMakefile->GetTargets(); + typedef std::map 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 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c0ff542c58e48ac91714d9dc44058c9cb42fb828 commit c0ff542c58e48ac91714d9dc44058c9cb42fb828 Author: Brad King AuthorDate: Mon Jan 19 08:27:15 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 08:34:32 2015 -0500 Xcode: Fix early termination on per-config source file error In commit v3.1.0-rc1~687^2~4 (cmTarget: Make the source files depend on the config, 2014-02-13) an early termination case was added to the Xcode generator. Fix handling of this case to actually abort all the generation steps. Otherwise some of the later steps are attempted without the preconditions normally established by earlier steps, possibly leading to a crash. diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 13e6988..09d5c79 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -966,7 +966,7 @@ struct cmSourceFilePathCompare }; //---------------------------------------------------------------------------- -void +bool cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, std::vector& targets) @@ -992,7 +992,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; } @@ -1000,7 +1005,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, std::vector classes; if (!cmtarget.GetConfigCommonSourceFiles(classes)) { - return; + return false; } std::sort(classes.begin(), classes.end(), cmSourceFilePathCompare()); @@ -1227,6 +1232,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, targets.push_back(this->CreateXCodeTarget(cmtarget, buildPhases)); } + return true; } //---------------------------------------------------------------------------- @@ -2940,7 +2946,7 @@ void cmGlobalXCodeGenerator } //---------------------------------------------------------------------------- -void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, +bool cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, std::vector& generators) { @@ -2983,7 +2989,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, std::vector classes; if (!cmtarget.GetConfigCommonSourceFiles(classes)) { - return; + return false; } // Put cmSourceFile instances in proper groups: for(std::vector::const_iterator s = classes.begin(); @@ -3016,6 +3022,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, } } } + return true; } cmXCodeObject *cmGlobalXCodeGenerator @@ -3136,7 +3143,7 @@ cmXCodeObject* cmGlobalXCodeGenerator } //---------------------------------------------------------------------------- -void cmGlobalXCodeGenerator +bool cmGlobalXCodeGenerator ::CreateXCodeObjects(cmLocalGenerator* root, std::vector& generators) @@ -3217,7 +3224,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")); @@ -3417,7 +3427,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 @@ -3446,6 +3459,7 @@ void cmGlobalXCodeGenerator } } this->RootObject->AddAttribute("targets", allTargets); + return true; } //---------------------------------------------------------------------------- @@ -3632,8 +3646,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 9d7b784..8d7cfaf 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& generators); std::string XCodeEscapePath(const char* p); @@ -151,7 +151,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& generators); void OutputXCodeProject(cmLocalGenerator* root, std::vector& generators); @@ -170,7 +170,7 @@ private: cmXCodeObject* CreateXCodeSourceFile(cmLocalGenerator* gen, cmSourceFile* sf, cmTarget& cmtarget); - void CreateXCodeTargets(cmLocalGenerator* gen, + bool CreateXCodeTargets(cmLocalGenerator* gen, std::vector&); bool IsHeaderFile(cmSourceFile*); void AddDependTarget(cmXCodeObject* target, ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalXCodeGenerator.cxx | 62 ++++++++++++++++++++++++++++++------- Source/cmGlobalXCodeGenerator.h | 6 ++-- 2 files changed, 54 insertions(+), 14 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:04:48 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:04:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2133-ged79818 Message-ID: <20150119140448.82E4BAA968@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ed798181b088d99d1e6dd4c29b756af6d6d34b22 (commit) via ba7b2ef617445a14352f87c9eff9864b2d34a667 (commit) from 7cf7cc664af24a7ca8e74dfad2d655183e0f85e3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed798181b088d99d1e6dd4c29b756af6d6d34b22 commit ed798181b088d99d1e6dd4c29b756af6d6d34b22 Merge: 7cf7cc6 ba7b2ef Author: Brad King AuthorDate: Mon Jan 19 09:04:47 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:04:47 2015 -0500 Merge topic 'rpm_multi_prefix' into next ba7b2ef6 Revert "multiple path relocation prefixes" http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ba7b2ef617445a14352f87c9eff9864b2d34a667 commit ba7b2ef617445a14352f87c9eff9864b2d34a667 Author: Brad King AuthorDate: Mon Jan 19 09:04:28 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 09:04:28 2015 -0500 Revert "multiple path relocation prefixes" This reverts commit c908ba3707fcf8cf43df0c5cd90f8ea6d98d7c29. This functionality will be revised and resubmitted. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 5328b8c..d2cb2ee 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -379,39 +379,6 @@ # # May be used to add more exclude path (directories or files) from the initial # default list of excluded paths. See CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST. -# -# .. variable:: CPACK_PACKAGING_INSTALL_FULL_ -# -# * Mandatory : NO -# * Default : - -# -# May be used to specify more than one relocation path per relocatable RPM. -# Variables are not component based as they can be used to set a different -# path prefix for e.g. binary dir and documentation dir at the same time. -# Only prefixes that are required by a certain component are added to that -# component - component must contain at least one file/directory/symbolic link -# with CPACK_PACKAGING_INSTALL_FULL_ prefix for a certain relocation path -# to be added. Package will not contain any relocation paths if there are no -# files/directories/symbolic links on any of the provided prefix locations. -# Packages that either do not contain any relocation paths or contain -# files/directories/symbolic links that are outside relocation paths print -# out an AUTHOR_WARNING that RPM will be partially relocatable. -# Variables can be set automatically by including GNUInstallDirs module and -# using corresponding CMAKE_INSTALL_* variables from the same module -# in install() command DESTINATION paths. -# For a list of values see :module:`GNUInstallDirs` module. -# -# .. variable:: CPACK_RPM__PACKAGE_PREFIX -# -# * Mandatory : NO -# * Default : CPACK_PACKAGING_INSTALL_PREFIX -# -# May be used to set per component CPACK_PACKAGING_INSTALL_PREFIX for -# relocatable RPM packages. -# If CPACK_PACKAGING_INSTALL_FULL_ paths are used and -# CPACK_RPM__PACKAGE_PREFIX is set then -# CPACK_PACKAGING_INSTALL_PREFIX prefix path is replaced by -# CPACK_RPM__PACKAGE_PREFIX prefix path where found. #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -428,83 +395,6 @@ # Author: Eric Noulard with the help of Alexander Neundorf. -function(cpack_rpm_prepare_relocation_paths) - set(RPM_RELOCATION_PATH_VARS - CPACK_PACKAGING_INSTALL_FULL_BINDIR CPACK_PACKAGING_INSTALL_FULL_SBINDIR - CPACK_PACKAGING_INSTALL_FULL_LIBEXECDIR CPACK_PACKAGING_INSTALL_FULL_SYSCONFDIR - CPACK_PACKAGING_INSTALL_FULL_SHAREDSTATEDIR CPACK_PACKAGING_INSTALL_FULL_LOCALSTATEDIR - CPACK_PACKAGING_INSTALL_FULL_LIBDIR CPACK_PACKAGING_INSTALL_FULL_INCLUDEDIR - CPACK_PACKAGING_INSTALL_FULL_OLDINCLUDEDIR CPACK_PACKAGING_INSTALL_FULL_DATAROOTDIR - CPACK_PACKAGING_INSTALL_FULL_DATADIR CPACK_PACKAGING_INSTALL_FULL_INFODIR - CPACK_PACKAGING_INSTALL_FULL_LOCALEDIR CPACK_PACKAGING_INSTALL_FULL_MANDIR - CPACK_PACKAGING_INSTALL_FULL_DOCDIR) - file(TO_CMAKE_PATH "${CPACK_PACKAGING_INSTALL_PREFIX}" RPM_PACKAGE_PREFIX_PART) - - if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX) - # remove possible trailing slash and convert backslashes to slashes - file(TO_CMAKE_PATH "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX}" RPM_COMPONENT_PREFIX_) - string(LENGTH "${RPM_PACKAGE_PREFIX_PART}" RPM_PACKAGE_PREFIX_PART_LEN) - set(RPM_PACKAGE_PREFIXES "${RPM_COMPONENT_PREFIX_}") - - foreach(RELOCATE_PATH_VAR ${RPM_RELOCATION_PATH_VARS}) - if(${RELOCATE_PATH_VAR}) - # check if path is a subpath of CPACK_PACKAGING_INSTALL_PREFIX - file(RELATIVE_PATH REL_PATH_ "${RPM_PACKAGE_PREFIX_PART}" "${${RELOCATE_PATH_VAR}}") - string(SUBSTRING "${REL_PATH_}" 0 2 PREFIX_) - - if("${PREFIX_}" STREQUAL "..") # not a subpath - leave it as is - file(TO_CMAKE_PATH "${${RELOCATE_PATH_VAR}}" RELOCATE_PATH) - list(APPEND RPM_PACKAGE_PREFIXES "${RELOCATE_PATH}") - else() # a subpath - it should be replaced with component path - list(APPEND RPM_PACKAGE_PREFIXES "${RPM_COMPONENT_PREFIX_}/${REL_PATH_}") - endif() - endif() - endforeach() - else() - set(RPM_PACKAGE_PREFIXES "${RPM_PACKAGE_PREFIX_PART}") - foreach(RELOCATE_PATH_VAR ${RPM_RELOCATION_PATH_VARS}) - if(${RELOCATE_PATH_VAR}) - file(TO_CMAKE_PATH "${${RELOCATE_PATH_VAR}}" RELOCATE_PATH) - list(APPEND RPM_PACKAGE_PREFIXES "${RELOCATE_PATH}") - endif() - endforeach() - endif() - - list(REMOVE_DUPLICATES RPM_PACKAGE_PREFIXES) - - # remove all the paths that are not used - foreach(RELOCATION_PATH ${RPM_PACKAGE_PREFIXES}) - if(EXISTS "${WDIR}/${RELOCATION_PATH}") - set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}Prefix: ${RELOCATION_PATH}\n") - list(APPEND RPM_USED_PACKAGE_PREFIXES "${RELOCATION_PATH}") - endif() - endforeach() - - # warn about all the paths that are not relocatable - file(GLOB_RECURSE FILE_PATHS_ "${WDIR}/*") - foreach(TMP_PATH ${FILE_PATHS_}) - string(LENGTH "${WDIR}" WDIR_LEN) - string(SUBSTRING "${TMP_PATH}" ${WDIR_LEN} -1 TMP_PATH) - unset(TMP_PATH_FOUND_) - - foreach(RELOCATION_PATH ${RPM_USED_PACKAGE_PREFIXES}) - file(RELATIVE_PATH REL_PATH_ "${RELOCATION_PATH}" "${TMP_PATH}") - string(SUBSTRING "${REL_PATH_}" 0 2 PREFIX_) - - if(NOT "${PREFIX_}" STREQUAL "..") - set(TPM_PATH_FOUND_ TRUE) - break() - endif() - endforeach() - - if(NOT TPM_PATH_FOUND_) - message(AUTHOR_WARNING "CPackRPM:Warning: Path ${TMP_PATH} is not on one of the relocatable paths! Package will be partially relocatable.") - endif() - endforeach() - - set(TMP_RPM_PREFIXES ${TMP_RPM_PREFIXES} PARENT_SCOPE) -endfunction() - if(CMAKE_BINARY_DIR) message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.") endif() @@ -746,16 +636,13 @@ if(CPACK_PACKAGE_RELOCATABLE) set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE) endif() if(CPACK_RPM_PACKAGE_RELOCATABLE) - unset(TMP_RPM_PREFIXES) - if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: Trying to build a relocatable package") endif() if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.") else() - set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) # kept for back compatibility (provided external RPM spec files) - cpack_rpm_prepare_relocation_paths() + set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) endif() endif() @@ -969,21 +856,15 @@ if(CPACK_RPM_PACKAGE_RELOCATABLE) # get a list of the elements in CPACK_RPM_PACKAGE_PREFIX and remove # the final element (so the install-prefix dir itself is not omitted # from the RPM's content-list) - foreach(CPACK_RPM_PACKAGE_PREFIX ${RPM_PACKAGE_PREFIXES}) - string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${CPACK_RPM_PACKAGE_PREFIX}") - list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1) - unset(_TMP_LIST) - # Now generate all of the parent dirs of CPACK_RPM_PACKAGE_PREFIX - foreach(_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS}) - list(APPEND _TMP_LIST "${_ELEM}") - string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}") - list(FIND _RPM_DIRS_TO_OMIT "${_OMIT_DIR}" _DUPLICATE_FOUND) - if(_DUPLICATE_FOUND EQUAL -1) - set(_OMIT_DIR "-o -path ${_OMIT_DIR}") - separate_arguments(_OMIT_DIR) - list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR}) - endif() - endforeach() + string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${CPACK_RPM_PACKAGE_PREFIX}") + list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1) + # Now generate all of the parent dirs of CPACK_RPM_PACKAGE_PREFIX + foreach(_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS}) + list(APPEND _TMP_LIST "${_ELEM}") + string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}") + set(_OMIT_DIR "-o -path ${_OMIT_DIR}") + separate_arguments(_OMIT_DIR) + list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR}) endforeach() endif() @@ -1220,7 +1101,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_AUTOREQ\@ \@TMP_RPM_AUTOREQPROV\@ \@TMP_RPM_BUILDARCH\@ -\@TMP_RPM_PREFIXES\@ +\@TMP_RPM_PREFIX\@ %define _rpmdir \@CPACK_RPM_DIRECTORY\@ %define _rpmfilename \@CPACK_RPM_FILE_NAME\@ diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake index 37c781b..c61e7e9 100644 --- a/Modules/GNUInstallDirs.cmake +++ b/Modules/GNUInstallDirs.cmake @@ -14,9 +14,6 @@ # destination for files of a given type # ``CMAKE_INSTALL_FULL_`` # corresponding absolute path -# ``CPACK_PACKAGING_INSTALL_FULL_`` -# CMAKE_INSTALL_ prepended (if path is relateive) by -# CPACK_PACKAGING_INSTALL_PREFIX for use in CPack (relocatable RPM) # # where is one of: # @@ -279,9 +276,7 @@ foreach(dir ) if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}}) set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") - set(CPACK_PACKAGING_INSTALL_FULL_${dir} "${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") else() set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") - set(CPACK_PACKAGING_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") endif() endforeach() diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in index 6d6b619..8c01b32 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -6,19 +6,15 @@ if(CPACK_GENERATOR MATCHES "ZIP") endif() if(CPACK_GENERATOR MATCHES "RPM") - # set gnu install prefixes - set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") - include(GNUInstallDirs) + set(CPACK_RPM_COMPONENT_INSTALL "ON") + set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") + # test package summary override + set(CPACK_RPM_PACKAGE_SUMMARY "default summary") + set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") - # test package summary override - set(CPACK_RPM_PACKAGE_SUMMARY "default summary") - set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") - - # test package description override - set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") + # test package description override + set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") endif() if(CPACK_GENERATOR MATCHES "DEB") diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index d856c44..4d56218 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -140,10 +140,6 @@ if(CPackGen MATCHES "RPM") "C/C\\+\\+ header files for use with MyLib") if(${CPackComponentWay} STREQUAL "IgnoreGroup") - # set gnu install prefixes to what they are set during rpm creation - set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") - include(GNUInstallDirs) - foreach(check_file ${expected_file}) string(REGEX MATCH ".*libraries.*" check_file_libraries_match ${check_file}) string(REGEX MATCH ".*headers.*" check_file_headers_match ${check_file}) @@ -158,19 +154,15 @@ if(CPackGen MATCHES "RPM") if(check_file_libraries_match) set(check_file_match_expected_summary ".*${CPACK_RPM_libraries_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_RPM_libraries_PACKAGE_DESCRIPTION}.*") - set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_FULL_LIBDIR}") elseif(check_file_headers_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_HEADERS_DESCRIPTION}.*") - set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_FULL_INCLUDEDIR}") elseif(check_file_applications_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_APPLICATIONS_DESCRIPTION}.*") - set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_FULL_BINDIR}") elseif(check_file_Unspecified_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*DESCRIPTION.*") - set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_FULL_BINDIR}") else() message(FATAL_ERROR "error: unexpected rpm package '${check_file}'") endif() @@ -178,19 +170,13 @@ if(CPackGen MATCHES "RPM") string(REGEX MATCH ${check_file_match_expected_summary} check_file_match_summary ${check_file_content}) if(NOT check_file_match_summary) - message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'") + message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'") endif() string(REGEX MATCH ${check_file_match_expected_description} check_file_match_description ${check_file_content}) if(NOT check_file_match_description) - message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'") - endif() - - string(REGEX MATCH ${check_file_match_expected_relocation_path} check_file_match_relocation_path ${check_file_content}) - - if(NOT check_file_match_relocation_path) - message(FATAL_ERROR "error: '${check_file}' rpm package relocation path does not match expected value - regex '${check_file_match_expected_relocation_path}'") + message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'") endif() endforeach() elseif(${CPackComponentWay} STREQUAL "IgnoreGroup") ----------------------------------------------------------------------- Summary of changes: Modules/CPackRPM.cmake | 141 ++------------------ Modules/GNUInstallDirs.cmake | 5 - .../MyLibCPackConfig-IgnoreGroup.cmake.in | 18 +-- .../RunCPackVerifyResult.cmake | 18 +-- 4 files changed, 20 insertions(+), 162 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:28:10 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:28:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2135-ga63d44a Message-ID: <20150119142810.9255DA9FE8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a63d44a18e1b3090f7f6c50d4fbca8fdc779a7cd (commit) via ca80598ecaff14414193fd65268f80e1eddb9fa0 (commit) from ed798181b088d99d1e6dd4c29b756af6d6d34b22 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a63d44a18e1b3090f7f6c50d4fbca8fdc779a7cd commit a63d44a18e1b3090f7f6c50d4fbca8fdc779a7cd Merge: ed79818 ca80598 Author: Brad King AuthorDate: Mon Jan 19 09:28:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:28:09 2015 -0500 Merge topic 'emacs-mode-fix-word-at-point' into next ca80598e cmake-mode.el: Fix extracting keyword at point in cmake-help http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca80598ecaff14414193fd65268f80e1eddb9fa0 commit ca80598ecaff14414193fd65268f80e1eddb9fa0 Author: Peter Vasil AuthorDate: Sun Jan 18 01:27:28 2015 +0100 Commit: Brad King CommitDate: Mon Jan 19 09:14:10 2015 -0500 cmake-mode.el: Fix extracting keyword at point in cmake-help Since commit v3.1.0-rc2~1^2~1 (cmake-mode.el: syntax of '_' should be treated as symbol, 2014-11-12) the 'word-at-point' function does not extract the whole keyword anymore if it contains an '_', because 'forward-word' stops at '_'. Use 'symbol-at-point' to extract a whole keyword even if there is an '_'. diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index f1470f3..37ca942 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -320,9 +320,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 +369,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")) ----------------------------------------------------------------------- Summary of changes: Auxiliary/cmake-mode.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:34:17 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:34:17 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2137-gf1dfe06 Message-ID: <20150119143417.56AB9AA1A6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f1dfe06fe4997b16024e33d541f23bb06b4734e8 (commit) via 0aebeb9c84086b19c56a3ced5c95c60063ab37e2 (commit) from a63d44a18e1b3090f7f6c50d4fbca8fdc779a7cd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f1dfe06fe4997b16024e33d541f23bb06b4734e8 commit f1dfe06fe4997b16024e33d541f23bb06b4734e8 Merge: a63d44a 0aebeb9 Author: Brad King AuthorDate: Mon Jan 19 09:34:16 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:34:16 2015 -0500 Merge topic 'add-FindJsonCpp' into next 0aebeb9c FindJsonCpp: Add module to find JsonCpp package http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0aebeb9c84086b19c56a3ced5c95c60063ab37e2 commit 0aebeb9c84086b19c56a3ced5c95c60063ab37e2 Author: Brad King AuthorDate: Fri Jan 16 14:11:38 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 09:34:03 2015 -0500 FindJsonCpp: Add module to find JsonCpp package 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/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/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 ` 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/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/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 $ + --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 $ + ) 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 + +int main() +{ + int zero = 0; + Json::Value value(zero); + return value.asInt(); +} ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:43:10 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:43:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-846-g373199b Message-ID: <20150119144310.33C5B4983@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 373199b1c922c6897e007fc1c8fa684aa1a8f707 (commit) via 6e6e0c4048b1500edfc8c27a0fc567997b494a56 (commit) from 6164f7cef637a226fe1c08cc0cce428a8931ccb1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=373199b1c922c6897e007fc1c8fa684aa1a8f707 commit 373199b1c922c6897e007fc1c8fa684aa1a8f707 Merge: 6164f7c 6e6e0c4 Author: Brad King AuthorDate: Mon Jan 19 09:43:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:43:09 2015 -0500 Merge topic 'eclipse-fix-cxx-natures' 6e6e0c40 Eclipse: Add org.eclipse.cdt.core.cnature to CXX projects (#15068) ----------------------------------------------------------------------- Summary of changes: Source/cmExtraEclipseCDT4Generator.cxx | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:43:14 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:43:14 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-848-g5803ae3 Message-ID: <20150119144314.AD9EF4984@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 5803ae3e88e922c06ce835eb7bdcb5c584420453 (commit) via 0aebeb9c84086b19c56a3ced5c95c60063ab37e2 (commit) from 373199b1c922c6897e007fc1c8fa684aa1a8f707 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5803ae3e88e922c06ce835eb7bdcb5c584420453 commit 5803ae3e88e922c06ce835eb7bdcb5c584420453 Merge: 373199b 0aebeb9 Author: Brad King AuthorDate: Mon Jan 19 09:43:12 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:43:12 2015 -0500 Merge topic 'add-FindJsonCpp' 0aebeb9c FindJsonCpp: Add module to find JsonCpp package ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-modules.7.rst | 1 + Help/module/FindJsonCpp.rst | 1 + Help/release/dev/add-FindJsonCpp.rst | 5 ++ Modules/FindJsonCpp.cmake | 117 +++++++++++++++++++++++++++++++++ Tests/CMakeLists.txt | 3 + Tests/FindJsonCpp/CMakeLists.txt | 10 +++ Tests/FindJsonCpp/Test/CMakeLists.txt | 14 ++++ Tests/FindJsonCpp/Test/main.cxx | 8 +++ 8 files changed, 159 insertions(+) create mode 100644 Help/module/FindJsonCpp.rst create mode 100644 Help/release/dev/add-FindJsonCpp.rst create mode 100644 Modules/FindJsonCpp.cmake create mode 100644 Tests/FindJsonCpp/CMakeLists.txt create mode 100644 Tests/FindJsonCpp/Test/CMakeLists.txt create mode 100644 Tests/FindJsonCpp/Test/main.cxx hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:43:16 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:43:16 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-850-ge320640 Message-ID: <20150119144316.C8A314991@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e320640bcf2323e54add8a7c920b406c4a652816 (commit) via ca80598ecaff14414193fd65268f80e1eddb9fa0 (commit) from 5803ae3e88e922c06ce835eb7bdcb5c584420453 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e320640bcf2323e54add8a7c920b406c4a652816 commit e320640bcf2323e54add8a7c920b406c4a652816 Merge: 5803ae3 ca80598 Author: Brad King AuthorDate: Mon Jan 19 09:43:15 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:43:15 2015 -0500 Merge topic 'emacs-mode-fix-word-at-point' ca80598e cmake-mode.el: Fix extracting keyword at point in cmake-help ----------------------------------------------------------------------- Summary of changes: Auxiliary/cmake-mode.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:43:19 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:43:19 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-852-g953272b Message-ID: <20150119144319.61703498F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 953272b725ba98358f262588d89c75bdd3429367 (commit) via 91fbcda28fff000f8ece00ba7b23cc4fa4889cef (commit) from e320640bcf2323e54add8a7c920b406c4a652816 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=953272b725ba98358f262588d89c75bdd3429367 commit 953272b725ba98358f262588d89c75bdd3429367 Merge: e320640 91fbcda Author: Brad King AuthorDate: Mon Jan 19 09:43:18 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:43:18 2015 -0500 Merge topic 'fix-cmake-org-links' 91fbcda2 Help: Update cmake.org links to avoid redirects ----------------------------------------------------------------------- Summary of changes: Auxiliary/cmake-indent.vim | 2 +- Auxiliary/cmake-syntax.vim | 2 +- Help/manual/LINKS.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:43:21 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:43:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-856-ga5be8e3 Message-ID: <20150119144321.B7BED49BB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via a5be8e3111ff0b6c656facd603c2e2d972d61671 (commit) via b937f7537943e56998f1f4630e3684ca7417442b (commit) via 6af8cbf214c7de6ef4bb036cb9f6c4bc147fd511 (commit) via 49d05a4713729d7531192ae16fc94511dac9b8ec (commit) from 953272b725ba98358f262588d89c75bdd3429367 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5be8e3111ff0b6c656facd603c2e2d972d61671 commit a5be8e3111ff0b6c656facd603c2e2d972d61671 Merge: 953272b b937f75 Author: Brad King AuthorDate: Mon Jan 19 09:43:20 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:43:20 2015 -0500 Merge topic 'FindQt-fixes' b937f753 FindQt: explicitely mention that it cannot Qt5 or later 6af8cbf2 FindQt: fix variable name in error message 49d05a47 FindQt: fix setting DESIRED_QT_VERSION if "find_package(Qt VVV)" was called ----------------------------------------------------------------------- Summary of changes: Modules/FindQt.cmake | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:43:24 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:43:24 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-858-ga1fea84 Message-ID: <20150119144324.4A2E34987@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via a1fea841a92568c0bdc35e1c8c7a400b20459a96 (commit) via e11f8d6446badeb0f1af99f567e4cd9c5c65783f (commit) from a5be8e3111ff0b6c656facd603c2e2d972d61671 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a1fea841a92568c0bdc35e1c8c7a400b20459a96 commit a1fea841a92568c0bdc35e1c8c7a400b20459a96 Merge: a5be8e3 e11f8d6 Author: Brad King AuthorDate: Mon Jan 19 09:43:22 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:43:22 2015 -0500 Merge topic 'remove-AppleClang-51-release-notes' e11f8d64 Remove AppleClang-5.1-features.rst release notes. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/AppleClang-5.1-features.rst | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 Help/release/dev/AppleClang-5.1-features.rst hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:43:26 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:43:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-861-g95d4284 Message-ID: <20150119144326.36E8F4991@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 95d42840e88599ab1959f7531668e320a7c20fdf (commit) via 681d965df18fa55a9eaa615515015ac088ea0805 (commit) via 4dc0c488f94a5f0c7ae04fd15b46a92c20fb03fa (commit) from a1fea841a92568c0bdc35e1c8c7a400b20459a96 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95d42840e88599ab1959f7531668e320a7c20fdf commit 95d42840e88599ab1959f7531668e320a7c20fdf Merge: a1fea84 681d965 Author: Brad King AuthorDate: Mon Jan 19 09:43:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:43:25 2015 -0500 Merge topic 'delete-algorithm' 681d965d Use the cmDeleteAll algorithm for types derived from std::map. 4dc0c488 cmDeleteAll: Generalize deletion specialization for map types. ----------------------------------------------------------------------- Summary of changes: Source/cmExportSetMap.cxx | 7 +------ Source/cmGlobalGenerator.cxx | 6 +----- Source/cmStandardIncludes.h | 21 +++++++++++++++++---- Source/cmTarget.cxx | 12 ++---------- 4 files changed, 21 insertions(+), 25 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:43:28 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:43:28 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-867-ga6bbbd0 Message-ID: <20150119144328.12BEC49BB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via a6bbbd0f4a9ca9d683000f3302842bc25615e57a (commit) via fa889c4d2f49ed4b3edc8e7820b4d9bbfeeeb2a3 (commit) via 8211010c3f0d262cd7d300856f34a3af01f766b3 (commit) via b54225732f6b46c8f2ab0b2dd76ffa04d173b2f0 (commit) via 92a37f92791f801d378b49fd86f097391facd02e (commit) via aac44e71e6a6c2630f1c1e61b34cf91aa775dc02 (commit) from 95d42840e88599ab1959f7531668e320a7c20fdf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6bbbd0f4a9ca9d683000f3302842bc25615e57a commit a6bbbd0f4a9ca9d683000f3302842bc25615e57a Merge: 95d4284 fa889c4 Author: Brad King AuthorDate: Mon Jan 19 09:43:27 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:43:27 2015 -0500 Merge topic 'use-member-insert' fa889c4d cmakemain: Initialize vector content with iterators directly. 8211010c cmakemain: Use member insert in command line handling code. b5422573 cmListCommand: Replace loop with member algorithm. 92a37f92 Convert raw loops to set member insert. aac44e71 Convert raw loops to vector member insert. ----------------------------------------------------------------------- Summary of changes: Source/cmComputeLinkDepends.cxx | 7 ++----- Source/cmGeneratorExpression.cxx | 8 ++------ Source/cmListCommand.cxx | 10 +++------- Source/cmLoadCacheCommand.cxx | 5 +---- Source/cmLocalUnixMakefileGenerator3.cxx | 7 ++----- Source/cmakemain.cxx | 12 +++--------- 6 files changed, 13 insertions(+), 36 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:43:30 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:43:30 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-878-g9de2ab7 Message-ID: <20150119144330.5718949C5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 9de2ab7fcefba2bc9ce7b483f1643b1d97d58e43 (commit) via 5f69314ea65ebd0de23484e7c91bd12a8bf861f6 (commit) via fd0c036c0c3e5e6be685e64caecdcbad4b3e744c (commit) via f09fde2d21ef0c97f0ed1b8c6849f0d7055bc24e (commit) via 86b5bdfa0874a0eb97d726fa9dc2f534e5a67c7e (commit) via fd7b37129360364531ddfeda7edb6e34ba773d00 (commit) via aa773035b7f4a1aefd860d0b9e80f134bd4a4547 (commit) via 64592633773004df83cdd790b9cb1838503ca854 (commit) via 607e19384f19fcf8713ccf0377e0255084ede785 (commit) via 930bd4781694ea85a876c08c34a2dd8243688920 (commit) via d92887efabad6a91e221588d0dc7a0bffd91a9f7 (commit) from a6bbbd0f4a9ca9d683000f3302842bc25615e57a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9de2ab7fcefba2bc9ce7b483f1643b1d97d58e43 commit 9de2ab7fcefba2bc9ce7b483f1643b1d97d58e43 Merge: a6bbbd0 5f69314 Author: Brad King AuthorDate: Mon Jan 19 09:43:28 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:43:28 2015 -0500 Merge topic 'consistent-empty-method' 5f69314e Replace foo.length() pattern with !foo.empty(). fd0c036c Replace 'foo.length() >= 1' pattern with !foo.empty() f09fde2d Replace 'foo.length() > 0' pattern with !foo.empty(). 86b5bdfa Replace 'foo.length() == 0' pattern with foo.empty(). fd7b3712 Replace foo.size() pattern with !foo.empty(). aa773035 Replace !foo.size() pattern with foo.empty(). 64592633 cmListCommand: Use empty() and expand whitespace. 607e1938 Replace 'foo.size() != 0' pattern with !foo.empty(). 930bd478 Replace 'foo.size() == 0' pattern with foo.empty(). d92887ef Replace 'foo.size() > 0' pattern with !foo.empty(). ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 6 ++-- Source/CPack/cmCPackLog.cxx | 10 +++--- Source/CPack/cpack.cxx | 2 +- Source/CTest/cmCTestBatchTestHandler.cxx | 2 +- Source/CTest/cmCTestBuildAndTestHandler.cxx | 24 ++++++------- Source/CTest/cmCTestBuildHandler.cxx | 10 +++--- Source/CTest/cmCTestConfigureHandler.cxx | 4 +-- Source/CTest/cmCTestCoverageHandler.cxx | 38 ++++++++++---------- Source/CTest/cmCTestLaunch.cxx | 2 +- Source/CTest/cmCTestMemCheckHandler.cxx | 14 ++++---- Source/CTest/cmCTestMultiProcessHandler.cxx | 10 +++--- Source/CTest/cmCTestP4.cxx | 4 +-- Source/CTest/cmCTestRunTest.cxx | 8 ++--- Source/CTest/cmCTestScriptHandler.cxx | 2 +- Source/CTest/cmCTestSubmitHandler.cxx | 52 +++++++++++++-------------- Source/CTest/cmCTestTestHandler.cxx | 42 +++++++++++----------- Source/CTest/cmCTestUpdateHandler.cxx | 2 +- Source/CTest/cmParseCacheCoverage.cxx | 4 +-- Source/CTest/cmParseDelphiCoverage.cxx | 6 ++-- Source/CTest/cmParseGTMCoverage.cxx | 2 +- Source/CTest/cmParseJacocoCoverage.cxx | 2 +- Source/CTest/cmProcess.cxx | 4 +-- Source/CursesDialog/cmCursesMainForm.cxx | 8 ++--- Source/cmAddSubDirectoryCommand.cxx | 2 +- Source/cmAuxSourceDirectoryCommand.cxx | 2 +- Source/cmBuildNameCommand.cxx | 2 +- Source/cmCTest.cxx | 24 ++++++------- Source/cmCacheManager.cxx | 2 +- Source/cmCommand.h | 2 +- Source/cmCoreTryCompile.cxx | 10 +++--- Source/cmCreateTestSourceList.cxx | 8 ++--- Source/cmDependsC.cxx | 4 +-- Source/cmDependsJavaParserHelper.cxx | 10 +++--- Source/cmDocumentation.cxx | 4 +-- Source/cmDocumentationFormatter.cxx | 6 ++-- Source/cmExecProgramCommand.cxx | 12 +++---- Source/cmExecuteProcessCommand.cxx | 4 +-- Source/cmExtraEclipseCDT4Generator.cxx | 2 +- Source/cmExtraKateGenerator.cxx | 2 +- Source/cmFileCommand.cxx | 30 ++++++++-------- Source/cmFindBase.cxx | 4 +-- Source/cmFindPackageCommand.cxx | 4 +-- Source/cmFindPathCommand.cxx | 6 ++-- Source/cmFunctionCommand.cxx | 4 +-- Source/cmGeneratorExpressionEvaluator.cxx | 6 ++-- Source/cmGeneratorExpressionParser.cxx | 6 ++-- Source/cmGetCMakePropertyCommand.cxx | 2 +- Source/cmGetFilenameComponentCommand.cxx | 4 +-- Source/cmGlobalGenerator.cxx | 20 +++++------ Source/cmGlobalKdevelopGenerator.cxx | 2 +- Source/cmGlobalUnixMakefileGenerator3.cxx | 4 +-- Source/cmGraphVizWriter.cxx | 2 +- Source/cmIfCommand.cxx | 6 ++-- Source/cmIncludeCommand.cxx | 6 ++-- Source/cmIncludeDirectoryCommand.cxx | 2 +- Source/cmInstallFilesCommand.cxx | 2 +- Source/cmInstallTargetGenerator.cxx | 2 +- Source/cmListCommand.cxx | 10 +++--- Source/cmLoadCacheCommand.cxx | 4 +-- Source/cmLocalGenerator.cxx | 18 +++++----- Source/cmLocalUnixMakefileGenerator3.cxx | 6 ++-- Source/cmMacroCommand.cxx | 6 ++-- Source/cmMakeDepend.cxx | 6 ++-- Source/cmMakefile.cxx | 12 +++---- Source/cmRemoveCommand.cxx | 2 +- Source/cmSetCommand.cxx | 2 +- Source/cmSetTargetPropertiesCommand.cxx | 2 +- Source/cmSetTestsPropertiesCommand.cxx | 2 +- Source/cmSiteNameCommand.cxx | 4 +-- Source/cmStringCommand.cxx | 4 +-- Source/cmSystemTools.cxx | 2 +- Source/cmTarget.cxx | 4 +-- Source/cmTryRunCommand.cxx | 18 +++++----- Source/cmUseMangledMesaCommand.cxx | 2 +- Source/cmUtilitySourceCommand.cxx | 2 +- Source/cmUuid.cxx | 2 +- Source/cmWhileCommand.cxx | 4 +-- Source/cmake.cxx | 36 +++++++++---------- Source/cmakemain.cxx | 2 +- Source/cmcmd.cxx | 2 +- Source/ctest.cxx | 2 +- 81 files changed, 310 insertions(+), 310 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:45:56 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:45:56 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2148-g50c85f8 Message-ID: <20150119144556.5AF1BAA19A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 50c85f8df978c864170024492e19ec68b73e631b (commit) via 9de2ab7fcefba2bc9ce7b483f1643b1d97d58e43 (commit) via a6bbbd0f4a9ca9d683000f3302842bc25615e57a (commit) via 95d42840e88599ab1959f7531668e320a7c20fdf (commit) via a1fea841a92568c0bdc35e1c8c7a400b20459a96 (commit) via a5be8e3111ff0b6c656facd603c2e2d972d61671 (commit) via 953272b725ba98358f262588d89c75bdd3429367 (commit) via e320640bcf2323e54add8a7c920b406c4a652816 (commit) via 5803ae3e88e922c06ce835eb7bdcb5c584420453 (commit) via 373199b1c922c6897e007fc1c8fa684aa1a8f707 (commit) via 6164f7cef637a226fe1c08cc0cce428a8931ccb1 (commit) from f1dfe06fe4997b16024e33d541f23bb06b4734e8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=50c85f8df978c864170024492e19ec68b73e631b commit 50c85f8df978c864170024492e19ec68b73e631b Merge: f1dfe06 9de2ab7 Author: Brad King AuthorDate: Mon Jan 19 09:45:46 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 09:45:46 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:47:17 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:47:17 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2150-gd703c9b Message-ID: <20150119144717.BC834AA1EE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d703c9bdd288935967fb424535355b1c2cb2024e (commit) via 98216ea8037650a284adcf4f7c314077ac3346a4 (commit) from 50c85f8df978c864170024492e19ec68b73e631b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d703c9bdd288935967fb424535355b1c2cb2024e commit d703c9bdd288935967fb424535355b1c2cb2024e Merge: 50c85f8 98216ea Author: Brad King AuthorDate: Mon Jan 19 09:47:16 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:47:16 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 98216ea8 cmake: Generate an internal 'Labels.json' file next to 'Labels.txt' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98216ea8037650a284adcf4f7c314077ac3346a4 commit 98216ea8037650a284adcf4f7c314077ac3346a4 Author: Brad King AuthorDate: Fri Jan 16 15:35:36 2015 -0500 Commit: Brad King CommitDate: Fri Jan 16 15:43:26 2015 -0500 cmake: Generate an internal 'Labels.json' file next to 'Labels.txt' In each internal target directory we generate a "Labels.txt" file containing labels for that target and its sources, but it uses an internal format. In order to make the list of labels easier to publish, use a json format and call it "Labels.json". diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 78bef91..4ce601d 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -500,7 +500,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} + cmjsoncpp + ) # On Apple we need CoreFoundation if(APPLE) @@ -584,7 +586,7 @@ set(CTEST_SRCS cmCTest.cxx # Build CTestLib add_library(CTestLib ${CTEST_SRCS}) -target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES} cmjsoncpp) +target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) # # Sources for CPack diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index d17710e..015e1dd 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -38,6 +38,8 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) # include +# include "cm_jsoncpp_value.h" +# include "cm_jsoncpp_writer.h" #endif #include // required for atof @@ -2915,10 +2917,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 +2946,7 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target) li != labels.end(); ++li) { fout << " " << *li << "\n"; + lj_target_labels.append(*li); } } @@ -2958,23 +2972,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::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/Utilities/cm_jsoncpp_value.h b/Utilities/cm_jsoncpp_value.h new file mode 100644 index 0000000..15e1088 --- /dev/null +++ b/Utilities/cm_jsoncpp_value.h @@ -0,0 +1,18 @@ +/*============================================================================ + 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 + +#endif diff --git a/Utilities/cm_jsoncpp_writer.h b/Utilities/cm_jsoncpp_writer.h new file mode 100644 index 0000000..c410369 --- /dev/null +++ b/Utilities/cm_jsoncpp_writer.h @@ -0,0 +1,18 @@ +/*============================================================================ + 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 + +#endif ----------------------------------------------------------------------- Summary of changes: Source/CMakeLists.txt | 6 +++-- Source/cmGlobalGenerator.cxx | 26 +++++++++++++++++++- .../{cm_jsoncpp_reader.h => cm_jsoncpp_value.h} | 6 ++--- .../{cm_jsoncpp_reader.h => cm_jsoncpp_writer.h} | 6 ++--- 4 files changed, 35 insertions(+), 9 deletions(-) copy Utilities/{cm_jsoncpp_reader.h => cm_jsoncpp_value.h} (86%) copy Utilities/{cm_jsoncpp_reader.h => cm_jsoncpp_writer.h} (86%) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:53:10 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:53:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2152-g721cf69 Message-ID: <20150119145310.63913AA31F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 721cf69c03495cbea80442561b354bfe5eca70b4 (commit) via 2787738b1af12988e5d6ae1bef68fa7afefc4d40 (commit) from d703c9bdd288935967fb424535355b1c2cb2024e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=721cf69c03495cbea80442561b354bfe5eca70b4 commit 721cf69c03495cbea80442561b354bfe5eca70b4 Merge: d703c9b 2787738 Author: Brad King AuthorDate: Mon Jan 19 09:53:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:53:09 2015 -0500 Merge topic 'test-ctest_submit-fail-with-RunCMake' into next 2787738b Tests: Drop RunCMake.CTestSubmit FailDrop cases for now http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2787738b1af12988e5d6ae1bef68fa7afefc4d40 commit 2787738b1af12988e5d6ae1bef68fa7afefc4d40 Author: Brad King AuthorDate: Mon Jan 19 09:48:39 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 09:52:50 2015 -0500 Tests: Drop RunCMake.CTestSubmit FailDrop cases for now They mysteriously fail on one machine, so prepare to split these out into a separate commit so the main test can be finished earlier. diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt deleted file mode 100644 index b451315..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -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 deleted file mode 100644 index fa6e004..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -Submit files \(using cp\) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt deleted file mode 100644 index a622fac..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 345bb62..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-http-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt deleted file mode 100644 index 6870d2e..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index c7f35c5..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-https-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt deleted file mode 100644 index a3c0cd5..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 19f8234..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-scp-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt deleted file mode 100644 index 42b8f50..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ - 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 deleted file mode 100644 index ec2ce92..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -Submit files \(using scp\) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt deleted file mode 100644 index b57e2de..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt +++ /dev/null @@ -1 +0,0 @@ -(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt b/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt deleted file mode 100644 index 020b615..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ - (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 deleted file mode 100644 index ed2acb5..0000000 --- a/Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -Submit files \(using xmlrpc\) diff --git a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake index 7cab3f3..6f18563 100644 --- a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake @@ -40,9 +40,4 @@ 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) +# TODO: call run_ctest_submit_FailDrop() for each submission protocol ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt | 1 - Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt | 4 ---- Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt | 1 - Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt | 1 - Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt | 3 --- Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt | 3 --- Tests/RunCMake/CTestSubmit/FailDrop-http-result.txt | 1 - Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt | 3 --- Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt | 3 --- Tests/RunCMake/CTestSubmit/FailDrop-https-result.txt | 1 - Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt | 3 --- Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt | 3 --- Tests/RunCMake/CTestSubmit/FailDrop-scp-result.txt | 1 - Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt | 2 -- Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt | 1 - Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt | 1 - Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt | 2 -- Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt | 1 - Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake | 7 +------ 19 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-cp-result.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-ftp-result.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-http-result.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-https-result.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-scp-result.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-result.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt delete mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:57:58 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:57:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2154-gd695130 Message-ID: <20150119145758.1925AAA5FD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d695130d0a9f971fa3fb9ccd009b4399cb95de93 (commit) via 352de1d74960dea4db66ac560ad7e4489546f2dd (commit) from 721cf69c03495cbea80442561b354bfe5eca70b4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d695130d0a9f971fa3fb9ccd009b4399cb95de93 commit d695130d0a9f971fa3fb9ccd009b4399cb95de93 Merge: 721cf69 352de1d Author: Brad King AuthorDate: Mon Jan 19 09:57:57 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:57:57 2015 -0500 Merge topic 'test-ctest_submit-fail-with-RunCMake' into next 352de1d7 Tests: Add RunCMake.CTestSubmit cases covering ctest_submit failures http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=352de1d74960dea4db66ac560ad7e4489546f2dd commit 352de1d74960dea4db66ac560ad7e4489546f2dd Author: Brad King AuthorDate: Thu Jan 15 13:41:39 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 09:53:57 2015 -0500 Tests: Add RunCMake.CTestSubmit cases covering ctest_submit failures Cover command invocation argument errors. Prepare infrastructure to cover failed 'drop' cases, but do not cover them yet because we need to collect error messages from each platform. 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 at 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..f0e1653 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in @@ -0,0 +1,5 @@ +set(CTEST_PROJECT_NAME "CTestSubmit at 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@") 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..6f18563 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake @@ -0,0 +1,43 @@ +include(RunCMake) + +# Default case parameters. +set(CASE_DROP_METHOD "http") +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() + +# TODO: call run_ctest_submit_FailDrop() for each submission protocol 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 at -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}) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 09:58:16 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 09:58:16 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2156-g5b5e673 Message-ID: <20150119145816.C654FAA614@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5b5e6734955f7f6c948eb7a99af3d6ce82586c83 (commit) via 76f7eb2e4a359a7c978efa19fdf71fe1ea46b971 (commit) from d695130d0a9f971fa3fb9ccd009b4399cb95de93 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5b5e6734955f7f6c948eb7a99af3d6ce82586c83 commit 5b5e6734955f7f6c948eb7a99af3d6ce82586c83 Merge: d695130 76f7eb2 Author: Brad King AuthorDate: Mon Jan 19 09:58:15 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 09:58:15 2015 -0500 Merge topic 'test-ctest_submit-fail-with-RunCMake' into next 76f7eb2e Tests: Extend RunCMake.CTestSubmit test to cover 'drop' failures http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76f7eb2e4a359a7c978efa19fdf71fe1ea46b971 commit 76f7eb2e4a359a7c978efa19fdf71fe1ea46b971 Author: Brad King AuthorDate: Mon Jan 19 09:55:59 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 09:56:38 2015 -0500 Tests: Extend RunCMake.CTestSubmit test to cover 'drop' failures Replace the TODO comment with calls to run_ctest_submit_FailDrop. For now leave curl errors out of expected stderr. They can be ported over from CTestTestFailedSubmit-* tests later. 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/RunCMakeTest.cmake b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake index 6f18563..7cab3f3 100644 --- a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake @@ -40,4 +40,9 @@ function(run_ctest_submit_FailDrop CASE_DROP_METHOD) run_ctest(FailDrop-${CASE_DROP_METHOD}) endfunction() -# TODO: call run_ctest_submit_FailDrop() for each submission protocol +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) ----------------------------------------------------------------------- Summary of changes: .../FailDrop-cp-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt | 4 ++++ Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt | 1 + .../FailDrop-ftp-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt | 3 +++ Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt | 3 +++ .../FailDrop-http-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt | 3 +++ Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt | 3 +++ .../FailDrop-https-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt | 3 +++ Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt | 3 +++ .../FailDrop-scp-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt | 2 ++ Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt | 1 + .../FailDrop-xmlrpc-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt | 2 ++ Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt | 1 + Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake | 7 ++++++- 19 files changed, 35 insertions(+), 1 deletion(-) copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-cp-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-ftp-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-http-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-https-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-scp-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-xmlrpc-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 10:01:25 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 10:01:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-886-gfc9204e Message-ID: <20150119150125.4B880AA87F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via fc9204efcb7cd77562cf8cc76baa58df9841649f (commit) via bc9cd21bd46023f3f0f7be5be5386315a193af08 (commit) via a2dc7f87e01c3621878e3e2336d50c769524572a (commit) via 99f66e9b4aae95f1d229f83e53c26f9d7c212b79 (commit) via 8741991e4bf913e009030a66cac81004f63d7b45 (commit) via 9a92734cddbf4879e56cc07a252ff1beba92b21f (commit) via 41eb20f8fcf0496679f063e196ec40d385a46d3d (commit) via d58396b722bd4120306aafd08211cc09287bb670 (commit) from 9de2ab7fcefba2bc9ce7b483f1643b1d97d58e43 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 10:01:25 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 10:01:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2165-g829bf43 Message-ID: <20150119150125.780B9AA889@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 829bf431cd87375ae774d550a7a1d784b65a24ed (commit) via fc9204efcb7cd77562cf8cc76baa58df9841649f (commit) via bc9cd21bd46023f3f0f7be5be5386315a193af08 (commit) via a2dc7f87e01c3621878e3e2336d50c769524572a (commit) via 99f66e9b4aae95f1d229f83e53c26f9d7c212b79 (commit) via 8741991e4bf913e009030a66cac81004f63d7b45 (commit) via 9a92734cddbf4879e56cc07a252ff1beba92b21f (commit) via 41eb20f8fcf0496679f063e196ec40d385a46d3d (commit) via d58396b722bd4120306aafd08211cc09287bb670 (commit) from 5b5e6734955f7f6c948eb7a99af3d6ce82586c83 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=829bf431cd87375ae774d550a7a1d784b65a24ed commit 829bf431cd87375ae774d550a7a1d784b65a24ed Merge: 5b5e673 fc9204e Author: Brad King AuthorDate: Mon Jan 19 10:01:13 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 10:01:13 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 10:01:25 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 10:01:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, release, updated. v3.1.0-74-gbc9cd21 Message-ID: <20150119150125.9B2B1AA88B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via bc9cd21bd46023f3f0f7be5be5386315a193af08 (commit) via ca80598ecaff14414193fd65268f80e1eddb9fa0 (commit) via a2dc7f87e01c3621878e3e2336d50c769524572a (commit) via b937f7537943e56998f1f4630e3684ca7417442b (commit) via 6af8cbf214c7de6ef4bb036cb9f6c4bc147fd511 (commit) via 49d05a4713729d7531192ae16fc94511dac9b8ec (commit) via 99f66e9b4aae95f1d229f83e53c26f9d7c212b79 (commit) via 91fbcda28fff000f8ece00ba7b23cc4fa4889cef (commit) via 8741991e4bf913e009030a66cac81004f63d7b45 (commit) via 9a92734cddbf4879e56cc07a252ff1beba92b21f (commit) via 6e6e0c4048b1500edfc8c27a0fc567997b494a56 (commit) via 41eb20f8fcf0496679f063e196ec40d385a46d3d (commit) via d58396b722bd4120306aafd08211cc09287bb670 (commit) via 9c9bc71256000c8bedd391e049150b6a0f3b0dc3 (commit) via 45ec182d27dc27412c94ccb49632e22a55d5fbe4 (commit) via 2bead0eb1b605cc5d0db23d9af00087277157921 (commit) from 0fcdc57b7b9bbdeaa77c6751b92fd6a14394d1b4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Auxiliary/cmake-indent.vim | 2 +- Auxiliary/cmake-mode.el | 10 +++++++--- Auxiliary/cmake-syntax.vim | 2 +- Help/manual/LINKS.txt | 4 ++-- Modules/CMakeCCompilerId.c.in | 2 +- Modules/CMakeCXXCompilerId.cpp.in | 2 +- Modules/CMakeDetermineCompilerId.cmake | 2 +- Modules/FindQt.cmake | 13 ++++++++++--- Source/cmExtraEclipseCDT4Generator.cxx | 1 + Source/cmGeneratorExpressionEvaluator.cxx | 9 ++++++++- Source/cmMakefile.cxx | 11 ++++++----- Source/cmMakefile.h | 6 +++--- 12 files changed, 42 insertions(+), 22 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 10:03:14 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 10:03:14 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-888-g2e71d92 Message-ID: <20150119150314.219CDAA903@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 2e71d92ef270c4234368fd2e88259c0defbfb650 (commit) via 352de1d74960dea4db66ac560ad7e4489546f2dd (commit) from fc9204efcb7cd77562cf8cc76baa58df9841649f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e71d92ef270c4234368fd2e88259c0defbfb650 commit 2e71d92ef270c4234368fd2e88259c0defbfb650 Merge: fc9204e 352de1d Author: Brad King AuthorDate: Mon Jan 19 10:03:12 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 10:03:12 2015 -0500 Merge topic 'test-ctest_submit-fail-with-RunCMake' 352de1d7 Tests: Add RunCMake.CTestSubmit cases covering ctest_submit failures ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CMakeLists.txt | 1 + .../BadArg-result.txt} | 0 Tests/RunCMake/CTestSubmit/BadArg-stderr.txt | 2 + .../BadFILES-result.txt} | 0 Tests/RunCMake/CTestSubmit/BadFILES-stderr.txt | 2 + .../BadPARTS-result.txt} | 0 Tests/RunCMake/CTestSubmit/BadPARTS-stderr.txt | 2 + Tests/RunCMake/CTestSubmit/CMakeLists.txt.in | 4 ++ Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in | 5 +++ .../RepeatRETURN_VALUE-result.txt} | 0 .../CTestSubmit/RepeatRETURN_VALUE-stderr.txt | 2 + Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake | 43 ++++++++++++++++++++ Tests/RunCMake/CTestSubmit/test.cmake.in | 16 ++++++++ 13 files changed, 77 insertions(+) copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/BadArg-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/BadArg-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/BadFILES-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/BadFILES-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/BadPARTS-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/BadPARTS-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/CMakeLists.txt.in create mode 100644 Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/RepeatRETURN_VALUE-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/RepeatRETURN_VALUE-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/CTestSubmit/test.cmake.in hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 10:04:01 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 10:04:01 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2167-g4703cca Message-ID: <20150119150401.EEDDFAA919@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4703cca3e907970b2de37a75c7eac023cf40d61e (commit) via 2e71d92ef270c4234368fd2e88259c0defbfb650 (commit) from 829bf431cd87375ae774d550a7a1d784b65a24ed (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4703cca3e907970b2de37a75c7eac023cf40d61e commit 4703cca3e907970b2de37a75c7eac023cf40d61e Merge: 829bf43 2e71d92 Author: Brad King AuthorDate: Mon Jan 19 10:03:55 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 10:03:55 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 10:49:29 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 10:49:29 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2169-g9a96401 Message-ID: <20150119154929.CB61FAA252@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9a96401774c4afc6bc12cde06cf6d6306b2f5b22 (commit) via 48984958192029f57338f511885eed85d1963f94 (commit) from 4703cca3e907970b2de37a75c7eac023cf40d61e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a96401774c4afc6bc12cde06cf6d6306b2f5b22 commit 9a96401774c4afc6bc12cde06cf6d6306b2f5b22 Merge: 4703cca 4898495 Author: Brad King AuthorDate: Mon Jan 19 10:49:29 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 10:49:29 2015 -0500 Merge topic 'find-package-mode-fix-multiarch' into next 48984958 CMakeFindPackageMode: Fix Debian multiarch default guess (#15250) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=48984958192029f57338f511885eed85d1963f94 commit 48984958192029f57338f511885eed85d1963f94 Author: Felix Geyer AuthorDate: Mon Jan 19 10:39:21 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 10:45:32 2015 -0500 CMakeFindPackageMode: Fix Debian multiarch default guess (#15250) In commit v2.8.6~102^2~18 (Better support for lib64 and Debian multiarch, 2011-07-14) variable names "..._LANGUAGE_ARCHITECTURE" were set instead of the correct "..._LIBRARY_ARCHITECTURE". Fix this typo and also set the language-independent variable CMAKE_LIBRARY_ARCHITECTURE. 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() ----------------------------------------------------------------------- Summary of changes: Modules/CMakeFindPackageMode.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 11:18:18 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 11:18:18 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2172-g85f6c64 Message-ID: <20150119161818.A3478A895D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 85f6c64358e1a1077d01b77b93c09d8d964375c9 (commit) via bf7096c4adc4e1642353a57bfdec509693586697 (commit) via 941a1dfb85a96e778d666e4d823729d292a64d20 (commit) from 9a96401774c4afc6bc12cde06cf6d6306b2f5b22 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85f6c64358e1a1077d01b77b93c09d8d964375c9 commit 85f6c64358e1a1077d01b77b93c09d8d964375c9 Merge: 9a96401 bf7096c Author: Brad King AuthorDate: Mon Jan 19 11:18:17 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 11:18:17 2015 -0500 Merge topic 'cdash_upload_file_mode' into next bf7096c4 cmake: Generate an internal 'Labels.json' file next to 'Labels.txt' 941a1dfb Add support to ctest_submit to upload files to cdash with CDASH_UPLOAD. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf7096c4adc4e1642353a57bfdec509693586697 commit bf7096c4adc4e1642353a57bfdec509693586697 Author: Brad King AuthorDate: Fri Jan 16 15:35:36 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 11:17:18 2015 -0500 cmake: Generate an internal 'Labels.json' file next to 'Labels.txt' In each internal target directory we generate a "Labels.txt" file containing labels for that target and its sources, but it uses an internal format. In order to make the list of labels easier to publish, use a json format and call it "Labels.json". diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 78bef91..4ce601d 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -500,7 +500,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} + cmjsoncpp + ) # On Apple we need CoreFoundation if(APPLE) @@ -584,7 +586,7 @@ set(CTEST_SRCS cmCTest.cxx # Build CTestLib add_library(CTestLib ${CTEST_SRCS}) -target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES} cmjsoncpp) +target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) # # Sources for CPack diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 1745d9a..dd3b1ec 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -38,6 +38,8 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) # include +# include "cm_jsoncpp_value.h" +# include "cm_jsoncpp_writer.h" #endif #include // required for atof @@ -2911,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()); @@ -2929,6 +2942,7 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target) li != labels.end(); ++li) { fout << " " << *li << "\n"; + lj_target_labels.append(*li); } } @@ -2954,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::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/Utilities/cm_jsoncpp_value.h b/Utilities/cm_jsoncpp_value.h new file mode 100644 index 0000000..15e1088 --- /dev/null +++ b/Utilities/cm_jsoncpp_value.h @@ -0,0 +1,18 @@ +/*============================================================================ + 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 + +#endif diff --git a/Utilities/cm_jsoncpp_writer.h b/Utilities/cm_jsoncpp_writer.h new file mode 100644 index 0000000..c410369 --- /dev/null +++ b/Utilities/cm_jsoncpp_writer.h @@ -0,0 +1,18 @@ +/*============================================================================ + 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 + +#endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=941a1dfb85a96e778d666e4d823729d292a64d20 commit 941a1dfb85a96e778d666e4d823729d292a64d20 Author: Bill Hoffman AuthorDate: Tue Dec 23 11:03:14 2014 -0500 Commit: Brad King CommitDate: Mon Jan 19 11:17:17 2015 -0500 Add support to ctest_submit to upload files to cdash with CDASH_UPLOAD. This adds support for the new cdash API where arbitrary files can be uploaded to the CDash server. This CDash API communicates via json files so the json parser jsoncpp was added to the Utilities directory. In addition since CDash tracks the md5 sum of the files uploaded the --mtime option was added to cmake -E tar so that tar files could be created that would have the same md5sum with the same content. The first supported file upload type to CDash is a GCOV with branches coverage tar file. To support this a Modules/CTestCoverageCollectGCOV.cmake was added to run gcov for a project via a CMake function. diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index d9b0b78..316a43d 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -37,3 +37,14 @@ timed-out submission before attempting to re-submit. The RETRY_COUNT option specifies how many times to retry a timed-out submission. + +:: + + ctest_submit([CDASH_UPLOAD file] + [CDASH_UPLOAD_TYPE type_string]) + +This second signature is used to upload files to CDash via the CDash +file upload API. The api first sends a request to upload to CDash along +with the md5 sum of the file. If CDash does not already have the file, +then it is uploaded. Along with the file, a CDash type string is specified +to tell CDash which handler to use to process the data. diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index 0a0ca23..db56010 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -63,6 +63,7 @@ All Modules /module/CPack /module/CPackWIX /module/CTest + /module/CTestCoverageCollectGCOV /module/CTestScriptMode /module/CTestUseLaunchers /module/Dart diff --git a/Help/module/CTestCoverageCollectGCOV.rst b/Help/module/CTestCoverageCollectGCOV.rst new file mode 100644 index 0000000..4c5deca --- /dev/null +++ b/Help/module/CTestCoverageCollectGCOV.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/CTestCoverageCollectGCOV.cmake diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake new file mode 100644 index 0000000..29fd504 --- /dev/null +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -0,0 +1,123 @@ +#.rst: +# CTestCoverageCollectGCOV +# ------------------------ +# +# This module provides the function ``ctest_coverage_collect_gcov``. +# The function will run gcov on the .gcda files in a binary tree and then +# package all of the .gcov files into a tar file with a data.json. +# This file can be sent to a CDash server for display with the +# :command:`ctest_submit(CDASH_UPLOAD)` command. +# +# .. command:: cdash_coverage_collect_gcov +# +# :: +# +# ctest_coverage_collect_gcov( +# TARBALL # required +# SOURCE # optional, else CTEST_SOURCE_DIRECTORY +# BUILD # optional, else CTEST_BINARY_DIRECTORY +# GCOV_COMMAND # optional, else CTEST_COVERAGE_COMMAND +# ) +# +# Run gcov and package a tar file for cdash. ```` is the name +# of the tarfile that is created and it will be placed in ````. +# ```` is the source directory for the build and ```` +# is the binary directory for the build. The ```` is a full +# path to ``gcov`` for the machine. + +#============================================================================= +# 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.) +include(CMakeParseArguments) +function(ctest_coverage_collect_gcov) + set(options "") + set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) + set(multiValueArgs "") + cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" + "${multiValueArgs}" "" ${ARGN} ) + if(NOT DEFINED GCOV_TARBALL) + message(FATAL_ERROR + "TARBALL must be specified. for ctest_coverage_collect_gcov") + endif() + if(NOT DEFINED GCOV_SOURCE) + set(source_dir "${CTEST_SOURCE_DIRECTORY}") + else() + set(source_dir "${GCOV_SOURCE}") + endif() + if(NOT DEFINED GCOV_BUILD) + set(binary_dir "${CTEST_BINARY_DIRECTORY}") + else() + set(binary_dir "${GCOV_BUILD}") + endif() + if(NOT DEFINED GCOV_GCOV_COMMAND) + set(gcov_command "${CTEST_COVERAGE_COMMAND}") + else() + set(gcov_command "${GCOV_GCOV_COMMAND}") + endif() + # run gcov on each gcda file in the binary tree + set(gcda_files) + set(label_files) + # look for gcda files in the target directories + # could do a glob from the top of the binary tree but + # this will be faster and only look where the files will be + file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) + foreach(target_dir ${target_dirs}) + file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") + list(LENGTH gfiles len) + # if we have gcda files then also grab the labels file for that target + if(${len} GREATER 0) + file(GLOB_RECURSE lfiles RELATIVE ${binary_dir} + "${target_dir}/Labels.txt") + list(APPEND gcda_files ${gfiles}) + list(APPEND label_files ${lfiles}) + endif() + endforeach() + # return early if no coverage files were found + list(LENGTH gcda_files len) + if(len EQUAL 0) + message("ctest_coverage_collect_gcov: No .gcda files found, " + "ignoring coverage request.") + return() + endif() + # setup the dir for the coverage files + set(coverage_dir "${binary_dir}/Testing/CoverageInfo") + file(MAKE_DIRECTORY "${coverage_dir}") + # call gcov on each .gcda file + foreach (gcda_file ${gcda_files}) + # get the directory of the gcda file + get_filename_component(gcda_file ${binary_dir}/${gcda_file} ABSOLUTE) + get_filename_component(gcov_dir ${gcda_file} DIRECTORY) + # run gcov, this will produce the .gcov file in the current + # working directory + execute_process(COMMAND + ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${coverage_dir}) + endforeach() + # create json file with project information + file(WRITE ${coverage_dir}/data.json + "{ + \"Source\": \"${source_dir}\", + \"Binary\": \"${binary_dir}\" +}") + # collect the gcov files + set(gcov_files) + file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "${binary_dir}/*.gcov") + # tar up the coverage info with the same date so that the md5 + # sum will be the same for the tar file independent of file time + # stamps + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} + --mtime=1970-01-01\ 0:0:0\ UTC ${gcov_files} + ${coverage_dir}/data.json ${label_files} + WORKING_DIRECTORY ${binary_dir}) +endfunction() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 96f4709..78bef91 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -533,6 +533,7 @@ set(CTEST_SRCS cmCTest.cxx CTest/cmCTestConfigureHandler.cxx CTest/cmCTestCoverageCommand.cxx CTest/cmCTestCoverageHandler.cxx + CTest/cmCTestCurl.cxx CTest/cmParseMumpsCoverage.cxx CTest/cmParseCacheCoverage.cxx CTest/cmParseGTMCoverage.cxx @@ -583,7 +584,7 @@ set(CTEST_SRCS cmCTest.cxx # Build CTestLib add_library(CTestLib ${CTEST_SRCS}) -target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) +target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES} cmjsoncpp) # # Sources for CPack diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx new file mode 100644 index 0000000..b354592 --- /dev/null +++ b/Source/CTest/cmCTestCurl.cxx @@ -0,0 +1,258 @@ +#include "cmCTestCurl.h" +#include "cmSystemTools.h" +#include "cmCTest.h" + +cmCTestCurl::cmCTestCurl(cmCTest* ctest) +{ + this->CTest = ctest; + this->SetProxyType(); + this->UseHttp10 = false; + // In windows, this will init the winsock stuff + ::curl_global_init(CURL_GLOBAL_ALL); + // default is to verify https + this->VerifyPeerOff = false; + this->VerifyHostOff = false; + this->TimeOutSeconds = 0; +} + +namespace +{ +static size_t +curlWriteMemoryCallback(void *ptr, size_t size, size_t nmemb, + void *data) +{ + int realsize = (int)(size * nmemb); + + std::vector *vec + = static_cast* >(data); + const char* chPtr = static_cast(ptr); + vec->insert(vec->end(), chPtr, chPtr + realsize); + return realsize; +} + +static size_t +curlDebugCallback(CURL *, curl_infotype, char *chPtr, + size_t size, void *data) +{ + std::vector *vec + = static_cast* >(data); + vec->insert(vec->end(), chPtr, chPtr + size); + + return size; +} + +} +void cmCTestCurl::SetCurlOptions(std::vector const& args) +{ + for( std::vector::const_iterator i = args.begin(); + i != args.end(); ++i) + { + if(*i == "CURLOPT_SSL_VERIFYPEER_OFF") + { + this->VerifyPeerOff = true; + } + if(*i == "CURLOPT_SSL_VERIFYHOST_OFF") + { + this->VerifyHostOff = true; + } + } +} + +bool cmCTestCurl::InitCurl() +{ + this->Curl = curl_easy_init(); + if(!this->Curl) + { + return false; + } + if(this->VerifyPeerOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYPEER, 0); + } + if(this->VerifyHostOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYHOST, 0); + } + if(this->HTTPProxy.size()) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXY, this->HTTPProxy.c_str()); + curl_easy_setopt(this->Curl, CURLOPT_PROXYTYPE, this->HTTPProxyType); + if (this->HTTPProxyAuth.size() > 0) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXYUSERPWD, + this->HTTPProxyAuth.c_str()); + } + } + if(this->UseHttp10) + { + curl_easy_setopt(this->Curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + } + // enable HTTP ERROR parsing + curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + return true; +} + + +bool cmCTestCurl::UploadFile(std::string const& local_file, + std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + /* enable uploading */ + curl_easy_setopt(this->Curl, CURLOPT_UPLOAD, 1); + // if there is little to no activity for too long stop submitting + if(this->TimeOutSeconds) + { + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_LIMIT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_TIME, + this->TimeOutSeconds); + } + /* HTTP PUT please */ + ::curl_easy_setopt(this->Curl, CURLOPT_PUT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_VERBOSE, 1); + + FILE* ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); + if(!ftpfile) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not open file for upload: " << local_file << "\n"); + return false; + } + // set the url + std::string upload_url = url; + upload_url += "?"; + upload_url += fields; + ::curl_easy_setopt(this->Curl, CURLOPT_URL, upload_url.c_str()); + // now specify which file to upload + ::curl_easy_setopt(this->Curl, CURLOPT_INFILE, ftpfile); + unsigned long filelen = cmSystemTools::FileLength(local_file); + // and give the size of the upload (optional) + ::curl_easy_setopt(this->Curl, CURLOPT_INFILESIZE, + static_cast(filelen)); + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + // Now run off and do what you've been told! + ::curl_easy_perform(this->Curl); + ::fclose(ftpfile); + ::curl_global_cleanup(); + + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Curl response: [" << response << "]\n"); + } + std::string curlDebug; + if ( debugData.size() > 0 ) + { + curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + if(response.size() == 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "No response from server.\n" << + curlDebug); + return false; + } + return true; +} + +bool cmCTestCurl::HttpRequest(std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + cmCTestLog(this->CTest, DEBUG, "HttpRequest\n" + << "url: " << url << "\n" + << "fields " << fields << "\n"); + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + curl_easy_setopt(this->Curl, CURLOPT_POST, 1); + curl_easy_setopt(this->Curl, CURLOPT_POSTFIELDS, fields.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_URL, url.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_FOLLOWLOCATION, 1); + //set response options + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + + CURLcode res = ::curl_easy_perform(this->Curl); + + ::curl_easy_cleanup(this->Curl); + ::curl_global_cleanup(); + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl response: [" << response << "]\n"); + } + if ( debugData.size() > 0 ) + { + std::string curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + cmCTestLog(this->CTest, DEBUG, "Curl res: " << res << "\n"); + return (res == 0); +} + +void cmCTestCurl::SetProxyType() +{ + if ( cmSystemTools::GetEnv("HTTP_PROXY") ) + { + this->HTTPProxy = cmSystemTools::GetEnv("HTTP_PROXY"); + if ( cmSystemTools::GetEnv("HTTP_PROXY_PORT") ) + { + this->HTTPProxy += ":"; + this->HTTPProxy += cmSystemTools::GetEnv("HTTP_PROXY_PORT"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_TYPE") ) + { + // this is the default + this->HTTPProxyType = CURLPROXY_HTTP; + std::string type = cmSystemTools::GetEnv("HTTP_PROXY_TYPE"); + // HTTP/SOCKS4/SOCKS5 + if ( type == "HTTP" ) + { + this->HTTPProxyType = CURLPROXY_HTTP; + } + else if ( type == "SOCKS4" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS4; + } + else if ( type == "SOCKS5" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS5; + } + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_USER") ) + { + this->HTTPProxyAuth = cmSystemTools::GetEnv("HTTP_PROXY_USER"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_PASSWD") ) + { + this->HTTPProxyAuth += ":"; + this->HTTPProxyAuth += cmSystemTools::GetEnv("HTTP_PROXY_PASSWD"); + } + } +} diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h new file mode 100644 index 0000000..bb5c74a --- /dev/null +++ b/Source/CTest/cmCTestCurl.h @@ -0,0 +1,50 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 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 cmCTestCurl_h +#define cmCTestCurl_h +#include "cm_curl.h" +#include "cmStandardIncludes.h" +class cmCTest; + +class cmCTestCurl +{ +public: + cmCTestCurl(cmCTest*); + bool UploadFile(std::string const& url, + std::string const& file, + std::string const& fields, + std::string& response); + bool HttpRequest(std::string const& url, + std::string const& fields, + std::string& response); + // currently only supports CURLOPT_SSL_VERIFYPEER_OFF + // and CURLOPT_SSL_VERIFYHOST_OFF + void SetCurlOptions(std::vector const& args); + void SetUseHttp10On() { this->UseHttp10 = true;} + void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s;} +protected: + void SetProxyType(); + bool InitCurl(); +private: + cmCTest* CTest; + CURL* Curl; + std::string HTTPProxyAuth; + std::string HTTPProxy; + curl_proxytype HTTPProxyType; + bool VerifyHostOff; + bool VerifyPeerOff; + bool UseHttp10; + int TimeOutSeconds; +}; + + +#endif diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 4005a63..dcd7982 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -27,7 +27,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() = this->Makefile->GetDefinition("CTEST_TRIGGER_SITE"); bool ctestDropSiteCDash = this->Makefile->IsOn("CTEST_DROP_SITE_CDASH"); - + const char* ctestProjectName + = this->Makefile->GetDefinition("CTEST_PROJECT_NAME"); if ( !ctestDropMethod ) { ctestDropMethod = "http"; @@ -43,7 +44,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() // error: CDash requires CTEST_DROP_LOCATION definition // in CTestConfig.cmake } - + this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName); this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod); this->CTest->SetCTestConfiguration("DropSite", ctestDropSite); this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation); @@ -144,6 +145,13 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() static_cast(handler)->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF"); + if(this->CDashUploadFile.size()) + { + static_cast(handler)-> + SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); + static_cast(handler)-> + SetOption("CDashUploadType", this->CDashUploadType.c_str()); + } return handler; } @@ -178,6 +186,16 @@ bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg) return true; } + if(arg == "CDASH_UPLOAD") + { + this->ArgumentDoing = ArgumentDoingCDashUpload; + return true; + } + if(arg == "CDASH_UPLOAD_TYPE") + { + this->ArgumentDoing = ArgumentDoingCDashUploadType; + return true; + } if(arg == "INTERNAL_TEST_CHECKSUM") { this->InternalTest = true; @@ -240,6 +258,17 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) return true; } + if(this->ArgumentDoing == ArgumentDoingCDashUpload) + { + this->CDashUploadFile = arg; + return true; + } + if(this->ArgumentDoing == ArgumentDoingCDashUploadType) + { + this->CDashUploadType = arg; + return true; + } + // Look for other arguments. return this->Superclass::CheckArgumentValue(arg); } diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index 3673fbd..cb0ac61 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -64,6 +64,8 @@ protected: ArgumentDoingFiles, ArgumentDoingRetryDelay, ArgumentDoingRetryCount, + ArgumentDoingCDashUpload, + ArgumentDoingCDashUploadType, ArgumentDoingLast2 }; @@ -74,6 +76,8 @@ protected: cmCTest::SetOfStrings Files; std::string RetryCount; std::string RetryDelay; + std::string CDashUploadFile; + std::string CDashUploadType; }; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index bc6fb31..0e19259 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -10,7 +10,8 @@ See the License for more information. ============================================================================*/ #include "cmCTestSubmitHandler.h" - +#include "cmCTestScriptHandler.h" +#include "cmake.h" #include "cmSystemTools.h" #include "cmVersion.h" #include "cmGeneratedFileStream.h" @@ -23,8 +24,10 @@ // For XML-RPC submission #include "cm_xmlrpc.h" +#include // For curl submission #include "cm_curl.h" +#include "cmCTestCurl.h" #include @@ -1055,9 +1058,165 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(std::string const&, } #endif +void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod, + std::string& url) +{ + dropMethod = this->CTest->GetCTestConfiguration("DropMethod"); + url = dropMethod; + url += "://"; + if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 ) + { + url += this->CTest->GetCTestConfiguration("DropSiteUser"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + this->CTest->GetCTestConfiguration("DropSiteUser").c_str()); + if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 ) + { + url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******"); + } + url += "@"; + } + url += this->CTest->GetCTestConfiguration("DropSite") + + this->CTest->GetCTestConfiguration("DropLocation"); +} + + +int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, + std::string const& typeString) +{ + if(!cmSystemTools::FileExists(file)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Upload file not found: " << file << "\n"); + return -1; + } + cmCTestCurl curl(this->CTest); + std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); + std::vector args; + cmSystemTools::ExpandListArgument(curlopt, args); + curl.SetCurlOptions(args); + curl.SetTimeOutSeconds(SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT); + std::string dropMethod; + std::string url; + this->ConstructCDashURL(dropMethod, url); + std::string::size_type pos = url.find("submit.php?"); + url = url.substr(0, pos+10); + if ( ! (dropMethod == "http" || dropMethod == "https" ) ) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Only http and https are supported for CDASH_UPLOAD\n"); + return -1; + } + char md5sum[33]; + md5sum[32] = 0; + cmSystemTools::ComputeFileMD5(file, md5sum); + // 1. request the buildid and check to see if the file + // has already been uploaded + // TODO I added support for subproject. You would need to add + // a "&subproject=subprojectname" to the first POST. + cmCTestScriptHandler* ch = + static_cast(this->CTest->GetHandler("script")); + cmake* cm = ch->GetCMake(); + const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + std::ostringstream str; + str << "project=" + << this->CTest->GetCTestConfiguration("ProjectName") << "&"; + if(subproject) + { + str << "subproject=" << subproject << "&"; + } + str << "stamp=" << this->CTest->GetCurrentTag() << "-" + << this->CTest->GetTestModelString() << "&" + << "model=" << this->CTest->GetTestModelString() << "&" + << "build=" << this->CTest->GetCTestConfiguration("BuildName") << "&" + << "site=" << this->CTest->GetCTestConfiguration("Site") << "&" + << "track=" << this->CTest->GetTestModelString() << "&" + << "starttime=" << (int)cmSystemTools::GetTime() << "&" + << "endtime=" << (int)cmSystemTools::GetTime() << "&" + << "datafilesmd5[0]=" << md5sum << "&" + << "type=" << typeString; + std::string fields = str.str(); + cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:" + << url << "\nfile: " << file << "\n"); + std::string response; + if(!curl.HttpRequest(url, fields, response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error in HttpRequest\n" << response); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Request upload response: [" << response << "]\n"); + Json::Value json; + Json::Reader reader; + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + if(json["status"].asInt() != 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Bad status returned from CDash: " + << json["status"].asInt()); + return -1; + } + if(json["datafilesmd5"].isArray()) + { + int datares = json["datafilesmd5"][0].asInt(); + if(datares == 1) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "File already exists on CDash, skip upload " + << file << "\n"); + return 0; + } + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "bad datafilesmd5 value in response " + << response << "\n"); + return -1; + } + + std::string upload_as = cmSystemTools::GetFilenameName(file); + std::ostringstream fstr; + fstr << "type=" << typeString << "&" + << "md5=" << md5sum << "&" + << "filename=" << upload_as << "&" + << "buildid=" << json["buildid"].asString(); + if(!curl.UploadFile(file, url, fstr.str(), response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error uploading to CDash. " + << file << " " << url << " " << fstr.str()); + return -1; + } + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Upload file response: [" << response << "]\n"); + return 0; +} + //---------------------------------------------------------------------------- int cmCTestSubmitHandler::ProcessHandler() { + const char* cdashUploadFile = this->GetOption("CDashUploadFile"); + const char* cdashUploadType = this->GetOption("CDashUploadType"); + if(cdashUploadFile && cdashUploadType) + { + return this->HandleCDashUploadFile(std::string(cdashUploadFile), + std::string(cdashUploadType)); + } std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); // cdash does not need to trigger so just return true if(!iscdash.empty()) diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index accabd1..f9cd894 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -41,6 +41,11 @@ public: /** Specify a set of files to submit. */ void SelectFiles(cmCTest::SetOfStrings const& files); + // handle the cdash file upload protocol + int HandleCDashUploadFile(std::string const& file, std::string const& type); + + void ConstructCDashURL(std::string& dropMethod, std::string& url); + private: void SetLogFile(std::ostream* ost) { this->LogFile = ost; } diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index a2aecac..fc4c40d 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -247,6 +247,11 @@ bool cmArchiveWrite::AddPath(const char* path, return true; } +// function from libarchive +extern "C" +{ + time_t __archive_get_date(time_t, const char*); +} //---------------------------------------------------------------------------- bool cmArchiveWrite::AddFile(const char* file, size_t skip, const char* prefix) @@ -275,6 +280,17 @@ bool cmArchiveWrite::AddFile(const char* file, this->Error += cm_archive_error_string(this->Disk); return false; } + if(this->MTime.size()) + { + time_t t = __archive_get_date(0, this->MTime.c_str()); + if (t == -1) + { + this->Error = "__archive_get_date: Unable to parse mtime: "; + this->Error += "[" + this->MTime + "]"; + 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..987e95c 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(const char* t) { if(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/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 7d938c5..d8a5631 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1469,7 +1469,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, - bool verbose) + bool verbose, const char* mtime) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); @@ -1501,6 +1501,10 @@ bool cmSystemTools::CreateTar(const char* outFileName, } cmArchiveWrite a(fout, compress, cmArchiveWrite::TypeTAR); + if(mtime) + { + a.SetMTime(mtime); + } a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); i != files.end(); ++i) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 09ceea6..1c7208f 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& files, - cmTarCompression compressType, bool verbose); - static bool ExtractTar(const char* inFileName, - bool verbose); + cmTarCompression compressType, bool verbose, + const char* mtime=0); + 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/cmcmd.cxx b/Source/cmcmd.cxx index ecf4650..f6c13bb 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -729,9 +729,21 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) std::string flags = args[2]; std::string outFile = args[3]; std::vector files; + std::string mtime; for (std::string::size_type cc = 4; cc < args.size(); cc ++) { - files.push_back(args[cc]); + // if the first 8 chars of an arg are --mtime= and that arg + // is not a file on disk, treat it is the --mtime= flag and + // not a file + if( (args[cc].substr(0, 8) == "--mtime=") && + !cmSystemTools::FileExists(args[cc])) + { + mtime = args[cc].substr(8); + } + else + { + files.push_back(args[cc]); + } } cmSystemTools::cmTarCompression compress = cmSystemTools::TarCompressNone; @@ -773,8 +785,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) } else if ( flags.find_first_of('c') != flags.npos ) { + const char* mtimestr = 0; + if(mtime.size()) + { + mtimestr = mtime.c_str(); + } if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, compress, verbose) ) + outFile.c_str(), files, compress, verbose, mtimestr) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 11:36:10 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 11:36:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2174-gd4c1925 Message-ID: <20150119163610.3CDB6AA9F4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d4c1925db5fb501cae4df7dcd2e3fb30df0b26a3 (commit) via 6016a5c7e1b69b9f3160dadce91ee405b9480d1e (commit) from 85f6c64358e1a1077d01b77b93c09d8d964375c9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4c1925db5fb501cae4df7dcd2e3fb30df0b26a3 commit d4c1925db5fb501cae4df7dcd2e3fb30df0b26a3 Merge: 85f6c64 6016a5c Author: Brad King AuthorDate: Mon Jan 19 11:36:07 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 11:36:07 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 6016a5c7 Revise topic 'cdash_upload_file_mode' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6016a5c7e1b69b9f3160dadce91ee405b9480d1e commit 6016a5c7e1b69b9f3160dadce91ee405b9480d1e Author: Brad King AuthorDate: Mon Jan 19 11:34:35 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 11:35:33 2015 -0500 Revise topic 'cdash_upload_file_mode' Update the head of the topic to look like a revised version with more granular commits. diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index 316a43d..2b83ed9 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -38,13 +38,15 @@ timed-out submission before attempting to re-submit. The RETRY_COUNT option specifies how many times to retry a timed-out submission. +Submit to CDash Upload API +^^^^^^^^^^^^^^^^^^^^^^^^^^ + :: - ctest_submit([CDASH_UPLOAD file] - [CDASH_UPLOAD_TYPE type_string]) + ctest_submit(CDASH_UPLOAD [CDASH_UPLOAD_TYPE ]) This second signature is used to upload files to CDash via the CDash file upload API. The api first sends a request to upload to CDash along -with the md5 sum of the file. If CDash does not already have the file, +with a content hash of the file. If CDash does not already have the file, then it is uploaded. Along with the file, a CDash type string is specified to tell CDash which handler to use to process the data. 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=`` option to specify the modification time + recorded in tarball entries. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 29fd504..34e5f9a 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -12,18 +12,29 @@ # # :: # -# ctest_coverage_collect_gcov( -# TARBALL # required -# SOURCE # optional, else CTEST_SOURCE_DIRECTORY -# BUILD # optional, else CTEST_BINARY_DIRECTORY -# GCOV_COMMAND # optional, else CTEST_COVERAGE_COMMAND -# ) +# ctest_coverage_collect_gcov(TARBALL +# [SOURCE ][BUILD ] +# [GCOV_COMMAND ] +# ) # -# Run gcov and package a tar file for cdash. ```` is the name -# of the tarfile that is created and it will be placed in ````. -# ```` is the source directory for the build and ```` -# is the binary directory for the build. The ```` is a full -# path to ``gcov`` for the machine. +# Run gcov and package a tar file for CDash. The options are: +# +# ``TARBALL `` +# Specify the location of the ``.tar`` file to be created for later +# upload to CDash. Relative paths will be interpreted with respect +# to the top-level build directory. +# +# ``SOURCE `` +# Specify the top-level source directory for the build. +# Default is the value of :variable:`CTEST_SOURCE_DIRECTORY`. +# +# ``BUILD `` +# Specify the top-level build directory for the build. +# Default is the value of :variable:`CTEST_BINARY_DIRECTORY`. +# +# ``GCOV_COMMAND `` +# Specify the full path to the ``gcov`` command on the machine. +# Default is the value of :variable:`CTEST_COVERAGE_COMMAND`. #============================================================================= # Copyright 2014-2015 Kitware, Inc. @@ -117,7 +128,7 @@ function(ctest_coverage_collect_gcov) # stamps execute_process(COMMAND ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} - --mtime=1970-01-01\ 0:0:0\ UTC ${gcov_files} + "--mtime=1970-01-01 0:0:0 UTC" ${gcov_files} ${coverage_dir}/data.json ${label_files} WORKING_DIRECTORY ${binary_dir}) endfunction() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 4ce601d..c54b943 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 diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index b354592..b0d26cc 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -1,4 +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 "cmCTestCurl.h" + #include "cmSystemTools.h" #include "cmCTest.h" @@ -42,6 +54,7 @@ curlDebugCallback(CURL *, curl_infotype, char *chPtr, } } + void cmCTestCurl::SetCurlOptions(std::vector const& args) { for( std::vector::const_iterator i = args.begin(); diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h index bb5c74a..5bb8b41 100644 --- a/Source/CTest/cmCTestCurl.h +++ b/Source/CTest/cmCTestCurl.h @@ -1,6 +1,6 @@ /*============================================================================ CMake - Cross Platform Makefile Generator - Copyright 2000-2009 Kitware, Inc. + Copyright 2000-2015 Kitware, Inc. Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. @@ -11,8 +11,11 @@ ============================================================================*/ #ifndef cmCTestCurl_h #define cmCTestCurl_h -#include "cm_curl.h" + #include "cmStandardIncludes.h" + +#include "cm_curl.h" + class cmCTest; class cmCTestCurl @@ -46,5 +49,4 @@ private: int TimeOutSeconds; }; - #endif diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index dcd7982..cc3514f 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -145,7 +145,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() static_cast(handler)->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF"); - if(this->CDashUploadFile.size()) + if (this->CDashUpload) { static_cast(handler)-> SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); @@ -155,51 +155,65 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() return handler; } +//---------------------------------------------------------------------------- +bool cmCTestSubmitCommand::InitialPass(std::vector const& args, + cmExecutionStatus& status) +{ + this->CDashUpload = !args.empty() && args[0] == "CDASH_UPLOAD"; + return this->cmCTestHandlerCommand::InitialPass(args, status); +} //---------------------------------------------------------------------------- bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg) { - // Look for arguments specific to this command. - if(arg == "PARTS") + if (this->CDashUpload) { - this->ArgumentDoing = ArgumentDoingParts; - this->PartsMentioned = true; - return true; - } + if(arg == "CDASH_UPLOAD") + { + this->ArgumentDoing = ArgumentDoingCDashUpload; + return true; + } - if(arg == "FILES") - { - this->ArgumentDoing = ArgumentDoingFiles; - this->FilesMentioned = true; - return true; + if(arg == "CDASH_UPLOAD_TYPE") + { + this->ArgumentDoing = ArgumentDoingCDashUploadType; + return true; + } } - - if(arg == "RETRY_COUNT") + else { - this->ArgumentDoing = ArgumentDoingRetryCount; - return true; - } + // Look for arguments specific to this command. + if(arg == "PARTS") + { + this->ArgumentDoing = ArgumentDoingParts; + this->PartsMentioned = true; + return true; + } - if(arg == "RETRY_DELAY") - { - this->ArgumentDoing = ArgumentDoingRetryDelay; - return true; - } + if(arg == "FILES") + { + this->ArgumentDoing = ArgumentDoingFiles; + this->FilesMentioned = true; + return true; + } - if(arg == "CDASH_UPLOAD") - { - this->ArgumentDoing = ArgumentDoingCDashUpload; - return true; - } - if(arg == "CDASH_UPLOAD_TYPE") - { - this->ArgumentDoing = ArgumentDoingCDashUploadType; - return true; - } - if(arg == "INTERNAL_TEST_CHECKSUM") - { - this->InternalTest = true; - return true; + if(arg == "RETRY_COUNT") + { + this->ArgumentDoing = ArgumentDoingRetryCount; + return true; + } + + if(arg == "RETRY_DELAY") + { + this->ArgumentDoing = ArgumentDoingRetryDelay; + return true; + } + + if(arg == "INTERNAL_TEST_CHECKSUM") + { + this->InternalTest = true; + return true; + } } // Look for other arguments. @@ -260,11 +274,14 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) if(this->ArgumentDoing == ArgumentDoingCDashUpload) { + this->ArgumentDoing = ArgumentDoingNone; this->CDashUploadFile = arg; return true; } + if(this->ArgumentDoing == ArgumentDoingCDashUploadType) { + this->ArgumentDoing = ArgumentDoingNone; this->CDashUploadType = arg; return true; } diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index cb0ac61..19e8eaf 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -32,6 +32,7 @@ public: this->InternalTest = false; this->RetryCount = ""; this->RetryDelay = ""; + this->CDashUpload = false; } /** @@ -45,6 +46,9 @@ public: return ni; } + virtual bool InitialPass(std::vector const& args, + cmExecutionStatus &status); + /** * The name of the command as specified in CMakeList.txt. */ @@ -76,6 +80,7 @@ protected: cmCTest::SetOfStrings Files; std::string RetryCount; std::string RetryDelay; + bool CDashUpload; std::string CDashUploadFile; std::string CDashUploadType; }; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 0e19259..11e3343 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1084,10 +1084,16 @@ void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod, int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, std::string const& typeString) { - if(!cmSystemTools::FileExists(file)) + if (file.empty()) { cmCTestLog(this->CTest, ERROR_MESSAGE, - "Upload file not found: " << file << "\n"); + "Upload file not specified\n"); + return -1; + } + if (!cmSystemTools::FileExists(file)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Upload file not found: '" << file << "'\n"); return -1; } cmCTestCurl curl(this->CTest); @@ -1118,6 +1124,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, static_cast(this->CTest->GetHandler("script")); cmake* cm = ch->GetCMake(); const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; str << "project=" << this->CTest->GetCTestConfiguration("ProjectName") << "&"; @@ -1214,8 +1221,7 @@ int cmCTestSubmitHandler::ProcessHandler() const char* cdashUploadType = this->GetOption("CDashUploadType"); if(cdashUploadFile && cdashUploadType) { - return this->HandleCDashUploadFile(std::string(cdashUploadFile), - std::string(cdashUploadType)); + return this->HandleCDashUploadFile(cdashUploadFile, cdashUploadType); } std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); // cdash does not need to trigger so just return true diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index fc4c40d..47ec736 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -16,6 +16,7 @@ #include #include #include +#include "cm_get_date.h" //---------------------------------------------------------------------------- static std::string cm_archive_error_string(struct archive* a) @@ -247,11 +248,6 @@ bool cmArchiveWrite::AddPath(const char* path, return true; } -// function from libarchive -extern "C" -{ - time_t __archive_get_date(time_t, const char*); -} //---------------------------------------------------------------------------- bool cmArchiveWrite::AddFile(const char* file, size_t skip, const char* prefix) @@ -280,13 +276,16 @@ bool cmArchiveWrite::AddFile(const char* file, this->Error += cm_archive_error_string(this->Disk); return false; } - if(this->MTime.size()) + if (!this->MTime.empty()) { - time_t t = __archive_get_date(0, this->MTime.c_str()); + time_t now; + time(&now); + time_t t = cm_get_date(now, this->MTime.c_str()); if (t == -1) { - this->Error = "__archive_get_date: Unable to parse mtime: "; - this->Error += "[" + this->MTime + "]"; + this->Error = "unable to parse mtime '"; + this->Error += this->MTime; + this->Error += "'"; return false; } archive_entry_set_mtime(e, t, 0); diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 987e95c..17357b4 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -74,7 +74,7 @@ public: // std::cout. void SetVerbose(bool v) { this->Verbose = v; } - void SetMTime(const char* t) { if(t) {this->MTime = t;}} + 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); diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index d8a5631..e9735ed 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1469,7 +1469,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, - bool verbose, const char* mtime) + bool verbose, std::string const& mtime) { #if defined(CMAKE_BUILD_WITH_CMAKE) std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); @@ -1501,10 +1501,7 @@ bool cmSystemTools::CreateTar(const char* outFileName, } cmArchiveWrite a(fout, compress, cmArchiveWrite::TypeTAR); - if(mtime) - { - a.SetMTime(mtime); - } + a.SetMTime(mtime); a.SetVerbose(verbose); for(std::vector::const_iterator i = files.begin(); i != files.end(); ++i) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 1c7208f..361f42e 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -395,7 +395,7 @@ public: static bool CreateTar(const char* outFileName, const std::vector& files, cmTarCompression compressType, bool verbose, - const char* mtime=0); + 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 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 + +#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/cmcmd.cxx b/Source/cmcmd.cxx index f6c13bb..7ca3eb3 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -730,19 +730,29 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) std::string outFile = args[3]; std::vector files; std::string mtime; + bool doing_options = true; for (std::string::size_type cc = 4; cc < args.size(); cc ++) { - // if the first 8 chars of an arg are --mtime= and that arg - // is not a file on disk, treat it is the --mtime= flag and - // not a file - if( (args[cc].substr(0, 8) == "--mtime=") && - !cmSystemTools::FileExists(args[cc])) + std::string const& arg = args[cc]; + if (doing_options && cmHasLiteralPrefix(arg, "--")) { - mtime = args[cc].substr(8); + 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(args[cc]); + files.push_back(arg); } } cmSystemTools::cmTarCompression compress = @@ -785,13 +795,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) } else if ( flags.find_first_of('c') != flags.npos ) { - const char* mtimestr = 0; - if(mtime.size()) - { - mtimestr = mtime.c_str(); - } if ( !cmSystemTools::CreateTar( - outFile.c_str(), files, compress, verbose, mtimestr) ) + outFile.c_str(), files, compress, verbose, mtime) ) { cmSystemTools::Error("Problem creating tar: ", outFile.c_str()); return 1; diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFILES-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFILES-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-stderr.txt new file mode 100644 index 0000000..48177e2 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadFILES/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "FILES". diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFTP-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt new file mode 100644 index 0000000..77df44f --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt @@ -0,0 +1 @@ +Only http and https are supported for CDASH_UPLOAD diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadNone-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadNone-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadNone-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadNone-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadNone-stderr.txt new file mode 100644 index 0000000..af95b5c --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadNone-stderr.txt @@ -0,0 +1 @@ +Upload file not specified diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-stderr.txt new file mode 100644 index 0000000..497ead2 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadPARTS/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "PARTS". diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt new file mode 100644 index 0000000..8c4e6b1 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "RETRY_COUNT". diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt new file mode 100644 index 0000000..6c56399 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "RETRY_DELAY". diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-result.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-stderr.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-stderr.txt new file mode 100644 index 0000000..dfa7e33 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/PARTSCDashUpload/test.cmake:[0-9]+ \(ctest_submit\): + Part name "CDASH_UPLOAD" is invalid. diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-result.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-stderr.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-stderr.txt new file mode 100644 index 0000000..42becaf --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType/test.cmake:[0-9]+ \(ctest_submit\): + Part name "CDASH_UPLOAD_TYPE" is invalid. diff --git a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake index 6f18563..bfb3b96 100644 --- a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake @@ -32,6 +32,19 @@ 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) +run_ctest_submit(PARTSCDashUpload PARTS Configure CDASH_UPLOAD) +run_ctest_submit(PARTSCDashUploadType PARTS Configure CDASH_UPLOAD_TYPE) +run_ctest_submit(CDashUploadPARTS CDASH_UPLOAD bad-upload PARTS) +run_ctest_submit(CDashUploadFILES CDASH_UPLOAD bad-upload FILES) +run_ctest_submit(CDashUploadRETRY_COUNT CDASH_UPLOAD bad-upload RETRY_COUNT) +run_ctest_submit(CDashUploadRETRY_DELAY CDASH_UPLOAD bad-upload RETRY_DELAY) +run_ctest_submit(CDashUploadNone CDASH_UPLOAD) + +function(run_ctest_CDashUploadFTP) + set(CASE_DROP_METHOD ftp) + run_ctest_submit(CDashUploadFTP CDASH_UPLOAD ${CMAKE_CURRENT_LIST_FILE}) +endfunction() +run_ctest_CDashUploadFTP() #----------------------------------------------------------------------------- # Test failed drops by various protocols 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..f9339cc --- /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 ----------------------------------------------------------------------- Summary of changes: Help/command/ctest_submit.rst | 8 +- Help/release/dev/cmake-E-tar-mtime.rst | 6 ++ Modules/CTestCoverageCollectGCOV.cmake | 35 +++++--- Source/CMakeLists.txt | 2 + Source/CTest/cmCTestCurl.cxx | 13 +++ Source/CTest/cmCTestCurl.h | 8 +- Source/CTest/cmCTestSubmitCommand.cxx | 89 ++++++++++++-------- Source/CTest/cmCTestSubmitCommand.h | 5 ++ Source/CTest/cmCTestSubmitHandler.cxx | 14 ++- Source/cmArchiveWrite.cxx | 17 ++-- Source/cmArchiveWrite.h | 2 +- Source/cmSystemTools.cxx | 7 +- Source/cmSystemTools.h | 2 +- .../{cmCommandsForBootstrap.cxx => cm_get_date.c} | 10 +-- Tests/QtAutogen/foo.h => Source/cm_get_date.h | 27 +++--- Source/cmcmd.cxx | 31 ++++--- .../CDashUploadFILES-result.txt} | 0 .../CTestSubmit/CDashUploadFILES-stderr.txt | 2 + .../CDashUploadFTP-result.txt} | 0 .../RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt | 1 + .../CDashUploadNone-result.txt} | 0 .../CTestSubmit/CDashUploadNone-stderr.txt | 1 + .../CDashUploadPARTS-result.txt} | 0 .../CTestSubmit/CDashUploadPARTS-stderr.txt | 2 + .../CDashUploadRETRY_COUNT-result.txt} | 0 .../CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt | 2 + .../CDashUploadRETRY_DELAY-result.txt} | 0 .../CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt | 2 + .../PARTSCDashUpload-result.txt} | 0 .../CTestSubmit/PARTSCDashUpload-stderr.txt | 2 + .../PARTSCDashUploadType-result.txt} | 0 .../CTestSubmit/PARTSCDashUploadType-stderr.txt | 2 + Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake | 13 +++ .../E_tar-bad-mtime1-result.txt} | 0 .../CommandLine/E_tar-bad-mtime1-stderr.txt | 2 + .../E_tar-bad-opt1-result.txt} | 0 .../RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt | 1 + .../E_tar-end-opt1-result.txt} | 0 .../RunCMake/CommandLine/E_tar-end-opt1-stderr.txt | 2 + Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 6 ++ 40 files changed, 207 insertions(+), 107 deletions(-) create mode 100644 Help/release/dev/cmake-E-tar-mtime.rst copy Source/{cmCommandsForBootstrap.cxx => cm_get_date.c} (75%) copy Tests/QtAutogen/foo.h => Source/cm_get_date.h (63%) copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadFILES-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadFILES-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadFTP-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadNone-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadNone-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadPARTS-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadPARTS-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadRETRY_COUNT-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadRETRY_DELAY-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/PARTSCDashUpload-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/PARTSCDashUpload-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/PARTSCDashUploadType-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-mtime1-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-opt1-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-end-opt1-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 11:37:27 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 11:37:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2182-g6351880 Message-ID: <20150119163727.5BBA8AAA0D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 6351880c2aa815f389e0154ab41b7138a5cbf6b4 (commit) via 485812417c68faf3f124a97aaf615b998eaa2288 (commit) via 1ceae33a983c03eebf9d4472ba4261599784d836 (commit) via de07a7c8103ea39c2ff35c3ee7de29f078c9aa8a (commit) via b0ef8f0c97b23e65902eb93be9f0724cbdc42ef2 (commit) via 05910c42abf0a3aa5d6c2094714623a0aff1b048 (commit) via b20ba217545415f7be5d85f12993d1033e54041b (commit) via e2aff06b54545512f0b0feee24dd5f9333a53eeb (commit) from d4c1925db5fb501cae4df7dcd2e3fb30df0b26a3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6351880c2aa815f389e0154ab41b7138a5cbf6b4 commit 6351880c2aa815f389e0154ab41b7138a5cbf6b4 Merge: d4c1925 4858124 Author: Brad King AuthorDate: Mon Jan 19 11:37:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 11:37:25 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 48581241 CTestCoverageCollectGCOV: Add module to run gcov 1ceae33a ctest_submit: Make CDASH_UPLOAD mode arguments more strict de07a7c8 ctest_submit: Add CDASH_UPLOAD mode to upload files to CDash b0ef8f0c Merge branch 'cmake-labels-json' into cdash_upload_file_mode 05910c42 Merge branch 'cmake-E-tar-mtime' into cdash_upload_file_mode b20ba217 cmake: Generate an internal 'Labels.json' file next to 'Labels.txt' e2aff06b cmake: Teach "-E tar" command a "--mtime=" option http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=485812417c68faf3f124a97aaf615b998eaa2288 commit 485812417c68faf3f124a97aaf615b998eaa2288 Author: Bill Hoffman AuthorDate: Wed Jan 14 10:52:26 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 11:32:41 2015 -0500 CTestCoverageCollectGCOV: Add module to run gcov Provide a function to run gcov and create a tarball of results. Since CDash tracks the md5sum of the files uploaded, use the --mtime option with "cmake -E tar" so that tar files could be created that would have the same md5sum with the same content. diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index 0a0ca23..db56010 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -63,6 +63,7 @@ All Modules /module/CPack /module/CPackWIX /module/CTest + /module/CTestCoverageCollectGCOV /module/CTestScriptMode /module/CTestUseLaunchers /module/Dart diff --git a/Help/module/CTestCoverageCollectGCOV.rst b/Help/module/CTestCoverageCollectGCOV.rst new file mode 100644 index 0000000..4c5deca --- /dev/null +++ b/Help/module/CTestCoverageCollectGCOV.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/CTestCoverageCollectGCOV.cmake diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake new file mode 100644 index 0000000..34e5f9a --- /dev/null +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -0,0 +1,134 @@ +#.rst: +# CTestCoverageCollectGCOV +# ------------------------ +# +# This module provides the function ``ctest_coverage_collect_gcov``. +# The function will run gcov on the .gcda files in a binary tree and then +# package all of the .gcov files into a tar file with a data.json. +# This file can be sent to a CDash server for display with the +# :command:`ctest_submit(CDASH_UPLOAD)` command. +# +# .. command:: cdash_coverage_collect_gcov +# +# :: +# +# ctest_coverage_collect_gcov(TARBALL +# [SOURCE ][BUILD ] +# [GCOV_COMMAND ] +# ) +# +# Run gcov and package a tar file for CDash. The options are: +# +# ``TARBALL `` +# Specify the location of the ``.tar`` file to be created for later +# upload to CDash. Relative paths will be interpreted with respect +# to the top-level build directory. +# +# ``SOURCE `` +# Specify the top-level source directory for the build. +# Default is the value of :variable:`CTEST_SOURCE_DIRECTORY`. +# +# ``BUILD `` +# Specify the top-level build directory for the build. +# Default is the value of :variable:`CTEST_BINARY_DIRECTORY`. +# +# ``GCOV_COMMAND `` +# Specify the full path to the ``gcov`` command on the machine. +# Default is the value of :variable:`CTEST_COVERAGE_COMMAND`. + +#============================================================================= +# 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.) +include(CMakeParseArguments) +function(ctest_coverage_collect_gcov) + set(options "") + set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) + set(multiValueArgs "") + cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" + "${multiValueArgs}" "" ${ARGN} ) + if(NOT DEFINED GCOV_TARBALL) + message(FATAL_ERROR + "TARBALL must be specified. for ctest_coverage_collect_gcov") + endif() + if(NOT DEFINED GCOV_SOURCE) + set(source_dir "${CTEST_SOURCE_DIRECTORY}") + else() + set(source_dir "${GCOV_SOURCE}") + endif() + if(NOT DEFINED GCOV_BUILD) + set(binary_dir "${CTEST_BINARY_DIRECTORY}") + else() + set(binary_dir "${GCOV_BUILD}") + endif() + if(NOT DEFINED GCOV_GCOV_COMMAND) + set(gcov_command "${CTEST_COVERAGE_COMMAND}") + else() + set(gcov_command "${GCOV_GCOV_COMMAND}") + endif() + # run gcov on each gcda file in the binary tree + set(gcda_files) + set(label_files) + # look for gcda files in the target directories + # could do a glob from the top of the binary tree but + # this will be faster and only look where the files will be + file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) + foreach(target_dir ${target_dirs}) + file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") + list(LENGTH gfiles len) + # if we have gcda files then also grab the labels file for that target + if(${len} GREATER 0) + file(GLOB_RECURSE lfiles RELATIVE ${binary_dir} + "${target_dir}/Labels.txt") + list(APPEND gcda_files ${gfiles}) + list(APPEND label_files ${lfiles}) + endif() + endforeach() + # return early if no coverage files were found + list(LENGTH gcda_files len) + if(len EQUAL 0) + message("ctest_coverage_collect_gcov: No .gcda files found, " + "ignoring coverage request.") + return() + endif() + # setup the dir for the coverage files + set(coverage_dir "${binary_dir}/Testing/CoverageInfo") + file(MAKE_DIRECTORY "${coverage_dir}") + # call gcov on each .gcda file + foreach (gcda_file ${gcda_files}) + # get the directory of the gcda file + get_filename_component(gcda_file ${binary_dir}/${gcda_file} ABSOLUTE) + get_filename_component(gcov_dir ${gcda_file} DIRECTORY) + # run gcov, this will produce the .gcov file in the current + # working directory + execute_process(COMMAND + ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${coverage_dir}) + endforeach() + # create json file with project information + file(WRITE ${coverage_dir}/data.json + "{ + \"Source\": \"${source_dir}\", + \"Binary\": \"${binary_dir}\" +}") + # collect the gcov files + set(gcov_files) + file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "${binary_dir}/*.gcov") + # tar up the coverage info with the same date so that the md5 + # sum will be the same for the tar file independent of file time + # stamps + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} + "--mtime=1970-01-01 0:0:0 UTC" ${gcov_files} + ${coverage_dir}/data.json ${label_files} + WORKING_DIRECTORY ${binary_dir}) +endfunction() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ceae33a983c03eebf9d4472ba4261599784d836 commit 1ceae33a983c03eebf9d4472ba4261599784d836 Author: Brad King AuthorDate: Thu Jan 15 15:23:07 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 11:32:36 2015 -0500 ctest_submit: Make CDASH_UPLOAD mode arguments more strict Disallow mixing of arguments from different command signatures. Extend the RunCMake.CTestSubmit test to cover such error cases. diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index 316a43d..2b83ed9 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -38,13 +38,15 @@ timed-out submission before attempting to re-submit. The RETRY_COUNT option specifies how many times to retry a timed-out submission. +Submit to CDash Upload API +^^^^^^^^^^^^^^^^^^^^^^^^^^ + :: - ctest_submit([CDASH_UPLOAD file] - [CDASH_UPLOAD_TYPE type_string]) + ctest_submit(CDASH_UPLOAD [CDASH_UPLOAD_TYPE ]) This second signature is used to upload files to CDash via the CDash file upload API. The api first sends a request to upload to CDash along -with the md5 sum of the file. If CDash does not already have the file, +with a content hash of the file. If CDash does not already have the file, then it is uploaded. Along with the file, a CDash type string is specified to tell CDash which handler to use to process the data. diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index dcd7982..cc3514f 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -145,7 +145,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() static_cast(handler)->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF"); - if(this->CDashUploadFile.size()) + if (this->CDashUpload) { static_cast(handler)-> SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); @@ -155,51 +155,65 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() return handler; } +//---------------------------------------------------------------------------- +bool cmCTestSubmitCommand::InitialPass(std::vector const& args, + cmExecutionStatus& status) +{ + this->CDashUpload = !args.empty() && args[0] == "CDASH_UPLOAD"; + return this->cmCTestHandlerCommand::InitialPass(args, status); +} //---------------------------------------------------------------------------- bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg) { - // Look for arguments specific to this command. - if(arg == "PARTS") + if (this->CDashUpload) { - this->ArgumentDoing = ArgumentDoingParts; - this->PartsMentioned = true; - return true; - } + if(arg == "CDASH_UPLOAD") + { + this->ArgumentDoing = ArgumentDoingCDashUpload; + return true; + } - if(arg == "FILES") - { - this->ArgumentDoing = ArgumentDoingFiles; - this->FilesMentioned = true; - return true; + if(arg == "CDASH_UPLOAD_TYPE") + { + this->ArgumentDoing = ArgumentDoingCDashUploadType; + return true; + } } - - if(arg == "RETRY_COUNT") + else { - this->ArgumentDoing = ArgumentDoingRetryCount; - return true; - } + // Look for arguments specific to this command. + if(arg == "PARTS") + { + this->ArgumentDoing = ArgumentDoingParts; + this->PartsMentioned = true; + return true; + } - if(arg == "RETRY_DELAY") - { - this->ArgumentDoing = ArgumentDoingRetryDelay; - return true; - } + if(arg == "FILES") + { + this->ArgumentDoing = ArgumentDoingFiles; + this->FilesMentioned = true; + return true; + } - if(arg == "CDASH_UPLOAD") - { - this->ArgumentDoing = ArgumentDoingCDashUpload; - return true; - } - if(arg == "CDASH_UPLOAD_TYPE") - { - this->ArgumentDoing = ArgumentDoingCDashUploadType; - return true; - } - if(arg == "INTERNAL_TEST_CHECKSUM") - { - this->InternalTest = true; - return true; + if(arg == "RETRY_COUNT") + { + this->ArgumentDoing = ArgumentDoingRetryCount; + return true; + } + + if(arg == "RETRY_DELAY") + { + this->ArgumentDoing = ArgumentDoingRetryDelay; + return true; + } + + if(arg == "INTERNAL_TEST_CHECKSUM") + { + this->InternalTest = true; + return true; + } } // Look for other arguments. @@ -260,11 +274,14 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) if(this->ArgumentDoing == ArgumentDoingCDashUpload) { + this->ArgumentDoing = ArgumentDoingNone; this->CDashUploadFile = arg; return true; } + if(this->ArgumentDoing == ArgumentDoingCDashUploadType) { + this->ArgumentDoing = ArgumentDoingNone; this->CDashUploadType = arg; return true; } diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index cb0ac61..19e8eaf 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -32,6 +32,7 @@ public: this->InternalTest = false; this->RetryCount = ""; this->RetryDelay = ""; + this->CDashUpload = false; } /** @@ -45,6 +46,9 @@ public: return ni; } + virtual bool InitialPass(std::vector const& args, + cmExecutionStatus &status); + /** * The name of the command as specified in CMakeList.txt. */ @@ -76,6 +80,7 @@ protected: cmCTest::SetOfStrings Files; std::string RetryCount; std::string RetryDelay; + bool CDashUpload; std::string CDashUploadFile; std::string CDashUploadType; }; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 0e19259..11e3343 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1084,10 +1084,16 @@ void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod, int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, std::string const& typeString) { - if(!cmSystemTools::FileExists(file)) + if (file.empty()) { cmCTestLog(this->CTest, ERROR_MESSAGE, - "Upload file not found: " << file << "\n"); + "Upload file not specified\n"); + return -1; + } + if (!cmSystemTools::FileExists(file)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Upload file not found: '" << file << "'\n"); return -1; } cmCTestCurl curl(this->CTest); @@ -1118,6 +1124,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, static_cast(this->CTest->GetHandler("script")); cmake* cm = ch->GetCMake(); const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; str << "project=" << this->CTest->GetCTestConfiguration("ProjectName") << "&"; @@ -1214,8 +1221,7 @@ int cmCTestSubmitHandler::ProcessHandler() const char* cdashUploadType = this->GetOption("CDashUploadType"); if(cdashUploadFile && cdashUploadType) { - return this->HandleCDashUploadFile(std::string(cdashUploadFile), - std::string(cdashUploadType)); + return this->HandleCDashUploadFile(cdashUploadFile, cdashUploadType); } std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); // cdash does not need to trigger so just return true diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFILES-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFILES-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-stderr.txt new file mode 100644 index 0000000..48177e2 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadFILES/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "FILES". diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFTP-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt new file mode 100644 index 0000000..77df44f --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt @@ -0,0 +1 @@ +Only http and https are supported for CDASH_UPLOAD diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadNone-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadNone-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadNone-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadNone-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadNone-stderr.txt new file mode 100644 index 0000000..af95b5c --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadNone-stderr.txt @@ -0,0 +1 @@ +Upload file not specified diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-stderr.txt new file mode 100644 index 0000000..497ead2 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadPARTS/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "PARTS". diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt new file mode 100644 index 0000000..8c4e6b1 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "RETRY_COUNT". diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt new file mode 100644 index 0000000..6c56399 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "RETRY_DELAY". diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-result.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-stderr.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-stderr.txt new file mode 100644 index 0000000..dfa7e33 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/PARTSCDashUpload/test.cmake:[0-9]+ \(ctest_submit\): + Part name "CDASH_UPLOAD" is invalid. diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-result.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-stderr.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-stderr.txt new file mode 100644 index 0000000..42becaf --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType/test.cmake:[0-9]+ \(ctest_submit\): + Part name "CDASH_UPLOAD_TYPE" is invalid. diff --git a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake index 6f18563..bfb3b96 100644 --- a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake @@ -32,6 +32,19 @@ 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) +run_ctest_submit(PARTSCDashUpload PARTS Configure CDASH_UPLOAD) +run_ctest_submit(PARTSCDashUploadType PARTS Configure CDASH_UPLOAD_TYPE) +run_ctest_submit(CDashUploadPARTS CDASH_UPLOAD bad-upload PARTS) +run_ctest_submit(CDashUploadFILES CDASH_UPLOAD bad-upload FILES) +run_ctest_submit(CDashUploadRETRY_COUNT CDASH_UPLOAD bad-upload RETRY_COUNT) +run_ctest_submit(CDashUploadRETRY_DELAY CDASH_UPLOAD bad-upload RETRY_DELAY) +run_ctest_submit(CDashUploadNone CDASH_UPLOAD) + +function(run_ctest_CDashUploadFTP) + set(CASE_DROP_METHOD ftp) + run_ctest_submit(CDashUploadFTP CDASH_UPLOAD ${CMAKE_CURRENT_LIST_FILE}) +endfunction() +run_ctest_CDashUploadFTP() #----------------------------------------------------------------------------- # Test failed drops by various protocols http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de07a7c8103ea39c2ff35c3ee7de29f078c9aa8a commit de07a7c8103ea39c2ff35c3ee7de29f078c9aa8a Author: Bill Hoffman AuthorDate: Wed Jan 14 10:54:25 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 11:32:31 2015 -0500 ctest_submit: Add CDASH_UPLOAD mode to upload files to CDash This adds support for the new cdash API where arbitrary files can be uploaded to the CDash server. This CDash API communicates via json files so the json parser jsoncpp was added to the Utilities directory. diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index d9b0b78..316a43d 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -37,3 +37,14 @@ timed-out submission before attempting to re-submit. The RETRY_COUNT option specifies how many times to retry a timed-out submission. + +:: + + ctest_submit([CDASH_UPLOAD file] + [CDASH_UPLOAD_TYPE type_string]) + +This second signature is used to upload files to CDash via the CDash +file upload API. The api first sends a request to upload to CDash along +with the md5 sum of the file. If CDash does not already have the file, +then it is uploaded. Along with the file, a CDash type string is specified +to tell CDash which handler to use to process the data. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 435b654..c54b943 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -537,6 +537,7 @@ set(CTEST_SRCS cmCTest.cxx CTest/cmCTestConfigureHandler.cxx CTest/cmCTestCoverageCommand.cxx CTest/cmCTestCoverageHandler.cxx + CTest/cmCTestCurl.cxx CTest/cmParseMumpsCoverage.cxx CTest/cmParseCacheCoverage.cxx CTest/cmParseGTMCoverage.cxx diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx new file mode 100644 index 0000000..b0d26cc --- /dev/null +++ b/Source/CTest/cmCTestCurl.cxx @@ -0,0 +1,271 @@ +/*============================================================================ + 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 "cmCTestCurl.h" + +#include "cmSystemTools.h" +#include "cmCTest.h" + +cmCTestCurl::cmCTestCurl(cmCTest* ctest) +{ + this->CTest = ctest; + this->SetProxyType(); + this->UseHttp10 = false; + // In windows, this will init the winsock stuff + ::curl_global_init(CURL_GLOBAL_ALL); + // default is to verify https + this->VerifyPeerOff = false; + this->VerifyHostOff = false; + this->TimeOutSeconds = 0; +} + +namespace +{ +static size_t +curlWriteMemoryCallback(void *ptr, size_t size, size_t nmemb, + void *data) +{ + int realsize = (int)(size * nmemb); + + std::vector *vec + = static_cast* >(data); + const char* chPtr = static_cast(ptr); + vec->insert(vec->end(), chPtr, chPtr + realsize); + return realsize; +} + +static size_t +curlDebugCallback(CURL *, curl_infotype, char *chPtr, + size_t size, void *data) +{ + std::vector *vec + = static_cast* >(data); + vec->insert(vec->end(), chPtr, chPtr + size); + + return size; +} + +} + +void cmCTestCurl::SetCurlOptions(std::vector const& args) +{ + for( std::vector::const_iterator i = args.begin(); + i != args.end(); ++i) + { + if(*i == "CURLOPT_SSL_VERIFYPEER_OFF") + { + this->VerifyPeerOff = true; + } + if(*i == "CURLOPT_SSL_VERIFYHOST_OFF") + { + this->VerifyHostOff = true; + } + } +} + +bool cmCTestCurl::InitCurl() +{ + this->Curl = curl_easy_init(); + if(!this->Curl) + { + return false; + } + if(this->VerifyPeerOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYPEER, 0); + } + if(this->VerifyHostOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYHOST, 0); + } + if(this->HTTPProxy.size()) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXY, this->HTTPProxy.c_str()); + curl_easy_setopt(this->Curl, CURLOPT_PROXYTYPE, this->HTTPProxyType); + if (this->HTTPProxyAuth.size() > 0) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXYUSERPWD, + this->HTTPProxyAuth.c_str()); + } + } + if(this->UseHttp10) + { + curl_easy_setopt(this->Curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + } + // enable HTTP ERROR parsing + curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + return true; +} + + +bool cmCTestCurl::UploadFile(std::string const& local_file, + std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + /* enable uploading */ + curl_easy_setopt(this->Curl, CURLOPT_UPLOAD, 1); + // if there is little to no activity for too long stop submitting + if(this->TimeOutSeconds) + { + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_LIMIT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_TIME, + this->TimeOutSeconds); + } + /* HTTP PUT please */ + ::curl_easy_setopt(this->Curl, CURLOPT_PUT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_VERBOSE, 1); + + FILE* ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); + if(!ftpfile) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not open file for upload: " << local_file << "\n"); + return false; + } + // set the url + std::string upload_url = url; + upload_url += "?"; + upload_url += fields; + ::curl_easy_setopt(this->Curl, CURLOPT_URL, upload_url.c_str()); + // now specify which file to upload + ::curl_easy_setopt(this->Curl, CURLOPT_INFILE, ftpfile); + unsigned long filelen = cmSystemTools::FileLength(local_file); + // and give the size of the upload (optional) + ::curl_easy_setopt(this->Curl, CURLOPT_INFILESIZE, + static_cast(filelen)); + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + // Now run off and do what you've been told! + ::curl_easy_perform(this->Curl); + ::fclose(ftpfile); + ::curl_global_cleanup(); + + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Curl response: [" << response << "]\n"); + } + std::string curlDebug; + if ( debugData.size() > 0 ) + { + curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + if(response.size() == 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "No response from server.\n" << + curlDebug); + return false; + } + return true; +} + +bool cmCTestCurl::HttpRequest(std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + cmCTestLog(this->CTest, DEBUG, "HttpRequest\n" + << "url: " << url << "\n" + << "fields " << fields << "\n"); + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + curl_easy_setopt(this->Curl, CURLOPT_POST, 1); + curl_easy_setopt(this->Curl, CURLOPT_POSTFIELDS, fields.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_URL, url.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_FOLLOWLOCATION, 1); + //set response options + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + + CURLcode res = ::curl_easy_perform(this->Curl); + + ::curl_easy_cleanup(this->Curl); + ::curl_global_cleanup(); + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl response: [" << response << "]\n"); + } + if ( debugData.size() > 0 ) + { + std::string curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + cmCTestLog(this->CTest, DEBUG, "Curl res: " << res << "\n"); + return (res == 0); +} + +void cmCTestCurl::SetProxyType() +{ + if ( cmSystemTools::GetEnv("HTTP_PROXY") ) + { + this->HTTPProxy = cmSystemTools::GetEnv("HTTP_PROXY"); + if ( cmSystemTools::GetEnv("HTTP_PROXY_PORT") ) + { + this->HTTPProxy += ":"; + this->HTTPProxy += cmSystemTools::GetEnv("HTTP_PROXY_PORT"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_TYPE") ) + { + // this is the default + this->HTTPProxyType = CURLPROXY_HTTP; + std::string type = cmSystemTools::GetEnv("HTTP_PROXY_TYPE"); + // HTTP/SOCKS4/SOCKS5 + if ( type == "HTTP" ) + { + this->HTTPProxyType = CURLPROXY_HTTP; + } + else if ( type == "SOCKS4" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS4; + } + else if ( type == "SOCKS5" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS5; + } + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_USER") ) + { + this->HTTPProxyAuth = cmSystemTools::GetEnv("HTTP_PROXY_USER"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_PASSWD") ) + { + this->HTTPProxyAuth += ":"; + this->HTTPProxyAuth += cmSystemTools::GetEnv("HTTP_PROXY_PASSWD"); + } + } +} diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h new file mode 100644 index 0000000..5bb8b41 --- /dev/null +++ b/Source/CTest/cmCTestCurl.h @@ -0,0 +1,52 @@ +/*============================================================================ + 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 cmCTestCurl_h +#define cmCTestCurl_h + +#include "cmStandardIncludes.h" + +#include "cm_curl.h" + +class cmCTest; + +class cmCTestCurl +{ +public: + cmCTestCurl(cmCTest*); + bool UploadFile(std::string const& url, + std::string const& file, + std::string const& fields, + std::string& response); + bool HttpRequest(std::string const& url, + std::string const& fields, + std::string& response); + // currently only supports CURLOPT_SSL_VERIFYPEER_OFF + // and CURLOPT_SSL_VERIFYHOST_OFF + void SetCurlOptions(std::vector const& args); + void SetUseHttp10On() { this->UseHttp10 = true;} + void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s;} +protected: + void SetProxyType(); + bool InitCurl(); +private: + cmCTest* CTest; + CURL* Curl; + std::string HTTPProxyAuth; + std::string HTTPProxy; + curl_proxytype HTTPProxyType; + bool VerifyHostOff; + bool VerifyPeerOff; + bool UseHttp10; + int TimeOutSeconds; +}; + +#endif diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 4005a63..dcd7982 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -27,7 +27,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() = this->Makefile->GetDefinition("CTEST_TRIGGER_SITE"); bool ctestDropSiteCDash = this->Makefile->IsOn("CTEST_DROP_SITE_CDASH"); - + const char* ctestProjectName + = this->Makefile->GetDefinition("CTEST_PROJECT_NAME"); if ( !ctestDropMethod ) { ctestDropMethod = "http"; @@ -43,7 +44,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() // error: CDash requires CTEST_DROP_LOCATION definition // in CTestConfig.cmake } - + this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName); this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod); this->CTest->SetCTestConfiguration("DropSite", ctestDropSite); this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation); @@ -144,6 +145,13 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() static_cast(handler)->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF"); + if(this->CDashUploadFile.size()) + { + static_cast(handler)-> + SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); + static_cast(handler)-> + SetOption("CDashUploadType", this->CDashUploadType.c_str()); + } return handler; } @@ -178,6 +186,16 @@ bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg) return true; } + if(arg == "CDASH_UPLOAD") + { + this->ArgumentDoing = ArgumentDoingCDashUpload; + return true; + } + if(arg == "CDASH_UPLOAD_TYPE") + { + this->ArgumentDoing = ArgumentDoingCDashUploadType; + return true; + } if(arg == "INTERNAL_TEST_CHECKSUM") { this->InternalTest = true; @@ -240,6 +258,17 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) return true; } + if(this->ArgumentDoing == ArgumentDoingCDashUpload) + { + this->CDashUploadFile = arg; + return true; + } + if(this->ArgumentDoing == ArgumentDoingCDashUploadType) + { + this->CDashUploadType = arg; + return true; + } + // Look for other arguments. return this->Superclass::CheckArgumentValue(arg); } diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index 3673fbd..cb0ac61 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -64,6 +64,8 @@ protected: ArgumentDoingFiles, ArgumentDoingRetryDelay, ArgumentDoingRetryCount, + ArgumentDoingCDashUpload, + ArgumentDoingCDashUploadType, ArgumentDoingLast2 }; @@ -74,6 +76,8 @@ protected: cmCTest::SetOfStrings Files; std::string RetryCount; std::string RetryDelay; + std::string CDashUploadFile; + std::string CDashUploadType; }; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index bc6fb31..0e19259 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -10,7 +10,8 @@ See the License for more information. ============================================================================*/ #include "cmCTestSubmitHandler.h" - +#include "cmCTestScriptHandler.h" +#include "cmake.h" #include "cmSystemTools.h" #include "cmVersion.h" #include "cmGeneratedFileStream.h" @@ -23,8 +24,10 @@ // For XML-RPC submission #include "cm_xmlrpc.h" +#include // For curl submission #include "cm_curl.h" +#include "cmCTestCurl.h" #include @@ -1055,9 +1058,165 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(std::string const&, } #endif +void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod, + std::string& url) +{ + dropMethod = this->CTest->GetCTestConfiguration("DropMethod"); + url = dropMethod; + url += "://"; + if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 ) + { + url += this->CTest->GetCTestConfiguration("DropSiteUser"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + this->CTest->GetCTestConfiguration("DropSiteUser").c_str()); + if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 ) + { + url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******"); + } + url += "@"; + } + url += this->CTest->GetCTestConfiguration("DropSite") + + this->CTest->GetCTestConfiguration("DropLocation"); +} + + +int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, + std::string const& typeString) +{ + if(!cmSystemTools::FileExists(file)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Upload file not found: " << file << "\n"); + return -1; + } + cmCTestCurl curl(this->CTest); + std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); + std::vector args; + cmSystemTools::ExpandListArgument(curlopt, args); + curl.SetCurlOptions(args); + curl.SetTimeOutSeconds(SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT); + std::string dropMethod; + std::string url; + this->ConstructCDashURL(dropMethod, url); + std::string::size_type pos = url.find("submit.php?"); + url = url.substr(0, pos+10); + if ( ! (dropMethod == "http" || dropMethod == "https" ) ) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Only http and https are supported for CDASH_UPLOAD\n"); + return -1; + } + char md5sum[33]; + md5sum[32] = 0; + cmSystemTools::ComputeFileMD5(file, md5sum); + // 1. request the buildid and check to see if the file + // has already been uploaded + // TODO I added support for subproject. You would need to add + // a "&subproject=subprojectname" to the first POST. + cmCTestScriptHandler* ch = + static_cast(this->CTest->GetHandler("script")); + cmake* cm = ch->GetCMake(); + const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + std::ostringstream str; + str << "project=" + << this->CTest->GetCTestConfiguration("ProjectName") << "&"; + if(subproject) + { + str << "subproject=" << subproject << "&"; + } + str << "stamp=" << this->CTest->GetCurrentTag() << "-" + << this->CTest->GetTestModelString() << "&" + << "model=" << this->CTest->GetTestModelString() << "&" + << "build=" << this->CTest->GetCTestConfiguration("BuildName") << "&" + << "site=" << this->CTest->GetCTestConfiguration("Site") << "&" + << "track=" << this->CTest->GetTestModelString() << "&" + << "starttime=" << (int)cmSystemTools::GetTime() << "&" + << "endtime=" << (int)cmSystemTools::GetTime() << "&" + << "datafilesmd5[0]=" << md5sum << "&" + << "type=" << typeString; + std::string fields = str.str(); + cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:" + << url << "\nfile: " << file << "\n"); + std::string response; + if(!curl.HttpRequest(url, fields, response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error in HttpRequest\n" << response); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Request upload response: [" << response << "]\n"); + Json::Value json; + Json::Reader reader; + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + if(json["status"].asInt() != 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Bad status returned from CDash: " + << json["status"].asInt()); + return -1; + } + if(json["datafilesmd5"].isArray()) + { + int datares = json["datafilesmd5"][0].asInt(); + if(datares == 1) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "File already exists on CDash, skip upload " + << file << "\n"); + return 0; + } + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "bad datafilesmd5 value in response " + << response << "\n"); + return -1; + } + + std::string upload_as = cmSystemTools::GetFilenameName(file); + std::ostringstream fstr; + fstr << "type=" << typeString << "&" + << "md5=" << md5sum << "&" + << "filename=" << upload_as << "&" + << "buildid=" << json["buildid"].asString(); + if(!curl.UploadFile(file, url, fstr.str(), response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error uploading to CDash. " + << file << " " << url << " " << fstr.str()); + return -1; + } + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Upload file response: [" << response << "]\n"); + return 0; +} + //---------------------------------------------------------------------------- int cmCTestSubmitHandler::ProcessHandler() { + const char* cdashUploadFile = this->GetOption("CDashUploadFile"); + const char* cdashUploadType = this->GetOption("CDashUploadType"); + if(cdashUploadFile && cdashUploadType) + { + return this->HandleCDashUploadFile(std::string(cdashUploadFile), + std::string(cdashUploadType)); + } std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); // cdash does not need to trigger so just return true if(!iscdash.empty()) diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index accabd1..f9cd894 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -41,6 +41,11 @@ public: /** Specify a set of files to submit. */ void SelectFiles(cmCTest::SetOfStrings const& files); + // handle the cdash file upload protocol + int HandleCDashUploadFile(std::string const& file, std::string const& type); + + void ConstructCDashURL(std::string& dropMethod, std::string& url); + private: void SetLogFile(std::ostream* ost) { this->LogFile = ost; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0ef8f0c97b23e65902eb93be9f0724cbdc42ef2 commit b0ef8f0c97b23e65902eb93be9f0724cbdc42ef2 Merge: 05910c4 b20ba21 Author: Brad King AuthorDate: Mon Jan 19 11:32:23 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 11:32:23 2015 -0500 Merge branch 'cmake-labels-json' into cdash_upload_file_mode http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05910c42abf0a3aa5d6c2094714623a0aff1b048 commit 05910c42abf0a3aa5d6c2094714623a0aff1b048 Merge: 2e71d92 e2aff06 Author: Brad King AuthorDate: Mon Jan 19 11:32:12 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 11:32:12 2015 -0500 Merge branch 'cmake-E-tar-mtime' into cdash_upload_file_mode http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b20ba217545415f7be5d85f12993d1033e54041b commit b20ba217545415f7be5d85f12993d1033e54041b Author: Brad King AuthorDate: Fri Jan 16 15:35:36 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 11:29:56 2015 -0500 cmake: Generate an internal 'Labels.json' file next to 'Labels.txt' In each internal target directory we generate a "Labels.txt" file containing labels for that target and its sources, but it uses an internal format. In order to make the list of labels easier to publish, use a json format and call it "Labels.json". diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 96f4709..6b6008d 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -500,7 +500,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} + cmjsoncpp + ) # On Apple we need CoreFoundation if(APPLE) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 1745d9a..dd3b1ec 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -38,6 +38,8 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) # include +# include "cm_jsoncpp_value.h" +# include "cm_jsoncpp_writer.h" #endif #include // required for atof @@ -2911,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()); @@ -2929,6 +2942,7 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target) li != labels.end(); ++li) { fout << " " << *li << "\n"; + lj_target_labels.append(*li); } } @@ -2954,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::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/Utilities/cm_jsoncpp_value.h b/Utilities/cm_jsoncpp_value.h new file mode 100644 index 0000000..15e1088 --- /dev/null +++ b/Utilities/cm_jsoncpp_value.h @@ -0,0 +1,18 @@ +/*============================================================================ + 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 + +#endif diff --git a/Utilities/cm_jsoncpp_writer.h b/Utilities/cm_jsoncpp_writer.h new file mode 100644 index 0000000..c410369 --- /dev/null +++ b/Utilities/cm_jsoncpp_writer.h @@ -0,0 +1,18 @@ +/*============================================================================ + 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 + +#endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e2aff06b54545512f0b0feee24dd5f9333a53eeb commit e2aff06b54545512f0b0feee24dd5f9333a53eeb Author: Brad King AuthorDate: Wed Jan 14 13:22:29 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 11:12:57 2015 -0500 cmake: Teach "-E tar" command a "--mtime=" option Add an option to set the mtime of entries in a tarball so that one can create a tarball with a consistent content hash (e.g. MD5) for a given set of files regardless of their current timestamps on disk. This will be useful for submission of tarballs to CDash, which tracks content hashes to avoid duplication. Inspired-by: Bill Hoffman 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=`` option to specify the modification time + recorded in tarball entries. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 96f4709..caabd43 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 diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index a2aecac..47ec736 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -16,6 +16,7 @@ #include #include #include +#include "cm_get_date.h" //---------------------------------------------------------------------------- static std::string cm_archive_error_string(struct archive* a) @@ -275,6 +276,20 @@ bool cmArchiveWrite::AddFile(const char* file, 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/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 7d938c5..e9735ed 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1469,7 +1469,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& 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::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& 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/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 + +#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/cmcmd.cxx b/Source/cmcmd.cxx index ecf4650..7ca3eb3 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -729,9 +729,31 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) std::string flags = args[2]; std::string outFile = args[3]; std::vector 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& 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; 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..f9339cc --- /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 ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From robert.maynard at kitware.com Mon Jan 19 12:59:12 2015 From: robert.maynard at kitware.com (Robert Maynard) Date: Mon, 19 Jan 2015 12:59:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2189-gecfb1d6 Message-ID: <20150119175912.C939DAA374@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ecfb1d6137b547f9b3b9fe5517a8aba3c177fb97 (commit) via 7c335f150524a219f44023eeeb353c6ae5bd67b8 (commit) via adfba79088fa3370fc9d77082e0aaedf045851e6 (commit) via fc44c07b9c0ff06e0810e3547c6fe661e786d4ba (commit) via 54da94ad01f457cfab41c3e479bba083a67ab552 (commit) via 797dc0cf0d3f1fba43a9689499c466f09ba2900d (commit) via b69437a25d0132cd153d9a037207a440c9fa4815 (commit) from 6351880c2aa815f389e0154ab41b7138a5cbf6b4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ecfb1d6137b547f9b3b9fe5517a8aba3c177fb97 commit ecfb1d6137b547f9b3b9fe5517a8aba3c177fb97 Merge: 6351880 7c335f1 Author: Robert Maynard AuthorDate: Mon Jan 19 12:59:11 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 12:59:11 2015 -0500 Merge topic 'feature-record-msvc' into next 7c335f15 Merge topic 'SolarisStudio-compile-features' into feature-record-msvc adfba790 Features: Temporarily exclude MSVC from Link Feature tests. fc44c07b Features: Enable writing of MSVC compiler feature header. 54da94ad Features: Record for MSVC C++ 2015 and MSVC C 2010-2015. 797dc0cf Features: Record for MSVC 2010-2013. b69437a2 Extend test for MSVC. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c335f150524a219f44023eeeb353c6ae5bd67b8 commit 7c335f150524a219f44023eeeb353c6ae5bd67b8 Merge: adfba79 bcb0478 Author: Robert Maynard AuthorDate: Mon Jan 19 12:58:57 2015 -0500 Commit: Robert Maynard CommitDate: Mon Jan 19 12:58:57 2015 -0500 Merge topic 'SolarisStudio-compile-features' into feature-record-msvc Conflicts: Modules/WriteCompilerDetectionHeader.cmake Tests/CompileFeatures/CMakeLists.txt Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt diff --cc Modules/WriteCompilerDetectionHeader.cmake index 2ecf481,e81bc08..5642c99 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@@ -321,7 -321,7 +321,8 @@@ function(write_compiler_detection_heade GNU Clang AppleClang + MSVC + SunPro ) set(_hex_compilers ADSP Borland Embarcadero SunPro) diff --cc Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index cfaa78c,b725919..3d8bf31 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@@ -11,7 -11,7 +11,7 @@@ get_property(c_known_features GLOBAL PR write_compiler_detection_header( FILE "${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h" PREFIX TEST - COMPILERS GNU Clang AppleClang MSVC - COMPILERS GNU Clang AppleClang SunPro ++ COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 PROLOG "// something" EPILOG "// more" @@@ -93,7 -82,7 +94,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 MSVC - COMPILERS GNU Clang AppleClang SunPro ++ COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=adfba79088fa3370fc9d77082e0aaedf045851e6 commit adfba79088fa3370fc9d77082e0aaedf045851e6 Author: Robert Maynard AuthorDate: Mon Jan 19 12:50:24 2015 -0500 Commit: Robert Maynard CommitDate: Mon Jan 19 12:50:24 2015 -0500 Features: Temporarily exclude MSVC from Link Feature tests. While we are working on figuring out the best way to detect a C++ feature cycle with MSVC disable these tests. This will allow us to verify the rest of the MSVC Feature tests are working properly. diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..f890f24 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,8 +27,10 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) - run_cmake(LinkImplementationFeatureCycleSolved) + if(NOT MSVC) + run_cmake(LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycleSolved) + endif() if (";${CXX_FEATURES};" MATCHES ";cxx_final;") set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc44c07b9c0ff06e0810e3547c6fe661e786d4ba commit fc44c07b9c0ff06e0810e3547c6fe661e786d4ba Author: Robert Maynard AuthorDate: Thu Jan 15 13:14:53 2015 -0500 Commit: Robert Maynard CommitDate: Mon Jan 19 11:10:30 2015 -0500 Features: Enable writing of MSVC compiler feature header. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index a6ff475..2ecf481 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC ) set(_hex_compilers ADSP Borland Embarcadero SunPro) diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 11a9584..d67adfe 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -207,6 +207,7 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_FINAL=0 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) + endif() endif() add_executable(CompileFeaturesGenex genex_test.cpp) diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 401de95..cfaa78c 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 MSVC VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -64,6 +64,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -81,7 +93,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 MSVC VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54da94ad01f457cfab41c3e479bba083a67ab552 commit 54da94ad01f457cfab41c3e479bba083a67ab552 Author: Robert Maynard AuthorDate: Thu Jan 15 13:05:19 2015 -0500 Commit: Robert Maynard CommitDate: Mon Jan 19 11:10:30 2015 -0500 Features: Record for MSVC C++ 2015 and MSVC C 2010-2015. Notes: Initializer lists are only properly supported in 2015 and above. Previous Visual Studio releases said they supported initializer lists VS2012 and above to conform to cxx_decltype_incomplete_return_types proposal, but without support for auto return types, the feature is unusable so only state support in VS2015 and above. VS2010 and above to conform to the updated cxx_contextual_conversions proposal. diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake index 18dea24..476f244 100644 --- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -1,8 +1,39 @@ # Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx # http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx -set(_oldestSupported "_MSC_VER >= 1600") + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +# In theory decltype incomplete return types was added in 2012 +# but without support for decltype_auto and return type deduction this +# feature is unusable +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") set(MSVC_2013 "_MSC_VER >= 1800") set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") @@ -11,8 +42,6 @@ set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") -# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221 -set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}") set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") @@ -21,7 +50,6 @@ set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") set(MSVC_2012 "_MSC_VER >= 1700") -set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") set(_cmake_feature_test_cxx_final "${MSVC_2012}") set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") @@ -30,6 +58,10 @@ set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") set(MSVC_2010 "_MSC_VER >= 1600") set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +# Microsoft now states they support contextual conversions +# see footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2010}") set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") @@ -42,24 +74,27 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") # Currently unsupported: # http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ -# set(_cmake_feature_test_cxx_reference_qualified_functions ) -# set(_cmake_feature_test_cxx_inheriting_constructors ) -# set(_cmake_feature_test_cxx_alignas ) -# set(_cmake_feature_test_cxx_alignof ) -# set(_cmake_feature_test_cxx_thread_local ) -# set(_cmake_feature_test_cxx_func_identifier ) -# set(_cmake_feature_test_cxx_sizeof_member ) +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -# set(_cmake_feature_test_cxx_user_literals ) -# set(_cmake_feature_test_cxx_unrestricted_unions ) -# set(_cmake_feature_test_cxx_unicode_literals ) -# set(_cmake_feature_test_cxx_inline_namespaces ) +# set(_cmake_feature_test_cxx_reference_qualified_functions ) # set(_cmake_feature_test_cxx_constexpr ) -# set(_cmake_feature_test_cxx_noexcept ) # set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + -set(_oldestSupported) +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Platform/Windows-MSVC-C.cmake b/Modules/Platform/Windows-MSVC-C.cmake index cbe1586..c7792eb 100644 --- a/Modules/Platform/Windows-MSVC-C.cmake +++ b/Modules/Platform/Windows-MSVC-C.cmake @@ -3,3 +3,5 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_C " /FS") endif() __windows_compiler_msvc(C) + +set(CMAKE_C_STANDARD_DEFAULT 90) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 89885b8..ad56f68 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -5,6 +5,11 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) endif() __windows_compiler_msvc(CXX) +# No version of MSVC has full conformance to C++11. Therefore the +# __cplusplus macro always evaluates to 98 even if the compilers come with +# C++11/14/+ features enabled. +set(CMAKE_CXX_STANDARD_DEFAULT 98) + macro(cmake_record_cxx_compile_features) record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=797dc0cf0d3f1fba43a9689499c466f09ba2900d commit 797dc0cf0d3f1fba43a9689499c466f09ba2900d Author: Stephen Kelly AuthorDate: Sun Apr 6 15:55:37 2014 +0200 Commit: Robert Maynard CommitDate: Mon Jan 19 11:10:30 2015 -0500 Features: Record for MSVC 2010-2013. diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..18dea24 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,65 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx + +set(_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221 +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Possibly broken: +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_inheriting_constructors ) +# set(_cmake_feature_test_cxx_alignas ) +# set(_cmake_feature_test_cxx_alignof ) +# set(_cmake_feature_test_cxx_thread_local ) +# set(_cmake_feature_test_cxx_func_identifier ) +# set(_cmake_feature_test_cxx_sizeof_member ) + +# set(_cmake_feature_test_cxx_user_literals ) +# set(_cmake_feature_test_cxx_unrestricted_unions ) +# set(_cmake_feature_test_cxx_unicode_literals ) +# set(_cmake_feature_test_cxx_inline_namespaces ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_noexcept ) +# set(_cmake_feature_test_cxx_attributes ) + +set(_oldestSupported) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 0e85005..89885b8 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -4,3 +4,7 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_CXX " /FS") endif() __windows_compiler_msvc(CXX) + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b69437a25d0132cd153d9a037207a440c9fa4815 commit b69437a25d0132cd153d9a037207a440c9fa4815 Author: Stephen Kelly AuthorDate: Thu Jan 15 21:55:18 2015 +0100 Commit: Robert Maynard CommitDate: Mon Jan 19 11:10:29 2015 -0500 Extend test for MSVC. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 106f29c..11a9584 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -188,6 +188,25 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=0 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) endif() add_executable(CompileFeaturesGenex genex_test.cpp) ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 100 ++++++++++++++++++++ Modules/Platform/Windows-MSVC-C.cmake | 2 + Modules/Platform/Windows-MSVC-CXX.cmake | 9 ++ Modules/WriteCompilerDetectionHeader.cmake | 5 +- Tests/CompileFeatures/CMakeLists.txt | 20 ++++ .../WriteCompilerDetectionHeader/CMakeLists.txt | 16 +++- Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake | 6 +- 7 files changed, 152 insertions(+), 6 deletions(-) create mode 100644 Modules/Compiler/MSVC-CXX-FeatureTests.cmake hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 13:53:31 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 13:53:31 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2191-g700ed02 Message-ID: <20150119185331.73225AA173@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 700ed02cc88ff28d80330cea7543a7220c5f7409 (commit) via 00194ea752ed02dbe70a808b337cf630735f2894 (commit) from ecfb1d6137b547f9b3b9fe5517a8aba3c177fb97 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=700ed02cc88ff28d80330cea7543a7220c5f7409 commit 700ed02cc88ff28d80330cea7543a7220c5f7409 Merge: ecfb1d6 00194ea Author: Brad King AuthorDate: Mon Jan 19 13:53:30 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 13:53:30 2015 -0500 Merge topic 'SolarisStudio-compile-features' into next 00194ea7 Help: Add notes for topic 'SolarisStudio-compile-features' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00194ea752ed02dbe70a808b337cf630735f2894 commit 00194ea752ed02dbe70a808b337cf630735f2894 Author: Brad King AuthorDate: Mon Jan 19 13:51:38 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 13:51:38 2015 -0500 Help: Add notes for topic 'SolarisStudio-compile-features' 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 ` functionality + is now aware of features supported by Oracle SolarisStudio (``SunPro``). ----------------------------------------------------------------------- Summary of changes: Help/release/dev/SolarisStudio-compile-features.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Help/release/dev/SolarisStudio-compile-features.rst hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 13:54:16 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 13:54:16 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2193-g108f1c4 Message-ID: <20150119185416.9925AAA19C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 108f1c46e6ed1e0046dd6176e8a11a3ce582bbf8 (commit) via 3a147e1b623a4b8bb381c4b651cf983e294f3509 (commit) from 700ed02cc88ff28d80330cea7543a7220c5f7409 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=108f1c46e6ed1e0046dd6176e8a11a3ce582bbf8 commit 108f1c46e6ed1e0046dd6176e8a11a3ce582bbf8 Merge: 700ed02 3a147e1 Author: Brad King AuthorDate: Mon Jan 19 13:54:15 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 13:54:15 2015 -0500 Merge topic 'emacs-mode-fix-word-at-point' into next 3a147e1b cmake-mode.el: Re-add explicit call to require thingatpt http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a147e1b623a4b8bb381c4b651cf983e294f3509 commit 3a147e1b623a4b8bb381c4b651cf983e294f3509 Author: Peter Vasil AuthorDate: Mon Jan 19 19:49:07 2015 +0100 Commit: Brad King CommitDate: Mon Jan 19 13:53:38 2015 -0500 cmake-mode.el: Re-add explicit call to require thingatpt Usually it is not needed to call '(require 'thingatpt')' explicitly because the function 'symbol-at-point' is in autoloaded but to be sure to have the function loaded in every case, require thingatpt. diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index 37ca942..7458a66 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -320,6 +320,7 @@ 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)) ----------------------------------------------------------------------- Summary of changes: Auxiliary/cmake-mode.el | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 13:55:28 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 13:55:28 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-893-g0898de9 Message-ID: <20150119185528.51E8DAA1E5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0898de99cc085fee8534369aea27e9333b53d694 (commit) via 59e6e15cde911e182e471df5b99746e0e203ba43 (commit) via 54156d723a3fde678ed7f884364ad0449d23ad2b (commit) via d84d6ed409c663573a02efa7d2692b6829d27c46 (commit) via 7dcdfec97fdefa90bded7868a638277d7c9903f1 (commit) from 2e71d92ef270c4234368fd2e88259c0defbfb650 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0898de99cc085fee8534369aea27e9333b53d694 commit 0898de99cc085fee8534369aea27e9333b53d694 Merge: 2e71d92 59e6e15 Author: Brad King AuthorDate: Mon Jan 19 13:55:27 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 13:55:27 2015 -0500 Merge topic 'WriteCompilerDetectionHeader-multi-file-lang' 59e6e15c Help: Add notes for topic 'WriteCompilerDetectionHeader-multi-file-lang' 54156d72 WCDH: Generate per-language files in multi-file mode. d84d6ed4 WCDH: Allow compilers to specify features for one language but not the other. 7dcdfec9 WCDH: Find a language-specific DetermineCompiler.cmake if present. ----------------------------------------------------------------------- Summary of changes: ...riteCompilerDetectionHeader-multi-file-lang.rst | 6 +++ Modules/WriteCompilerDetectionHeader.cmake | 44 +++++++++++++------- 2 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 Help/release/dev/WriteCompilerDetectionHeader-multi-file-lang.rst hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 13:55:30 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 13:55:30 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-899-g137a15b Message-ID: <20150119185530.C6663AA1E8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 137a15bf1da72c795d8eeded4ad3848a5692dce6 (commit) via 00194ea752ed02dbe70a808b337cf630735f2894 (commit) via bcb04783f7abd1e7781eda7499b53118fdbe8000 (commit) via 536c535cb0cf245a1785d436b0662f7fe59ef1e4 (commit) via 5d57970dd9ddea70163bdd3c64fbf365a15af9fb (commit) via 69182ce4ed95c62d51e208c8620ff4e6599dee2e (commit) from 0898de99cc085fee8534369aea27e9333b53d694 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=137a15bf1da72c795d8eeded4ad3848a5692dce6 commit 137a15bf1da72c795d8eeded4ad3848a5692dce6 Merge: 0898de9 00194ea Author: Brad King AuthorDate: Mon Jan 19 13:55:29 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 13:55:29 2015 -0500 Merge topic 'SolarisStudio-compile-features' 00194ea7 Help: Add notes for topic 'SolarisStudio-compile-features' bcb04783 Features: Record for SolarisStudio 12.4. 536c535c Features: Adjust cxx_variadic_templates unit test for SolarisStudio. 5d57970d Features: Use variable in cxx_inheriting_constructors test. 69182ce4 Features: Ensure that the cxx_auto_type test is correct. ----------------------------------------------------------------------- Summary of changes: .../release/dev/SolarisStudio-compile-features.rst | 5 ++ Modules/Compiler/SunPro-CXX-FeatureTests.cmake | 52 ++++++++++++++++++++ Modules/Compiler/SunPro-CXX.cmake | 21 ++++++++ Modules/WriteCompilerDetectionHeader.cmake | 1 + Tests/CompileFeatures/CMakeLists.txt | 18 +++++++ Tests/CompileFeatures/cxx_auto_type.cpp | 9 +++- .../cxx_inheriting_constructors.cpp | 2 +- Tests/CompileFeatures/cxx_variadic_templates.cpp | 21 +++++--- .../WriteCompilerDetectionHeader/CMakeLists.txt | 7 +-- 9 files changed, 125 insertions(+), 11 deletions(-) create mode 100644 Help/release/dev/SolarisStudio-compile-features.rst create mode 100644 Modules/Compiler/SunPro-CXX-FeatureTests.cmake hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 13:55:33 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 13:55:33 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-907-g813ace9 Message-ID: <20150119185533.2689AAA1E5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 813ace90e4d02a782176ea13bcec15a3e9338210 (commit) via 004e1540e0870e9b3bde19ad16c4f50b7d22df73 (commit) via 2a5ca650c9f973c83fe3d5b070f6313e1bd536c1 (commit) via 1ae2c6b2c9def9f0d0db3a808290d485eccf062c (commit) via c66e3317492709ab3b830024f67021dde67a7fe5 (commit) via c43a6dc5ec2ac57d8334beeabf90de43e8ddb829 (commit) via 782591350ced90d4289d220f91bdbdb4acec2ba6 (commit) via 7b9fc88b045fd34df73e3cc864c9ac924a449cd3 (commit) from 137a15bf1da72c795d8eeded4ad3848a5692dce6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=813ace90e4d02a782176ea13bcec15a3e9338210 commit 813ace90e4d02a782176ea13bcec15a3e9338210 Merge: 137a15b 004e154 Author: Brad King AuthorDate: Mon Jan 19 13:55:31 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 13:55:31 2015 -0500 Merge topic 'GNU-4.4-compile-features' 004e1540 Features: Record for GNU 4.4. 2a5ca650 Features: Wrap failure-test in UNIX condition. 1ae2c6b2 Features: Blacklist cxx_constexpr test for GNU 4.5. c66e3317 Features: Use a more-common feature in cycle-test. c43a6dc5 Features: Update comment in test to match the code. 78259135 Features: Test presence of cxx_auto_type with genex. 7b9fc88b Features: Remove outdated comment. diff --cc Tests/CompileFeatures/CMakeLists.txt index 182954e,ccd6f30..5cd0836 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -51,18 -51,15 +51,26 @@@ if (CMAKE_CXX_COMPILER_ID STREQUAL "App ) 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 + # GNU 4.5, but it is first documented as available with GNU 4.6. + list(REMOVE_ITEM CXX_non_features + cxx_constexpr + ) + endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) # The cxx_alignof feature happens to work (for *this* testcase) with # GNU 4.7, but it is first documented as available with GNU 4.8. ----------------------------------------------------------------------- Summary of changes: ...compile-features.rst => GNU-4.4-compile-features.rst} | 4 ++-- Modules/Compiler/GNU-C-FeatureTests.cmake | 4 ++-- Modules/Compiler/GNU-C.cmake | 6 +++--- Modules/Compiler/GNU-CXX-FeatureTests.cmake | 9 +++------ Modules/Compiler/GNU-CXX.cmake | 6 +++--- Tests/CompileFeatures/CMakeLists.txt | 14 +++++++++++--- Tests/CompileFeatures/genex_test.cpp | 13 +++---------- Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt | 14 ++++++++------ .../CompileFeatures/LinkImplementationFeatureCycle.cmake | 6 +++--- 9 files changed, 38 insertions(+), 38 deletions(-) rename Help/release/dev/{GNU-4.6-compile-features.rst => GNU-4.4-compile-features.rst} (52%) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 13:55:52 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 13:55:52 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2197-g26883b2 Message-ID: <20150119185552.0BB2EAA1E7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 26883b20debd5facab0eb9a2baa08b98a4df1eb0 (commit) via 813ace90e4d02a782176ea13bcec15a3e9338210 (commit) via 137a15bf1da72c795d8eeded4ad3848a5692dce6 (commit) via 0898de99cc085fee8534369aea27e9333b53d694 (commit) from 108f1c46e6ed1e0046dd6176e8a11a3ce582bbf8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=26883b20debd5facab0eb9a2baa08b98a4df1eb0 commit 26883b20debd5facab0eb9a2baa08b98a4df1eb0 Merge: 108f1c4 813ace9 Author: Brad King AuthorDate: Mon Jan 19 13:55:44 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 13:55:44 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Mon Jan 19 14:04:52 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 19 Jan 2015 14:04:52 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2200-g41a41e6 Message-ID: <20150119190452.3C643AA52D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 41a41e60fdc05c31ce5fafb5b2242fabc207c4db (commit) via 3c0996c135198fbcaf8951cffc98e3a1570e756d (commit) via 8dc0c976661ff048c346d6c68666bd7056ed84a5 (commit) from 26883b20debd5facab0eb9a2baa08b98a4df1eb0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41a41e60fdc05c31ce5fafb5b2242fabc207c4db commit 41a41e60fdc05c31ce5fafb5b2242fabc207c4db Merge: 26883b2 3c0996c Author: Stephen Kelly AuthorDate: Mon Jan 19 14:04:51 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 14:04:51 2015 -0500 Merge topic 'WriteCompilerDetectionHeader-tests' into next 3c0996c1 WCDH: Test that no C compiler features are defined for CXX compiler. 8dc0c976 WCDH: Fix the C_STANDARD property in the tests. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c0996c135198fbcaf8951cffc98e3a1570e756d commit 3c0996c135198fbcaf8951cffc98e3a1570e756d Author: Stephen Kelly AuthorDate: Mon Jan 19 19:52:22 2015 +0100 Commit: Stephen Kelly CommitDate: Mon Jan 19 20:03:23 2015 +0100 WCDH: Test that no C compiler features are defined for CXX compiler. This amends commit 54156d72 (WCDH: Generate per-language files in multi-file mode., 2015-01-17). diff --git a/Tests/Module/WriteCompilerDetectionHeader/main.cpp b/Tests/Module/WriteCompilerDetectionHeader/main.cpp index 82b2191..192094c 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/main.cpp +++ b/Tests/Module/WriteCompilerDetectionHeader/main.cpp @@ -4,6 +4,10 @@ #define PREFIX TEST #include "compile_tests.h" +#ifdef TEST_COMPILER_C_STATIC_ASSERT +#error Expect no C features defined +#endif + int main() { return 0; diff --git a/Tests/Module/WriteCompilerDetectionHeader/multi_files.cpp b/Tests/Module/WriteCompilerDetectionHeader/multi_files.cpp index ca29823..1635091 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/multi_files.cpp +++ b/Tests/Module/WriteCompilerDetectionHeader/multi_files.cpp @@ -4,6 +4,10 @@ #define PREFIX MULTI #include "compile_tests.h" +#ifdef MULTI_COMPILER_C_STATIC_ASSERT +#error Expect no C features defined +#endif + int main() { return 0; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8dc0c976661ff048c346d6c68666bd7056ed84a5 commit 8dc0c976661ff048c346d6c68666bd7056ed84a5 Author: Stephen Kelly AuthorDate: Mon Jan 19 19:43:04 2015 +0100 Commit: Stephen Kelly CommitDate: Mon Jan 19 19:57:54 2015 +0100 WCDH: Fix the C_STANDARD property in the tests. The CXX_STANDARD property validates the values allowed for it, and '90' is not a valid value for it. However, the validation is only done for languages enabled for the target, and as C_undefined has no CXX files, that language is not enabled for it. This amends commit v3.1.0-rc3~23^2 (WCDH: Make the header -Wundef safe for the C language., 2014-11-24). diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index b5e46c0..78c4a6a 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -71,7 +71,7 @@ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") add_executable(C_undefined c_undefined.c) - set_property(TARGET C_undefined PROPERTY CXX_STANDARD 90) + set_property(TARGET C_undefined PROPERTY C_STANDARD 90) target_compile_options(C_undefined PRIVATE -Werror=undef) endif() ----------------------------------------------------------------------- Summary of changes: Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt | 2 +- Tests/Module/WriteCompilerDetectionHeader/main.cpp | 4 ++++ Tests/Module/WriteCompilerDetectionHeader/multi_files.cpp | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 14:15:34 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 14:15:34 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2202-g4426234 Message-ID: <20150119191534.A2F57A6A67@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 44262347099d0de4dd421a15e647a7fdb33f83ab (commit) via 00eaf2acbc37a0e514e94f0180e9edfc6e804f06 (commit) from 41a41e60fdc05c31ce5fafb5b2242fabc207c4db (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44262347099d0de4dd421a15e647a7fdb33f83ab commit 44262347099d0de4dd421a15e647a7fdb33f83ab Merge: 41a41e6 00eaf2a Author: Brad King AuthorDate: Mon Jan 19 14:15:34 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 14:15:34 2015 -0500 Merge topic 'cmake-E-tar-mtime' into next 00eaf2ac cmake: Teach -E tar to report file name on failure to read from disk http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=00eaf2acbc37a0e514e94f0180e9edfc6e804f06 commit 00eaf2acbc37a0e514e94f0180e9edfc6e804f06 Author: Brad King AuthorDate: Mon Jan 19 14:14:18 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 14:14:18 2015 -0500 cmake: Teach -E tar to report file name on failure to read from disk The libarchive-provided error message does not always include the file name, so add it to the message ourselves to ensure users know which file fails. diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 47ec736..c24c68e 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -272,7 +272,9 @@ 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; } diff --git a/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt index f9339cc..1fddf6d 100644 --- a/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt +++ b/Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt @@ -1,2 +1,2 @@ -^CMake Error: archive_read_disk_entry_from_file:.*--bad +^CMake Error: archive_read_disk_entry_from_file '--bad':.* CMake Error: Problem creating tar: bad.tar$ ----------------------------------------------------------------------- Summary of changes: Source/cmArchiveWrite.cxx | 4 +++- Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From steveire at gmail.com Mon Jan 19 14:58:12 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 19 Jan 2015 14:58:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2204-g9b7ab08 Message-ID: <20150119195812.58064AA30B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9b7ab08044e7d024e225efb44835153f53c6c1dd (commit) via a6a1adb59fc0003cbd520e7994c3cf1d05df54db (commit) from 44262347099d0de4dd421a15e647a7fdb33f83ab (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b7ab08044e7d024e225efb44835153f53c6c1dd commit 9b7ab08044e7d024e225efb44835153f53c6c1dd Merge: 4426234 a6a1adb Author: Stephen Kelly AuthorDate: Mon Jan 19 14:58:11 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 14:58:11 2015 -0500 Merge topic 'doc-unsupported-compilers' into next a6a1adb5 Help: Document unsupported compilers in the release notes. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6a1adb59fc0003cbd520e7994c3cf1d05df54db commit a6a1adb59fc0003cbd520e7994c3cf1d05df54db Author: Stephen Kelly AuthorDate: Mon Jan 19 20:57:25 2015 +0100 Commit: Stephen Kelly CommitDate: Mon Jan 19 20:57:25 2015 +0100 Help: Document unsupported compilers in the release notes. 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. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/unsupported-compilers.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Help/release/dev/unsupported-compilers.rst hooks/post-receive -- CMake From robert.maynard at kitware.com Mon Jan 19 15:02:26 2015 From: robert.maynard at kitware.com (Robert Maynard) Date: Mon, 19 Jan 2015 15:02:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2210-gb37304e Message-ID: <20150119200226.8381EAA4DC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b37304eb1acedcd57c40a0eedc6c93e5db21027f (commit) via b8f3ed834c03bbe4a1eb61041f6c650f31601743 (commit) via ee51008df2b4120eac0ff072090d528174c3cfd9 (commit) via 73bb00ad863be2e54cce4abe43f3e24ea2c5a720 (commit) via 4daddae7099c3faa18c7f7aad8bb363b70e9623d (commit) via 5c02d2be180b8e0b16206cf56ac41324435f0188 (commit) from 9b7ab08044e7d024e225efb44835153f53c6c1dd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b37304eb1acedcd57c40a0eedc6c93e5db21027f commit b37304eb1acedcd57c40a0eedc6c93e5db21027f Merge: 9b7ab08 b8f3ed8 Author: Robert Maynard AuthorDate: Mon Jan 19 15:02:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 15:02:25 2015 -0500 Merge topic 'feature-record-msvc' into next b8f3ed83 Features: Exclude MSVC from Link Feature tests. ee51008d Features: Enable writing of MSVC compiler feature header. 73bb00ad Features: Record for MSVC 2010-2015. 4daddae7 Features: Record for MSVC 2010-2013. 5c02d2be Extend test for MSVC. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8f3ed834c03bbe4a1eb61041f6c650f31601743 commit b8f3ed834c03bbe4a1eb61041f6c650f31601743 Author: Robert Maynard AuthorDate: Mon Jan 19 12:50:24 2015 -0500 Commit: Robert Maynard CommitDate: Mon Jan 19 15:01:45 2015 -0500 Features: Exclude MSVC from Link Feature tests. Compilers such as MSVC have no explicit flags to enable C++11/14/17 mode, instead the compiler comes with a set list of supported features. This combined with the fact that MSVC has no C++ ABI compatibility means that this test is not needed for MSVC. diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..f890f24 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,8 +27,10 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) - run_cmake(LinkImplementationFeatureCycleSolved) + if(NOT MSVC) + run_cmake(LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycleSolved) + endif() if (";${CXX_FEATURES};" MATCHES ";cxx_final;") set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ee51008df2b4120eac0ff072090d528174c3cfd9 commit ee51008df2b4120eac0ff072090d528174c3cfd9 Author: Robert Maynard AuthorDate: Thu Jan 15 13:14:53 2015 -0500 Commit: Robert Maynard CommitDate: Mon Jan 19 15:01:45 2015 -0500 Features: Enable writing of MSVC compiler feature header. diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index e81bc08..5642c99 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC SunPro ) diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index b5e46c0..43e89ab 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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -67,6 +67,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -84,7 +96,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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=73bb00ad863be2e54cce4abe43f3e24ea2c5a720 commit 73bb00ad863be2e54cce4abe43f3e24ea2c5a720 Author: Robert Maynard AuthorDate: Thu Jan 15 13:05:19 2015 -0500 Commit: Robert Maynard CommitDate: Mon Jan 19 15:01:40 2015 -0500 Features: Record for MSVC 2010-2015. Notes: Initializer lists are only properly supported in 2015 and above. Previous Visual Studio releases said they supported initializer lists VS2012 and above to conform to cxx_decltype_incomplete_return_types proposal, but without support for auto return types, the feature is unusable so only state support in VS2015 and above. VS2010 and above to conform to the updated cxx_contextual_conversions proposal. diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake index 18dea24..476f244 100644 --- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -1,8 +1,39 @@ # Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx # http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx -set(_oldestSupported "_MSC_VER >= 1600") + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +# In theory decltype incomplete return types was added in 2012 +# but without support for decltype_auto and return type deduction this +# feature is unusable +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") set(MSVC_2013 "_MSC_VER >= 1800") set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") @@ -11,8 +42,6 @@ set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") -# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221 -set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}") set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") @@ -21,7 +50,6 @@ set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") set(MSVC_2012 "_MSC_VER >= 1700") -set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") set(_cmake_feature_test_cxx_final "${MSVC_2012}") set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") @@ -30,6 +58,10 @@ set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") set(MSVC_2010 "_MSC_VER >= 1600") set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +# Microsoft now states they support contextual conversions +# see footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2010}") set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") @@ -42,24 +74,27 @@ set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") # Currently unsupported: # http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ -# set(_cmake_feature_test_cxx_reference_qualified_functions ) -# set(_cmake_feature_test_cxx_inheriting_constructors ) -# set(_cmake_feature_test_cxx_alignas ) -# set(_cmake_feature_test_cxx_alignof ) -# set(_cmake_feature_test_cxx_thread_local ) -# set(_cmake_feature_test_cxx_func_identifier ) -# set(_cmake_feature_test_cxx_sizeof_member ) +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -# set(_cmake_feature_test_cxx_user_literals ) -# set(_cmake_feature_test_cxx_unrestricted_unions ) -# set(_cmake_feature_test_cxx_unicode_literals ) -# set(_cmake_feature_test_cxx_inline_namespaces ) +# set(_cmake_feature_test_cxx_reference_qualified_functions ) # set(_cmake_feature_test_cxx_constexpr ) -# set(_cmake_feature_test_cxx_noexcept ) # set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + -set(_oldestSupported) +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 89885b8..ad56f68 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -5,6 +5,11 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) endif() __windows_compiler_msvc(CXX) +# No version of MSVC has full conformance to C++11. Therefore the +# __cplusplus macro always evaluates to 98 even if the compilers come with +# C++11/14/+ features enabled. +set(CMAKE_CXX_STANDARD_DEFAULT 98) + macro(cmake_record_cxx_compile_features) record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4daddae7099c3faa18c7f7aad8bb363b70e9623d commit 4daddae7099c3faa18c7f7aad8bb363b70e9623d Author: Stephen Kelly AuthorDate: Sun Apr 6 15:55:37 2014 +0200 Commit: Robert Maynard CommitDate: Mon Jan 19 14:32:47 2015 -0500 Features: Record for MSVC 2010-2013. diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..18dea24 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,65 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx + +set(_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +# http://thread.gmane.org/gmane.comp.lib.boost.devel/245202/focus=245221 +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Possibly broken: +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2012}") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_inheriting_constructors ) +# set(_cmake_feature_test_cxx_alignas ) +# set(_cmake_feature_test_cxx_alignof ) +# set(_cmake_feature_test_cxx_thread_local ) +# set(_cmake_feature_test_cxx_func_identifier ) +# set(_cmake_feature_test_cxx_sizeof_member ) + +# set(_cmake_feature_test_cxx_user_literals ) +# set(_cmake_feature_test_cxx_unrestricted_unions ) +# set(_cmake_feature_test_cxx_unicode_literals ) +# set(_cmake_feature_test_cxx_inline_namespaces ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_noexcept ) +# set(_cmake_feature_test_cxx_attributes ) + +set(_oldestSupported) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 0e85005..89885b8 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -4,3 +4,7 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_CXX " /FS") endif() __windows_compiler_msvc(CXX) + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c02d2be180b8e0b16206cf56ac41324435f0188 commit 5c02d2be180b8e0b16206cf56ac41324435f0188 Author: Stephen Kelly AuthorDate: Thu Jan 15 21:55:18 2015 +0100 Commit: Robert Maynard CommitDate: Mon Jan 19 14:32:46 2015 -0500 Extend test for MSVC. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 5cd0836..a0dc2a5 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -207,6 +207,26 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=0 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") add_definitions( -DEXPECT_OVERRIDE_CONTROL=1 ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 15:18:53 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 15:18:53 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2211-g53a30cb Message-ID: <20150119201853.E3A53A7B18@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 53a30cbdf04d7f04097473c451d1a5a1bfbba506 (commit) from b37304eb1acedcd57c40a0eedc6c93e5db21027f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53a30cbdf04d7f04097473c451d1a5a1bfbba506 commit 53a30cbdf04d7f04097473c451d1a5a1bfbba506 Merge: b37304e 004e154 Author: Brad King AuthorDate: Mon Jan 19 15:12:26 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 15:18:33 2015 -0500 Merge branch 'GNU-4.4-compile-features' into next Revert stray changes from 'next' that appeared due to repeated merges of this topic. ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 15:22:11 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 15:22:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2212-g4bb9d1e Message-ID: <20150119202211.8096CA8C81@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4bb9d1e3dfe398e2835387cf1dd0b9c753fbf7d1 (commit) from 53a30cbdf04d7f04097473c451d1a5a1bfbba506 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bb9d1e3dfe398e2835387cf1dd0b9c753fbf7d1 commit 4bb9d1e3dfe398e2835387cf1dd0b9c753fbf7d1 Merge: 53a30cb b8f3ed8 Author: Brad King AuthorDate: Mon Jan 19 15:20:51 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 15:21:44 2015 -0500 Merge branch 'feature-record-msvc' into next Revert stray changes from 'next' that appeared due to repeated merges of this topic. ----------------------------------------------------------------------- Summary of changes: Modules/Platform/Windows-MSVC-C.cmake | 2 -- 1 file changed, 2 deletions(-) hooks/post-receive -- CMake From robert.maynard at kitware.com Mon Jan 19 15:50:45 2015 From: robert.maynard at kitware.com (Robert Maynard) Date: Mon, 19 Jan 2015 15:50:45 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2215-g7b307f3 Message-ID: <20150119205045.17322A51EF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7b307f3eb0a5cbc044370754a6b5883bf22c7e07 (commit) via d275eb11df7a090b5fb42882690783b5296619c6 (commit) via 9ab6fd968501383f1ab3e54a28ab3c51b84b47ac (commit) from 4bb9d1e3dfe398e2835387cf1dd0b9c753fbf7d1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b307f3eb0a5cbc044370754a6b5883bf22c7e07 commit 7b307f3eb0a5cbc044370754a6b5883bf22c7e07 Merge: 4bb9d1e d275eb1 Author: Robert Maynard AuthorDate: Mon Jan 19 15:50:44 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 15:50:44 2015 -0500 Merge topic 'feature-record-msvc' into next d275eb11 Features: Record for MSVC 2010-2015. 9ab6fd96 Features: Exclude MSVC from Link Feature tests. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d275eb11df7a090b5fb42882690783b5296619c6 commit d275eb11df7a090b5fb42882690783b5296619c6 Author: Robert Maynard AuthorDate: Mon Jan 19 15:49:06 2015 -0500 Commit: Robert Maynard CommitDate: Mon Jan 19 15:49:06 2015 -0500 Features: Record for MSVC 2010-2015. Co-Author: Stephen Kelly Notes: Initializer lists are only properly supported in 2015 and above. Previous Visual Studio releases said they supported initializer lists VS2012 and above to conform to cxx_decltype_incomplete_return_types proposal, but without support for auto return types, the feature is unusable so only state support in VS2015 and above. VS2010 and above to conform to the updated cxx_contextual_conversions proposal. diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..476f244 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,100 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +# In theory decltype incomplete return types was added in 2012 +# but without support for decltype_auto and return type deduction this +# feature is unusable +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Possibly broken: +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +# Microsoft now states they support contextual conversions +# see footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx + +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + + +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 0e85005..ad56f68 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -4,3 +4,12 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_CXX " /FS") endif() __windows_compiler_msvc(CXX) + +# No version of MSVC has full conformance to C++11. Therefore the +# __cplusplus macro always evaluates to 98 even if the compilers come with +# C++11/14/+ features enabled. +set(CMAKE_CXX_STANDARD_DEFAULT 98) + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index e81bc08..5642c99 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC SunPro ) diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index b5e46c0..43e89ab 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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -67,6 +67,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -84,7 +96,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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ab6fd968501383f1ab3e54a28ab3c51b84b47ac commit 9ab6fd968501383f1ab3e54a28ab3c51b84b47ac Author: Robert Maynard AuthorDate: Mon Jan 19 12:50:24 2015 -0500 Commit: Robert Maynard CommitDate: Mon Jan 19 15:41:42 2015 -0500 Features: Exclude MSVC from Link Feature tests. Compilers such as MSVC have no explicit flags to enable C++11/14/17 mode, instead the compiler comes with a set list of supported features. This combined with the fact that MSVC has no C++ ABI compatibility means that this test is not needed for MSVC. diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..f890f24 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,8 +27,10 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) - run_cmake(LinkImplementationFeatureCycleSolved) + if(NOT MSVC) + run_cmake(LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycleSolved) + endif() if (";${CXX_FEATURES};" MATCHES ";cxx_final;") set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From steveire at gmail.com Mon Jan 19 16:33:01 2015 From: steveire at gmail.com (Stephen Kelly) Date: Mon, 19 Jan 2015 16:33:01 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2217-g7634fd7 Message-ID: <20150119213301.27F3FAA3B3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7634fd7e72e85b5573fc33059fffaaa03da8fd37 (commit) via 59e3569c7280aee1736e141487f506e423c33948 (commit) from 7b307f3eb0a5cbc044370754a6b5883bf22c7e07 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7634fd7e72e85b5573fc33059fffaaa03da8fd37 commit 7634fd7e72e85b5573fc33059fffaaa03da8fd37 Merge: 7b307f3 59e3569 Author: Stephen Kelly AuthorDate: Mon Jan 19 16:33:00 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 16:33:00 2015 -0500 Merge topic 'doc-virtual-override-specifiers-links' into next 59e3569c Help: Link relevant documents for virtual override features (#15311) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59e3569c7280aee1736e141487f506e423c33948 commit 59e3569c7280aee1736e141487f506e423c33948 Author: Stephen Kelly AuthorDate: Mon Jan 19 22:32:06 2015 +0100 Commit: Stephen Kelly CommitDate: Mon Jan 19 22:32:06 2015 +0100 Help: Link relevant documents for virtual override features (#15311) 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_. ----------------------------------------------------------------------- Summary of changes: Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 19 16:40:05 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 19 Jan 2015 16:40:05 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2219-gda8512d Message-ID: <20150119214005.0948721EA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via da8512dc174a42f6b4ac949b27cc789462f7aba3 (commit) via d8f93f6e9a4678385f6f2b8c108311e2fcdf376d (commit) from 7634fd7e72e85b5573fc33059fffaaa03da8fd37 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da8512dc174a42f6b4ac949b27cc789462f7aba3 commit da8512dc174a42f6b4ac949b27cc789462f7aba3 Merge: 7634fd7 d8f93f6 Author: Brad King AuthorDate: Mon Jan 19 16:40:04 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 19 16:40:04 2015 -0500 Merge topic 'doc-virtual-override-specifiers-links' into next d8f93f6e Help: Link relevant documents for virtual override features (#15311) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d8f93f6e9a4678385f6f2b8c108311e2fcdf376d commit d8f93f6e9a4678385f6f2b8c108311e2fcdf376d Author: Stephen Kelly AuthorDate: Mon Jan 19 22:32:06 2015 +0100 Commit: Brad King CommitDate: Mon Jan 19 16:38:06 2015 -0500 Help: Link relevant documents for virtual override features (#15311) 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_. ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jan 20 00:01:19 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 20 Jan 2015 00:01:19 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-908-g70eb44b Message-ID: <20150120050119.6D9B2AA1FE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 70eb44b7dcf86e23716dc0e036941abe887bc756 (commit) from 813ace90e4d02a782176ea13bcec15a3e9338210 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=70eb44b7dcf86e23716dc0e036941abe887bc756 commit 70eb44b7dcf86e23716dc0e036941abe887bc756 Author: Kitware Robot AuthorDate: Tue Jan 20 00:01:17 2015 -0500 Commit: Kitware Robot CommitDate: Tue Jan 20 00:01:17 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index daae107..3dd8e7b 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 20150119) +set(CMake_VERSION_PATCH 20150120) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:19:36 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:19:36 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2222-g0b2ef52 Message-ID: <20150120141936.D3700A9869@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0b2ef5281ebbbfb1daad42b5a427ca70431ac095 (commit) via 3a60c899fce77f221cba670b62c90fe2d2daffed (commit) via 90f9c42732a18e53943c3aa27de76c2511c5a0c6 (commit) from da8512dc174a42f6b4ac949b27cc789462f7aba3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b2ef5281ebbbfb1daad42b5a427ca70431ac095 commit 0b2ef5281ebbbfb1daad42b5a427ca70431ac095 Merge: da8512d 3a60c89 Author: Brad King AuthorDate: Tue Jan 20 09:19:35 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 09:19:35 2015 -0500 Merge topic 'cmake-E-tar-mtime' into next 3a60c899 cmake: Teach "-E tar" command a "--mtime=" option 90f9c427 cmake: Teach "-E tar" to report file name on failure to read from disk http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a60c899fce77f221cba670b62c90fe2d2daffed commit 3a60c899fce77f221cba670b62c90fe2d2daffed Author: Brad King AuthorDate: Wed Jan 14 13:22:29 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 14:16:19 2015 -0500 cmake: Teach "-E tar" command a "--mtime=" option Add an option to set the mtime of entries in a tarball so that one can create a tarball with a consistent content hash (e.g. MD5) for a given set of files regardless of their current timestamps on disk. This will be useful for submission of tarballs to CDash, which tracks content hashes to avoid duplication. Inspired-by: Bill Hoffman 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=`` option to specify the modification time + recorded in tarball entries. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 96f4709..caabd43 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 diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 16f67f4..c24c68e 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -16,6 +16,7 @@ #include #include #include +#include "cm_get_date.h" //---------------------------------------------------------------------------- static std::string cm_archive_error_string(struct archive* a) @@ -277,6 +278,20 @@ bool cmArchiveWrite::AddFile(const char* file, 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/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 7d938c5..e9735ed 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1469,7 +1469,7 @@ bool cmSystemTools::IsPathToFramework(const char* path) bool cmSystemTools::CreateTar(const char* outFileName, const std::vector& 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::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& 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/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 + +#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/cmcmd.cxx b/Source/cmcmd.cxx index ecf4650..7ca3eb3 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -729,9 +729,31 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) std::string flags = args[2]; std::string outFile = args[3]; std::vector 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& 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; 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 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=90f9c42732a18e53943c3aa27de76c2511c5a0c6 commit 90f9c42732a18e53943c3aa27de76c2511c5a0c6 Author: Brad King AuthorDate: Mon Jan 19 14:14:18 2015 -0500 Commit: Brad King CommitDate: Mon Jan 19 14:15:58 2015 -0500 cmake: Teach "-E tar" to report file name on failure to read from disk The libarchive-provided error message does not always include the file name, so add it to the message ourselves to ensure users know which file fails. diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index a2aecac..16f67f4 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -271,7 +271,9 @@ 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; } ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:19:54 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:19:54 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-910-gcf17d41 Message-ID: <20150120141954.1AD06A9B84@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via cf17d41535962f4b94ac45a3d5870c59b63641d1 (commit) via d8f93f6e9a4678385f6f2b8c108311e2fcdf376d (commit) from 70eb44b7dcf86e23716dc0e036941abe887bc756 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cf17d41535962f4b94ac45a3d5870c59b63641d1 commit cf17d41535962f4b94ac45a3d5870c59b63641d1 Merge: 70eb44b d8f93f6 Author: Brad King AuthorDate: Tue Jan 20 09:19:52 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 09:19:52 2015 -0500 Merge topic 'doc-virtual-override-specifiers-links' d8f93f6e Help: Link relevant documents for virtual override features (#15311) ----------------------------------------------------------------------- Summary of changes: Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:19:57 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:19:57 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-913-g4970ac3 Message-ID: <20150120141957.188A4A9AA4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 4970ac3d5fe1b0bc3519753fe50e4397c074353e (commit) via 9e0176e2b37b93f34718b6333edd73302b5c5350 (commit) via c0ff542c58e48ac91714d9dc44058c9cb42fb828 (commit) from cf17d41535962f4b94ac45a3d5870c59b63641d1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4970ac3d5fe1b0bc3519753fe50e4397c074353e commit 4970ac3d5fe1b0bc3519753fe50e4397c074353e Merge: cf17d41 9e0176e Author: Brad King AuthorDate: Tue Jan 20 09:19:55 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 09:19:55 2015 -0500 Merge topic 'xcode-target-sort' 9e0176e2 Xcode: Sort targets deterministically and with ALL_BUILD first (#15346) c0ff542c Xcode: Fix early termination on per-config source file error ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalXCodeGenerator.cxx | 62 ++++++++++++++++++++++++++++++------- Source/cmGlobalXCodeGenerator.h | 6 ++-- 2 files changed, 54 insertions(+), 14 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:20:05 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:20:05 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-915-g481c5fd Message-ID: <20150120142006.759CCA9E1A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 481c5fd31e99b4aa0277dc76c7a201c627f3db79 (commit) via 3a147e1b623a4b8bb381c4b651cf983e294f3509 (commit) from 4970ac3d5fe1b0bc3519753fe50e4397c074353e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=481c5fd31e99b4aa0277dc76c7a201c627f3db79 commit 481c5fd31e99b4aa0277dc76c7a201c627f3db79 Merge: 4970ac3 3a147e1 Author: Brad King AuthorDate: Tue Jan 20 09:20:04 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 09:20:04 2015 -0500 Merge topic 'emacs-mode-fix-word-at-point' 3a147e1b cmake-mode.el: Re-add explicit call to require thingatpt ----------------------------------------------------------------------- Summary of changes: Auxiliary/cmake-mode.el | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:20:08 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:20:08 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-917-g86b6cbe Message-ID: <20150120142008.E026AA9DFA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 86b6cbeaad642f4479b1b089edec4837ce0da48d (commit) via 48984958192029f57338f511885eed85d1963f94 (commit) from 481c5fd31e99b4aa0277dc76c7a201c627f3db79 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86b6cbeaad642f4479b1b089edec4837ce0da48d commit 86b6cbeaad642f4479b1b089edec4837ce0da48d Merge: 481c5fd 4898495 Author: Brad King AuthorDate: Tue Jan 20 09:20:07 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 09:20:07 2015 -0500 Merge topic 'find-package-mode-fix-multiarch' 48984958 CMakeFindPackageMode: Fix Debian multiarch default guess (#15250) ----------------------------------------------------------------------- Summary of changes: Modules/CMakeFindPackageMode.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:20:11 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:20:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-919-g770131c Message-ID: <20150120142011.0623CA9E1D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 770131c9731b3bb6276816195ac6a22f63847516 (commit) via a6a1adb59fc0003cbd520e7994c3cf1d05df54db (commit) from 86b6cbeaad642f4479b1b089edec4837ce0da48d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=770131c9731b3bb6276816195ac6a22f63847516 commit 770131c9731b3bb6276816195ac6a22f63847516 Merge: 86b6cbe a6a1adb Author: Brad King AuthorDate: Tue Jan 20 09:20:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 09:20:09 2015 -0500 Merge topic 'doc-unsupported-compilers' a6a1adb5 Help: Document unsupported compilers in the release notes. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/unsupported-compilers.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Help/release/dev/unsupported-compilers.rst hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:20:13 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:20:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-922-g1ef4e3a Message-ID: <20150120142013.918A0A9DFC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 1ef4e3ab4534d0b24031045a476ff223574c38ec (commit) via 3a60c899fce77f221cba670b62c90fe2d2daffed (commit) via 90f9c42732a18e53943c3aa27de76c2511c5a0c6 (commit) from 770131c9731b3bb6276816195ac6a22f63847516 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1ef4e3ab4534d0b24031045a476ff223574c38ec commit 1ef4e3ab4534d0b24031045a476ff223574c38ec Merge: 770131c 3a60c89 Author: Brad King AuthorDate: Tue Jan 20 09:20:12 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 09:20:12 2015 -0500 Merge topic 'cmake-E-tar-mtime' 3a60c899 cmake: Teach "-E tar" command a "--mtime=" option 90f9c427 cmake: Teach "-E tar" to report file name on failure to read from disk ----------------------------------------------------------------------- Summary of changes: Help/release/dev/cmake-E-tar-mtime.rst | 6 +++++ Source/CMakeLists.txt | 2 ++ Source/cmArchiveWrite.cxx | 19 +++++++++++++- Source/cmArchiveWrite.h | 2 ++ Source/cmSystemTools.cxx | 3 ++- Source/cmSystemTools.h | 6 ++--- .../{cmCommandsForBootstrap.cxx => cm_get_date.c} | 10 ++++---- Tests/QtAutogen/foo.h => Source/cm_get_date.h | 27 +++++++++----------- Source/cmcmd.cxx | 26 +++++++++++++++++-- .../E_tar-bad-mtime1-result.txt} | 0 .../CommandLine/E_tar-bad-mtime1-stderr.txt | 2 ++ .../E_tar-bad-opt1-result.txt} | 0 .../RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt | 1 + .../E_tar-end-opt1-result.txt} | 0 .../RunCMake/CommandLine/E_tar-end-opt1-stderr.txt | 2 ++ Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 6 +++++ 16 files changed, 85 insertions(+), 27 deletions(-) create mode 100644 Help/release/dev/cmake-E-tar-mtime.rst copy Source/{cmCommandsForBootstrap.cxx => cm_get_date.c} (75%) copy Tests/QtAutogen/foo.h => Source/cm_get_date.h (63%) copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-mtime1-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-mtime1-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-opt1-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-opt1-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-end-opt1-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-end-opt1-stderr.txt hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:20:41 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:20:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2230-g355f956 Message-ID: <20150120142041.D909BA9E62@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 355f9563bdbeffe6f552f5f578a6fb2a2239e9d7 (commit) via 1ef4e3ab4534d0b24031045a476ff223574c38ec (commit) via 770131c9731b3bb6276816195ac6a22f63847516 (commit) via 86b6cbeaad642f4479b1b089edec4837ce0da48d (commit) via 481c5fd31e99b4aa0277dc76c7a201c627f3db79 (commit) via 4970ac3d5fe1b0bc3519753fe50e4397c074353e (commit) via cf17d41535962f4b94ac45a3d5870c59b63641d1 (commit) via 70eb44b7dcf86e23716dc0e036941abe887bc756 (commit) from 0b2ef5281ebbbfb1daad42b5a427ca70431ac095 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=355f9563bdbeffe6f552f5f578a6fb2a2239e9d7 commit 355f9563bdbeffe6f552f5f578a6fb2a2239e9d7 Merge: 0b2ef52 1ef4e3a Author: Brad King AuthorDate: Tue Jan 20 09:20:31 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 09:20:31 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:28:02 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:28:02 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2232-gee01a24 Message-ID: <20150120142802.087BCAA945@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ee01a24ede9a83c9f72eb1fbcfb3fbb621078bfe (commit) via 7500f92f52b0026a0a56b80acd301e319c36024d (commit) from 355f9563bdbeffe6f552f5f578a6fb2a2239e9d7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ee01a24ede9a83c9f72eb1fbcfb3fbb621078bfe commit ee01a24ede9a83c9f72eb1fbcfb3fbb621078bfe Merge: 355f956 7500f92 Author: Brad King AuthorDate: Tue Jan 20 09:28:01 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 09:28:01 2015 -0500 Merge topic 'cmake-labels-json' into next 7500f92f jsoncpp: Drop doxygen comments that cause Clang warnings http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7500f92f52b0026a0a56b80acd301e319c36024d commit 7500f92f52b0026a0a56b80acd301e319c36024d Author: Brad King AuthorDate: Tue Jan 20 09:26:36 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 09:27:14 2015 -0500 jsoncpp: Drop doxygen comments that cause Clang warnings Even though we disable warnings when building jsoncpp itself, including its headers from other CMake sources may still cause warnings. Update the code to remove these -Wdocumentation warnings. 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 { ----------------------------------------------------------------------- Summary of changes: Utilities/cmjsoncpp/include/json/reader.h | 2 -- Utilities/cmjsoncpp/include/json/writer.h | 1 - 2 files changed, 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:31:51 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:31:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2236-gb4812c7 Message-ID: <20150120143151.AE067AA9B2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b4812c7c9e03f46b40a0dfbe9000dc87832cb6ed (commit) via 0238d0c397e52a82f20a0b7bf5aad9a07f36133c (commit) via bda4f0b661018b32aefdb14887d8137e7a4fd118 (commit) via a02fbec5f3eabf7847583a7f45c092ef6c066546 (commit) from ee01a24ede9a83c9f72eb1fbcfb3fbb621078bfe (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4812c7c9e03f46b40a0dfbe9000dc87832cb6ed commit b4812c7c9e03f46b40a0dfbe9000dc87832cb6ed Merge: ee01a24 0238d0c Author: Brad King AuthorDate: Tue Jan 20 09:31:50 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 09:31:50 2015 -0500 Merge topic 'cmake-labels-json' into next 0238d0c3 cmake: Generate an internal 'Labels.json' file next to 'Labels.txt' bda4f0b6 jsoncpp: Add headers to help CMake include in-source jsoncpp headers a02fbec5 jsoncpp: Drop doxygen comments that cause Clang warnings http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0238d0c397e52a82f20a0b7bf5aad9a07f36133c commit 0238d0c397e52a82f20a0b7bf5aad9a07f36133c Author: Brad King AuthorDate: Fri Jan 16 15:35:36 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 09:31:11 2015 -0500 cmake: Generate an internal 'Labels.json' file next to 'Labels.txt' In each internal target directory we generate a "Labels.txt" file containing labels for that target and its sources, but it uses an internal format. In order to make the list of labels easier to publish, use a json format and call it "Labels.json". Since we now use jsoncpp headers, link CMakeLib to the jsoncpp library. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 96f4709..6b6008d 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -500,7 +500,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} + cmjsoncpp + ) # On Apple we need CoreFoundation if(APPLE) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 1745d9a..dd3b1ec 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -38,6 +38,8 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) # include +# include "cm_jsoncpp_value.h" +# include "cm_jsoncpp_writer.h" #endif #include // required for atof @@ -2911,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()); @@ -2929,6 +2942,7 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target) li != labels.end(); ++li) { fout << " " << *li << "\n"; + lj_target_labels.append(*li); } } @@ -2954,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::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); } } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bda4f0b661018b32aefdb14887d8137e7a4fd118 commit bda4f0b661018b32aefdb14887d8137e7a4fd118 Author: Brad King AuthorDate: Tue Jan 20 09:28:59 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 09:28:59 2015 -0500 jsoncpp: Add headers to help CMake include in-source jsoncpp headers Add cm_jsoncpp_value.h and cm_jsoncpp_writer.h headers to include the CMake-provided copy of the json/value.h and json/writer.h headers from CMake sources. diff --git a/Utilities/cm_jsoncpp_value.h b/Utilities/cm_jsoncpp_value.h new file mode 100644 index 0000000..15e1088 --- /dev/null +++ b/Utilities/cm_jsoncpp_value.h @@ -0,0 +1,18 @@ +/*============================================================================ + 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 + +#endif diff --git a/Utilities/cm_jsoncpp_writer.h b/Utilities/cm_jsoncpp_writer.h new file mode 100644 index 0000000..c410369 --- /dev/null +++ b/Utilities/cm_jsoncpp_writer.h @@ -0,0 +1,18 @@ +/*============================================================================ + 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 + +#endif http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a02fbec5f3eabf7847583a7f45c092ef6c066546 commit a02fbec5f3eabf7847583a7f45c092ef6c066546 Author: Brad King AuthorDate: Tue Jan 20 09:26:36 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 09:28:28 2015 -0500 jsoncpp: Drop doxygen comments that cause Clang warnings Even though we disable warnings when building jsoncpp itself, including its headers from other CMake sources may still cause warnings. Update the code to remove these -Wdocumentation warnings. 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 { ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:32:02 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:32:02 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-926-g17cfa09 Message-ID: <20150120143202.6E620AA94C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 17cfa09eb2a78349a6471e4719bc933dd0625d9e (commit) via 0238d0c397e52a82f20a0b7bf5aad9a07f36133c (commit) via bda4f0b661018b32aefdb14887d8137e7a4fd118 (commit) via a02fbec5f3eabf7847583a7f45c092ef6c066546 (commit) from 1ef4e3ab4534d0b24031045a476ff223574c38ec (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=17cfa09eb2a78349a6471e4719bc933dd0625d9e commit 17cfa09eb2a78349a6471e4719bc933dd0625d9e Merge: 1ef4e3a 0238d0c Author: Brad King AuthorDate: Tue Jan 20 09:31:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 09:31:59 2015 -0500 Merge topic 'cmake-labels-json' 0238d0c3 cmake: Generate an internal 'Labels.json' file next to 'Labels.txt' bda4f0b6 jsoncpp: Add headers to help CMake include in-source jsoncpp headers a02fbec5 jsoncpp: Drop doxygen comments that cause Clang warnings ----------------------------------------------------------------------- Summary of changes: Source/CMakeLists.txt | 4 ++- Source/cmGlobalGenerator.cxx | 26 +++++++++++++++++++- .../{cm_jsoncpp_reader.h => cm_jsoncpp_value.h} | 6 ++--- .../{cm_jsoncpp_reader.h => cm_jsoncpp_writer.h} | 6 ++--- Utilities/cmjsoncpp/include/json/reader.h | 2 -- Utilities/cmjsoncpp/include/json/writer.h | 1 - 6 files changed, 34 insertions(+), 11 deletions(-) copy Utilities/{cm_jsoncpp_reader.h => cm_jsoncpp_value.h} (86%) copy Utilities/{cm_jsoncpp_reader.h => cm_jsoncpp_writer.h} (86%) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 09:32:27 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 09:32:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2238-g71dc347 Message-ID: <20150120143227.3986DAA9C2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 71dc34772b46734636a9f83f116908bbc666a131 (commit) via 17cfa09eb2a78349a6471e4719bc933dd0625d9e (commit) from b4812c7c9e03f46b40a0dfbe9000dc87832cb6ed (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=71dc34772b46734636a9f83f116908bbc666a131 commit 71dc34772b46734636a9f83f116908bbc666a131 Merge: b4812c7 17cfa09 Author: Brad King AuthorDate: Tue Jan 20 09:32:20 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 09:32:20 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 10:02:08 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 10:02:08 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2242-g1f8c142 Message-ID: <20150120150208.23BC8AA4AF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1f8c14286538290277c81761e7109479d6e563c2 (commit) via 174fad7a7c9546fccd325eae759c32f6fd5faffe (commit) via 6dd980e0ef1254a6c3098488e6677f5eb4f40a86 (commit) via 5dc33f89b5405f1fbcefb9783ea2050a3686d7de (commit) from 71dc34772b46734636a9f83f116908bbc666a131 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f8c14286538290277c81761e7109479d6e563c2 commit 1f8c14286538290277c81761e7109479d6e563c2 Merge: 71dc347 174fad7 Author: Brad King AuthorDate: Tue Jan 20 10:02:06 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 10:02:06 2015 -0500 Merge topic 'cdash_upload_file_mode' into next 174fad7a CTestCoverageCollectGCOV: Add module to run gcov 6dd980e0 ctest_submit: Make CDASH_UPLOAD mode arguments more strict 5dc33f89 ctest_submit: Add CDASH_UPLOAD mode to upload files to CDash http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=174fad7a7c9546fccd325eae759c32f6fd5faffe commit 174fad7a7c9546fccd325eae759c32f6fd5faffe Author: Bill Hoffman AuthorDate: Wed Jan 14 10:52:26 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 09:33:21 2015 -0500 CTestCoverageCollectGCOV: Add module to run gcov Provide a function to run gcov and create a tarball of results. Since CDash tracks the md5sum of the files uploaded, use the --mtime option with "cmake -E tar" so that tar files could be created that would have the same md5sum with the same content. diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index 0a0ca23..db56010 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -63,6 +63,7 @@ All Modules /module/CPack /module/CPackWIX /module/CTest + /module/CTestCoverageCollectGCOV /module/CTestScriptMode /module/CTestUseLaunchers /module/Dart diff --git a/Help/module/CTestCoverageCollectGCOV.rst b/Help/module/CTestCoverageCollectGCOV.rst new file mode 100644 index 0000000..4c5deca --- /dev/null +++ b/Help/module/CTestCoverageCollectGCOV.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/CTestCoverageCollectGCOV.cmake diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake new file mode 100644 index 0000000..34e5f9a --- /dev/null +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -0,0 +1,134 @@ +#.rst: +# CTestCoverageCollectGCOV +# ------------------------ +# +# This module provides the function ``ctest_coverage_collect_gcov``. +# The function will run gcov on the .gcda files in a binary tree and then +# package all of the .gcov files into a tar file with a data.json. +# This file can be sent to a CDash server for display with the +# :command:`ctest_submit(CDASH_UPLOAD)` command. +# +# .. command:: cdash_coverage_collect_gcov +# +# :: +# +# ctest_coverage_collect_gcov(TARBALL +# [SOURCE ][BUILD ] +# [GCOV_COMMAND ] +# ) +# +# Run gcov and package a tar file for CDash. The options are: +# +# ``TARBALL `` +# Specify the location of the ``.tar`` file to be created for later +# upload to CDash. Relative paths will be interpreted with respect +# to the top-level build directory. +# +# ``SOURCE `` +# Specify the top-level source directory for the build. +# Default is the value of :variable:`CTEST_SOURCE_DIRECTORY`. +# +# ``BUILD `` +# Specify the top-level build directory for the build. +# Default is the value of :variable:`CTEST_BINARY_DIRECTORY`. +# +# ``GCOV_COMMAND `` +# Specify the full path to the ``gcov`` command on the machine. +# Default is the value of :variable:`CTEST_COVERAGE_COMMAND`. + +#============================================================================= +# 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.) +include(CMakeParseArguments) +function(ctest_coverage_collect_gcov) + set(options "") + set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) + set(multiValueArgs "") + cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" + "${multiValueArgs}" "" ${ARGN} ) + if(NOT DEFINED GCOV_TARBALL) + message(FATAL_ERROR + "TARBALL must be specified. for ctest_coverage_collect_gcov") + endif() + if(NOT DEFINED GCOV_SOURCE) + set(source_dir "${CTEST_SOURCE_DIRECTORY}") + else() + set(source_dir "${GCOV_SOURCE}") + endif() + if(NOT DEFINED GCOV_BUILD) + set(binary_dir "${CTEST_BINARY_DIRECTORY}") + else() + set(binary_dir "${GCOV_BUILD}") + endif() + if(NOT DEFINED GCOV_GCOV_COMMAND) + set(gcov_command "${CTEST_COVERAGE_COMMAND}") + else() + set(gcov_command "${GCOV_GCOV_COMMAND}") + endif() + # run gcov on each gcda file in the binary tree + set(gcda_files) + set(label_files) + # look for gcda files in the target directories + # could do a glob from the top of the binary tree but + # this will be faster and only look where the files will be + file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) + foreach(target_dir ${target_dirs}) + file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") + list(LENGTH gfiles len) + # if we have gcda files then also grab the labels file for that target + if(${len} GREATER 0) + file(GLOB_RECURSE lfiles RELATIVE ${binary_dir} + "${target_dir}/Labels.txt") + list(APPEND gcda_files ${gfiles}) + list(APPEND label_files ${lfiles}) + endif() + endforeach() + # return early if no coverage files were found + list(LENGTH gcda_files len) + if(len EQUAL 0) + message("ctest_coverage_collect_gcov: No .gcda files found, " + "ignoring coverage request.") + return() + endif() + # setup the dir for the coverage files + set(coverage_dir "${binary_dir}/Testing/CoverageInfo") + file(MAKE_DIRECTORY "${coverage_dir}") + # call gcov on each .gcda file + foreach (gcda_file ${gcda_files}) + # get the directory of the gcda file + get_filename_component(gcda_file ${binary_dir}/${gcda_file} ABSOLUTE) + get_filename_component(gcov_dir ${gcda_file} DIRECTORY) + # run gcov, this will produce the .gcov file in the current + # working directory + execute_process(COMMAND + ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${coverage_dir}) + endforeach() + # create json file with project information + file(WRITE ${coverage_dir}/data.json + "{ + \"Source\": \"${source_dir}\", + \"Binary\": \"${binary_dir}\" +}") + # collect the gcov files + set(gcov_files) + file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "${binary_dir}/*.gcov") + # tar up the coverage info with the same date so that the md5 + # sum will be the same for the tar file independent of file time + # stamps + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} + "--mtime=1970-01-01 0:0:0 UTC" ${gcov_files} + ${coverage_dir}/data.json ${label_files} + WORKING_DIRECTORY ${binary_dir}) +endfunction() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6dd980e0ef1254a6c3098488e6677f5eb4f40a86 commit 6dd980e0ef1254a6c3098488e6677f5eb4f40a86 Author: Brad King AuthorDate: Thu Jan 15 15:23:07 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 09:33:21 2015 -0500 ctest_submit: Make CDASH_UPLOAD mode arguments more strict Disallow mixing of arguments from different command signatures. Extend the RunCMake.CTestSubmit test to cover such error cases. diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index 316a43d..2b83ed9 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -38,13 +38,15 @@ timed-out submission before attempting to re-submit. The RETRY_COUNT option specifies how many times to retry a timed-out submission. +Submit to CDash Upload API +^^^^^^^^^^^^^^^^^^^^^^^^^^ + :: - ctest_submit([CDASH_UPLOAD file] - [CDASH_UPLOAD_TYPE type_string]) + ctest_submit(CDASH_UPLOAD [CDASH_UPLOAD_TYPE ]) This second signature is used to upload files to CDash via the CDash file upload API. The api first sends a request to upload to CDash along -with the md5 sum of the file. If CDash does not already have the file, +with a content hash of the file. If CDash does not already have the file, then it is uploaded. Along with the file, a CDash type string is specified to tell CDash which handler to use to process the data. diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index dcd7982..cc3514f 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -145,7 +145,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() static_cast(handler)->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF"); - if(this->CDashUploadFile.size()) + if (this->CDashUpload) { static_cast(handler)-> SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); @@ -155,51 +155,65 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() return handler; } +//---------------------------------------------------------------------------- +bool cmCTestSubmitCommand::InitialPass(std::vector const& args, + cmExecutionStatus& status) +{ + this->CDashUpload = !args.empty() && args[0] == "CDASH_UPLOAD"; + return this->cmCTestHandlerCommand::InitialPass(args, status); +} //---------------------------------------------------------------------------- bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg) { - // Look for arguments specific to this command. - if(arg == "PARTS") + if (this->CDashUpload) { - this->ArgumentDoing = ArgumentDoingParts; - this->PartsMentioned = true; - return true; - } + if(arg == "CDASH_UPLOAD") + { + this->ArgumentDoing = ArgumentDoingCDashUpload; + return true; + } - if(arg == "FILES") - { - this->ArgumentDoing = ArgumentDoingFiles; - this->FilesMentioned = true; - return true; + if(arg == "CDASH_UPLOAD_TYPE") + { + this->ArgumentDoing = ArgumentDoingCDashUploadType; + return true; + } } - - if(arg == "RETRY_COUNT") + else { - this->ArgumentDoing = ArgumentDoingRetryCount; - return true; - } + // Look for arguments specific to this command. + if(arg == "PARTS") + { + this->ArgumentDoing = ArgumentDoingParts; + this->PartsMentioned = true; + return true; + } - if(arg == "RETRY_DELAY") - { - this->ArgumentDoing = ArgumentDoingRetryDelay; - return true; - } + if(arg == "FILES") + { + this->ArgumentDoing = ArgumentDoingFiles; + this->FilesMentioned = true; + return true; + } - if(arg == "CDASH_UPLOAD") - { - this->ArgumentDoing = ArgumentDoingCDashUpload; - return true; - } - if(arg == "CDASH_UPLOAD_TYPE") - { - this->ArgumentDoing = ArgumentDoingCDashUploadType; - return true; - } - if(arg == "INTERNAL_TEST_CHECKSUM") - { - this->InternalTest = true; - return true; + if(arg == "RETRY_COUNT") + { + this->ArgumentDoing = ArgumentDoingRetryCount; + return true; + } + + if(arg == "RETRY_DELAY") + { + this->ArgumentDoing = ArgumentDoingRetryDelay; + return true; + } + + if(arg == "INTERNAL_TEST_CHECKSUM") + { + this->InternalTest = true; + return true; + } } // Look for other arguments. @@ -260,11 +274,14 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) if(this->ArgumentDoing == ArgumentDoingCDashUpload) { + this->ArgumentDoing = ArgumentDoingNone; this->CDashUploadFile = arg; return true; } + if(this->ArgumentDoing == ArgumentDoingCDashUploadType) { + this->ArgumentDoing = ArgumentDoingNone; this->CDashUploadType = arg; return true; } diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index cb0ac61..19e8eaf 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -32,6 +32,7 @@ public: this->InternalTest = false; this->RetryCount = ""; this->RetryDelay = ""; + this->CDashUpload = false; } /** @@ -45,6 +46,9 @@ public: return ni; } + virtual bool InitialPass(std::vector const& args, + cmExecutionStatus &status); + /** * The name of the command as specified in CMakeList.txt. */ @@ -76,6 +80,7 @@ protected: cmCTest::SetOfStrings Files; std::string RetryCount; std::string RetryDelay; + bool CDashUpload; std::string CDashUploadFile; std::string CDashUploadType; }; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 0e19259..11e3343 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1084,10 +1084,16 @@ void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod, int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, std::string const& typeString) { - if(!cmSystemTools::FileExists(file)) + if (file.empty()) { cmCTestLog(this->CTest, ERROR_MESSAGE, - "Upload file not found: " << file << "\n"); + "Upload file not specified\n"); + return -1; + } + if (!cmSystemTools::FileExists(file)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Upload file not found: '" << file << "'\n"); return -1; } cmCTestCurl curl(this->CTest); @@ -1118,6 +1124,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, static_cast(this->CTest->GetHandler("script")); cmake* cm = ch->GetCMake(); const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; str << "project=" << this->CTest->GetCTestConfiguration("ProjectName") << "&"; @@ -1214,8 +1221,7 @@ int cmCTestSubmitHandler::ProcessHandler() const char* cdashUploadType = this->GetOption("CDashUploadType"); if(cdashUploadFile && cdashUploadType) { - return this->HandleCDashUploadFile(std::string(cdashUploadFile), - std::string(cdashUploadType)); + return this->HandleCDashUploadFile(cdashUploadFile, cdashUploadType); } std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); // cdash does not need to trigger so just return true diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFILES-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFILES-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-stderr.txt new file mode 100644 index 0000000..48177e2 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFILES-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadFILES/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "FILES". diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFTP-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt new file mode 100644 index 0000000..77df44f --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt @@ -0,0 +1 @@ +Only http and https are supported for CDASH_UPLOAD diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadNone-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadNone-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadNone-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadNone-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadNone-stderr.txt new file mode 100644 index 0000000..af95b5c --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadNone-stderr.txt @@ -0,0 +1 @@ +Upload file not specified diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-stderr.txt new file mode 100644 index 0000000..497ead2 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadPARTS-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadPARTS/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "PARTS". diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt new file mode 100644 index 0000000..8c4e6b1 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "RETRY_COUNT". diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-result.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt new file mode 100644 index 0000000..6c56399 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY/test.cmake:[0-9]+ \(ctest_submit\): + ctest_submit called with unknown argument "RETRY_DELAY". diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-result.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-stderr.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-stderr.txt new file mode 100644 index 0000000..dfa7e33 --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUpload-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/PARTSCDashUpload/test.cmake:[0-9]+ \(ctest_submit\): + Part name "CDASH_UPLOAD" is invalid. diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-result.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-result.txt new file mode 100644 index 0000000..b57e2de --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-result.txt @@ -0,0 +1 @@ +(-1|255) diff --git a/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-stderr.txt b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-stderr.txt new file mode 100644 index 0000000..42becaf --- /dev/null +++ b/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*/Tests/RunCMake/CTestSubmit/PARTSCDashUploadType/test.cmake:[0-9]+ \(ctest_submit\): + Part name "CDASH_UPLOAD_TYPE" is invalid. diff --git a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake index 6f18563..bfb3b96 100644 --- a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake @@ -32,6 +32,19 @@ 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) +run_ctest_submit(PARTSCDashUpload PARTS Configure CDASH_UPLOAD) +run_ctest_submit(PARTSCDashUploadType PARTS Configure CDASH_UPLOAD_TYPE) +run_ctest_submit(CDashUploadPARTS CDASH_UPLOAD bad-upload PARTS) +run_ctest_submit(CDashUploadFILES CDASH_UPLOAD bad-upload FILES) +run_ctest_submit(CDashUploadRETRY_COUNT CDASH_UPLOAD bad-upload RETRY_COUNT) +run_ctest_submit(CDashUploadRETRY_DELAY CDASH_UPLOAD bad-upload RETRY_DELAY) +run_ctest_submit(CDashUploadNone CDASH_UPLOAD) + +function(run_ctest_CDashUploadFTP) + set(CASE_DROP_METHOD ftp) + run_ctest_submit(CDashUploadFTP CDASH_UPLOAD ${CMAKE_CURRENT_LIST_FILE}) +endfunction() +run_ctest_CDashUploadFTP() #----------------------------------------------------------------------------- # Test failed drops by various protocols http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5dc33f89b5405f1fbcefb9783ea2050a3686d7de commit 5dc33f89b5405f1fbcefb9783ea2050a3686d7de Author: Bill Hoffman AuthorDate: Wed Jan 14 10:54:25 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 09:33:21 2015 -0500 ctest_submit: Add CDASH_UPLOAD mode to upload files to CDash This adds support for the new cdash API where arbitrary files can be uploaded to the CDash server. This CDash API communicates via json files so the json parser jsoncpp was added to the Utilities directory. diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst index d9b0b78..316a43d 100644 --- a/Help/command/ctest_submit.rst +++ b/Help/command/ctest_submit.rst @@ -37,3 +37,14 @@ timed-out submission before attempting to re-submit. The RETRY_COUNT option specifies how many times to retry a timed-out submission. + +:: + + ctest_submit([CDASH_UPLOAD file] + [CDASH_UPLOAD_TYPE type_string]) + +This second signature is used to upload files to CDash via the CDash +file upload API. The api first sends a request to upload to CDash along +with the md5 sum of the file. If CDash does not already have the file, +then it is uploaded. Along with the file, a CDash type string is specified +to tell CDash which handler to use to process the data. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 435b654..c54b943 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -537,6 +537,7 @@ set(CTEST_SRCS cmCTest.cxx CTest/cmCTestConfigureHandler.cxx CTest/cmCTestCoverageCommand.cxx CTest/cmCTestCoverageHandler.cxx + CTest/cmCTestCurl.cxx CTest/cmParseMumpsCoverage.cxx CTest/cmParseCacheCoverage.cxx CTest/cmParseGTMCoverage.cxx diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx new file mode 100644 index 0000000..b0d26cc --- /dev/null +++ b/Source/CTest/cmCTestCurl.cxx @@ -0,0 +1,271 @@ +/*============================================================================ + 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 "cmCTestCurl.h" + +#include "cmSystemTools.h" +#include "cmCTest.h" + +cmCTestCurl::cmCTestCurl(cmCTest* ctest) +{ + this->CTest = ctest; + this->SetProxyType(); + this->UseHttp10 = false; + // In windows, this will init the winsock stuff + ::curl_global_init(CURL_GLOBAL_ALL); + // default is to verify https + this->VerifyPeerOff = false; + this->VerifyHostOff = false; + this->TimeOutSeconds = 0; +} + +namespace +{ +static size_t +curlWriteMemoryCallback(void *ptr, size_t size, size_t nmemb, + void *data) +{ + int realsize = (int)(size * nmemb); + + std::vector *vec + = static_cast* >(data); + const char* chPtr = static_cast(ptr); + vec->insert(vec->end(), chPtr, chPtr + realsize); + return realsize; +} + +static size_t +curlDebugCallback(CURL *, curl_infotype, char *chPtr, + size_t size, void *data) +{ + std::vector *vec + = static_cast* >(data); + vec->insert(vec->end(), chPtr, chPtr + size); + + return size; +} + +} + +void cmCTestCurl::SetCurlOptions(std::vector const& args) +{ + for( std::vector::const_iterator i = args.begin(); + i != args.end(); ++i) + { + if(*i == "CURLOPT_SSL_VERIFYPEER_OFF") + { + this->VerifyPeerOff = true; + } + if(*i == "CURLOPT_SSL_VERIFYHOST_OFF") + { + this->VerifyHostOff = true; + } + } +} + +bool cmCTestCurl::InitCurl() +{ + this->Curl = curl_easy_init(); + if(!this->Curl) + { + return false; + } + if(this->VerifyPeerOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYPEER, 0); + } + if(this->VerifyHostOff) + { + curl_easy_setopt(this->Curl, CURLOPT_SSL_VERIFYHOST, 0); + } + if(this->HTTPProxy.size()) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXY, this->HTTPProxy.c_str()); + curl_easy_setopt(this->Curl, CURLOPT_PROXYTYPE, this->HTTPProxyType); + if (this->HTTPProxyAuth.size() > 0) + { + curl_easy_setopt(this->Curl, CURLOPT_PROXYUSERPWD, + this->HTTPProxyAuth.c_str()); + } + } + if(this->UseHttp10) + { + curl_easy_setopt(this->Curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + } + // enable HTTP ERROR parsing + curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + return true; +} + + +bool cmCTestCurl::UploadFile(std::string const& local_file, + std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + /* enable uploading */ + curl_easy_setopt(this->Curl, CURLOPT_UPLOAD, 1); + // if there is little to no activity for too long stop submitting + if(this->TimeOutSeconds) + { + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_LIMIT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_LOW_SPEED_TIME, + this->TimeOutSeconds); + } + /* HTTP PUT please */ + ::curl_easy_setopt(this->Curl, CURLOPT_PUT, 1); + ::curl_easy_setopt(this->Curl, CURLOPT_VERBOSE, 1); + + FILE* ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); + if(!ftpfile) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Could not open file for upload: " << local_file << "\n"); + return false; + } + // set the url + std::string upload_url = url; + upload_url += "?"; + upload_url += fields; + ::curl_easy_setopt(this->Curl, CURLOPT_URL, upload_url.c_str()); + // now specify which file to upload + ::curl_easy_setopt(this->Curl, CURLOPT_INFILE, ftpfile); + unsigned long filelen = cmSystemTools::FileLength(local_file); + // and give the size of the upload (optional) + ::curl_easy_setopt(this->Curl, CURLOPT_INFILESIZE, + static_cast(filelen)); + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + // Now run off and do what you've been told! + ::curl_easy_perform(this->Curl); + ::fclose(ftpfile); + ::curl_global_cleanup(); + + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Curl response: [" << response << "]\n"); + } + std::string curlDebug; + if ( debugData.size() > 0 ) + { + curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + if(response.size() == 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "No response from server.\n" << + curlDebug); + return false; + } + return true; +} + +bool cmCTestCurl::HttpRequest(std::string const& url, + std::string const& fields, + std::string& response) +{ + response = ""; + cmCTestLog(this->CTest, DEBUG, "HttpRequest\n" + << "url: " << url << "\n" + << "fields " << fields << "\n"); + if(!this->InitCurl()) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "Initialization of curl failed"); + return false; + } + curl_easy_setopt(this->Curl, CURLOPT_POST, 1); + curl_easy_setopt(this->Curl, CURLOPT_POSTFIELDS, fields.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_URL, url.c_str()); + ::curl_easy_setopt(this->Curl, CURLOPT_FOLLOWLOCATION, 1); + //set response options + ::curl_easy_setopt(this->Curl, CURLOPT_WRITEFUNCTION, + curlWriteMemoryCallback); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGFUNCTION, + curlDebugCallback); + std::vector responseData; + std::vector debugData; + ::curl_easy_setopt(this->Curl, CURLOPT_FILE, (void *)&responseData); + ::curl_easy_setopt(this->Curl, CURLOPT_DEBUGDATA, (void *)&debugData); + ::curl_easy_setopt(this->Curl, CURLOPT_FAILONERROR, 1); + + CURLcode res = ::curl_easy_perform(this->Curl); + + ::curl_easy_cleanup(this->Curl); + ::curl_global_cleanup(); + if ( responseData.size() > 0 ) + { + response = std::string(responseData.begin(), responseData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl response: [" << response << "]\n"); + } + if ( debugData.size() > 0 ) + { + std::string curlDebug = std::string(debugData.begin(), debugData.end()); + cmCTestLog(this->CTest, DEBUG, "Curl debug: [" << curlDebug << "]\n"); + } + cmCTestLog(this->CTest, DEBUG, "Curl res: " << res << "\n"); + return (res == 0); +} + +void cmCTestCurl::SetProxyType() +{ + if ( cmSystemTools::GetEnv("HTTP_PROXY") ) + { + this->HTTPProxy = cmSystemTools::GetEnv("HTTP_PROXY"); + if ( cmSystemTools::GetEnv("HTTP_PROXY_PORT") ) + { + this->HTTPProxy += ":"; + this->HTTPProxy += cmSystemTools::GetEnv("HTTP_PROXY_PORT"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_TYPE") ) + { + // this is the default + this->HTTPProxyType = CURLPROXY_HTTP; + std::string type = cmSystemTools::GetEnv("HTTP_PROXY_TYPE"); + // HTTP/SOCKS4/SOCKS5 + if ( type == "HTTP" ) + { + this->HTTPProxyType = CURLPROXY_HTTP; + } + else if ( type == "SOCKS4" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS4; + } + else if ( type == "SOCKS5" ) + { + this->HTTPProxyType = CURLPROXY_SOCKS5; + } + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_USER") ) + { + this->HTTPProxyAuth = cmSystemTools::GetEnv("HTTP_PROXY_USER"); + } + if ( cmSystemTools::GetEnv("HTTP_PROXY_PASSWD") ) + { + this->HTTPProxyAuth += ":"; + this->HTTPProxyAuth += cmSystemTools::GetEnv("HTTP_PROXY_PASSWD"); + } + } +} diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h new file mode 100644 index 0000000..5bb8b41 --- /dev/null +++ b/Source/CTest/cmCTestCurl.h @@ -0,0 +1,52 @@ +/*============================================================================ + 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 cmCTestCurl_h +#define cmCTestCurl_h + +#include "cmStandardIncludes.h" + +#include "cm_curl.h" + +class cmCTest; + +class cmCTestCurl +{ +public: + cmCTestCurl(cmCTest*); + bool UploadFile(std::string const& url, + std::string const& file, + std::string const& fields, + std::string& response); + bool HttpRequest(std::string const& url, + std::string const& fields, + std::string& response); + // currently only supports CURLOPT_SSL_VERIFYPEER_OFF + // and CURLOPT_SSL_VERIFYHOST_OFF + void SetCurlOptions(std::vector const& args); + void SetUseHttp10On() { this->UseHttp10 = true;} + void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s;} +protected: + void SetProxyType(); + bool InitCurl(); +private: + cmCTest* CTest; + CURL* Curl; + std::string HTTPProxyAuth; + std::string HTTPProxy; + curl_proxytype HTTPProxyType; + bool VerifyHostOff; + bool VerifyPeerOff; + bool UseHttp10; + int TimeOutSeconds; +}; + +#endif diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index 4005a63..dcd7982 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -27,7 +27,8 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() = this->Makefile->GetDefinition("CTEST_TRIGGER_SITE"); bool ctestDropSiteCDash = this->Makefile->IsOn("CTEST_DROP_SITE_CDASH"); - + const char* ctestProjectName + = this->Makefile->GetDefinition("CTEST_PROJECT_NAME"); if ( !ctestDropMethod ) { ctestDropMethod = "http"; @@ -43,7 +44,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() // error: CDash requires CTEST_DROP_LOCATION definition // in CTestConfig.cmake } - + this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName); this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod); this->CTest->SetCTestConfiguration("DropSite", ctestDropSite); this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation); @@ -144,6 +145,13 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() static_cast(handler)->SetOption("InternalTest", this->InternalTest ? "ON" : "OFF"); + if(this->CDashUploadFile.size()) + { + static_cast(handler)-> + SetOption("CDashUploadFile", this->CDashUploadFile.c_str()); + static_cast(handler)-> + SetOption("CDashUploadType", this->CDashUploadType.c_str()); + } return handler; } @@ -178,6 +186,16 @@ bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg) return true; } + if(arg == "CDASH_UPLOAD") + { + this->ArgumentDoing = ArgumentDoingCDashUpload; + return true; + } + if(arg == "CDASH_UPLOAD_TYPE") + { + this->ArgumentDoing = ArgumentDoingCDashUploadType; + return true; + } if(arg == "INTERNAL_TEST_CHECKSUM") { this->InternalTest = true; @@ -240,6 +258,17 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg) return true; } + if(this->ArgumentDoing == ArgumentDoingCDashUpload) + { + this->CDashUploadFile = arg; + return true; + } + if(this->ArgumentDoing == ArgumentDoingCDashUploadType) + { + this->CDashUploadType = arg; + return true; + } + // Look for other arguments. return this->Superclass::CheckArgumentValue(arg); } diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index 3673fbd..cb0ac61 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -64,6 +64,8 @@ protected: ArgumentDoingFiles, ArgumentDoingRetryDelay, ArgumentDoingRetryCount, + ArgumentDoingCDashUpload, + ArgumentDoingCDashUploadType, ArgumentDoingLast2 }; @@ -74,6 +76,8 @@ protected: cmCTest::SetOfStrings Files; std::string RetryCount; std::string RetryDelay; + std::string CDashUploadFile; + std::string CDashUploadType; }; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index bc6fb31..0e19259 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -10,7 +10,8 @@ See the License for more information. ============================================================================*/ #include "cmCTestSubmitHandler.h" - +#include "cmCTestScriptHandler.h" +#include "cmake.h" #include "cmSystemTools.h" #include "cmVersion.h" #include "cmGeneratedFileStream.h" @@ -23,8 +24,10 @@ // For XML-RPC submission #include "cm_xmlrpc.h" +#include // For curl submission #include "cm_curl.h" +#include "cmCTestCurl.h" #include @@ -1055,9 +1058,165 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(std::string const&, } #endif +void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod, + std::string& url) +{ + dropMethod = this->CTest->GetCTestConfiguration("DropMethod"); + url = dropMethod; + url += "://"; + if ( this->CTest->GetCTestConfiguration("DropSiteUser").size() > 0 ) + { + url += this->CTest->GetCTestConfiguration("DropSiteUser"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, + this->CTest->GetCTestConfiguration("DropSiteUser").c_str()); + if ( this->CTest->GetCTestConfiguration("DropSitePassword").size() > 0 ) + { + url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword"); + cmCTestLog(this->CTest, HANDLER_OUTPUT, ":******"); + } + url += "@"; + } + url += this->CTest->GetCTestConfiguration("DropSite") + + this->CTest->GetCTestConfiguration("DropLocation"); +} + + +int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, + std::string const& typeString) +{ + if(!cmSystemTools::FileExists(file)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Upload file not found: " << file << "\n"); + return -1; + } + cmCTestCurl curl(this->CTest); + std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); + std::vector args; + cmSystemTools::ExpandListArgument(curlopt, args); + curl.SetCurlOptions(args); + curl.SetTimeOutSeconds(SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT); + std::string dropMethod; + std::string url; + this->ConstructCDashURL(dropMethod, url); + std::string::size_type pos = url.find("submit.php?"); + url = url.substr(0, pos+10); + if ( ! (dropMethod == "http" || dropMethod == "https" ) ) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Only http and https are supported for CDASH_UPLOAD\n"); + return -1; + } + char md5sum[33]; + md5sum[32] = 0; + cmSystemTools::ComputeFileMD5(file, md5sum); + // 1. request the buildid and check to see if the file + // has already been uploaded + // TODO I added support for subproject. You would need to add + // a "&subproject=subprojectname" to the first POST. + cmCTestScriptHandler* ch = + static_cast(this->CTest->GetHandler("script")); + cmake* cm = ch->GetCMake(); + const char* subproject = cm->GetProperty("SubProject", cmProperty::GLOBAL); + std::ostringstream str; + str << "project=" + << this->CTest->GetCTestConfiguration("ProjectName") << "&"; + if(subproject) + { + str << "subproject=" << subproject << "&"; + } + str << "stamp=" << this->CTest->GetCurrentTag() << "-" + << this->CTest->GetTestModelString() << "&" + << "model=" << this->CTest->GetTestModelString() << "&" + << "build=" << this->CTest->GetCTestConfiguration("BuildName") << "&" + << "site=" << this->CTest->GetCTestConfiguration("Site") << "&" + << "track=" << this->CTest->GetTestModelString() << "&" + << "starttime=" << (int)cmSystemTools::GetTime() << "&" + << "endtime=" << (int)cmSystemTools::GetTime() << "&" + << "datafilesmd5[0]=" << md5sum << "&" + << "type=" << typeString; + std::string fields = str.str(); + cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:" + << url << "\nfile: " << file << "\n"); + std::string response; + if(!curl.HttpRequest(url, fields, response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Error in HttpRequest\n" << response); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Request upload response: [" << response << "]\n"); + Json::Value json; + Json::Reader reader; + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + if(json["status"].asInt() != 0) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "Bad status returned from CDash: " + << json["status"].asInt()); + return -1; + } + if(json["datafilesmd5"].isArray()) + { + int datares = json["datafilesmd5"][0].asInt(); + if(datares == 1) + { + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "File already exists on CDash, skip upload " + << file << "\n"); + return 0; + } + } + else + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "bad datafilesmd5 value in response " + << response << "\n"); + return -1; + } + + std::string upload_as = cmSystemTools::GetFilenameName(file); + std::ostringstream fstr; + fstr << "type=" << typeString << "&" + << "md5=" << md5sum << "&" + << "filename=" << upload_as << "&" + << "buildid=" << json["buildid"].asString(); + if(!curl.UploadFile(file, url, fstr.str(), response)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error uploading to CDash. " + << file << " " << url << " " << fstr.str()); + return -1; + } + if(!reader.parse(response, json)) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, + "error parsing json string [" << response << "]\n" + << reader.getFormattedErrorMessages() << "\n"); + return -1; + } + cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, + "Upload file response: [" << response << "]\n"); + return 0; +} + //---------------------------------------------------------------------------- int cmCTestSubmitHandler::ProcessHandler() { + const char* cdashUploadFile = this->GetOption("CDashUploadFile"); + const char* cdashUploadType = this->GetOption("CDashUploadType"); + if(cdashUploadFile && cdashUploadType) + { + return this->HandleCDashUploadFile(std::string(cdashUploadFile), + std::string(cdashUploadType)); + } std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash"); // cdash does not need to trigger so just return true if(!iscdash.empty()) diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index accabd1..f9cd894 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -41,6 +41,11 @@ public: /** Specify a set of files to submit. */ void SelectFiles(cmCTest::SetOfStrings const& files); + // handle the cdash file upload protocol + int HandleCDashUploadFile(std::string const& file, std::string const& type); + + void ConstructCDashURL(std::string& dropMethod, std::string& url); + private: void SetLogFile(std::ostream* ost) { this->LogFile = ost; } ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 10:27:39 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 10:27:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2244-g661541c Message-ID: <20150120152739.AA6ABAA061@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 661541c4d9e363c1785299e359588a82b97d16f5 (commit) via 6f4b103b56e280a162ca544a43f47abb3bf3f1ce (commit) from 1f8c14286538290277c81761e7109479d6e563c2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=661541c4d9e363c1785299e359588a82b97d16f5 commit 661541c4d9e363c1785299e359588a82b97d16f5 Merge: 1f8c142 6f4b103 Author: Brad King AuthorDate: Tue Jan 20 10:27:38 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 10:27:38 2015 -0500 Merge topic 'test-ctest_submit-fail-with-RunCMake' into next 6f4b103b Tests: Fix RunCMake.CTestSubmit 'drop' cases http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f4b103b56e280a162ca544a43f47abb3bf3f1ce commit 6f4b103b56e280a162ca544a43f47abb3bf3f1ce Author: Brad King AuthorDate: Tue Jan 20 10:11:39 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 10:11:39 2015 -0500 Tests: Fix RunCMake.CTestSubmit 'drop' cases When curl is given a URL of the form '://' it tries to resolve '' as a host name. If the host happens to exist and have a server then the drop might actually appear to work. Instead use an explicit '-no-site-' host to ensure it cannot connect. Reported-by: Gilles Khouzam diff --git a/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in b/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in index f0e1653..378a85a 100644 --- a/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in +++ b/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in @@ -3,3 +3,4 @@ set(CTEST_PROJECT_NAME "CTestSubmit at 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/RunCMakeTest.cmake b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake index 7cab3f3..3638007 100644 --- a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake @@ -2,6 +2,7 @@ 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) ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in | 1 + Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake | 1 + 2 files changed, 2 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 11:03:29 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 11:03:29 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2246-g895bc35 Message-ID: <20150120160329.5DA3BAAA78@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 895bc35c76bd9684e30ef29af5608e497392995a (commit) via 27c6da933ec1dd4028bb80e4adf2fa7309ef4a04 (commit) from 661541c4d9e363c1785299e359588a82b97d16f5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=895bc35c76bd9684e30ef29af5608e497392995a commit 895bc35c76bd9684e30ef29af5608e497392995a Merge: 661541c 27c6da9 Author: Brad King AuthorDate: Tue Jan 20 11:03:28 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 11:03:28 2015 -0500 Merge topic 'jsoncpp-third-party' into next 27c6da93 Add option to build CMake against a system jsoncpp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27c6da933ec1dd4028bb80e4adf2fa7309ef4a04 commit 27c6da933ec1dd4028bb80e4adf2fa7309ef4a04 Author: Brad King AuthorDate: Tue Jan 20 10:31:13 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 10:37:35 2015 -0500 Add option to build CMake against a system jsoncpp Create a CMAKE_USE_SYSTEM_JSONCPP option. 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/Source/CMakeLists.txt b/Source/CMakeLists.txt index 435b654..af4c7cf 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -503,7 +503,7 @@ target_link_libraries(CMakeLib cmsys ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES} ${CMAKE_TAR_LIBRARIES} ${CMAKE_COMPRESS_LIBRARIES} ${CMAKE_CURL_LIBRARIES} - cmjsoncpp + ${CMAKE_JSONCPP_LIBRARIES} ) # On Apple we need CoreFoundation 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 +#include "cmThirdParty.h" +#ifdef CMAKE_USE_SYSTEM_JSONCPP +# include +#else +# include +#endif #endif diff --git a/Utilities/cm_jsoncpp_value.h b/Utilities/cm_jsoncpp_value.h index 15e1088..b4cf620 100644 --- a/Utilities/cm_jsoncpp_value.h +++ b/Utilities/cm_jsoncpp_value.h @@ -13,6 +13,11 @@ #define cm_jsoncpp_value_h /* Use the jsoncpp library configured for CMake. */ -#include +#include "cmThirdParty.h" +#ifdef CMAKE_USE_SYSTEM_JSONCPP +# include +#else +# include +#endif #endif diff --git a/Utilities/cm_jsoncpp_writer.h b/Utilities/cm_jsoncpp_writer.h index c410369..c99a0d0 100644 --- a/Utilities/cm_jsoncpp_writer.h +++ b/Utilities/cm_jsoncpp_writer.h @@ -13,6 +13,11 @@ #define cm_jsoncpp_writer_h /* Use the jsoncpp library configured for CMake. */ -#include +#include "cmThirdParty.h" +#ifdef CMAKE_USE_SYSTEM_JSONCPP +# include +#else +# include +#endif #endif ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 23 ++++++++++++++++++++--- Source/CMakeLists.txt | 2 +- Utilities/cmThirdParty.h.in | 1 + Utilities/cm_jsoncpp_reader.h | 7 ++++++- Utilities/cm_jsoncpp_value.h | 7 ++++++- Utilities/cm_jsoncpp_writer.h | 7 ++++++- 6 files changed, 40 insertions(+), 7 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 11:04:16 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 11:04:16 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-930-g9b4d434 Message-ID: <20150120160416.72BB3AAA88@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 9b4d4344c67bece5b8074f6fc711feb6a169121b (commit) via 445786964abe6519bd4695d982e0801a5dda35ce (commit) via 5806f6c5e61fa1707ba1903a368e0e226477e4e4 (commit) via 55e78dbee376961ee05e89e23a69ce6a970bdcbc (commit) from 17cfa09eb2a78349a6471e4719bc933dd0625d9e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 11:04:16 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 11:04:16 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2251-g0576572 Message-ID: <20150120160416.A8E7FAAA8A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 05765722c40adad41b758855b47a17a74193cddc (commit) via 9b4d4344c67bece5b8074f6fc711feb6a169121b (commit) via 445786964abe6519bd4695d982e0801a5dda35ce (commit) via 5806f6c5e61fa1707ba1903a368e0e226477e4e4 (commit) via 55e78dbee376961ee05e89e23a69ce6a970bdcbc (commit) from 895bc35c76bd9684e30ef29af5608e497392995a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=05765722c40adad41b758855b47a17a74193cddc commit 05765722c40adad41b758855b47a17a74193cddc Merge: 895bc35 9b4d434 Author: Brad King AuthorDate: Tue Jan 20 11:04:02 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 11:04:02 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 11:04:16 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 11:04:16 -0500 (EST) Subject: [Cmake-commits] CMake branch, release, updated. v3.1.0-81-g4457869 Message-ID: <20150120160416.C51A8AAA8B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 445786964abe6519bd4695d982e0801a5dda35ce (commit) via d8f93f6e9a4678385f6f2b8c108311e2fcdf376d (commit) via 5806f6c5e61fa1707ba1903a368e0e226477e4e4 (commit) via 55e78dbee376961ee05e89e23a69ce6a970bdcbc (commit) via 3a147e1b623a4b8bb381c4b651cf983e294f3509 (commit) via 9e0176e2b37b93f34718b6333edd73302b5c5350 (commit) via c0ff542c58e48ac91714d9dc44058c9cb42fb828 (commit) from bc9cd21bd46023f3f0f7be5be5386315a193af08 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Auxiliary/cmake-mode.el | 1 + Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst | 9 +++- Source/cmGlobalXCodeGenerator.cxx | 62 +++++++++++++++++++++++----- Source/cmGlobalXCodeGenerator.h | 6 +-- 4 files changed, 62 insertions(+), 16 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 11:12:23 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 11:12:23 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2254-g28ca223 Message-ID: <20150120161223.968E14942@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 28ca22320782278dc423d55a8c426122064ae1d5 (commit) via 8d106ff43bf3e75adcbf2618e50b69e5f0d71029 (commit) via 57622bd19d3fd013038d34f497b106a7e2bfd26d (commit) from 05765722c40adad41b758855b47a17a74193cddc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=28ca22320782278dc423d55a8c426122064ae1d5 commit 28ca22320782278dc423d55a8c426122064ae1d5 Merge: 0576572 8d106ff Author: Brad King AuthorDate: Tue Jan 20 11:12:22 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 11:12:22 2015 -0500 Merge topic 'test-release' into next 8d106ff4 Merge branch 'release' into test-release 57622bd1 CMake 3.1.1 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8d106ff43bf3e75adcbf2618e50b69e5f0d71029 commit 8d106ff43bf3e75adcbf2618e50b69e5f0d71029 Merge: 9b4d434 57622bd Author: Brad King AuthorDate: Tue Jan 20 11:08:32 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 11:08:32 2015 -0500 Merge branch 'release' into test-release http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57622bd19d3fd013038d34f497b106a7e2bfd26d commit 57622bd19d3fd013038d34f497b106a7e2bfd26d Author: Brad King AuthorDate: Tue Jan 20 11:04:44 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 11:04:44 2015 -0500 CMake 3.1.1 diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 1bde1e0..6e17c35 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 0) +set(CMake_VERSION_PATCH 1) #set(CMake_VERSION_RC 0) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 13:03:32 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 13:03:32 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2256-g4faa9d3 Message-ID: <20150120180332.2D9C4AA321@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4faa9d39ad49f942c231b60204d9834cf94256ca (commit) via 642dcc7d55072c1de996aa15d40d3673cb444331 (commit) from 28ca22320782278dc423d55a8c426122064ae1d5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4faa9d39ad49f942c231b60204d9834cf94256ca commit 4faa9d39ad49f942c231b60204d9834cf94256ca Merge: 28ca223 642dcc7 Author: Brad King AuthorDate: Tue Jan 20 13:03:31 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 13:03:31 2015 -0500 Merge topic 'feature-record-msvc' into next 642dcc7d Fix RunCMake.CompileFeatures exclusion for MSVC http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=642dcc7d55072c1de996aa15d40d3673cb444331 commit 642dcc7d55072c1de996aa15d40d3673cb444331 Author: Brad King AuthorDate: Tue Jan 20 13:02:00 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 13:02:00 2015 -0500 Fix RunCMake.CompileFeatures exclusion for MSVC The "MSVC" variable is not set inside the RunCMakeTest script. Check it when configuring the available tests and pass in a variable telling the test whether to exclude parts for MSVC. diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3a61751..3e2624e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -84,6 +84,9 @@ add_RunCMake_test(ObjectLibrary) add_RunCMake_test(TargetObjects) add_RunCMake_test(TargetSources) add_RunCMake_test(find_dependency) +if(MSVC) + set(CompileFeatures_ARGS "-DNO_LinkImplementationFeatureCycle=1") +endif() add_RunCMake_test(CompileFeatures) add_RunCMake_test(WriteCompilerDetectionHeader) if(NOT WIN32) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index f890f24..4c04e78 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,10 +27,10 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - if(NOT MSVC) + if(NOT NO_LinkImplementationFeatureCycle) run_cmake(LinkImplementationFeatureCycle) - run_cmake(LinkImplementationFeatureCycleSolved) endif() + run_cmake(LinkImplementationFeatureCycleSolved) if (";${CXX_FEATURES};" MATCHES ";cxx_final;") set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1") ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CMakeLists.txt | 3 +++ Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 13:34:01 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 13:34:01 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2260-g410710a Message-ID: <20150120183402.02CFFA977A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 410710a869259e9b0f390f652e4d4dfc51c7ed41 (commit) via 4fad797618cedabeb601ef458d1bd435ff55aaf8 (commit) via 407677ace703e992163b4d9088d30eca4951f852 (commit) via 6163e7f976039479837c18fa46e36779e83945fe (commit) from 4faa9d39ad49f942c231b60204d9834cf94256ca (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=410710a869259e9b0f390f652e4d4dfc51c7ed41 commit 410710a869259e9b0f390f652e4d4dfc51c7ed41 Merge: 4faa9d3 4fad797 Author: Brad King AuthorDate: Tue Jan 20 13:34:01 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 13:34:01 2015 -0500 Merge topic 'feature-record-msvc' into next 4fad7976 Features: Record for MSVC 2010-2015. 407677ac Features: Exclude MSVC from link feature cycle rejection test 6163e7f9 Features: Extend CompileFeatures test for MSVC http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4fad797618cedabeb601ef458d1bd435ff55aaf8 commit 4fad797618cedabeb601ef458d1bd435ff55aaf8 Author: Robert Maynard AuthorDate: Mon Jan 19 15:49:06 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 13:33:51 2015 -0500 Features: Record for MSVC 2010-2015. Notes: * Initializer lists are only properly supported in 2015 and above. Previous Visual Studio releases said they supported initializer lists. * VS2012 and above conform to cxx_decltype_incomplete_return_types proposal but without support for auto return types the feature is unusable. Activate support only in VS2015 and above. * VS2010 and above to conform to the updated cxx_contextual_conversions proposal. Co-Author: Stephen Kelly diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..476f244 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,100 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +# In theory decltype incomplete return types was added in 2012 +# but without support for decltype_auto and return type deduction this +# feature is unusable +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Possibly broken: +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +# Microsoft now states they support contextual conversions +# see footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx + +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + + +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 0e85005..ad56f68 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -4,3 +4,12 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_CXX " /FS") endif() __windows_compiler_msvc(CXX) + +# No version of MSVC has full conformance to C++11. Therefore the +# __cplusplus macro always evaluates to 98 even if the compilers come with +# C++11/14/+ features enabled. +set(CMAKE_CXX_STANDARD_DEFAULT 98) + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index e81bc08..5642c99 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC SunPro ) diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index b5e46c0..43e89ab 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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -67,6 +67,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -84,7 +96,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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=407677ace703e992163b4d9088d30eca4951f852 commit 407677ace703e992163b4d9088d30eca4951f852 Author: Robert Maynard AuthorDate: Mon Jan 19 12:50:24 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 13:33:03 2015 -0500 Features: Exclude MSVC from link feature cycle rejection test MSVC has no explicit flags to enable C++11/14/17 language standard levels. Instead each version of the compiler documents a list of supported features that are always on. Therefore no use of specific features will adjust the CXX_STANDARD level required for any target. Therefore we must exclude the RunCMake.CompileFeatures test case "LinkImplementationFeatureCycle" because it can never fail. Note that within the RunCMakeTest script no languages or toolchains are enabled so we cannot test if(MSVC) directly. Instead test it during configuration of the test and pass in a variable telling RunCMakeTest whether to activate this test case. diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3a61751..3e2624e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -84,6 +84,9 @@ add_RunCMake_test(ObjectLibrary) add_RunCMake_test(TargetObjects) add_RunCMake_test(TargetSources) add_RunCMake_test(find_dependency) +if(MSVC) + set(CompileFeatures_ARGS "-DNO_LinkImplementationFeatureCycle=1") +endif() add_RunCMake_test(CompileFeatures) add_RunCMake_test(WriteCompilerDetectionHeader) if(NOT WIN32) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..4c04e78 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,7 +27,9 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) + if(NOT NO_LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycle) + endif() run_cmake(LinkImplementationFeatureCycleSolved) if (";${CXX_FEATURES};" MATCHES ";cxx_final;") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6163e7f976039479837c18fa46e36779e83945fe commit 6163e7f976039479837c18fa46e36779e83945fe Author: Stephen Kelly AuthorDate: Thu Jan 15 21:55:18 2015 +0100 Commit: Brad King CommitDate: Tue Jan 20 13:24:36 2015 -0500 Features: Extend CompileFeatures test for MSVC Add preprocessor definitions for the expected availability of features for each version of the compiler. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 5cd0836..a0dc2a5 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -207,6 +207,26 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=0 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") add_definitions( -DEXPECT_OVERRIDE_CONTROL=1 ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 13:36:02 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 13:36:02 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2262-g49dbd15 Message-ID: <20150120183602.45448AA5F4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 49dbd156c1c4ea2f7a97a6ba7821cba2595fe37c (commit) via 88566c0c4e7d0fd8651794dec4bbdb4506cbdeb3 (commit) from 410710a869259e9b0f390f652e4d4dfc51c7ed41 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=49dbd156c1c4ea2f7a97a6ba7821cba2595fe37c commit 49dbd156c1c4ea2f7a97a6ba7821cba2595fe37c Merge: 410710a 88566c0 Author: Brad King AuthorDate: Tue Jan 20 13:36:01 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 13:36:01 2015 -0500 Merge topic 'feature-record-msvc' into next 88566c0c WCDH: MSVC Compatibility for cxx_align{of,as} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=88566c0c4e7d0fd8651794dec4bbdb4506cbdeb3 commit 88566c0c4e7d0fd8651794dec4bbdb4506cbdeb3 Author: Stephen Kelly AuthorDate: Sun Apr 6 15:55:37 2014 +0200 Commit: Brad King CommitDate: Tue Jan 20 13:34:42 2015 -0500 WCDH: MSVC Compatibility for cxx_align{of,as} diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 5642c99..d18f47c 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -529,6 +529,8 @@ function(write_compiler_detection_header # define ${def_value} alignas(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __attribute__ ((__aligned__(X))) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __declspec(align(X)) # else # define ${def_value} # endif @@ -541,6 +543,8 @@ function(write_compiler_detection_header # define ${def_value} alignof(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __alignof__(X) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __alignof(X) # endif \n") endif() ----------------------------------------------------------------------- Summary of changes: Modules/WriteCompilerDetectionHeader.cmake | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 13:48:09 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 13:48:09 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2264-g65af84b Message-ID: <20150120184809.D5C60513D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 65af84b164be876c455e818d4342d6eec93833b5 (commit) via fa90abc1783d5a65dbf4029aa60a1ec28e68b71e (commit) from 49dbd156c1c4ea2f7a97a6ba7821cba2595fe37c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=65af84b164be876c455e818d4342d6eec93833b5 commit 65af84b164be876c455e818d4342d6eec93833b5 Merge: 49dbd15 fa90abc Author: Brad King AuthorDate: Tue Jan 20 13:48:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 13:48:09 2015 -0500 Merge topic 'cdash_upload_file_mode' into next fa90abc1 Collect the Lables.json files and update the documentation. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fa90abc1783d5a65dbf4029aa60a1ec28e68b71e commit fa90abc1783d5a65dbf4029aa60a1ec28e68b71e Author: Bill Hoffman AuthorDate: Tue Jan 20 13:34:40 2015 -0500 Commit: Bill Hoffman CommitDate: Tue Jan 20 13:38:05 2015 -0500 Collect the Lables.json files and update the documentation. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 34e5f9a..3a9b421 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -4,8 +4,12 @@ # # This module provides the function ``ctest_coverage_collect_gcov``. # The function will run gcov on the .gcda files in a binary tree and then -# package all of the .gcov files into a tar file with a data.json. -# This file can be sent to a CDash server for display with the +# package all of the .gcov files into a tar file with a data.json that +# contains the source and build directories for CDash to use in parsing +# the coverage data. In addtion the Labels.json files for targets that +# have coverage information are also put in the tar file for CDash to +# asign the correct labels. This file can be sent to a CDash server for +# display with the # :command:`ctest_submit(CDASH_UPLOAD)` command. # # .. command:: cdash_coverage_collect_gcov @@ -87,7 +91,7 @@ function(ctest_coverage_collect_gcov) # if we have gcda files then also grab the labels file for that target if(${len} GREATER 0) file(GLOB_RECURSE lfiles RELATIVE ${binary_dir} - "${target_dir}/Labels.txt") + "${target_dir}/Labels.json") list(APPEND gcda_files ${gfiles}) list(APPEND label_files ${lfiles}) endif() ----------------------------------------------------------------------- Summary of changes: Modules/CTestCoverageCollectGCOV.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 20 13:56:30 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 20 Jan 2015 13:56:30 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2268-g850d020 Message-ID: <20150120185630.5C0CBAA149@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 850d020125bddf09624713a1c49fd42030b04ab1 (commit) via 51917aca1dd43b5ae4239b59380000d920c3cf24 (commit) via b9c7985c75f183b028feef52a9f86372fd0f4694 (commit) via bd8bec2c3d863e1030543591bf8586bebeccab59 (commit) from 65af84b164be876c455e818d4342d6eec93833b5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=850d020125bddf09624713a1c49fd42030b04ab1 commit 850d020125bddf09624713a1c49fd42030b04ab1 Merge: 65af84b 51917ac Author: Brad King AuthorDate: Tue Jan 20 13:56:29 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 13:56:29 2015 -0500 Merge topic 'feature-record-msvc' into next 51917aca Features: Record for MSVC 2010-2015. b9c7985c Features: Exclude MSVC from link feature cycle rejection test bd8bec2c Features: Extend CompileFeatures test for MSVC http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51917aca1dd43b5ae4239b59380000d920c3cf24 commit 51917aca1dd43b5ae4239b59380000d920c3cf24 Author: Robert Maynard AuthorDate: Mon Jan 19 15:49:06 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 13:43:06 2015 -0500 Features: Record for MSVC 2010-2015. Notes: * Initializer lists are only properly supported in 2015 and above. Previous Visual Studio releases said they supported initializer lists. * VS2012 and above conform to cxx_decltype_incomplete_return_types proposal but without support for auto return types the feature is unusable. Activate support only in VS2015 and above. * VS2010 and above to conform to the updated cxx_contextual_conversions proposal. * In WCDH add MSVC Compatibility for cxx_align{of,as}. Co-Author: Stephen Kelly diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..476f244 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,100 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +# In theory decltype incomplete return types was added in 2012 +# but without support for decltype_auto and return type deduction this +# feature is unusable +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Possibly broken: +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +# Microsoft now states they support contextual conversions +# see footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx + +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + + +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index 0e85005..ad56f68 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -4,3 +4,12 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_CXX " /FS") endif() __windows_compiler_msvc(CXX) + +# No version of MSVC has full conformance to C++11. Therefore the +# __cplusplus macro always evaluates to 98 even if the compilers come with +# C++11/14/+ features enabled. +set(CMAKE_CXX_STANDARD_DEFAULT 98) + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index e81bc08..d18f47c 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC SunPro ) @@ -528,6 +529,8 @@ function(write_compiler_detection_header # define ${def_value} alignas(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __attribute__ ((__aligned__(X))) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __declspec(align(X)) # else # define ${def_value} # endif @@ -540,6 +543,8 @@ function(write_compiler_detection_header # define ${def_value} alignof(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __alignof__(X) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __alignof(X) # endif \n") endif() diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index b5e46c0..43e89ab 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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -67,6 +67,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -84,7 +96,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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9c7985c75f183b028feef52a9f86372fd0f4694 commit b9c7985c75f183b028feef52a9f86372fd0f4694 Author: Robert Maynard AuthorDate: Mon Jan 19 12:50:24 2015 -0500 Commit: Brad King CommitDate: Tue Jan 20 13:41:45 2015 -0500 Features: Exclude MSVC from link feature cycle rejection test MSVC has no explicit flags to enable C++11/14/17 language standard levels. Instead each version of the compiler documents a list of supported features that are always on. Therefore no use of specific features will adjust the CXX_STANDARD level required for any target. Therefore we must exclude the RunCMake.CompileFeatures test case "LinkImplementationFeatureCycle" because it can never fail. Note that within the RunCMakeTest script no languages or toolchains are enabled so we cannot test if(MSVC) directly. Instead test it during configuration of the test and pass in a variable telling RunCMakeTest whether to activate this test case. diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3a61751..3e2624e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -84,6 +84,9 @@ add_RunCMake_test(ObjectLibrary) add_RunCMake_test(TargetObjects) add_RunCMake_test(TargetSources) add_RunCMake_test(find_dependency) +if(MSVC) + set(CompileFeatures_ARGS "-DNO_LinkImplementationFeatureCycle=1") +endif() add_RunCMake_test(CompileFeatures) add_RunCMake_test(WriteCompilerDetectionHeader) if(NOT WIN32) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..4c04e78 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,7 +27,9 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) + if(NOT NO_LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycle) + endif() run_cmake(LinkImplementationFeatureCycleSolved) if (";${CXX_FEATURES};" MATCHES ";cxx_final;") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bd8bec2c3d863e1030543591bf8586bebeccab59 commit bd8bec2c3d863e1030543591bf8586bebeccab59 Author: Stephen Kelly AuthorDate: Thu Jan 15 21:55:18 2015 +0100 Commit: Brad King CommitDate: Tue Jan 20 13:41:44 2015 -0500 Features: Extend CompileFeatures test for MSVC Add preprocessor definitions for the expected availability of features for each version of the compiler. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 5cd0836..a0dc2a5 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -207,6 +207,26 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=0 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") add_definitions( -DEXPECT_OVERRIDE_CONTROL=1 ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From ben.boeckel at kitware.com Tue Jan 20 14:53:28 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Tue, 20 Jan 2015 14:53:28 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2270-g656ddc5 Message-ID: <20150120195328.61421AA171@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 656ddc52c42f8fdfd22d331ceaa669c479124555 (commit) via ddfe463d8f62641f2e80e0c5cc0cb78203ea63ac (commit) from 850d020125bddf09624713a1c49fd42030b04ab1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=656ddc52c42f8fdfd22d331ceaa669c479124555 commit 656ddc52c42f8fdfd22d331ceaa669c479124555 Merge: 850d020 ddfe463 Author: Ben Boeckel AuthorDate: Tue Jan 20 14:53:27 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 14:53:27 2015 -0500 Merge topic 'ninja-rsp_file-calculation' into next ddfe463d ninja: use the minimum of all possible command line lengths http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ddfe463d8f62641f2e80e0c5cc0cb78203ea63ac commit ddfe463d8f62641f2e80e0c5cc0cb78203ea63ac Author: Ben Boeckel AuthorDate: Wed Jan 14 13:11:44 2015 -0500 Commit: Ben Boeckel CommitDate: Tue Jan 20 14:53:03 2015 -0500 ninja: use the minimum of all possible command line lengths diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index e344df4..a926447 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -22,6 +22,7 @@ #include #include +#include #ifndef _WIN32 #include @@ -358,15 +359,29 @@ cmNinjaNormalTargetGenerator static int calculateCommandLineLengthLimit(int linkRuleLength) { + static int limits[] = { #ifdef _WIN32 - return 8000 - linkRuleLength; -#elif defined(__linux) || defined(__APPLE__) || defined(__HAIKU__) - // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac - return ((int)sysconf(_SC_ARG_MAX)) - linkRuleLength - 1000; -#else - (void)linkRuleLength; - return -1; + 8000 - linkRuleLength, #endif +#if defined(__APPLE__) || defined(__HAIKU__) || defined(__linux) + // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac + ((int)sysconf(_SC_ARG_MAX)) - linkRuleLength - 1000, +#endif +#if defined(__linux) + // #define MAX_ARG_STRLEN (PAGE_SIZE * 32) in Linux's binfmts.h + ((int)sysconf(_SC_PAGESIZE) * 32) - linkRuleLength - 1000, +#endif + std::numeric_limits::max() + }; + + size_t arrSz = cmArraySize(limits); + int sz = *std::min_element(limits, limits + arrSz); + if (sz == std::numeric_limits::max()) + { + return -1; + } + + return sz; } ----------------------------------------------------------------------- Summary of changes: Source/cmNinjaNormalTargetGenerator.cxx | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) hooks/post-receive -- CMake From domen.vrankar at gmail.com Tue Jan 20 18:31:03 2015 From: domen.vrankar at gmail.com (Domen Vrankar) Date: Tue, 20 Jan 2015 18:31:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2272-g3c62239 Message-ID: <20150120233103.7CD49A9F07@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3c62239543d57cdae883463c73ddcb5f5a31c83c (commit) via 0538b325b4884c8b722ae31ea43b8c8cae113fcf (commit) from 656ddc52c42f8fdfd22d331ceaa669c479124555 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c62239543d57cdae883463c73ddcb5f5a31c83c commit 3c62239543d57cdae883463c73ddcb5f5a31c83c Merge: 656ddc5 0538b32 Author: Domen Vrankar AuthorDate: Tue Jan 20 18:31:02 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 20 18:31:02 2015 -0500 Merge topic 'rpm_multi_prefix' into next 0538b325 cpack rpm multiple path relocation prefixes http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0538b325b4884c8b722ae31ea43b8c8cae113fcf commit 0538b325b4884c8b722ae31ea43b8c8cae113fcf Author: Domen Vrankar AuthorDate: Wed Jan 21 00:29:46 2015 +0100 Commit: Domen Vrankar CommitDate: Wed Jan 21 00:29:46 2015 +0100 cpack rpm multiple path relocation prefixes Allow multiple path relocation prefixes for a single rpm package. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index d2cb2ee..43e3fe0 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -379,6 +379,34 @@ # # May be used to add more exclude path (directories or files) from the initial # default list of excluded paths. See CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST. +# +# .. variable:: CPACK_RPM_RELOCATION_PATHS +# +# * Mandatory : NO +# * Default : - +# +# May be used to specify more than one relocation path per relocatable RPM. +# Variable contains a list of relocation paths that if relative are prefixed +# by the value of CPACK_RPM__PACKAGE_PREFIX or by the value of +# CPACK_PACKAGING_INSTALL_PREFIX if the component version is not provided. +# Variable is not component based as its content can be used to set a different +# path prefix for e.g. binary dir and documentation dir at the same time. +# Only prefixes that are required by a certain component are added to that +# component - component must contain at least one file/directory/symbolic link +# with CPACK_RPM_RELOCATION_PATHS prefix for a certain relocation path +# to be added. Package will not contain any relocation paths if there are no +# files/directories/symbolic links on any of the provided prefix locations. +# Packages that either do not contain any relocation paths or contain +# files/directories/symbolic links that are outside relocation paths print +# out an AUTHOR_WARNING that RPM will be partially relocatable. +# +# .. variable:: CPACK_RPM__PACKAGE_PREFIX +# +# * Mandatory : NO +# * Default : CPACK_PACKAGING_INSTALL_PREFIX +# +# May be used to set per component CPACK_PACKAGING_INSTALL_PREFIX for +# relocatable RPM packages. #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -395,6 +423,62 @@ # Author: Eric Noulard with the help of Alexander Neundorf. +function(cpack_rpm_prepare_relocation_paths) + # set appropriate prefix, remove possible trailing slash and convert backslashes to slashes + if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX) + file(TO_CMAKE_PATH "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX}" PATH_PREFIX) + else() + file(TO_CMAKE_PATH "${CPACK_PACKAGING_INSTALL_PREFIX}" PATH_PREFIX) + endif() + + set(RPM_RELOCATION_PATHS "${CPACK_RPM_RELOCATION_PATHS}") + list(REMOVE_DUPLICATES RPM_RELOCATION_PATHS) + + # set base path prefix + if(EXISTS "${WDIR}/${PATH_PREFIX}") + set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}Prefix: ${PATH_PREFIX}\n") + list(APPEND RPM_USED_PACKAGE_PREFIXES "${PATH_PREFIX}") + endif() + + # set other path prefixes + foreach(RELOCATION_PATH ${RPM_RELOCATION_PATHS}) + if(IS_ABSOLUTE "${RELOCATE_PATH}") + set(PREPARED_RELOCATION_PATH "${RELOCATION_PATH}") + else() + set(PREPARED_RELOCATION_PATH "${PATH_PREFIX}/${RELOCATION_PATH}") + endif() + + if(EXISTS "${WDIR}/${PREPARED_RELOCATION_PATH}") + set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}Prefix: ${PREPARED_RELOCATION_PATH}\n") + list(APPEND RPM_USED_PACKAGE_PREFIXES "${PREPARED_RELOCATION_PATH}") + endif() + endforeach() + + # warn about all the paths that are not relocatable + file(GLOB_RECURSE FILE_PATHS_ "${WDIR}/*") + foreach(TMP_PATH ${FILE_PATHS_}) + string(LENGTH "${WDIR}" WDIR_LEN) + string(SUBSTRING "${TMP_PATH}" ${WDIR_LEN} -1 TMP_PATH) + unset(TMP_PATH_FOUND_) + + foreach(RELOCATION_PATH ${RPM_USED_PACKAGE_PREFIXES}) + file(RELATIVE_PATH REL_PATH_ "${RELOCATION_PATH}" "${TMP_PATH}") + string(SUBSTRING "${REL_PATH_}" 0 2 PREFIX_) + + if(NOT "${PREFIX_}" STREQUAL "..") + set(TPM_PATH_FOUND_ TRUE) + break() + endif() + endforeach() + + if(NOT TPM_PATH_FOUND_) + message(AUTHOR_WARNING "CPackRPM:Warning: Path ${TMP_PATH} is not on one of the relocatable paths! Package will be partially relocatable.") + endif() + endforeach() + + set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}" PARENT_SCOPE) +endfunction() + if(CMAKE_BINARY_DIR) message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.") endif() @@ -636,13 +720,16 @@ if(CPACK_PACKAGE_RELOCATABLE) set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE) endif() if(CPACK_RPM_PACKAGE_RELOCATABLE) + unset(TMP_RPM_PREFIXES) + if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: Trying to build a relocatable package") endif() if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.") else() - set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) + set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) # kept for back compatibility (provided external RPM spec files) + cpack_rpm_prepare_relocation_paths() endif() endif() @@ -856,15 +943,21 @@ if(CPACK_RPM_PACKAGE_RELOCATABLE) # get a list of the elements in CPACK_RPM_PACKAGE_PREFIX and remove # the final element (so the install-prefix dir itself is not omitted # from the RPM's content-list) - string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${CPACK_RPM_PACKAGE_PREFIX}") - list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1) - # Now generate all of the parent dirs of CPACK_RPM_PACKAGE_PREFIX - foreach(_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS}) - list(APPEND _TMP_LIST "${_ELEM}") - string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}") - set(_OMIT_DIR "-o -path ${_OMIT_DIR}") - separate_arguments(_OMIT_DIR) - list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR}) + foreach(CPACK_RPM_PACKAGE_PREFIX ${RPM_PACKAGE_PREFIXES}) + string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${CPACK_RPM_PACKAGE_PREFIX}") + list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1) + unset(_TMP_LIST) + # Now generate all of the parent dirs of CPACK_RPM_PACKAGE_PREFIX + foreach(_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS}) + list(APPEND _TMP_LIST "${_ELEM}") + string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}") + list(FIND _RPM_DIRS_TO_OMIT "${_OMIT_DIR}" _DUPLICATE_FOUND) + if(_DUPLICATE_FOUND EQUAL -1) + set(_OMIT_DIR "-o -path ${_OMIT_DIR}") + separate_arguments(_OMIT_DIR) + list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR}) + endif() + endforeach() endforeach() endif() @@ -1101,7 +1194,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_AUTOREQ\@ \@TMP_RPM_AUTOREQPROV\@ \@TMP_RPM_BUILDARCH\@ -\@TMP_RPM_PREFIX\@ +\@TMP_RPM_PREFIXES\@ %define _rpmdir \@CPACK_RPM_DIRECTORY\@ %define _rpmfilename \@CPACK_RPM_FILE_NAME\@ diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index dea30e4..007f735 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -832,6 +832,15 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release # Do not try to build RPM if (NOT RPMBUILD) set(CPACK_BINARY_RPM OFF) + else() + add_test(CPack-RPM ${CMAKE_CMAKE_COMMAND} + -D dir=${CMake_BINARY_DIR}/Tests/CPackRPM + -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} + -D CMAKE_CMAKE_COMMAND=${CMAKE_CMAKE_COMMAND} + -P ${CMake_SOURCE_DIR}/Tests/CPackRPM/RunCPack.cmake + ) + list(APPEND TEST_BUILD_DIRS + "${CMake_BINARY_DIR}/Tests/CPackRPM") endif() find_program(NSIS_MAKENSIS_EXECUTABLE NAMES makensis diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in index 8c01b32..e597480 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -6,15 +6,22 @@ if(CPACK_GENERATOR MATCHES "ZIP") endif() if(CPACK_GENERATOR MATCHES "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") + # set gnu install prefixes + include(GNUInstallDirs) - # test package summary override - set(CPACK_RPM_PACKAGE_SUMMARY "default summary") - set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") + set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") + set(CPACK_RPM_RELOCATION_PATHS "${CMAKE_INSTALL_INCLUDEDIR}" + "${CMAKE_INSTALL_LIBDIR}" "${CMAKE_INSTALL_BINDIR}") - # test package description override - set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") + set(CPACK_RPM_COMPONENT_INSTALL "ON") + set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") + + # test package summary override + set(CPACK_RPM_PACKAGE_SUMMARY "default summary") + set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") + + # test package description override + set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") endif() if(CPACK_GENERATOR MATCHES "DEB") diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 4d56218..aeb7ebc 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -140,6 +140,10 @@ if(CPackGen MATCHES "RPM") "C/C\\+\\+ header files for use with MyLib") if(${CPackComponentWay} STREQUAL "IgnoreGroup") + # set gnu install prefixes to what they are set during rpm creation + include(GNUInstallDirs) + set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") + foreach(check_file ${expected_file}) string(REGEX MATCH ".*libraries.*" check_file_libraries_match ${check_file}) string(REGEX MATCH ".*headers.*" check_file_headers_match ${check_file}) @@ -154,15 +158,23 @@ if(CPackGen MATCHES "RPM") if(check_file_libraries_match) set(check_file_match_expected_summary ".*${CPACK_RPM_libraries_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_RPM_libraries_PACKAGE_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + set(spec_regex "*libraries*") elseif(check_file_headers_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_HEADERS_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") + set(spec_regex "*headers*") elseif(check_file_applications_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_APPLICATIONS_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(spec_regex "*applications*") elseif(check_file_Unspecified_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*DESCRIPTION.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(spec_regex "*Unspecified*") else() message(FATAL_ERROR "error: unexpected rpm package '${check_file}'") endif() @@ -170,13 +182,25 @@ if(CPackGen MATCHES "RPM") string(REGEX MATCH ${check_file_match_expected_summary} check_file_match_summary ${check_file_content}) if(NOT check_file_match_summary) - message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'") + message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'; RPM output: '${check_file_content}'") endif() string(REGEX MATCH ${check_file_match_expected_description} check_file_match_description ${check_file_content}) if(NOT check_file_match_description) - message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'") + message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'; RPM output: '${check_file_content}'") + endif() + + string(REGEX MATCH ${check_file_match_expected_relocation_path} check_file_match_relocation_path ${check_file_content}) + + if(NOT check_file_match_relocation_path) + file(GLOB_RECURSE spec_file "${CPackComponentsForAll_BINARY_DIR}/${spec_regex}.spec") + + if(spec_file) + file(READ ${spec_file} spec_file_content) + endif() + + message(FATAL_ERROR "error: '${check_file}' rpm package relocation path does not match expected value - regex '${check_file_match_expected_relocation_path}'; RPM output: '${check_file_content}'; generated spec file: '${spec_file_content}'") endif() endforeach() elseif(${CPackComponentWay} STREQUAL "IgnoreGroup") diff --git a/Tests/CPackRPM/CMakeLists.txt b/Tests/CPackRPM/CMakeLists.txt new file mode 100644 index 0000000..a951610 --- /dev/null +++ b/Tests/CPackRPM/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required (VERSION 3.1) + +project(CPackRPM) + +install(FILES CMakeLists.txt DESTINATION /not_relocatable COMPONENT static) +install(FILES CMakeLists.txt DESTINATION relocatable COMPONENT relocatable) + +set(CPACK_PACKAGE_RELOCATABLE TRUE) +set(CPACK_GENERATOR "RPM") +set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") + +set(CPACK_RPM_COMPONENT_INSTALL ON) + +include(CPack) diff --git a/Tests/CPackRPM/RunCPack.cmake b/Tests/CPackRPM/RunCPack.cmake new file mode 100644 index 0000000..2547262 --- /dev/null +++ b/Tests/CPackRPM/RunCPack.cmake @@ -0,0 +1,15 @@ +file(MAKE_DIRECTORY "${dir}") + +execute_process( + COMMAND ${CMAKE_CMAKE_COMMAND} + "${CMake_SOURCE_DIR}/Tests/CPackRPM" + COMMAND make package + RESULT_VARIABLE result + OUTPUT_VARIABLE stdout + ERROR_VARIABLE stderr + WORKING_DIRECTORY ${dir}) + +# test for partial relocation warning +if(NOT "${stderr}" MATCHES "CPackRPM:Warning: Path /not_relocatable/CMakeLists.txt is not on one of the.*relocatable paths! Package will be partially relocatable.") + message(FATAL_ERROR "CPack/RPM missing partially relocatable warning; stderr output: '${stderr}'") +endif() ----------------------------------------------------------------------- Summary of changes: Modules/CPackRPM.cmake | 115 ++++++++++++++++++-- Tests/CMakeLists.txt | 9 ++ .../MyLibCPackConfig-IgnoreGroup.cmake.in | 21 ++-- .../RunCPackVerifyResult.cmake | 28 ++++- Tests/CPackRPM/CMakeLists.txt | 14 +++ Tests/CPackRPM/RunCPack.cmake | 15 +++ 6 files changed, 182 insertions(+), 20 deletions(-) create mode 100644 Tests/CPackRPM/CMakeLists.txt create mode 100644 Tests/CPackRPM/RunCPack.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jan 21 00:01:12 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 21 Jan 2015 00:01:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-931-gf709776 Message-ID: <20150121050112.69D1DAAC8A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via f709776864bbd94c7aa839248adfbfe7d4f5cae6 (commit) from 9b4d4344c67bece5b8074f6fc711feb6a169121b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f709776864bbd94c7aa839248adfbfe7d4f5cae6 commit f709776864bbd94c7aa839248adfbfe7d4f5cae6 Author: Kitware Robot AuthorDate: Wed Jan 21 00:01:10 2015 -0500 Commit: Kitware Robot CommitDate: Wed Jan 21 00:01:10 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 3dd8e7b..4536390 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 20150120) +set(CMake_VERSION_PATCH 20150121) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 21 09:26:31 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 21 Jan 2015 09:26:31 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2276-gca64658 Message-ID: <20150121142631.14648AAA54@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ca646585aa25396915e4ac0411c2e166abe24c6d (commit) via 7e468cd8f99daecfc1197883a0fd87bde771309b (commit) via 77444a7d486c415508a9c754fd4cc29cbb33f12f (commit) via f709776864bbd94c7aa839248adfbfe7d4f5cae6 (commit) from 3c62239543d57cdae883463c73ddcb5f5a31c83c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca646585aa25396915e4ac0411c2e166abe24c6d commit ca646585aa25396915e4ac0411c2e166abe24c6d Merge: 3c62239 7e468cd Author: Brad King AuthorDate: Wed Jan 21 09:26:29 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 09:26:29 2015 -0500 Merge topic 'update-kwsys' into next 7e468cd8 Merge branch 'upstream-kwsys' into update-kwsys 77444a7d KWSys 2015-01-20 (b33e7b96) f7097768 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7e468cd8f99daecfc1197883a0fd87bde771309b commit 7e468cd8f99daecfc1197883a0fd87bde771309b Merge: f709776 77444a7 Author: Brad King AuthorDate: Wed Jan 21 09:15:44 2015 -0500 Commit: Brad King CommitDate: Wed Jan 21 09:15:44 2015 -0500 Merge branch 'upstream-kwsys' into update-kwsys http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77444a7d486c415508a9c754fd4cc29cbb33f12f commit 77444a7d486c415508a9c754fd4cc29cbb33f12f Author: KWSys Robot AuthorDate: Tue Jan 20 11:00:48 2015 -0500 Commit: Brad King CommitDate: Wed Jan 21 09:15:40 2015 -0500 KWSys 2015-01-20 (b33e7b96) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ b33e7b96 | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 425fa73e..b33e7b96 Brad King (2): 57c3ef1d Suppress deprecation warnings for GetVersionEx on Intel compiler b33e7b96 FStream: Fix exception spec on our standard stream replacements Change-Id: I69044c5879a1ec4a5be59bdda05540c1eb65b197 diff --git a/FStream.hxx.in b/FStream.hxx.in index 45425ff..37055d6 100644 --- a/FStream.hxx.in +++ b/FStream.hxx.in @@ -18,6 +18,11 @@ namespace @KWSYS_NAMESPACE@ { #if defined(_MSC_VER) && _MSC_VER >= 1400 +# if defined(_NOEXCEPT) +# define @KWSYS_NAMESPACE at _FStream_NOEXCEPT _NOEXCEPT +# else +# define @KWSYS_NAMESPACE at _FStream_NOEXCEPT +# endif template class basic_filebuf : public std::basic_filebuf { @@ -85,7 +90,7 @@ namespace @KWSYS_NAMESPACE@ return buf_; } - ~basic_ifstream() + ~basic_ifstream() @KWSYS_NAMESPACE at _FStream_NOEXCEPT { buf_->close(); delete buf_; @@ -147,7 +152,7 @@ class basic_ofstream : public std::basic_ostream { return buf_.get(); } - ~basic_ofstream() + ~basic_ofstream() @KWSYS_NAMESPACE at _FStream_NOEXCEPT { buf_->close(); delete buf_; @@ -160,6 +165,7 @@ class basic_ofstream : public std::basic_ostream typedef basic_ifstream ifstream; typedef basic_ofstream ofstream; +# undef @KWSYS_NAMESPACE at _FStream_NOEXCEPT #else using @KWSYS_NAMESPACE at _ios_namespace::ofstream; using @KWSYS_NAMESPACE at _ios_namespace::ifstream; diff --git a/ProcessWin32.c b/ProcessWin32.c index ef71f26..c2965ea 100644 --- a/ProcessWin32.c +++ b/ProcessWin32.c @@ -340,7 +340,11 @@ kwsysProcess* kwsysProcess_New(void) osv.dwOSVersionInfoSize = sizeof(osv); #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (push) -# pragma warning (disable:4996) +# ifdef __INTEL_COMPILER +# pragma warning (disable:1478) +# else +# pragma warning (disable:4996) +# endif #endif GetVersionEx(&osv); #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx @@ -2382,7 +2386,11 @@ static kwsysProcess_List* kwsysProcess_List_New(void) osv.dwOSVersionInfoSize = sizeof(osv); #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (push) -# pragma warning (disable:4996) +# ifdef __INTEL_COMPILER +# pragma warning (disable:1478) +# else +# pragma warning (disable:4996) +# endif #endif GetVersionEx(&osv); #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx diff --git a/SystemInformation.cxx b/SystemInformation.cxx index 3d5e728..9c7ceee 100644 --- a/SystemInformation.cxx +++ b/SystemInformation.cxx @@ -5069,7 +5069,11 @@ bool SystemInformationImplementation::QueryOSInformation() osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEXW); #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (push) -# pragma warning (disable:4996) +# ifdef __INTEL_COMPILER +# pragma warning (disable:1478) +# else +# pragma warning (disable:4996) +# endif #endif bOsVersionInfoEx = GetVersionExW ((OSVERSIONINFOW*)&osvi); if (!bOsVersionInfoEx) diff --git a/SystemTools.cxx b/SystemTools.cxx index c2b6097..2708211 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -4732,7 +4732,11 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion() #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx # pragma warning (push) -# pragma warning (disable:4996) +# ifdef __INTEL_COMPILER +# pragma warning (disable:1478) +# else +# pragma warning (disable:4996) +# endif #endif bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osvi); if (!bOsVersionInfoEx) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- Source/kwsys/FStream.hxx.in | 10 ++++++++-- Source/kwsys/ProcessWin32.c | 12 ++++++++++-- Source/kwsys/SystemInformation.cxx | 6 +++++- Source/kwsys/SystemTools.cxx | 6 +++++- 5 files changed, 29 insertions(+), 7 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 21 11:55:38 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 21 Jan 2015 11:55:38 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2278-g6a5da86 Message-ID: <20150121165538.40FF8A9EBE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 6a5da86d1eb53526ad48724cae6ce23151f56e0e (commit) via 0d348d07e683e97fde1e881b18dbca32ed3a66b2 (commit) from ca646585aa25396915e4ac0411c2e166abe24c6d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6a5da86d1eb53526ad48724cae6ce23151f56e0e commit 6a5da86d1eb53526ad48724cae6ce23151f56e0e Merge: ca64658 0d348d0 Author: Brad King AuthorDate: Wed Jan 21 11:55:37 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 11:55:37 2015 -0500 Merge topic 'ninja-rsp_file-calculation' into next 0d348d07 Ninja: Revise command line length limit computation (#14892) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d348d07e683e97fde1e881b18dbca32ed3a66b2 commit 0d348d07e683e97fde1e881b18dbca32ed3a66b2 Author: Brad King AuthorDate: Wed Jan 21 11:53:52 2015 -0500 Commit: Brad King CommitDate: Wed Jan 21 11:53:52 2015 -0500 Ninja: Revise command line length limit computation (#14892) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index a926447..dd4bd48 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -359,29 +359,29 @@ cmNinjaNormalTargetGenerator static int calculateCommandLineLengthLimit(int linkRuleLength) { - static int limits[] = { + static int const limits[] = { #ifdef _WIN32 - 8000 - linkRuleLength, + 8000, #endif #if defined(__APPLE__) || defined(__HAIKU__) || defined(__linux) // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac - ((int)sysconf(_SC_ARG_MAX)) - linkRuleLength - 1000, + ((int)sysconf(_SC_ARG_MAX)) - 1000, #endif #if defined(__linux) // #define MAX_ARG_STRLEN (PAGE_SIZE * 32) in Linux's binfmts.h - ((int)sysconf(_SC_PAGESIZE) * 32) - linkRuleLength - 1000, + ((int)sysconf(_SC_PAGESIZE) * 32) - 1000, #endif std::numeric_limits::max() }; - size_t arrSz = cmArraySize(limits); - int sz = *std::min_element(limits, limits + arrSz); + size_t const arrSz = cmArraySize(limits); + int const sz = *std::min_element(limits, limits + arrSz); if (sz == std::numeric_limits::max()) { return -1; } - return sz; + return sz - linkRuleLength; } ----------------------------------------------------------------------- Summary of changes: Source/cmNinjaNormalTargetGenerator.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) hooks/post-receive -- CMake From ben.boeckel at kitware.com Wed Jan 21 13:20:19 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Wed, 21 Jan 2015 13:20:19 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2281-ga75bb83 Message-ID: <20150121182019.8241CAA2B3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a75bb8377e228107917135b06a1af42aec1ecd52 (commit) via 38ad671c4a5ef9e2346893b7dfa37a8a67c16c1e (commit) via caeffcc6b43df91f09fe3502454119148362a543 (commit) from 6a5da86d1eb53526ad48724cae6ce23151f56e0e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a75bb8377e228107917135b06a1af42aec1ecd52 commit a75bb8377e228107917135b06a1af42aec1ecd52 Merge: 6a5da86 38ad671 Author: Ben Boeckel AuthorDate: Wed Jan 21 13:20:17 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 13:20:17 2015 -0500 Merge topic 'ninja-generate-outputs' into next 38ad671c test: test that ninja regenerates properly caeffcc6 ninja: list outputs of CMake's generate step http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=38ad671c4a5ef9e2346893b7dfa37a8a67c16c1e commit 38ad671c4a5ef9e2346893b7dfa37a8a67c16c1e Author: Ben Boeckel AuthorDate: Wed Jan 21 13:16:33 2015 -0500 Commit: Ben Boeckel CommitDate: Wed Jan 21 13:16:33 2015 -0500 test: test that ninja regenerates properly Currently tests that the ninja files are regenerated when any of the following occurs: - an input for a configure_file is touched; - an input for a try_compile is touched; and - an output of a configure_file is removed. diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3a61751..358a918 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -175,3 +175,7 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) + +if(CMAKE_GENERATOR MATCHES "Ninja") + add_RunCMake_test(ninja) +endif() diff --git a/Tests/RunCMake/ninja/CMakeLists.txt b/Tests/RunCMake/ninja/CMakeLists.txt new file mode 100644 index 0000000..67a38be --- /dev/null +++ b/Tests/RunCMake/ninja/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 2.8.4) + +set(test_binary_dir "${test_binary_root}/init-build") + +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ninja/RunCMakeTest.cmake b/Tests/RunCMake/ninja/RunCMakeTest.cmake new file mode 100644 index 0000000..4bf4ed1 --- /dev/null +++ b/Tests/RunCMake/ninja/RunCMakeTest.cmake @@ -0,0 +1,21 @@ +include(RunCMake) + +# Test that Ninja is rerun properly. +set(test_dir "${CMAKE_CURRENT_BINARY_DIR}/ninja/test") + +set(RunCMake_BINARY_DIR "${test_dir}") +run_cmake(init) + +function (busy_loop) + execute_process( + COMMAND "${CMAKE_COMMAND}" -E sleep + 2) +endfunction () + +set(RunCMake_TEST_OPTIONS "-Dtest_binary_root=${test_dir}") +busy_loop() +run_cmake(touch_try_compile) +busy_loop() +run_cmake(remove_configured_file) +busy_loop() +run_cmake(touch_configure) diff --git a/Tests/RunCMake/ninja/check_build.cmake b/Tests/RunCMake/ninja/check_build.cmake new file mode 100644 index 0000000..0969639 --- /dev/null +++ b/Tests/RunCMake/ninja/check_build.cmake @@ -0,0 +1,24 @@ +function (busy_loop) + execute_process( + COMMAND "${CMAKE_COMMAND}" -E sleep + 2) +endfunction () + +file(TIMESTAMP "${test_binary_dir}/build.ninja" orig_time "%Y%m%d%H%M%S") + +busy_loop() +# Force NINJA_STATUS to be a certain style to not break the regex. +set(ENV{NINJA_STATUS} "[%s/%t] ") +execute_process( + COMMAND "${CMAKE_MAKE_PROGRAM}" + OUTPUT_VARIABLE out + ERROR_VARIABLE err + WORKING_DIRECTORY "${test_binary_dir}") +message("-->${out}<--") +message("-->${err}<--") + +file(TIMESTAMP "${test_binary_dir}/build.ninja" rerun_time "%Y%m%d%H%M%S") + +if (NOT rerun_time GREATER orig_time) + message(FATAL_ERROR "Ninja did not rerun? (old: ${orig_time}; new: ${rerun_time})") +endif () diff --git a/Tests/RunCMake/ninja/init-stderr.txt b/Tests/RunCMake/ninja/init-stderr.txt new file mode 100644 index 0000000..3510266 --- /dev/null +++ b/Tests/RunCMake/ninja/init-stderr.txt @@ -0,0 +1 @@ +^FALSE$ diff --git a/Tests/RunCMake/ninja/init.cmake b/Tests/RunCMake/ninja/init.cmake new file mode 100644 index 0000000..48b1f23 --- /dev/null +++ b/Tests/RunCMake/ninja/init.cmake @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.0) +project(ninja C) + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/test.txt.in" + "${CMAKE_CURRENT_BINARY_DIR}/test.txt") + +try_compile(res + "${CMAKE_CURRENT_BINARY_DIR}/bin" + SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/tc.c") +message("${res}") diff --git a/Tests/RunCMake/ninja/remove_configured_file-stderr.txt b/Tests/RunCMake/ninja/remove_configured_file-stderr.txt new file mode 100644 index 0000000..f12a099 --- /dev/null +++ b/Tests/RunCMake/ninja/remove_configured_file-stderr.txt @@ -0,0 +1,6 @@ +^-->\[1/1\] Re-running CMake\.\.\. +.* +ninja: no work to do. +<-- +-->FALSE +<--$ diff --git a/Tests/RunCMake/ninja/remove_configured_file.cmake b/Tests/RunCMake/ninja/remove_configured_file.cmake new file mode 100644 index 0000000..6cd9d61 --- /dev/null +++ b/Tests/RunCMake/ninja/remove_configured_file.cmake @@ -0,0 +1,3 @@ +file(REMOVE "${test_binary_dir}/test.txt") + +include("${CMAKE_CURRENT_LIST_DIR}/check_build.cmake") diff --git a/Tests/RunCMake/ninja/tc.c b/Tests/RunCMake/ninja/tc.c new file mode 100644 index 0000000..ee6947a --- /dev/null +++ b/Tests/RunCMake/ninja/tc.c @@ -0,0 +1,4 @@ +int main(int /*argc*/, char* /*argv*/[]) +{ + return 0; +} diff --git a/Tests/RunCMake/ninja/test.txt.in b/Tests/RunCMake/ninja/test.txt.in new file mode 100644 index 0000000..e69de29 diff --git a/Tests/RunCMake/ninja/touch_configure-stderr.txt b/Tests/RunCMake/ninja/touch_configure-stderr.txt new file mode 100644 index 0000000..f12a099 --- /dev/null +++ b/Tests/RunCMake/ninja/touch_configure-stderr.txt @@ -0,0 +1,6 @@ +^-->\[1/1\] Re-running CMake\.\.\. +.* +ninja: no work to do. +<-- +-->FALSE +<--$ diff --git a/Tests/RunCMake/ninja/touch_configure.cmake b/Tests/RunCMake/ninja/touch_configure.cmake new file mode 100644 index 0000000..4915081 --- /dev/null +++ b/Tests/RunCMake/ninja/touch_configure.cmake @@ -0,0 +1,5 @@ +execute_process( + COMMAND "${CMAKE_COMMAND}" -E touch + "${CMAKE_CURRENT_LIST_DIR}/test.txt.in") + +include("${CMAKE_CURRENT_LIST_DIR}/check_build.cmake") diff --git a/Tests/RunCMake/ninja/touch_try_compile-stderr.txt b/Tests/RunCMake/ninja/touch_try_compile-stderr.txt new file mode 100644 index 0000000..f12a099 --- /dev/null +++ b/Tests/RunCMake/ninja/touch_try_compile-stderr.txt @@ -0,0 +1,6 @@ +^-->\[1/1\] Re-running CMake\.\.\. +.* +ninja: no work to do. +<-- +-->FALSE +<--$ diff --git a/Tests/RunCMake/ninja/touch_try_compile.cmake b/Tests/RunCMake/ninja/touch_try_compile.cmake new file mode 100644 index 0000000..738cfcb --- /dev/null +++ b/Tests/RunCMake/ninja/touch_try_compile.cmake @@ -0,0 +1,5 @@ +execute_process( + COMMAND "${CMAKE_COMMAND}" -E touch + "${CMAKE_CURRENT_LIST_DIR}/tc.c") + +include("${CMAKE_CURRENT_LIST_DIR}/check_build.cmake") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=caeffcc6b43df91f09fe3502454119148362a543 commit caeffcc6b43df91f09fe3502454119148362a543 Author: Ben Boeckel AuthorDate: Wed Jan 21 12:35:22 2015 -0500 Commit: Ben Boeckel CommitDate: Wed Jan 21 12:35:22 2015 -0500 ninja: list outputs of CMake's generate step List outputs of the generate step as outputs of the RERUN_CMAKE target. Any outputs which are also inputs are not considered outputs because if they are missing, Ninja will need to rerun CMake anyways since an input file changed. The "restat = 1" flag is also required in case outputs are not updated. Fixes #15256. diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 3c07be1..3b599be 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1119,11 +1119,12 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) /*deptype=*/ "", /*rspfile=*/ "", /*rspcontent*/ "", - /*restat=*/ "", + /*restat=*/ "1", /*generator=*/ true); cmLocalNinjaGenerator *ng = static_cast(lg); + cmNinjaDeps outputs; cmNinjaDeps implicitDeps; for(std::vector::const_iterator i = this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i) @@ -1134,13 +1135,30 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) { implicitDeps.push_back(ng->ConvertToNinjaPath(*fi)); } + std::vector const& localOutputs = + (*i)->GetMakefile()->GetOutputFiles(); + for(std::vector::const_iterator o = localOutputs.begin(); + o != localOutputs.end(); ++o) + { + outputs.push_back(ng->ConvertToNinjaPath(*o)); + } } + outputs.push_back(NINJA_BUILD_FILE); implicitDeps.push_back("CMakeCache.txt"); std::sort(implicitDeps.begin(), implicitDeps.end()); implicitDeps.erase(std::unique(implicitDeps.begin(), implicitDeps.end()), implicitDeps.end()); + std::sort(outputs.begin(), outputs.end()); + outputs.erase(std::unique(outputs.begin(), outputs.end()), + outputs.end()); + + cmNinjaDeps filteredOutputs; + std::set_difference(outputs.begin(), outputs.end(), + implicitDeps.begin(), implicitDeps.end(), + std::back_inserter(filteredOutputs)); + cmNinjaVars variables; // Use 'console' pool to get non buffered output of the CMake re-run call // Available since Ninja 1.5 @@ -1152,7 +1170,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) this->WriteBuild(os, "Re-run CMake if any of its inputs changed.", "RERUN_CMAKE", - /*outputs=*/ cmNinjaDeps(1, NINJA_BUILD_FILE), + /*outputs=*/ filteredOutputs, /*explicitDeps=*/ cmNinjaDeps(), implicitDeps, /*orderOnlyDeps=*/ cmNinjaDeps(), ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalNinjaGenerator.cxx | 22 ++++++++++++++++-- Tests/RunCMake/CMakeLists.txt | 4 ++++ Tests/RunCMake/{CMP0026 => ninja}/CMakeLists.txt | 3 +++ Tests/RunCMake/ninja/RunCMakeTest.cmake | 21 +++++++++++++++++ Tests/RunCMake/ninja/check_build.cmake | 24 ++++++++++++++++++++ Tests/RunCMake/ninja/init-stderr.txt | 1 + Tests/RunCMake/ninja/init.cmake | 11 +++++++++ .../ninja/remove_configured_file-stderr.txt | 6 +++++ Tests/RunCMake/ninja/remove_configured_file.cmake | 3 +++ Tests/RunCMake/ninja/tc.c | 4 ++++ .../hello.f => Tests/RunCMake/ninja/test.txt.in | 0 Tests/RunCMake/ninja/touch_configure-stderr.txt | 6 +++++ Tests/RunCMake/ninja/touch_configure.cmake | 5 ++++ Tests/RunCMake/ninja/touch_try_compile-stderr.txt | 6 +++++ Tests/RunCMake/ninja/touch_try_compile.cmake | 5 ++++ 15 files changed, 119 insertions(+), 2 deletions(-) copy Tests/RunCMake/{CMP0026 => ninja}/CMakeLists.txt (64%) create mode 100644 Tests/RunCMake/ninja/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/ninja/check_build.cmake create mode 100644 Tests/RunCMake/ninja/init-stderr.txt create mode 100644 Tests/RunCMake/ninja/init.cmake create mode 100644 Tests/RunCMake/ninja/remove_configured_file-stderr.txt create mode 100644 Tests/RunCMake/ninja/remove_configured_file.cmake create mode 100644 Tests/RunCMake/ninja/tc.c copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/ninja/test.txt.in (100%) create mode 100644 Tests/RunCMake/ninja/touch_configure-stderr.txt create mode 100644 Tests/RunCMake/ninja/touch_configure.cmake create mode 100644 Tests/RunCMake/ninja/touch_try_compile-stderr.txt create mode 100644 Tests/RunCMake/ninja/touch_try_compile.cmake hooks/post-receive -- CMake From bill.hoffman at kitware.com Wed Jan 21 14:22:27 2015 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Wed, 21 Jan 2015 14:22:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2283-g7589b5f Message-ID: <20150121192227.E2514AA378@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7589b5fe25daa4fc154ae0ea6999e6e89f7d1bdb (commit) via d795a3d51274e6398da4ac59ee86943a5138f6d2 (commit) from a75bb8377e228107917135b06a1af42aec1ecd52 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7589b5fe25daa4fc154ae0ea6999e6e89f7d1bdb commit 7589b5fe25daa4fc154ae0ea6999e6e89f7d1bdb Merge: a75bb83 d795a3d Author: Bill Hoffman AuthorDate: Wed Jan 21 14:22:27 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 14:22:27 2015 -0500 Merge topic 'cdash_upload_file_mode' into next d795a3d5 Only glob in the coverage dir for the gcov files instead of the whole tree. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d795a3d51274e6398da4ac59ee86943a5138f6d2 commit d795a3d51274e6398da4ac59ee86943a5138f6d2 Author: Bill Hoffman AuthorDate: Wed Jan 21 14:15:23 2015 -0500 Commit: Bill Hoffman CommitDate: Wed Jan 21 14:15:23 2015 -0500 Only glob in the coverage dir for the gcov files instead of the whole tree. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 3a9b421..f6616e0 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -126,7 +126,7 @@ function(ctest_coverage_collect_gcov) }") # collect the gcov files set(gcov_files) - file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "${binary_dir}/*.gcov") + file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "${coverage_dir}/*.gcov") # tar up the coverage info with the same date so that the md5 # sum will be the same for the tar file independent of file time # stamps ----------------------------------------------------------------------- Summary of changes: Modules/CTestCoverageCollectGCOV.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 21 15:53:44 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 21 Jan 2015 15:53:44 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2287-gfcf07b5 Message-ID: <20150121205344.51E98A9BB9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fcf07b5ac180c78f5d88d3aebad2120844a2e841 (commit) via 965a50dceaa0abe2ec5870efcbc8ac0becd9615d (commit) via 7f4154a4aa4bb121bad05884f48466489e346821 (commit) via f40c19b5433aa601cd98fabd9491edc9aaf703b7 (commit) from 7589b5fe25daa4fc154ae0ea6999e6e89f7d1bdb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fcf07b5ac180c78f5d88d3aebad2120844a2e841 commit fcf07b5ac180c78f5d88d3aebad2120844a2e841 Merge: 7589b5f 965a50d Author: Brad King AuthorDate: Wed Jan 21 15:53:42 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 15:53:42 2015 -0500 Merge topic 'GNU-4.4-compile-features' into next 965a50dc Features: Fix GNU 4.4 and 4.5 C standard level flags 7f4154a4 Features: Fix CompileFeatures non-feature tests for space in path f40c19b5 Features: Fix CompileFeatures test for C non-features http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=965a50dceaa0abe2ec5870efcbc8ac0becd9615d commit 965a50dceaa0abe2ec5870efcbc8ac0becd9615d Author: Brad King AuthorDate: Wed Jan 21 15:45:39 2015 -0500 Commit: Brad King CommitDate: Wed Jan 21 15:47:13 2015 -0500 Features: Fix GNU 4.4 and 4.5 C standard level flags The C90 flags were only the "89" versions until GNU 4.5. The C11 flags were not introduced until GNU 4.6. diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 3036057..fa97a94 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -1,10 +1,15 @@ include(Compiler/GNU) __compiler_gnu(C) -if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") +elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) + set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89") + set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89") +endif() +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99") set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99") endif() @@ -12,7 +17,7 @@ endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") -elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) +elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x") endif() @@ -29,8 +34,10 @@ macro(cmake_record_c_compile_features) endmacro() set(_result 0) - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) + endif() + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f4154a4aa4bb121bad05884f48466489e346821 commit 7f4154a4aa4bb121bad05884f48466489e346821 Author: Brad King AuthorDate: Wed Jan 21 15:42:08 2015 -0500 Commit: Brad King CommitDate: Wed Jan 21 15:42:08 2015 -0500 Features: Fix CompileFeatures non-feature tests for space in path Fix the _non_features try_compile calls to work correctly when there is a space in the path. Otherwise they all fail due to the space instead of the lack of a feature. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index ccd6f30..a276f36 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -92,8 +92,9 @@ foreach(lang CXX C) try_compile(${feature}_works "${CMAKE_CURRENT_BINARY_DIR}/${feature}_test" "${CMAKE_CURRENT_SOURCE_DIR}/feature_test.${${lang}_ext}" - COMPILE_DEFINITIONS "-DTEST=${CMAKE_CURRENT_SOURCE_DIR}/${feature}.${${lang}_ext}" + COMPILE_DEFINITIONS "-DTEST=${feature}.${${lang}_ext}" CMAKE_FLAGS "-DCMAKE_${lang}_STANDARD=${${lang}_standard_flag}" + "-DINCLUDE_DIRECTORIES=${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE OUTPUT ) if (${feature}_works) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f40c19b5433aa601cd98fabd9491edc9aaf703b7 commit f40c19b5433aa601cd98fabd9491edc9aaf703b7 Author: Brad King AuthorDate: Wed Jan 21 15:40:47 2015 -0500 Commit: Brad King CommitDate: Wed Jan 21 15:40:47 2015 -0500 Features: Fix CompileFeatures test for C non-features Add a "feature_test.c" file corresponding to "feature_test.cpp" but for the C language. This source will be needed by C_non_features entries. diff --git a/Tests/CompileFeatures/feature_test.c b/Tests/CompileFeatures/feature_test.c new file mode 100644 index 0000000..4147f1f --- /dev/null +++ b/Tests/CompileFeatures/feature_test.c @@ -0,0 +1,10 @@ + +#define STRINGIFY_IMPL(X) #X +#define STRINGIFY(X) STRINGIFY_IMPL(X) + +#include STRINGIFY(TEST) + +int main(void) +{ + return 0; +} ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/GNU-C.cmake | 13 ++++++++++--- Tests/CompileFeatures/CMakeLists.txt | 3 ++- .../CompileFeatures/{feature_test.cpp => feature_test.c} | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) copy Tests/CompileFeatures/{feature_test.cpp => feature_test.c} (88%) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 21 15:55:27 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 21 Jan 2015 15:55:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2289-g7f7c996 Message-ID: <20150121205527.1D9D6A9EAD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7f7c996a707e206c8cd87bb97689b77ad249e114 (commit) via e56c93279523701d8f044372fcc451ce50369b93 (commit) from fcf07b5ac180c78f5d88d3aebad2120844a2e841 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f7c996a707e206c8cd87bb97689b77ad249e114 commit 7f7c996a707e206c8cd87bb97689b77ad249e114 Merge: fcf07b5 e56c932 Author: Brad King AuthorDate: Wed Jan 21 15:55:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 15:55:26 2015 -0500 Merge topic 'FindCUDA-cusolver' into next e56c9327 FindCUDA: Add cuSOLVER library from CUDA 7.0 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e56c93279523701d8f044372fcc451ce50369b93 commit e56c93279523701d8f044372fcc451ce50369b93 Author: Andrew Seidl AuthorDate: Tue Jan 20 18:06:11 2015 -0600 Commit: Brad King CommitDate: Wed Jan 21 15:54:12 2015 -0500 FindCUDA: Add cuSOLVER library from CUDA 7.0 diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 4f1f09a..cae9214 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -276,6 +276,8 @@ # Only available for CUDA version 4.0+. # CUDA_curand_LIBRARY -- CUDA Random Number Generation library. # Only available for CUDA version 3.2+. +# CUDA_cusolver_LIBRARY -- CUDA Direct Solver library. +# Only available for CUDA version 7.0+. # CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library. # Only available for CUDA version 3.2+. # CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib. @@ -518,6 +520,7 @@ macro(cuda_unset_include_and_libraries) unset(CUDA_cufft_LIBRARY CACHE) unset(CUDA_cufftemu_LIBRARY CACHE) unset(CUDA_curand_LIBRARY CACHE) + unset(CUDA_cusolver_LIBRARY CACHE) unset(CUDA_cusparse_LIBRARY CACHE) unset(CUDA_npp_LIBRARY CACHE) unset(CUDA_nppc_LIBRARY CACHE) @@ -754,6 +757,10 @@ if(CUDA_VERSION VERSION_GREATER "5.0") elseif(NOT CUDA_VERSION VERSION_LESS "4.0") find_cuda_helper_libs(npp) endif() +if(NOT CUDA_VERSION VERSION_LESS "7.0") + # cusolver showed up in version 7.0 + find_cuda_helper_libs(cusolver) +endif() if (CUDA_BUILD_EMULATION) set(CUDA_CUFFT_LIBRARIES ${CUDA_cufftemu_LIBRARY}) ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 7 +++++++ 1 file changed, 7 insertions(+) hooks/post-receive -- CMake From ben.boeckel at kitware.com Wed Jan 21 15:57:32 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Wed, 21 Jan 2015 15:57:32 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2291-gc709ebb Message-ID: <20150121205732.A98DDA9FAF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c709ebb08e675fc4603187cd8a125a6b8f704436 (commit) via bebdb4540b94aae3f213af586dbd7d1445ef25e5 (commit) from 7f7c996a707e206c8cd87bb97689b77ad249e114 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c709ebb08e675fc4603187cd8a125a6b8f704436 commit c709ebb08e675fc4603187cd8a125a6b8f704436 Merge: 7f7c996 bebdb45 Author: Ben Boeckel AuthorDate: Wed Jan 21 15:57:31 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 15:57:31 2015 -0500 Merge topic 'add-missing-variable-docs' into next bebdb454 Help: add missing MINGW variable documentation http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bebdb4540b94aae3f213af586dbd7d1445ef25e5 commit bebdb4540b94aae3f213af586dbd7d1445ef25e5 Author: Ben Boeckel AuthorDate: Wed Jan 21 15:48:00 2015 -0500 Commit: Ben Boeckel CommitDate: Wed Jan 21 15:48:00 2015 -0500 Help: add missing MINGW variable documentation diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index af2c348..c342dbe 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -181,6 +181,7 @@ Variables that Describe the System /variable/CMAKE_SYSTEM_VERSION /variable/CYGWIN /variable/ENV + /variable/MINGW /variable/MSVC10 /variable/MSVC11 /variable/MSVC12 diff --git a/Help/variable/MINGW.rst b/Help/variable/MINGW.rst new file mode 100644 index 0000000..521d417 --- /dev/null +++ b/Help/variable/MINGW.rst @@ -0,0 +1,6 @@ +MINGW +----- + +True when using MinGW + +Set to true when the compiler is some version of MinGW. ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-variables.7.rst | 1 + Help/variable/MINGW.rst | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 Help/variable/MINGW.rst hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 21 16:36:05 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 21 Jan 2015 16:36:05 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2293-gc2650e5 Message-ID: <20150121213605.5C3D2AA8FF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c2650e5588c8ce19ffbc3f861ce19f033c2eede3 (commit) via ef97cd8587e7f8d4017b18147aaaca0ec5cb9f0c (commit) from c709ebb08e675fc4603187cd8a125a6b8f704436 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c2650e5588c8ce19ffbc3f861ce19f033c2eede3 commit c2650e5588c8ce19ffbc3f861ce19f033c2eede3 Merge: c709ebb ef97cd8 Author: Brad King AuthorDate: Wed Jan 21 16:36:04 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 16:36:04 2015 -0500 Merge topic 'test-ctest_submit-fail-with-RunCMake' into next ef97cd85 Tests: Fix obscure RunCMake.CTestSubmit 'drop' case failures http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ef97cd8587e7f8d4017b18147aaaca0ec5cb9f0c commit ef97cd8587e7f8d4017b18147aaaca0ec5cb9f0c Author: Brad King AuthorDate: Tue Jan 20 10:11:39 2015 -0500 Commit: Brad King CommitDate: Wed Jan 21 16:34:42 2015 -0500 Tests: Fix obscure RunCMake.CTestSubmit 'drop' case failures When curl is given a URL of the form '://' it tries to resolve '' as a host name. If the host happens to exist and have a server then the drop might actually appear to work. Instead use an explicit '-no-site-' host to ensure it cannot connect. Reported-by: Gilles Khouzam diff --git a/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in b/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in index f0e1653..378a85a 100644 --- a/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in +++ b/Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in @@ -3,3 +3,4 @@ set(CTEST_PROJECT_NAME "CTestSubmit at 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/RunCMakeTest.cmake b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake index 7cab3f3..3638007 100644 --- a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake @@ -2,6 +2,7 @@ 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) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 21 16:36:21 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 21 Jan 2015 16:36:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-934-gafd9983 Message-ID: <20150121213621.B86EAAA8FA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via afd998373da0d0c39266b5c7a078ee48aa939554 (commit) via ef97cd8587e7f8d4017b18147aaaca0ec5cb9f0c (commit) via 76f7eb2e4a359a7c978efa19fdf71fe1ea46b971 (commit) from f709776864bbd94c7aa839248adfbfe7d4f5cae6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=afd998373da0d0c39266b5c7a078ee48aa939554 commit afd998373da0d0c39266b5c7a078ee48aa939554 Merge: f709776 ef97cd8 Author: Brad King AuthorDate: Wed Jan 21 16:36:20 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 16:36:20 2015 -0500 Merge topic 'test-ctest_submit-fail-with-RunCMake' ef97cd85 Tests: Fix obscure RunCMake.CTestSubmit 'drop' case failures 76f7eb2e Tests: Extend RunCMake.CTestSubmit test to cover 'drop' failures ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CTestSubmit/CTestConfig.cmake.in | 1 + .../FailDrop-cp-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt | 4 ++++ Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt | 1 + .../FailDrop-ftp-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt | 3 +++ Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt | 3 +++ .../FailDrop-http-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt | 3 +++ Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt | 3 +++ .../FailDrop-https-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt | 3 +++ Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt | 3 +++ .../FailDrop-scp-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt | 2 ++ Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt | 1 + .../FailDrop-xmlrpc-result.txt} | 0 Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt | 2 ++ Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt | 1 + Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake | 8 +++++++- 20 files changed, 37 insertions(+), 1 deletion(-) copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-cp-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-cp-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-cp-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-ftp-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-ftp-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-ftp-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-http-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-http-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-http-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-https-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-https-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-https-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-scp-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-scp-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-scp-stdout.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/FailDrop-xmlrpc-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stderr.txt create mode 100644 Tests/RunCMake/CTestSubmit/FailDrop-xmlrpc-stdout.txt hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 21 16:36:23 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 21 Jan 2015 16:36:23 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-936-g40c11f0 Message-ID: <20150121213623.BCAE4AA905@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 40c11f0f62af1365cee44111429946862b5cf93f (commit) via 27c6da933ec1dd4028bb80e4adf2fa7309ef4a04 (commit) from afd998373da0d0c39266b5c7a078ee48aa939554 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=40c11f0f62af1365cee44111429946862b5cf93f commit 40c11f0f62af1365cee44111429946862b5cf93f Merge: afd9983 27c6da9 Author: Brad King AuthorDate: Wed Jan 21 16:36:22 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 16:36:22 2015 -0500 Merge topic 'jsoncpp-third-party' 27c6da93 Add option to build CMake against a system jsoncpp ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 23 ++++++++++++++++++++--- Source/CMakeLists.txt | 2 +- Utilities/cmThirdParty.h.in | 1 + Utilities/cm_jsoncpp_reader.h | 7 ++++++- Utilities/cm_jsoncpp_value.h | 7 ++++++- Utilities/cm_jsoncpp_writer.h | 7 ++++++- 6 files changed, 40 insertions(+), 7 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 21 16:36:59 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 21 Jan 2015 16:36:59 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2296-g42eb85d Message-ID: <20150121213659.14BD4AA90D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 42eb85d6c7bfac664fee8df62bf0ccb84b8e4e5c (commit) via 40c11f0f62af1365cee44111429946862b5cf93f (commit) via afd998373da0d0c39266b5c7a078ee48aa939554 (commit) from c2650e5588c8ce19ffbc3f861ce19f033c2eede3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42eb85d6c7bfac664fee8df62bf0ccb84b8e4e5c commit 42eb85d6c7bfac664fee8df62bf0ccb84b8e4e5c Merge: c2650e5 40c11f0 Author: Brad King AuthorDate: Wed Jan 21 16:36:51 2015 -0500 Commit: Brad King CommitDate: Wed Jan 21 16:36:51 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From ben.boeckel at kitware.com Wed Jan 21 16:50:27 2015 From: ben.boeckel at kitware.com (Ben Boeckel) Date: Wed, 21 Jan 2015 16:50:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2300-g45049ec Message-ID: <20150121215028.EC5A4A9377@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 45049eca97e8931721f4a371e136a012c0473e8d (commit) via f4b78cf2ac9785ae02e910ac5566718fd8592f10 (commit) via fe685b92ecffdcb889806b0fc882d3fe75244b59 (commit) via ae723db5b4b4a4152547eae6166cbcc073767512 (commit) from 42eb85d6c7bfac664fee8df62bf0ccb84b8e4e5c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=45049eca97e8931721f4a371e136a012c0473e8d commit 45049eca97e8931721f4a371e136a012c0473e8d Merge: 42eb85d f4b78cf Author: Ben Boeckel AuthorDate: Wed Jan 21 16:50:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 16:50:26 2015 -0500 Merge topic 'ninja-generate-outputs' into next f4b78cf2 fixup! test: test that ninja regenerates properly fe685b92 fixup! test: test that ninja regenerates properly ae723db5 fixup! test: test that ninja regenerates properly http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4b78cf2ac9785ae02e910ac5566718fd8592f10 commit f4b78cf2ac9785ae02e910ac5566718fd8592f10 Author: Ben Boeckel AuthorDate: Wed Jan 21 16:47:58 2015 -0500 Commit: Ben Boeckel CommitDate: Wed Jan 21 16:48:31 2015 -0500 fixup! test: test that ninja regenerates properly diff --git a/Tests/RunCMake/ninja/check_build.cmake b/Tests/RunCMake/ninja/check_build.cmake index 7071228..093f18e 100644 --- a/Tests/RunCMake/ninja/check_build.cmake +++ b/Tests/RunCMake/ninja/check_build.cmake @@ -23,3 +23,19 @@ file(TIMESTAMP "${test_binary_dir}/build.ninja" rerun_time "%Y%m%d%H%M%S") if (NOT rerun_time GREATER orig_time) message(FATAL_ERROR "Ninja did not rerun? (old: ${orig_time}; new: ${rerun_time})") endif () + +busy_loop() +execute_process( + COMMAND "${CMAKE_COMMAND}" + --build . + OUTPUT_VARIABLE out + ERROR_VARIABLE err + WORKING_DIRECTORY "${test_binary_dir}") +message("-->${out}<--") +message("-->${err}<--") + +file(TIMESTAMP "${test_binary_dir}/build.ninja" noop_time "%Y%m%d%H%M%S") + +if (NOT rerun_time EQUAL noop_time) + message(FATAL_ERROR "Ninja found something to do? (old: ${rerun_time}; new: ${noop_time})") +endif () diff --git a/Tests/RunCMake/ninja/remove_configured_file-stderr.txt b/Tests/RunCMake/ninja/remove_configured_file-stderr.txt index f12a099..0ba5a9b 100644 --- a/Tests/RunCMake/ninja/remove_configured_file-stderr.txt +++ b/Tests/RunCMake/ninja/remove_configured_file-stderr.txt @@ -3,4 +3,7 @@ ninja: no work to do. <-- -->FALSE -<--$ +<-- +-->ninja: no work to do. +<-- +--><--$ diff --git a/Tests/RunCMake/ninja/touch_configure-stderr.txt b/Tests/RunCMake/ninja/touch_configure-stderr.txt index f12a099..0ba5a9b 100644 --- a/Tests/RunCMake/ninja/touch_configure-stderr.txt +++ b/Tests/RunCMake/ninja/touch_configure-stderr.txt @@ -3,4 +3,7 @@ ninja: no work to do. <-- -->FALSE -<--$ +<-- +-->ninja: no work to do. +<-- +--><--$ diff --git a/Tests/RunCMake/ninja/touch_try_compile-stderr.txt b/Tests/RunCMake/ninja/touch_try_compile-stderr.txt index f12a099..0ba5a9b 100644 --- a/Tests/RunCMake/ninja/touch_try_compile-stderr.txt +++ b/Tests/RunCMake/ninja/touch_try_compile-stderr.txt @@ -3,4 +3,7 @@ ninja: no work to do. <-- -->FALSE -<--$ +<-- +-->ninja: no work to do. +<-- +--><--$ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe685b92ecffdcb889806b0fc882d3fe75244b59 commit fe685b92ecffdcb889806b0fc882d3fe75244b59 Author: Ben Boeckel AuthorDate: Wed Jan 21 16:47:58 2015 -0500 Commit: Ben Boeckel CommitDate: Wed Jan 21 16:47:58 2015 -0500 fixup! test: test that ninja regenerates properly diff --git a/Tests/RunCMake/ninja/check_build.cmake b/Tests/RunCMake/ninja/check_build.cmake index 0969639..7071228 100644 --- a/Tests/RunCMake/ninja/check_build.cmake +++ b/Tests/RunCMake/ninja/check_build.cmake @@ -10,7 +10,8 @@ busy_loop() # Force NINJA_STATUS to be a certain style to not break the regex. set(ENV{NINJA_STATUS} "[%s/%t] ") execute_process( - COMMAND "${CMAKE_MAKE_PROGRAM}" + COMMAND "${CMAKE_COMMAND}" + --build . OUTPUT_VARIABLE out ERROR_VARIABLE err WORKING_DIRECTORY "${test_binary_dir}") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ae723db5b4b4a4152547eae6166cbcc073767512 commit ae723db5b4b4a4152547eae6166cbcc073767512 Author: Ben Boeckel AuthorDate: Wed Jan 21 16:46:43 2015 -0500 Commit: Ben Boeckel CommitDate: Wed Jan 21 16:47:27 2015 -0500 fixup! test: test that ninja regenerates properly diff --git a/Tests/RunCMake/ninja/init.cmake b/Tests/RunCMake/ninja/init.cmake index 48b1f23..33f4be1 100644 --- a/Tests/RunCMake/ninja/init.cmake +++ b/Tests/RunCMake/ninja/init.cmake @@ -1,11 +1,23 @@ cmake_minimum_required(VERSION 3.0) project(ninja C) +set(in_conf "${CMAKE_CURRENT_BINARY_DIR}/test.txt.in") + +if (NOT EXISTS "${in_conf}") + file(WRITE "${in_conf}" "") +endif () + configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/test.txt.in" + "${in_conf}" "${CMAKE_CURRENT_BINARY_DIR}/test.txt") +set(in_try_compile "${CMAKE_CURRENT_BINARY_DIR}/tc.c") + +if (NOT EXISTS "${in_try_compile}") + file(WRITE "${in_try_compile}" "int main(int, char**) { return 0; }") +endif () + try_compile(res "${CMAKE_CURRENT_BINARY_DIR}/bin" - SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/tc.c") + SOURCES "${in_try_compile}") message("${res}") diff --git a/Tests/RunCMake/ninja/tc.c b/Tests/RunCMake/ninja/tc.c deleted file mode 100644 index ee6947a..0000000 --- a/Tests/RunCMake/ninja/tc.c +++ /dev/null @@ -1,4 +0,0 @@ -int main(int /*argc*/, char* /*argv*/[]) -{ - return 0; -} diff --git a/Tests/RunCMake/ninja/test.txt.in b/Tests/RunCMake/ninja/test.txt.in deleted file mode 100644 index e69de29..0000000 diff --git a/Tests/RunCMake/ninja/touch_configure.cmake b/Tests/RunCMake/ninja/touch_configure.cmake index 4915081..a9f4a44 100644 --- a/Tests/RunCMake/ninja/touch_configure.cmake +++ b/Tests/RunCMake/ninja/touch_configure.cmake @@ -1,5 +1,5 @@ execute_process( COMMAND "${CMAKE_COMMAND}" -E touch - "${CMAKE_CURRENT_LIST_DIR}/test.txt.in") + "${test_binary_dir}/test.txt.in") include("${CMAKE_CURRENT_LIST_DIR}/check_build.cmake") diff --git a/Tests/RunCMake/ninja/touch_try_compile.cmake b/Tests/RunCMake/ninja/touch_try_compile.cmake index 738cfcb..43936d0 100644 --- a/Tests/RunCMake/ninja/touch_try_compile.cmake +++ b/Tests/RunCMake/ninja/touch_try_compile.cmake @@ -1,5 +1,5 @@ execute_process( COMMAND "${CMAKE_COMMAND}" -E touch - "${CMAKE_CURRENT_LIST_DIR}/tc.c") + "${test_binary_dir}/tc.c") include("${CMAKE_CURRENT_LIST_DIR}/check_build.cmake") ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/ninja/check_build.cmake | 19 ++++++++++++++++++- Tests/RunCMake/ninja/init.cmake | 16 ++++++++++++++-- .../ninja/remove_configured_file-stderr.txt | 5 ++++- Tests/RunCMake/ninja/tc.c | 4 ---- Tests/RunCMake/ninja/touch_configure-stderr.txt | 5 ++++- Tests/RunCMake/ninja/touch_configure.cmake | 2 +- Tests/RunCMake/ninja/touch_try_compile-stderr.txt | 5 ++++- Tests/RunCMake/ninja/touch_try_compile.cmake | 2 +- 8 files changed, 46 insertions(+), 12 deletions(-) delete mode 100644 Tests/RunCMake/ninja/tc.c delete mode 100644 Tests/RunCMake/ninja/test.txt.in hooks/post-receive -- CMake From matt.mccormick at kitware.com Wed Jan 21 22:45:22 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 21 Jan 2015 22:45:22 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2302-gb6aa739 Message-ID: <20150122034522.AFDF4A8075@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b6aa7393f5501c658afc1c83001fcecec7a86e7a (commit) via 52685ecbafd9f5a59eb88830dbb6121602ea7dc7 (commit) from 45049eca97e8931721f4a371e136a012c0473e8d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b6aa7393f5501c658afc1c83001fcecec7a86e7a commit b6aa7393f5501c658afc1c83001fcecec7a86e7a Merge: 45049ec 52685ec Author: Matt McCormick AuthorDate: Wed Jan 21 22:45:21 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 22:45:21 2015 -0500 Merge topic 'if-test' into next 52685ecb CMake: if command understands if(TEST TestName) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52685ecbafd9f5a59eb88830dbb6121602ea7dc7 commit 52685ecbafd9f5a59eb88830dbb6121602ea7dc7 Author: Matt McCormick AuthorDate: Mon Dec 29 20:47:48 2014 -0500 Commit: Matt McCormick CommitDate: Mon Dec 29 21:08:46 2014 -0500 CMake: if command understands if(TEST TestName) if(TEST TestNameThatExists) will return true if a test with the name TestNameThatExists has been added with add_test. The syntax is similar to if(TARGET TargetName). diff --git a/Help/command/if.rst b/Help/command/if.rst index 79e5d21..2caf8d3 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -70,6 +70,10 @@ Possible expressions are: created by the :command:`add_executable`, :command:`add_library`, or :command:`add_custom_target` commands. +``if(TEST test)`` + True if the given name is an existing test name created by the + :command:`add_test` command. + ``if(EXISTS path-to-file-or-directory)`` True if the named file or directory exists. Behavior is well-defined only for full paths. diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index aba26de..29a71c7 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -507,6 +507,14 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList &newArgs, this->Makefile.FindTargetToUse(argP1->GetValue())?true:false, reducible, arg, newArgs, argP1, argP2); } + // does a test exist + if (this->IsKeyword("TEST", *arg) && argP1 != newArgs.end()) + { + const cmTest* haveTest = this->Makefile.GetTest(argP1->c_str()); + this->HandlePredicate( + haveTest?true:false, + reducible, arg, newArgs, argP1, argP2); + } // is a variable defined if (this->IsKeyword("DEFINED", *arg) && argP1 != newArgs.end()) { diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index bf23d4a..102da6b 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -21,7 +21,20 @@ if(TARGET NotATarget) message(FATAL_ERROR "if(TARGET NotATarget) returned true!") endif() - # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to +# Test if(TEST... +add_test(NAME TestThatExists COMMAND ${CMAKE_COMMAND} -E echo "A CMake Test") +if(TEST TestThatExists) + message(STATUS "if(TestThatExists) is true") +else() + message(FATAL_ERROR "if(TestThatExists is false") +endif() +if(TEST TestThatDoesNotExist) + message(FATAL_ERROR "if(TestThatDoesNotExist is true") +else() + message(STATUS "if(TestThatDoesNotExist) is false") +endif() + +# Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) link_libraries(${COMPLEX_LIBS}) ----------------------------------------------------------------------- Summary of changes: Help/command/if.rst | 4 ++++ Source/cmConditionEvaluator.cxx | 8 ++++++++ Tests/Complex/Executable/CMakeLists.txt | 15 ++++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From matt.mccormick at kitware.com Wed Jan 21 22:50:30 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 21 Jan 2015 22:50:30 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2304-g1c17514 Message-ID: <20150122035030.C7C5BA9DFA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1c175147e32341d5a9bf4c54fc8ea7cd9831c31c (commit) via c33cbbd852f384883a56a027c6e7b96642559db0 (commit) from b6aa7393f5501c658afc1c83001fcecec7a86e7a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c175147e32341d5a9bf4c54fc8ea7cd9831c31c commit 1c175147e32341d5a9bf4c54fc8ea7cd9831c31c Merge: b6aa739 c33cbbd Author: Matt McCormick AuthorDate: Wed Jan 21 22:50:29 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 22:50:29 2015 -0500 Merge topic 'try-run-link-libraries' into next c33cbbd8 try_run: Add support for LINK_LIBRARIES option. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c33cbbd852f384883a56a027c6e7b96642559db0 commit c33cbbd852f384883a56a027c6e7b96642559db0 Author: Matt McCormick AuthorDate: Thu Jan 1 22:30:08 2015 -0500 Commit: Matt McCormick CommitDate: Mon Jan 5 12:41:56 2015 -0500 try_run: Add support for LINK_LIBRARIES option. Most functionality is already implemented in Source/cmCoreTryCompile.{h,cxx}. Document and improve argument parsing. This functionality is already being used by a number of modules, like CheckCSourceCompiles.cmake, but it is not documented. diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst index 9a17ad9..66245f6 100644 --- a/Help/command/try_run.rst +++ b/Help/command/try_run.rst @@ -6,8 +6,9 @@ Try compiling and then running some code. :: try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR - bindir srcfile [CMAKE_FLAGS ] + bindir srcfile [CMAKE_FLAGS ] [COMPILE_DEFINITIONS ] + [LINK_LIBRARIES ] [COMPILE_OUTPUT_VARIABLE comp] [RUN_OUTPUT_VARIABLE run] [OUTPUT_VARIABLE var] diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 8f2deeb..8bd33d0 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -48,7 +48,8 @@ bool cmTryRunCommand { ++i; while (i < argv.size() && argv[i] != "COMPILE_DEFINITIONS" && - argv[i] != "CMAKE_FLAGS") + argv[i] != "CMAKE_FLAGS" && + argv[i] != "LINK_LIBRARIES") { runArgs += " "; runArgs += argv[i]; ----------------------------------------------------------------------- Summary of changes: Help/command/try_run.rst | 3 ++- Source/cmTryRunCommand.cxx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From matt.mccormick at kitware.com Wed Jan 21 23:00:17 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 21 Jan 2015 23:00:17 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2306-g65ebdf1 Message-ID: <20150122040017.DC85BAA56C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 65ebdf17ae3f463dd10862a4f1bec017f2c15cb5 (commit) via ab1f20025d42a781e4d9d0a446089892f121bde2 (commit) from 1c175147e32341d5a9bf4c54fc8ea7cd9831c31c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=65ebdf17ae3f463dd10862a4f1bec017f2c15cb5 commit 65ebdf17ae3f463dd10862a4f1bec017f2c15cb5 Merge: 1c17514 ab1f200 Author: Matt McCormick AuthorDate: Wed Jan 21 23:00:15 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 21 23:00:15 2015 -0500 Merge topic 'if-test' into next ab1f2002 Help: if(TEST) consistent argument name. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab1f20025d42a781e4d9d0a446089892f121bde2 commit ab1f20025d42a781e4d9d0a446089892f121bde2 Author: Matt McCormick AuthorDate: Wed Jan 21 22:58:38 2015 -0500 Commit: Matt McCormick CommitDate: Wed Jan 21 22:58:38 2015 -0500 Help: if(TEST) consistent argument name. Consistent with other if expression argument names. diff --git a/Help/command/if.rst b/Help/command/if.rst index 2caf8d3..93ff6d3 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -70,7 +70,7 @@ Possible expressions are: created by the :command:`add_executable`, :command:`add_library`, or :command:`add_custom_target` commands. -``if(TEST test)`` +``if(TEST test-name)`` True if the given name is an existing test name created by the :command:`add_test` command. ----------------------------------------------------------------------- Summary of changes: Help/command/if.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jan 22 00:01:11 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 22 Jan 2015 00:01:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-937-gafe9921 Message-ID: <20150122050111.4CBE7AA256@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via afe99212d2a872da63bf027766c1ab00ec841680 (commit) from 40c11f0f62af1365cee44111429946862b5cf93f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=afe99212d2a872da63bf027766c1ab00ec841680 commit afe99212d2a872da63bf027766c1ab00ec841680 Author: Kitware Robot AuthorDate: Thu Jan 22 00:01:09 2015 -0500 Commit: Kitware Robot CommitDate: Thu Jan 22 00:01:09 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 4536390..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 20150121) +set(CMake_VERSION_PATCH 20150122) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 09:41:21 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 09:41:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2308-gaf96f69 Message-ID: <20150122144121.E85C24930@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via af96f69116e4f00b46028ef709fef898a53972e1 (commit) via 374a66b58ced947d9713dfd6f439a52b6646e923 (commit) from 65ebdf17ae3f463dd10862a4f1bec017f2c15cb5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af96f69116e4f00b46028ef709fef898a53972e1 commit af96f69116e4f00b46028ef709fef898a53972e1 Merge: 65ebdf1 374a66b Author: Brad King AuthorDate: Thu Jan 22 09:41:21 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 09:41:21 2015 -0500 Merge topic 'GNU-4.4-compile-features' into next 374a66b5 Features: Blacklist raw string literals test for GNU 4.4 diff --cc Tests/CompileFeatures/CMakeLists.txt index 65e3d98,0642487..ecb463c --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -51,18 -51,15 +51,26 @@@ if (CMAKE_CXX_COMPILER_ID STREQUAL "App ) 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.5) + # The cxx_raw_string_literals feature happens to work in some distributions + # of GNU 4.4, but it is first documented as available with GNU 4.5. + list(REMOVE_ITEM CXX_non_features + cxx_raw_string_literals + ) + 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 # GNU 4.5, but it is first documented as available with GNU 4.6. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=374a66b58ced947d9713dfd6f439a52b6646e923 commit 374a66b58ced947d9713dfd6f439a52b6646e923 Author: Brad King AuthorDate: Thu Jan 22 09:39:35 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 09:39:35 2015 -0500 Features: Blacklist raw string literals test for GNU 4.4 RedHat gcc 4.4.7-11 supports raw string literals, so simply blacklist the test for its rejection. diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index a276f36..0642487 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -52,6 +52,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5) + # The cxx_raw_string_literals feature happens to work in some distributions + # of GNU 4.4, but it is first documented as available with GNU 4.5. + list(REMOVE_ITEM CXX_non_features + cxx_raw_string_literals + ) +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 # GNU 4.5, but it is first documented as available with GNU 4.6. ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 09:50:37 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 09:50:37 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-941-gbe2a74d Message-ID: <20150122145037.7531AA94B4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via be2a74dbcbbc3a6d6af8ccb0a70688e4db0f6901 (commit) via 965a50dceaa0abe2ec5870efcbc8ac0becd9615d (commit) via 7f4154a4aa4bb121bad05884f48466489e346821 (commit) via f40c19b5433aa601cd98fabd9491edc9aaf703b7 (commit) from afe99212d2a872da63bf027766c1ab00ec841680 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=be2a74dbcbbc3a6d6af8ccb0a70688e4db0f6901 commit be2a74dbcbbc3a6d6af8ccb0a70688e4db0f6901 Merge: afe9921 965a50d Author: Brad King AuthorDate: Thu Jan 22 09:50:36 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 09:50:36 2015 -0500 Merge topic 'GNU-4.4-compile-features' 965a50dc Features: Fix GNU 4.4 and 4.5 C standard level flags 7f4154a4 Features: Fix CompileFeatures non-feature tests for space in path f40c19b5 Features: Fix CompileFeatures test for C non-features ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/GNU-C.cmake | 13 ++++++++++--- Tests/CompileFeatures/CMakeLists.txt | 3 ++- .../CompileFeatures/{feature_test.cpp => feature_test.c} | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) copy Tests/CompileFeatures/{feature_test.cpp => feature_test.c} (88%) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 09:50:39 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 09:50:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-944-g529293e Message-ID: <20150122145039.97F794941@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 529293e344106a7132983a8f166a36e835fcce87 (commit) via 3c0996c135198fbcaf8951cffc98e3a1570e756d (commit) via 8dc0c976661ff048c346d6c68666bd7056ed84a5 (commit) from be2a74dbcbbc3a6d6af8ccb0a70688e4db0f6901 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=529293e344106a7132983a8f166a36e835fcce87 commit 529293e344106a7132983a8f166a36e835fcce87 Merge: be2a74d 3c0996c Author: Brad King AuthorDate: Thu Jan 22 09:50:38 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 09:50:38 2015 -0500 Merge topic 'WriteCompilerDetectionHeader-tests' 3c0996c1 WCDH: Test that no C compiler features are defined for CXX compiler. 8dc0c976 WCDH: Fix the C_STANDARD property in the tests. ----------------------------------------------------------------------- Summary of changes: Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt | 2 +- Tests/Module/WriteCompilerDetectionHeader/main.cpp | 4 ++++ Tests/Module/WriteCompilerDetectionHeader/multi_files.cpp | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 09:50:41 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 09:50:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-947-g3eda92d Message-ID: <20150122145041.B8637A9580@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 3eda92df914f9e07775f5026ebc32580e743ea70 (commit) via 7e468cd8f99daecfc1197883a0fd87bde771309b (commit) via 77444a7d486c415508a9c754fd4cc29cbb33f12f (commit) from 529293e344106a7132983a8f166a36e835fcce87 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3eda92df914f9e07775f5026ebc32580e743ea70 commit 3eda92df914f9e07775f5026ebc32580e743ea70 Merge: 529293e 7e468cd Author: Brad King AuthorDate: Thu Jan 22 09:50:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 09:50:40 2015 -0500 Merge topic 'update-kwsys' 7e468cd8 Merge branch 'upstream-kwsys' into update-kwsys 77444a7d KWSys 2015-01-20 (b33e7b96) ----------------------------------------------------------------------- Summary of changes: Source/kwsys/FStream.hxx.in | 10 ++++++++-- Source/kwsys/ProcessWin32.c | 12 ++++++++++-- Source/kwsys/SystemInformation.cxx | 6 +++++- Source/kwsys/SystemTools.cxx | 6 +++++- 4 files changed, 28 insertions(+), 6 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 09:50:43 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 09:50:43 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-949-g57f4c83 Message-ID: <20150122145043.AE06FA95FB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 57f4c8346206d129d2ec6576b3fb0b7862566311 (commit) via e56c93279523701d8f044372fcc451ce50369b93 (commit) from 3eda92df914f9e07775f5026ebc32580e743ea70 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57f4c8346206d129d2ec6576b3fb0b7862566311 commit 57f4c8346206d129d2ec6576b3fb0b7862566311 Merge: 3eda92d e56c932 Author: Brad King AuthorDate: Thu Jan 22 09:50:42 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 09:50:42 2015 -0500 Merge topic 'FindCUDA-cusolver' e56c9327 FindCUDA: Add cuSOLVER library from CUDA 7.0 ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 7 +++++++ 1 file changed, 7 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 09:51:59 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 09:51:59 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2314-gb57c297 Message-ID: <20150122145159.AC752A9E5A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b57c2977083e8bf0c8e0ae12f6b2e9db5f4a216c (commit) via 57f4c8346206d129d2ec6576b3fb0b7862566311 (commit) via 3eda92df914f9e07775f5026ebc32580e743ea70 (commit) via 529293e344106a7132983a8f166a36e835fcce87 (commit) via be2a74dbcbbc3a6d6af8ccb0a70688e4db0f6901 (commit) via afe99212d2a872da63bf027766c1ab00ec841680 (commit) from af96f69116e4f00b46028ef709fef898a53972e1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b57c2977083e8bf0c8e0ae12f6b2e9db5f4a216c commit b57c2977083e8bf0c8e0ae12f6b2e9db5f4a216c Merge: af96f69 57f4c83 Author: Brad King AuthorDate: Thu Jan 22 09:51:10 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 09:51:10 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 10:06:48 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 10:06:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2316-g09bceae Message-ID: <20150122150648.736D1AA9E5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 09bceae5b9df968d8307d898f43963b2bd305c45 (commit) via 53df9bce19586858ad7c9b0e80d660433be757ed (commit) from b57c2977083e8bf0c8e0ae12f6b2e9db5f4a216c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09bceae5b9df968d8307d898f43963b2bd305c45 commit 09bceae5b9df968d8307d898f43963b2bd305c45 Merge: b57c297 53df9bc Author: Brad King AuthorDate: Thu Jan 22 10:06:47 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 10:06:47 2015 -0500 Merge topic 'update-curl' into next 53df9bce curl: Add README-CMake.txt http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53df9bce19586858ad7c9b0e80d660433be757ed commit 53df9bce19586858ad7c9b0e80d660433be757ed Author: Brad King AuthorDate: Thu Jan 22 09:59:34 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 10:00:04 2015 -0500 curl: Add README-CMake.txt Describe how to update curl from upstream. diff --git a/Utilities/cmcurl/README-CMake.txt b/Utilities/cmcurl/README-CMake.txt new file mode 100644 index 0000000..3f053d8 --- /dev/null +++ b/Utilities/cmcurl/README-CMake.txt @@ -0,0 +1,66 @@ +The Utilities/cmcurl directory contains a reduced distribution +of the curl source tree with only the library source code and +CMake build system. It is not a submodule; the actual content is part +of our source tree and changes can be made and committed directly. + +We update from upstream using Git's "subtree" merge strategy. A +special branch contains commits of upstream curl snapshots and +nothing else. No Git ref points explicitly to the head of this +branch, but it is merged into our history. + +Update curl from upstream as follows. Create a local branch to +explicitly reference the upstream snapshot branch head: + + git branch curl-upstream 3fe5d9bf + +Use a temporary directory to checkout the branch: + + mkdir curl-tmp + cd curl-tmp + git init + git pull .. curl-upstream + rm -rf * + +Now place the (reduced) curl content in this directory. See +instructions shown by + + git log 3fe5d9bf + +for help extracting the content from the upstream repo. Then run +the following commands to commit the new version. Substitute the +appropriate date and version number: + + git add --all + + GIT_AUTHOR_NAME='Curl Upstream' \ + GIT_AUTHOR_EMAIL='curl-library at cool.haxx.se' \ + GIT_AUTHOR_DATE='Wed Sep 10 08:07:58 2014 +0200' \ + git commit -m 'curl 7.38.0 (reduced)' && + git commit --amend + +Edit the commit message to describe the procedure used to obtain the +content. Then push the changes back up to the main local repository: + + git push .. HEAD:curl-upstream + cd .. + rm -rf curl-tmp + +Create a topic in the main repository on which to perform the update: + + git checkout -b update-curl master + +Merge the curl-upstream branch as a subtree: + + git merge -s recursive -X subtree=Utilities/cmcurl \ + curl-upstream + +If there are conflicts, resolve them and commit. Build and test the +tree. Commit any additional changes needed to succeed. + +Finally, run + + git rev-parse --short=8 curl-upstream + +to get the commit from which the curl-upstream branch must be started +on the next update. Edit the "git branch curl-upstream" line above to +record it, and commit this file. ----------------------------------------------------------------------- Summary of changes: Utilities/cmcurl/README-CMake.txt | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Utilities/cmcurl/README-CMake.txt hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 11:16:41 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 11:16:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2318-g23f546b Message-ID: <20150122161641.84606A80AA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 23f546b771106cf97a8e3163a824779c6898797f (commit) via f3e0b6f1eb8deba06e6072156bd9b247a559c9be (commit) from 09bceae5b9df968d8307d898f43963b2bd305c45 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23f546b771106cf97a8e3163a824779c6898797f commit 23f546b771106cf97a8e3163a824779c6898797f Merge: 09bceae f3e0b6f Author: Brad King AuthorDate: Thu Jan 22 11:16:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 11:16:40 2015 -0500 Merge topic 'cdash_upload_file_mode' into next f3e0b6f1 CTestCoverageCollectGCOV: Add module to run gcov http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3e0b6f1eb8deba06e6072156bd9b247a559c9be commit f3e0b6f1eb8deba06e6072156bd9b247a559c9be Author: Bill Hoffman AuthorDate: Wed Jan 14 10:52:26 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 11:15:54 2015 -0500 CTestCoverageCollectGCOV: Add module to run gcov Provide a function to run gcov and create a tarball of results. Since CDash tracks the md5sum of the files uploaded, use the --mtime option with "cmake -E tar" so that tar files could be created that would have the same md5sum with the same content. diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst index 0a0ca23..db56010 100644 --- a/Help/manual/cmake-modules.7.rst +++ b/Help/manual/cmake-modules.7.rst @@ -63,6 +63,7 @@ All Modules /module/CPack /module/CPackWIX /module/CTest + /module/CTestCoverageCollectGCOV /module/CTestScriptMode /module/CTestUseLaunchers /module/Dart diff --git a/Help/module/CTestCoverageCollectGCOV.rst b/Help/module/CTestCoverageCollectGCOV.rst new file mode 100644 index 0000000..4c5deca --- /dev/null +++ b/Help/module/CTestCoverageCollectGCOV.rst @@ -0,0 +1 @@ +.. cmake-module:: ../../Modules/CTestCoverageCollectGCOV.cmake diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake new file mode 100644 index 0000000..f6616e0 --- /dev/null +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -0,0 +1,138 @@ +#.rst: +# CTestCoverageCollectGCOV +# ------------------------ +# +# This module provides the function ``ctest_coverage_collect_gcov``. +# The function will run gcov on the .gcda files in a binary tree and then +# package all of the .gcov files into a tar file with a data.json that +# contains the source and build directories for CDash to use in parsing +# the coverage data. In addtion the Labels.json files for targets that +# have coverage information are also put in the tar file for CDash to +# asign the correct labels. This file can be sent to a CDash server for +# display with the +# :command:`ctest_submit(CDASH_UPLOAD)` command. +# +# .. command:: cdash_coverage_collect_gcov +# +# :: +# +# ctest_coverage_collect_gcov(TARBALL +# [SOURCE ][BUILD ] +# [GCOV_COMMAND ] +# ) +# +# Run gcov and package a tar file for CDash. The options are: +# +# ``TARBALL `` +# Specify the location of the ``.tar`` file to be created for later +# upload to CDash. Relative paths will be interpreted with respect +# to the top-level build directory. +# +# ``SOURCE `` +# Specify the top-level source directory for the build. +# Default is the value of :variable:`CTEST_SOURCE_DIRECTORY`. +# +# ``BUILD `` +# Specify the top-level build directory for the build. +# Default is the value of :variable:`CTEST_BINARY_DIRECTORY`. +# +# ``GCOV_COMMAND `` +# Specify the full path to the ``gcov`` command on the machine. +# Default is the value of :variable:`CTEST_COVERAGE_COMMAND`. + +#============================================================================= +# 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.) +include(CMakeParseArguments) +function(ctest_coverage_collect_gcov) + set(options "") + set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) + set(multiValueArgs "") + cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" + "${multiValueArgs}" "" ${ARGN} ) + if(NOT DEFINED GCOV_TARBALL) + message(FATAL_ERROR + "TARBALL must be specified. for ctest_coverage_collect_gcov") + endif() + if(NOT DEFINED GCOV_SOURCE) + set(source_dir "${CTEST_SOURCE_DIRECTORY}") + else() + set(source_dir "${GCOV_SOURCE}") + endif() + if(NOT DEFINED GCOV_BUILD) + set(binary_dir "${CTEST_BINARY_DIRECTORY}") + else() + set(binary_dir "${GCOV_BUILD}") + endif() + if(NOT DEFINED GCOV_GCOV_COMMAND) + set(gcov_command "${CTEST_COVERAGE_COMMAND}") + else() + set(gcov_command "${GCOV_GCOV_COMMAND}") + endif() + # run gcov on each gcda file in the binary tree + set(gcda_files) + set(label_files) + # look for gcda files in the target directories + # could do a glob from the top of the binary tree but + # this will be faster and only look where the files will be + file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) + foreach(target_dir ${target_dirs}) + file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") + list(LENGTH gfiles len) + # if we have gcda files then also grab the labels file for that target + if(${len} GREATER 0) + file(GLOB_RECURSE lfiles RELATIVE ${binary_dir} + "${target_dir}/Labels.json") + list(APPEND gcda_files ${gfiles}) + list(APPEND label_files ${lfiles}) + endif() + endforeach() + # return early if no coverage files were found + list(LENGTH gcda_files len) + if(len EQUAL 0) + message("ctest_coverage_collect_gcov: No .gcda files found, " + "ignoring coverage request.") + return() + endif() + # setup the dir for the coverage files + set(coverage_dir "${binary_dir}/Testing/CoverageInfo") + file(MAKE_DIRECTORY "${coverage_dir}") + # call gcov on each .gcda file + foreach (gcda_file ${gcda_files}) + # get the directory of the gcda file + get_filename_component(gcda_file ${binary_dir}/${gcda_file} ABSOLUTE) + get_filename_component(gcov_dir ${gcda_file} DIRECTORY) + # run gcov, this will produce the .gcov file in the current + # working directory + execute_process(COMMAND + ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${coverage_dir}) + endforeach() + # create json file with project information + file(WRITE ${coverage_dir}/data.json + "{ + \"Source\": \"${source_dir}\", + \"Binary\": \"${binary_dir}\" +}") + # collect the gcov files + set(gcov_files) + file(GLOB_RECURSE gcov_files RELATIVE ${binary_dir} "${coverage_dir}/*.gcov") + # tar up the coverage info with the same date so that the md5 + # sum will be the same for the tar file independent of file time + # stamps + execute_process(COMMAND + ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} + "--mtime=1970-01-01 0:0:0 UTC" ${gcov_files} + ${coverage_dir}/data.json ${label_files} + WORKING_DIRECTORY ${binary_dir}) +endfunction() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 11:16:47 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 11:16:47 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-953-gc029894 Message-ID: <20150122161647.C0387A8EFE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via c0298947ff664d200b7b2a86ac6e84c1c76e2fb1 (commit) via f3e0b6f1eb8deba06e6072156bd9b247a559c9be (commit) via 6dd980e0ef1254a6c3098488e6677f5eb4f40a86 (commit) via 5dc33f89b5405f1fbcefb9783ea2050a3686d7de (commit) from 57f4c8346206d129d2ec6576b3fb0b7862566311 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c0298947ff664d200b7b2a86ac6e84c1c76e2fb1 commit c0298947ff664d200b7b2a86ac6e84c1c76e2fb1 Merge: 57f4c83 f3e0b6f Author: Brad King AuthorDate: Thu Jan 22 11:16:45 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 11:16:45 2015 -0500 Merge topic 'cdash_upload_file_mode' f3e0b6f1 CTestCoverageCollectGCOV: Add module to run gcov 6dd980e0 ctest_submit: Make CDASH_UPLOAD mode arguments more strict 5dc33f89 ctest_submit: Add CDASH_UPLOAD mode to upload files to CDash ----------------------------------------------------------------------- Summary of changes: Help/command/ctest_submit.rst | 13 + Help/manual/cmake-modules.7.rst | 1 + Help/module/CTestCoverageCollectGCOV.rst | 1 + Modules/CTestCoverageCollectGCOV.cmake | 138 ++++++++++ Source/CMakeLists.txt | 1 + Source/CTest/cmCTestCurl.cxx | 271 ++++++++++++++++++++ Source/CTest/cmCTestCurl.h | 52 ++++ Source/CTest/cmCTestSubmitCommand.cxx | 100 ++++++-- Source/CTest/cmCTestSubmitCommand.h | 9 + Source/CTest/cmCTestSubmitHandler.cxx | 167 +++++++++++- Source/CTest/cmCTestSubmitHandler.h | 5 + .../CDashUploadFILES-result.txt} | 0 .../CTestSubmit/CDashUploadFILES-stderr.txt | 2 + .../CDashUploadFTP-result.txt} | 0 .../RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt | 1 + .../CDashUploadNone-result.txt} | 0 .../CTestSubmit/CDashUploadNone-stderr.txt | 1 + .../CDashUploadPARTS-result.txt} | 0 .../CTestSubmit/CDashUploadPARTS-stderr.txt | 2 + .../CDashUploadRETRY_COUNT-result.txt} | 0 .../CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt | 2 + .../CDashUploadRETRY_DELAY-result.txt} | 0 .../CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt | 2 + .../PARTSCDashUpload-result.txt} | 0 .../CTestSubmit/PARTSCDashUpload-stderr.txt | 2 + .../PARTSCDashUploadType-result.txt} | 0 .../CTestSubmit/PARTSCDashUploadType-stderr.txt | 2 + Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake | 13 + 28 files changed, 757 insertions(+), 28 deletions(-) create mode 100644 Help/module/CTestCoverageCollectGCOV.rst create mode 100644 Modules/CTestCoverageCollectGCOV.cmake create mode 100644 Source/CTest/cmCTestCurl.cxx create mode 100644 Source/CTest/cmCTestCurl.h copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadFILES-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadFILES-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadFTP-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadFTP-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadNone-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadNone-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadPARTS-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadPARTS-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadRETRY_COUNT-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadRETRY_COUNT-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/CDashUploadRETRY_DELAY-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/CDashUploadRETRY_DELAY-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/PARTSCDashUpload-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/PARTSCDashUpload-stderr.txt copy Tests/RunCMake/{CTestMemcheck/DummyAddressSanitizer-result.txt => CTestSubmit/PARTSCDashUploadType-result.txt} (100%) create mode 100644 Tests/RunCMake/CTestSubmit/PARTSCDashUploadType-stderr.txt hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 11:17:07 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 11:17:07 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2320-g515b029 Message-ID: <20150122161707.811CDA98FA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 515b029dd45712fb347f4889d2c2b261457f4b9d (commit) via c0298947ff664d200b7b2a86ac6e84c1c76e2fb1 (commit) from 23f546b771106cf97a8e3163a824779c6898797f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=515b029dd45712fb347f4889d2c2b261457f4b9d commit 515b029dd45712fb347f4889d2c2b261457f4b9d Merge: 23f546b c029894 Author: Brad King AuthorDate: Thu Jan 22 11:16:59 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 11:16:59 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 11:45:27 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 11:45:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2322-gc23c987 Message-ID: <20150122164527.0CB3CA895D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c23c98773d30735743b5a522a6b76a153aef4d3d (commit) via 005b409d6acc5b681b0614b778c1c3e76a2227c9 (commit) from 515b029dd45712fb347f4889d2c2b261457f4b9d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c23c98773d30735743b5a522a6b76a153aef4d3d commit c23c98773d30735743b5a522a6b76a153aef4d3d Merge: 515b029 005b409 Author: Brad King AuthorDate: Thu Jan 22 11:45:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 11:45:26 2015 -0500 Merge topic 'FindCUDA-more-advanced-cache-entries' into next 005b409d FindCUDA: Mark more cache variables as advanced http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=005b409d6acc5b681b0614b778c1c3e76a2227c9 commit 005b409d6acc5b681b0614b778c1c3e76a2227c9 Author: Mark Abraham AuthorDate: Thu Jan 22 16:29:22 2015 +0100 Commit: Brad King CommitDate: Thu Jan 22 11:44:05 2015 -0500 FindCUDA: Mark more cache variables as advanced Mark variables pertaining to specific situations relevant to CUDA compilation as advanced since they are not part of normal usage. diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index cae9214..81e1cad 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -483,6 +483,10 @@ mark_as_advanced( CUDA_HOST_COMPILATION_CPP CUDA_NVCC_FLAGS CUDA_PROPAGATE_HOST_FLAGS + CUDA_BUILD_CUBIN + CUDA_BUILD_EMULATION + CUDA_VERBOSE_BUILD + CUDA_SEPARABLE_COMPILATION ) # Makefile and similar generators don't define CMAKE_CONFIGURATION_TYPES, so we ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 13:23:11 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 13:23:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.0-955-g98bf613 Message-ID: <20150122182311.E6CBDAA121@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 98bf613cd09e2187fa5002dac06e63d5450dbcf0 (commit) via 57622bd19d3fd013038d34f497b106a7e2bfd26d (commit) from c0298947ff664d200b7b2a86ac6e84c1c76e2fb1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 13:23:12 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 13:23:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.0-2324-g2d65931 Message-ID: <20150122182312.145DCAA122@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2d65931be441528733687bb62f2d111eee659e27 (commit) via 98bf613cd09e2187fa5002dac06e63d5450dbcf0 (commit) from c23c98773d30735743b5a522a6b76a153aef4d3d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d65931be441528733687bb62f2d111eee659e27 commit 2d65931be441528733687bb62f2d111eee659e27 Merge: c23c987 98bf613 Author: Brad King AuthorDate: Thu Jan 22 13:22:57 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 13:22:57 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 13:23:12 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 13:23:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, release, updated. v3.1.0-82-g57622bd Message-ID: <20150122182312.28D59AA124@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 57622bd19d3fd013038d34f497b106a7e2bfd26d (commit) from 445786964abe6519bd4695d982e0801a5dda35ce (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 13:24:06 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 13:24:06 -0500 (EST) Subject: [Cmake-commits] CMake annotated tag, v3.1.1, created. v3.1.1 Message-ID: <20150122182406.4EA2CAA134@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The annotated tag, v3.1.1 has been created at 597f45070883c929d79a9a77060c3ee4d57e0122 (tag) tagging 57622bd19d3fd013038d34f497b106a7e2bfd26d (commit) replaces v3.1.0 tagged by Brad King on Thu Jan 22 13:21:19 2015 -0500 - Log ----------------------------------------------------------------- CMake 3.1.1 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJUwT+fAAoJEOyP7zp7+07afecP/iReCAY4tTjq3aPD3We/zEki fJJ3PGSXcrx2gzFEbV0y8CfwYn3zGnPYFdJ9wUNR0KnBV/lR8VQEZLy1vBrHHxDQ UBVqT07++z38VnPZhLh2BPlA3XUq3/WePDFqwFn6b+LcBD5SiqTm6xMKuR936QDh 5T2iIdet2kvDdGWlTSkcgQI2ly7fs3oeq8GmGPi3rON/r21XpeCpcy/lgCUjf1es RZPduFzgtZOffaRe9ZLPhK40ib9WOa2OGmiobPA3JSmTSVjHZ9hm32keBEBw2N0W 25Iv/6rKTDn4oLkfieRHXsJ0jyLsIUCopkZHYvZ9or0Tlu+SXuSODOxK54XiTvBM /BXZ9fegtDbKRUWPqg+xluyB63X8kSCWKPHzS9VJ/bVUzMuwqFMMJhnrWZsm03QB vJLK58/OGcQq75AaKCdIcBgOzKMwr+1ubrqTijdoT7hjzr2pGyWEmBIgsGq7qsBv +YBmN/sVYHJj94FCnI2CcRr8mE3Aa98xgvVpZzRDKM5RRerldOo13M5EtWinLHdu RTqDhVs7Qsuhp/Bd9T0FAwRmrhsOIg2exAaWiv9lo1rODhYy/nJJgN7VdGPKA/V+ rw5czBJkqTaZzkrXQq3xh5iC4oAUzssuvt6inZeGr34dtO24Z5rH8ZBZGB9ojZsT n1XbUyKFsE3Yh5rU/uzN =FKpS -----END PGP SIGNATURE----- Andr? Klitzing (1): Eclipse: Add org.eclipse.cdt.core.cnature to CXX projects (#15068) Ben Boeckel (4): get_test_property: clarify the documentation set_tests_properties: fix documentation tests: add tests for querying properties Xcode: Sort targets deterministically and with ALL_BUILD first (#15346) Brad King (50): Merge branch 'doc-INTERFACE-target-type' into release bootstrap: Fix syntax for Solaris 10 shell (#15317) Merge branch 'bootstrap-solaris' into release Help: Clarify MinGW v. MSYS Makefiles generators (#15319) Merge branch 'doc-mingw-makefiles' into release Merge branch 'backport-suncc-fixes' into release Merge branch 'CPackComponent-docs-fix' into release Ninja: Do not crash when CMAKE__COMPILE_OBJECT is empty (#15325) Merge branch 'ninja-fix-crash-on-error' into release Ninja: Generate rules only for languages compiled in a target (#15325) Tests: Test using objects from a language enabled in a subdirectory (#15325) Help: Add 3.1 release note about '#' escaping in Makefiles (#15322) Merge branch 'ninja-fix-subdir-objlib-languages' into release Merge branch 'doc-octothorpe-escaping' into release Help: Clarify if() documentation (#15335) Merge branch 'kwsys-Terminal-xterm-termite' into release Merge branch 'doc-if-variable-not-defined' into release Merge branch 'doc-CXX_STANDARD-14' into release Merge branch 'FindIce-CMP0054' into release Merge branch 'FindCUDA-cross' into release Merge branch 'FindSDL-quoting' into release Merge branch 'fix-empty-target-property-queries' into release Help: Document CMAKE_FIND_PACKAGE_NAME variable Xcode: Do not require code signing for compiler id (#15214) Merge branch 'fix-autouic-regression' into release Merge branch 'doc-CMAKE_FIND_PACKAGE_NAME' into release Merge branch 'xcode-ios-compiler-id' into release Copyright.txt: Update year range to end in 2015 Merge branch 'backport-copyright-year' into release XL: Fix link flags for executables on Linux with XL compilers QNX: Fix detection of QCC compiler id (#15349) Merge branch 'linux-XL-fortran' into release Merge branch 'backport-cpack_invalid_cmake_generator' into release Merge branch 'FindBoost-update-versions' into release Merge branch 'FindRuby-fix-version' into release Merge branch 'FindRuby-zero-version' into release Merge branch 'fix-LOCATION-with-TARGET_OBJECTS' into release Merge branch 'cpack-PackageMaker-OSX-10.10' into release Merge branch 'fix-COMPILE_FEATURES-genex' into release Merge branch 'fix-qcc-compiler-id' into release Merge branch 'eclipse-fix-cxx-natures' into release-3.0 Merge branch 'release-3.0' into release Merge branch 'fix-cmake-org-links' into release Merge branch 'FindQt-fixes' into release Xcode: Fix early termination on per-config source file error Merge branch 'emacs-mode-fix-word-at-point' into release Merge branch 'emacs-mode-fix-word-at-point' into release Merge branch 'xcode-target-sort' into release Merge branch 'doc-virtual-override-specifiers-links' into release CMake 3.1.1 Calin Cascaval (1): CPack: Fix PackageMaker internal versioning for OS X 10.10 Chuck Atkins (1): Fix compilation with the Oracle / Sun compiler (#15318) Daniele E. Domenichelli (1): Help: Small fixes in CPackComponent documentation David Coppa (1): FindRuby: fix selection of version x.0 (#15345) Domen Vrankar (1): CPack: Avoid crash on invalid CMake generator name (#15308) Evangelos Foutras (1): FindRuby: Fix output check in _RUBY_CONFIG_VAR Gregor Jasny (1): find_package: Document CMAKE_FIND_PACKAGE_NAME variable Justin Borodinsky (1): QtAutoUic: Restore source file AUTOUIC_OPTIONS settings Mark Abraham (1): FindCUDA: Do not assume CMAKE_SYSTEM_PROCESSOR is set Peter Vasil (2): cmake-mode.el: Fix extracting keyword at point in cmake-help cmake-mode.el: Re-add explicit call to require thingatpt Rolf Eike Beer (5): FindIce: Port to work with CMP0054 NEW behavior FindSDL: Allow if() to dereference SDL_INCLUDE_DIR for matching FindQt: fix setting DESIRED_QT_VERSION if "find_package(Qt VVV)" was called FindQt: fix variable name in error message FindQt: explicitely mention that it cannot Qt5 or later Sergey Nikulov (1): FindBoost: Add latest Boost version 1.57.0 and next milestone 1.58.0 Simon Gomizelj (1): KWSys Terminal: Add xterm-termite to VT100 color support whitelist Stephen Kelly (7): Help: Document valid 14 value for CXX_STANDARD. (#15339) get_target_property: discern empty from undefined properties (#15333) QtAutoUic: Add a test for the regression in the parent commit. cmMakefile: Rename a method to what it really does. Features: Fix the COMPILE_FEATURES genex for unavailable features. cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338) Help: Link relevant documents for virtual override features (#15311) Tim Blechmann (1): Help: Add INTERFACE_LIBRARY to TYPE target property documentation William Lynch (1): Help: Update cmake.org links to avoid redirects ----------------------------------------------------------------------- hooks/post-receive -- CMake From matt.mccormick at kitware.com Thu Jan 22 14:00:17 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 22 Jan 2015 14:00:17 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2244-gda9ed6b Message-ID: <20150122190017.CD05CAA1E8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via da9ed6be3896a3bdaed9cddfbf2fccc944992451 (commit) via 52a4fe75063d77f2b79ffd9bb93b1e48cd7af3dd (commit) from 2d65931be441528733687bb62f2d111eee659e27 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da9ed6be3896a3bdaed9cddfbf2fccc944992451 commit da9ed6be3896a3bdaed9cddfbf2fccc944992451 Merge: 2d65931 52a4fe7 Author: Matt McCormick AuthorDate: Thu Jan 22 14:00:16 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 14:00:16 2015 -0500 Merge topic 'if-test' into next 52a4fe75 Tests: Move if command TestName test to RunCMake group. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52a4fe75063d77f2b79ffd9bb93b1e48cd7af3dd commit 52a4fe75063d77f2b79ffd9bb93b1e48cd7af3dd Author: Matt McCormick AuthorDate: Thu Jan 22 13:58:53 2015 -0500 Commit: Matt McCormick CommitDate: Thu Jan 22 13:58:53 2015 -0500 Tests: Move if command TestName test to RunCMake group. The RunCMake group is preferred over the Complex test. diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 102da6b..bbd5878 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -21,19 +21,6 @@ if(TARGET NotATarget) message(FATAL_ERROR "if(TARGET NotATarget) returned true!") endif() -# Test if(TEST... -add_test(NAME TestThatExists COMMAND ${CMAKE_COMMAND} -E echo "A CMake Test") -if(TEST TestThatExists) - message(STATUS "if(TestThatExists) is true") -else() - message(FATAL_ERROR "if(TestThatExists is false") -endif() -if(TEST TestThatDoesNotExist) - message(FATAL_ERROR "if(TestThatDoesNotExist is true") -else() - message(STATUS "if(TestThatDoesNotExist) is false") -endif() - # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) link_libraries(${COMPLEX_LIBS}) diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake b/Tests/RunCMake/if/RunCMakeTest.cmake index 6b6b74b..9db79e9 100644 --- a/Tests/RunCMake/if/RunCMakeTest.cmake +++ b/Tests/RunCMake/if/RunCMakeTest.cmake @@ -2,3 +2,6 @@ include(RunCMake) run_cmake(IsDirectory) run_cmake(IsDirectoryLong) + +run_cmake(TestNameThatExists) +run_cmake(TestNameThatDoesNotExist) diff --git a/Tests/RunCMake/if/TestNameThatDoesNotExist-stdout.txt b/Tests/RunCMake/if/TestNameThatDoesNotExist-stdout.txt new file mode 100644 index 0000000..8874ca8 --- /dev/null +++ b/Tests/RunCMake/if/TestNameThatDoesNotExist-stdout.txt @@ -0,0 +1 @@ +TestThatDoesNotExist is false diff --git a/Tests/RunCMake/if/TestNameThatDoesNotExist.cmake b/Tests/RunCMake/if/TestNameThatDoesNotExist.cmake new file mode 100644 index 0000000..68ad6e3 --- /dev/null +++ b/Tests/RunCMake/if/TestNameThatDoesNotExist.cmake @@ -0,0 +1,5 @@ +if(TEST TestThatDoesNotExist) + message(FATAL_ERROR "if TestThatDoesNotExist is true") +else() + message(STATUS "if TestThatDoesNotExist is false") +endif() diff --git a/Tests/RunCMake/if/TestNameThatExists-stdout.txt b/Tests/RunCMake/if/TestNameThatExists-stdout.txt new file mode 100644 index 0000000..54911bc --- /dev/null +++ b/Tests/RunCMake/if/TestNameThatExists-stdout.txt @@ -0,0 +1 @@ +TestThatExists is true diff --git a/Tests/RunCMake/if/TestNameThatExists.cmake b/Tests/RunCMake/if/TestNameThatExists.cmake new file mode 100644 index 0000000..e03e148 --- /dev/null +++ b/Tests/RunCMake/if/TestNameThatExists.cmake @@ -0,0 +1,6 @@ +add_test(NAME TestThatExists COMMAND ${CMAKE_COMMAND} -E echo "A CMake Test") +if(TEST TestThatExists) + message(STATUS "if TestThatExists is true") +else() + message(FATAL_ERROR "if TestThatExists is false") +endif() ----------------------------------------------------------------------- Summary of changes: Tests/Complex/Executable/CMakeLists.txt | 13 ------------- Tests/RunCMake/if/RunCMakeTest.cmake | 3 +++ Tests/RunCMake/if/TestNameThatDoesNotExist-stdout.txt | 1 + Tests/RunCMake/if/TestNameThatDoesNotExist.cmake | 5 +++++ Tests/RunCMake/if/TestNameThatExists-stdout.txt | 1 + Tests/RunCMake/if/TestNameThatExists.cmake | 6 ++++++ 6 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 Tests/RunCMake/if/TestNameThatDoesNotExist-stdout.txt create mode 100644 Tests/RunCMake/if/TestNameThatDoesNotExist.cmake create mode 100644 Tests/RunCMake/if/TestNameThatExists-stdout.txt create mode 100644 Tests/RunCMake/if/TestNameThatExists.cmake hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 14:12:22 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 14:12:22 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2246-gcdfbe11 Message-ID: <20150122191222.C8393498C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via cdfbe11b7387eeb3594244feace5c99c1d090773 (commit) via 560b3e9f1df04808593997e7d1f6ac43c7b0c141 (commit) from da9ed6be3896a3bdaed9cddfbf2fccc944992451 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cdfbe11b7387eeb3594244feace5c99c1d090773 commit cdfbe11b7387eeb3594244feace5c99c1d090773 Merge: da9ed6b 560b3e9 Author: Brad King AuthorDate: Thu Jan 22 14:12:22 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 14:12:22 2015 -0500 Merge topic 'test-complex-remove-bad-indentation' into next 560b3e9f Tests: Remove incorrect indentation from Complex test comment http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=560b3e9f1df04808593997e7d1f6ac43c7b0c141 commit 560b3e9f1df04808593997e7d1f6ac43c7b0c141 Author: Brad King AuthorDate: Thu Jan 22 14:11:46 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 14:11:46 2015 -0500 Tests: Remove incorrect indentation from Complex test comment diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 508221c..a1f8e68 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -21,7 +21,7 @@ if(TARGET NotATarget) message(FATAL_ERROR "if(TARGET NotATarget) returned true!") endif() - # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to +# Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) link_libraries(${COMPLEX_LIBS}) diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index e910f20..b2307b2 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -21,7 +21,7 @@ if(TARGET NotATarget) message(FATAL_ERROR "if(TARGET NotATarget) returned true!") endif() - # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to +# Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) link_libraries(${COMPLEX_LIBS}) ----------------------------------------------------------------------- Summary of changes: Tests/ComplexOneConfig/Executable/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 14:45:11 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 14:45:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2249-g9ebdc29 Message-ID: <20150122194511.8B415A6D21@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9ebdc29f1d380cb37aacf99aded77aea76ac0f79 (commit) via c2a645b74e203c946eafe0f2fd6996989876f24b (commit) via 4f313114bab3ffd41e26178624f4e5dd3eb70e74 (commit) from cdfbe11b7387eeb3594244feace5c99c1d090773 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ebdc29f1d380cb37aacf99aded77aea76ac0f79 commit 9ebdc29f1d380cb37aacf99aded77aea76ac0f79 Merge: cdfbe11 c2a645b Author: Brad King AuthorDate: Thu Jan 22 14:45:10 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 14:45:10 2015 -0500 Merge topic 'curl-default-cainfo' into next c2a645b7 cmake: Use a default CA path when not using system curl 4f313114 curl: Add CURL_CA_PATH option to CMake build process http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c2a645b74e203c946eafe0f2fd6996989876f24b commit c2a645b74e203c946eafe0f2fd6996989876f24b Author: Brad King AuthorDate: Thu Jan 22 10:15:31 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 14:16:20 2015 -0500 cmake: Use a default CA path when not using system curl When using system curl, we trust it to be configured with desired CA certs. When using our own build of curl, we use os-configured CA certs on Windows and OS X. On other systems, try to achieve this by searching for common CA cert locations. According to a brief investigation, the curl packages on popular Linux distros are currently configured as: * Arch: /etc/ssl/certs/ca-certificates.crt * Debian with OpenSSL: /etc/ssl/certs * Debian with GNU TLS: /etc/ssl/certs/ca-certificates.crt * Debian with NSS: /etc/ssl/certs/ca-certificates.crt * Fedora: /etc/pki/tls/certs/ca-bundle.crt * Gentoo with OpenSSL: /etc/ssl/certs * Gentoo without OpenSSL: /etc/ssl/certs/ca-certificates.crt Teach CMake and CTest to look for these paths and use them as a CA path or bundle when no other os-configured or user-specified CAs are available. diff --git a/Help/release/dev/curl-default-cainfo.rst b/Help/release/dev/curl-default-cainfo.rst new file mode 100644 index 0000000..ed45d36 --- /dev/null +++ b/Help/release/dev/curl-default-cainfo.rst @@ -0,0 +1,8 @@ +curl-default-cainfo +------------------- + +* When CMake is built with OpenSSL on systems other than Windows + and OS X, commands supporting network communication via ``https``, + such as :command:`file(DOWNLOAD)`, :command:`file(UPLOAD)`, and + :command:`ctest_submit`, now search for OS-configured certificate + authorities in a few ``/etc`` paths to be trusted automatically. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index c04cf9a..07839f3 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -175,6 +175,8 @@ set(SRCS cmCPackPropertiesGenerator.cxx cmCryptoHash.cxx cmCryptoHash.h + cmCurl.cxx + cmCurl.h cmCustomCommand.cxx cmCustomCommand.h cmCustomCommandGenerator.cxx @@ -497,6 +499,12 @@ if(WIN32 AND NOT CYGWIN) install(TARGETS cmcldeps DESTINATION bin) endif() +foreach(v CURL_CA_BUNDLE CURL_CA_PATH) + if(${v}) + set_property(SOURCE cmCurl.cxx APPEND PROPERTY COMPILE_DEFINITIONS ${v}="${${v}}") + endif() +endforeach() + # create a library used by the command line and the GUI add_library(CMakeLib ${SRCS}) target_link_libraries(CMakeLib cmsys diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 11e3343..3d9545f 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -26,7 +26,7 @@ #include // For curl submission -#include "cm_curl.h" +#include "cmCurl.h" #include "cmCTestCurl.h" #include @@ -366,6 +366,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, curl = curl_easy_init(); if(curl) { + cmCurlSetCAInfo(curl); if(verifyPeerOff) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 1ef4c92..7968608 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -9,8 +9,6 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "cm_curl.h" - #include "cmCTest.h" #include "cmake.h" #include "cmMakefile.h" @@ -26,6 +24,7 @@ #include "cmVersionMacros.h" #include "cmCTestCommand.h" #include "cmCTestStartCommand.h" +#include "cmCurl.h" #include "cmCTestBuildHandler.h" #include "cmCTestBuildAndTestHandler.h" @@ -192,6 +191,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method, FILE* file; ::curl_global_init(CURL_GLOBAL_ALL); curl = ::curl_easy_init(); + cmCurlSetCAInfo(curl); //set request options based on method switch(method) diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx new file mode 100644 index 0000000..96d3547 --- /dev/null +++ b/Source/cmCurl.cxx @@ -0,0 +1,64 @@ +/*============================================================================ + 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. +============================================================================*/ +#include "cmCurl.h" +#include "cmSystemTools.h" + +#define check_curl_result(result, errstr) \ + if (result != CURLE_OK) \ + { \ + e += e.empty()? "" : "\n"; \ + e += errstr; \ + e += ::curl_easy_strerror(result); \ + } + +//---------------------------------------------------------------------------- +std::string cmCurlSetCAInfo(::CURL *curl, const char* cafile) +{ + std::string e; + if(cafile && *cafile) + { + ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile); + check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); + } +#if !defined(CMAKE_USE_SYSTEM_CURL) && \ + !defined(_WIN32) && !defined(__APPLE__) && \ + !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH) +# define CMAKE_CAFILE_FEDORA "/etc/pki/tls/certs/ca-bundle.crt" + else if(cmSystemTools::FileExists(CMAKE_CAFILE_FEDORA, true)) + { + ::CURLcode res = + ::curl_easy_setopt(curl, CURLOPT_CAINFO, CMAKE_CAFILE_FEDORA); + check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); + } +# undef CMAKE_CAFILE_FEDORA + else + { +# define CMAKE_CAFILE_COMMON "/etc/ssl/certs/ca-certificates.crt" + if(cmSystemTools::FileExists(CMAKE_CAFILE_COMMON, true)) + { + ::CURLcode res = + ::curl_easy_setopt(curl, CURLOPT_CAINFO, CMAKE_CAFILE_COMMON); + check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); + } +# undef CMAKE_CAFILE_COMMON +# define CMAKE_CAPATH_COMMON "/etc/ssl/certs" + if(cmSystemTools::FileIsDirectory(CMAKE_CAPATH_COMMON)) + { + ::CURLcode res = + ::curl_easy_setopt(curl, CURLOPT_CAPATH, CMAKE_CAPATH_COMMON); + check_curl_result(res, "Unable to set TLS/SSL Verify CAPATH: "); + } +# undef CMAKE_CAPATH_COMMON + } +#endif + return e; +} diff --git a/Source/cmCurl.h b/Source/cmCurl.h new file mode 100644 index 0000000..25d74ae --- /dev/null +++ b/Source/cmCurl.h @@ -0,0 +1,22 @@ +/*============================================================================ + 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 cmCurl_h +#define cmCurl_h + +#include "cmStandardIncludes.h" + +#ifdef CMAKE_BUILD_WITH_CMAKE +# include "cm_curl.h" +std::string cmCurlSetCAInfo(::CURL *curl, const char* cafile = 0); +#endif + +#endif diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 2c92db2..f125292 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -20,7 +20,7 @@ #include "cmTimestamp.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cm_curl.h" +#include "cmCurl.h" #include "cmFileLockResult.h" #endif @@ -3068,10 +3068,11 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) } // check to see if a CAINFO file has been specified // command arg comes first - if(cainfo && *cainfo) + std::string const& cainfo_err = cmCurlSetCAInfo(curl, cainfo); + if (!cainfo_err.empty()) { - res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cainfo); - check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); + this->SetError(cainfo_err); + return false; } cmFileCommandVectorOfChar chunkDebug; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f313114bab3ffd41e26178624f4e5dd3eb70e74 commit 4f313114bab3ffd41e26178624f4e5dd3eb70e74 Author: Brad King AuthorDate: Wed Jan 21 16:42:18 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 11:17:14 2015 -0500 curl: Add CURL_CA_PATH option to CMake build process Move CMAKE_USE_OPENSSL and CURL_CA_BUNDLE up to the top of CMake so that CMake's own sources can know their values. Add the CURL_CA_PATH option at the top and honor it as part of the curl build. diff --git a/CMakeLists.txt b/CMakeLists.txt index bdc160d..28fd02f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,6 +287,13 @@ macro (CMAKE_BUILD_UTILITIES) if(CMAKE_TESTS_CDASH_SERVER) set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php") endif() + option(CMAKE_USE_OPENSSL "Use OpenSSL." OFF) + mark_as_advanced(CMAKE_USE_OPENSSL) + if(CMAKE_USE_OPENSSL) + set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle") + set(CURL_CA_PATH "" CACHE PATH "Path to SSL CA Certificate Directory") + mark_as_advanced(CURL_CA_BUNDLE CURL_CA_PATH) + endif() add_subdirectory(Utilities/cmcurl) CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty") diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index 0db741e..08bdff5 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -425,9 +425,6 @@ endif() #----------------------------------------------------------------------------- -option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" OFF) -mark_as_advanced(CMAKE_USE_OPENSSL) - set(USE_SSLEAY OFF) set(USE_OPENSSL OFF) set(HAVE_LIBCRYPTO OFF) @@ -454,11 +451,13 @@ if(CMAKE_USE_OPENSSL) check_include_file("openssl/rand.h" HAVE_OPENSSL_RAND_H) # Optionally build with a specific CA cert bundle. - set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle") - mark_as_advanced(CURL_CA_BUNDLE) if(CURL_CA_BUNDLE) add_definitions(-DCURL_CA_BUNDLE="${CURL_CA_BUNDLE}") endif() + # Optionally build with a specific CA cert dir. + if(CURL_CA_PATH) + add_definitions(-DCURL_CA_PATH="${CURL_CA_PATH}") + endif() endif(OPENSSL_FOUND) elseif(WIN32) # Use Windows SSL/TLS native implementation. diff --git a/Utilities/cmcurl/lib/curl_config.h.cmake b/Utilities/cmcurl/lib/curl_config.h.cmake index b5db3b6..a561c3d 100644 --- a/Utilities/cmcurl/lib/curl_config.h.cmake +++ b/Utilities/cmcurl/lib/curl_config.h.cmake @@ -3,12 +3,6 @@ /* when building libcurl itself */ #cmakedefine BUILDING_LIBCURL 1 -/* Location of default ca bundle */ -#cmakedefine CURL_CA_BUNDLE ${CURL_CA_BUNDLE} - -/* Location of default ca path */ -#cmakedefine CURL_CA_PATH ${CURL_CA_PATH} - /* to disable cookies support */ #cmakedefine CURL_DISABLE_COOKIES 1 ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 7 +++ Help/release/dev/curl-default-cainfo.rst | 8 +++ Source/CMakeLists.txt | 8 +++ Source/CTest/cmCTestSubmitHandler.cxx | 3 +- Source/cmCTest.cxx | 4 +- Source/cmCurl.cxx | 64 +++++++++++++++++++++++ Utilities/cm_jsoncpp_value.h => Source/cmCurl.h | 15 +++--- Source/cmFileCommand.cxx | 9 ++-- Utilities/cmcurl/CMakeLists.txt | 9 ++-- Utilities/cmcurl/lib/curl_config.h.cmake | 6 --- 10 files changed, 107 insertions(+), 26 deletions(-) create mode 100644 Help/release/dev/curl-default-cainfo.rst create mode 100644 Source/cmCurl.cxx copy Utilities/cm_jsoncpp_value.h => Source/cmCurl.h (71%) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 16:52:03 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 16:52:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2251-gd3dad49 Message-ID: <20150122215203.B0AE0A92CD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d3dad494c00f64119c702440670e366a64b82554 (commit) via dadb104e12a803e1efd435712f59446675e86b6f (commit) from 9ebdc29f1d380cb37aacf99aded77aea76ac0f79 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3dad494c00f64119c702440670e366a64b82554 commit d3dad494c00f64119c702440670e366a64b82554 Merge: 9ebdc29 dadb104 Author: Brad King AuthorDate: Thu Jan 22 16:52:02 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 16:52:02 2015 -0500 Merge topic 'ninja-generate-outputs' into next dadb104e ninja: Add case to cover try_compile and configure_file CMake re-runs http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dadb104e12a803e1efd435712f59446675e86b6f commit dadb104e12a803e1efd435712f59446675e86b6f Author: Brad King AuthorDate: Thu Jan 22 16:40:41 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 16:49:48 2015 -0500 ninja: Add case to cover try_compile and configure_file CMake re-runs Extend the RunCMake.Configure test for the Ninja generator to cover re-running CMake when try_compile/configure_file inputs change or when the configure_file output is missing. diff --git a/Tests/RunCMake/Configure/NinjaRerunCMake-nowork-stdout.txt b/Tests/RunCMake/Configure/NinjaRerunCMake-nowork-stdout.txt new file mode 100644 index 0000000..76f3cb7 --- /dev/null +++ b/Tests/RunCMake/Configure/NinjaRerunCMake-nowork-stdout.txt @@ -0,0 +1 @@ +^ninja: no work to do.$ diff --git a/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stderr.txt b/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stderr.txt new file mode 100644 index 0000000..3510266 --- /dev/null +++ b/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stderr.txt @@ -0,0 +1 @@ +^FALSE$ diff --git a/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stdout.txt b/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stdout.txt new file mode 100644 index 0000000..f6e9e57 --- /dev/null +++ b/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stdout.txt @@ -0,0 +1,3 @@ +^\[1/1\] Re-running CMake\.\.\. +.* +ninja: no work to do.$ diff --git a/Tests/RunCMake/Configure/NinjaRerunCMake-stderr.txt b/Tests/RunCMake/Configure/NinjaRerunCMake-stderr.txt new file mode 100644 index 0000000..2093e5f --- /dev/null +++ b/Tests/RunCMake/Configure/NinjaRerunCMake-stderr.txt @@ -0,0 +1 @@ +^TRUE$ diff --git a/Tests/RunCMake/Configure/NinjaRerunCMake.cmake b/Tests/RunCMake/Configure/NinjaRerunCMake.cmake new file mode 100644 index 0000000..69b269b --- /dev/null +++ b/Tests/RunCMake/Configure/NinjaRerunCMake.cmake @@ -0,0 +1,11 @@ +enable_language(C) +configure_file( + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in" + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt" + @ONLY + ) +try_compile(res + "${CMAKE_CURRENT_BINARY_DIR}" + SOURCES "${CMAKE_CURRENT_BINARY_DIR}/TryCompileInput.c" + ) +message("${res}") diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake index 58e1a2a..8fa7a09 100644 --- a/Tests/RunCMake/Configure/RunCMakeTest.cmake +++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake @@ -23,3 +23,41 @@ file(WRITE "${depend}" "2") run_cmake_command(RerunCMake-build2 ${CMAKE_COMMAND} --build .) unset(RunCMake_TEST_BINARY_DIR) unset(RunCMake_TEST_NO_CLEAN) + +if(RunCMake_GENERATOR STREQUAL "Ninja") + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/NinjaRerunCMake-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + set(in_conf "${RunCMake_TEST_BINARY_DIR}/ConfigureFileInput.txt.in") + file(WRITE "${in_conf}" "1") + set(in_tc "${RunCMake_TEST_BINARY_DIR}/TryCompileInput.c") + file(WRITE "${in_tc}" "int main(void) { return 0; }\n") + + # Force NINJA_STATUS to be a certain style to not break the regex. + set(ENV{NINJA_STATUS} "[%s/%t] ") + + message(STATUS "NinjaRerunCMake - First configuration:") + run_cmake(NinjaRerunCMake) + run_cmake_command(NinjaRerunCMake-nowork ${CMAKE_COMMAND} --build .) + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution + message(STATUS "NinjaRerunCMake - Modify try_compile input:") + file(WRITE "${in_tc}" "does-not-compile\n") + run_cmake_command(NinjaRerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(NinjaRerunCMake-nowork ${CMAKE_COMMAND} --build .) + + message(STATUS "NinjaRerunCMake - Remove configure_file output:") + file(REMOVE "${RunCMake_TEST_BINARY_DIR}/ConfigureFileOutput.txt") + run_cmake_command(NinjaRerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(NinjaRerunCMake-nowork ${CMAKE_COMMAND} --build .) + + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution + message(STATUS "NinjaRerunCMake - Modify configure_file input:") + file(WRITE "${in_conf}" "2") + run_cmake_command(NinjaRerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(NinjaRerunCMake-nowork ${CMAKE_COMMAND} --build .) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) +endif() ----------------------------------------------------------------------- Summary of changes: .../Configure/NinjaRerunCMake-nowork-stdout.txt | 1 + .../NinjaRerunCMake-rerun-stderr.txt} | 0 .../Configure/NinjaRerunCMake-rerun-stdout.txt | 3 ++ .../RunCMake/Configure/NinjaRerunCMake-stderr.txt | 1 + Tests/RunCMake/Configure/NinjaRerunCMake.cmake | 11 ++++++ Tests/RunCMake/Configure/RunCMakeTest.cmake | 38 ++++++++++++++++++++ 6 files changed, 54 insertions(+) create mode 100644 Tests/RunCMake/Configure/NinjaRerunCMake-nowork-stdout.txt copy Tests/RunCMake/{ninja/init-stderr.txt => Configure/NinjaRerunCMake-rerun-stderr.txt} (100%) create mode 100644 Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stdout.txt create mode 100644 Tests/RunCMake/Configure/NinjaRerunCMake-stderr.txt create mode 100644 Tests/RunCMake/Configure/NinjaRerunCMake.cmake hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 16:55:04 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 16:55:04 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2253-gd12f442 Message-ID: <20150122215504.2A838A9F68@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d12f442c9453cdde4f95f708447bf77a9e87debd (commit) via 5105b55967fd6c58e7fe7f58ec5589eb151d48f4 (commit) from d3dad494c00f64119c702440670e366a64b82554 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d12f442c9453cdde4f95f708447bf77a9e87debd commit d12f442c9453cdde4f95f708447bf77a9e87debd Merge: d3dad49 5105b55 Author: Brad King AuthorDate: Thu Jan 22 16:55:03 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 16:55:03 2015 -0500 Merge topic 'curl-default-cainfo' into next 5105b559 Revert topic 'curl-default-cainfo' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5105b55967fd6c58e7fe7f58ec5589eb151d48f4 commit 5105b55967fd6c58e7fe7f58ec5589eb151d48f4 Author: Brad King AuthorDate: Thu Jan 22 16:54:37 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 16:54:45 2015 -0500 Revert topic 'curl-default-cainfo' It fails to build on some machines and needs to be revised. diff --git a/CMakeLists.txt b/CMakeLists.txt index 28fd02f..bdc160d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,13 +287,6 @@ macro (CMAKE_BUILD_UTILITIES) if(CMAKE_TESTS_CDASH_SERVER) set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php") endif() - option(CMAKE_USE_OPENSSL "Use OpenSSL." OFF) - mark_as_advanced(CMAKE_USE_OPENSSL) - if(CMAKE_USE_OPENSSL) - set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle") - set(CURL_CA_PATH "" CACHE PATH "Path to SSL CA Certificate Directory") - mark_as_advanced(CURL_CA_BUNDLE CURL_CA_PATH) - endif() add_subdirectory(Utilities/cmcurl) CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty") diff --git a/Help/release/dev/curl-default-cainfo.rst b/Help/release/dev/curl-default-cainfo.rst deleted file mode 100644 index ed45d36..0000000 --- a/Help/release/dev/curl-default-cainfo.rst +++ /dev/null @@ -1,8 +0,0 @@ -curl-default-cainfo -------------------- - -* When CMake is built with OpenSSL on systems other than Windows - and OS X, commands supporting network communication via ``https``, - such as :command:`file(DOWNLOAD)`, :command:`file(UPLOAD)`, and - :command:`ctest_submit`, now search for OS-configured certificate - authorities in a few ``/etc`` paths to be trusted automatically. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 07839f3..c04cf9a 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -175,8 +175,6 @@ set(SRCS cmCPackPropertiesGenerator.cxx cmCryptoHash.cxx cmCryptoHash.h - cmCurl.cxx - cmCurl.h cmCustomCommand.cxx cmCustomCommand.h cmCustomCommandGenerator.cxx @@ -499,12 +497,6 @@ if(WIN32 AND NOT CYGWIN) install(TARGETS cmcldeps DESTINATION bin) endif() -foreach(v CURL_CA_BUNDLE CURL_CA_PATH) - if(${v}) - set_property(SOURCE cmCurl.cxx APPEND PROPERTY COMPILE_DEFINITIONS ${v}="${${v}}") - endif() -endforeach() - # create a library used by the command line and the GUI add_library(CMakeLib ${SRCS}) target_link_libraries(CMakeLib cmsys diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 3d9545f..11e3343 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -26,7 +26,7 @@ #include // For curl submission -#include "cmCurl.h" +#include "cm_curl.h" #include "cmCTestCurl.h" #include @@ -366,7 +366,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, curl = curl_easy_init(); if(curl) { - cmCurlSetCAInfo(curl); if(verifyPeerOff) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 7968608..1ef4c92 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -9,6 +9,8 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ +#include "cm_curl.h" + #include "cmCTest.h" #include "cmake.h" #include "cmMakefile.h" @@ -24,7 +26,6 @@ #include "cmVersionMacros.h" #include "cmCTestCommand.h" #include "cmCTestStartCommand.h" -#include "cmCurl.h" #include "cmCTestBuildHandler.h" #include "cmCTestBuildAndTestHandler.h" @@ -191,7 +192,6 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method, FILE* file; ::curl_global_init(CURL_GLOBAL_ALL); curl = ::curl_easy_init(); - cmCurlSetCAInfo(curl); //set request options based on method switch(method) diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx deleted file mode 100644 index 96d3547..0000000 --- a/Source/cmCurl.cxx +++ /dev/null @@ -1,64 +0,0 @@ -/*============================================================================ - 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. -============================================================================*/ -#include "cmCurl.h" -#include "cmSystemTools.h" - -#define check_curl_result(result, errstr) \ - if (result != CURLE_OK) \ - { \ - e += e.empty()? "" : "\n"; \ - e += errstr; \ - e += ::curl_easy_strerror(result); \ - } - -//---------------------------------------------------------------------------- -std::string cmCurlSetCAInfo(::CURL *curl, const char* cafile) -{ - std::string e; - if(cafile && *cafile) - { - ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile); - check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); - } -#if !defined(CMAKE_USE_SYSTEM_CURL) && \ - !defined(_WIN32) && !defined(__APPLE__) && \ - !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH) -# define CMAKE_CAFILE_FEDORA "/etc/pki/tls/certs/ca-bundle.crt" - else if(cmSystemTools::FileExists(CMAKE_CAFILE_FEDORA, true)) - { - ::CURLcode res = - ::curl_easy_setopt(curl, CURLOPT_CAINFO, CMAKE_CAFILE_FEDORA); - check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); - } -# undef CMAKE_CAFILE_FEDORA - else - { -# define CMAKE_CAFILE_COMMON "/etc/ssl/certs/ca-certificates.crt" - if(cmSystemTools::FileExists(CMAKE_CAFILE_COMMON, true)) - { - ::CURLcode res = - ::curl_easy_setopt(curl, CURLOPT_CAINFO, CMAKE_CAFILE_COMMON); - check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); - } -# undef CMAKE_CAFILE_COMMON -# define CMAKE_CAPATH_COMMON "/etc/ssl/certs" - if(cmSystemTools::FileIsDirectory(CMAKE_CAPATH_COMMON)) - { - ::CURLcode res = - ::curl_easy_setopt(curl, CURLOPT_CAPATH, CMAKE_CAPATH_COMMON); - check_curl_result(res, "Unable to set TLS/SSL Verify CAPATH: "); - } -# undef CMAKE_CAPATH_COMMON - } -#endif - return e; -} diff --git a/Source/cmCurl.h b/Source/cmCurl.h deleted file mode 100644 index 25d74ae..0000000 --- a/Source/cmCurl.h +++ /dev/null @@ -1,22 +0,0 @@ -/*============================================================================ - 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 cmCurl_h -#define cmCurl_h - -#include "cmStandardIncludes.h" - -#ifdef CMAKE_BUILD_WITH_CMAKE -# include "cm_curl.h" -std::string cmCurlSetCAInfo(::CURL *curl, const char* cafile = 0); -#endif - -#endif diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index f125292..2c92db2 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -20,7 +20,7 @@ #include "cmTimestamp.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmCurl.h" +#include "cm_curl.h" #include "cmFileLockResult.h" #endif @@ -3068,11 +3068,10 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) } // check to see if a CAINFO file has been specified // command arg comes first - std::string const& cainfo_err = cmCurlSetCAInfo(curl, cainfo); - if (!cainfo_err.empty()) + if(cainfo && *cainfo) { - this->SetError(cainfo_err); - return false; + res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cainfo); + check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); } cmFileCommandVectorOfChar chunkDebug; diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index 08bdff5..0db741e 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -425,6 +425,9 @@ endif() #----------------------------------------------------------------------------- +option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" OFF) +mark_as_advanced(CMAKE_USE_OPENSSL) + set(USE_SSLEAY OFF) set(USE_OPENSSL OFF) set(HAVE_LIBCRYPTO OFF) @@ -451,13 +454,11 @@ if(CMAKE_USE_OPENSSL) check_include_file("openssl/rand.h" HAVE_OPENSSL_RAND_H) # Optionally build with a specific CA cert bundle. + set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle") + mark_as_advanced(CURL_CA_BUNDLE) if(CURL_CA_BUNDLE) add_definitions(-DCURL_CA_BUNDLE="${CURL_CA_BUNDLE}") endif() - # Optionally build with a specific CA cert dir. - if(CURL_CA_PATH) - add_definitions(-DCURL_CA_PATH="${CURL_CA_PATH}") - endif() endif(OPENSSL_FOUND) elseif(WIN32) # Use Windows SSL/TLS native implementation. diff --git a/Utilities/cmcurl/lib/curl_config.h.cmake b/Utilities/cmcurl/lib/curl_config.h.cmake index a561c3d..b5db3b6 100644 --- a/Utilities/cmcurl/lib/curl_config.h.cmake +++ b/Utilities/cmcurl/lib/curl_config.h.cmake @@ -3,6 +3,12 @@ /* when building libcurl itself */ #cmakedefine BUILDING_LIBCURL 1 +/* Location of default ca bundle */ +#cmakedefine CURL_CA_BUNDLE ${CURL_CA_BUNDLE} + +/* Location of default ca path */ +#cmakedefine CURL_CA_PATH ${CURL_CA_PATH} + /* to disable cookies support */ #cmakedefine CURL_DISABLE_COOKIES 1 ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 7 ---- Help/release/dev/curl-default-cainfo.rst | 8 ---- Source/CMakeLists.txt | 8 ---- Source/CTest/cmCTestSubmitHandler.cxx | 3 +- Source/cmCTest.cxx | 4 +- Source/cmCurl.cxx | 64 ------------------------------ Source/cmCurl.h | 22 ---------- Source/cmFileCommand.cxx | 9 ++--- Utilities/cmcurl/CMakeLists.txt | 9 +++-- Utilities/cmcurl/lib/curl_config.h.cmake | 6 +++ 10 files changed, 18 insertions(+), 122 deletions(-) delete mode 100644 Help/release/dev/curl-default-cainfo.rst delete mode 100644 Source/cmCurl.cxx delete mode 100644 Source/cmCurl.h hooks/post-receive -- CMake From steveire at gmail.com Thu Jan 22 18:17:07 2015 From: steveire at gmail.com (Stephen Kelly) Date: Thu, 22 Jan 2015 18:17:07 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2256-g73637b8 Message-ID: <20150122231707.874E8A95A2@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 73637b85b622bda8d327a19be52e4ba0947f5cc6 (commit) via 85857e6d1c1859bdc8ab4206e0329e846b6ef020 (commit) via ee38062be8ccdb7f4c53156ef00db0d42a41a6a7 (commit) from d12f442c9453cdde4f95f708447bf77a9e87debd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=73637b85b622bda8d327a19be52e4ba0947f5cc6 commit 73637b85b622bda8d327a19be52e4ba0947f5cc6 Merge: d12f442 85857e6 Author: Stephen Kelly AuthorDate: Thu Jan 22 18:17:06 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 18:17:06 2015 -0500 Merge topic 'INTERFACE_SYSTEM_INCLUDE_DIRECTORIES-update' into next 85857e6d Help: Clarify INTERFACE_SYSTEM_INCLUDE_DIRECTORIES documentation. ee38062b IncludeDirectories: Respect SYSTEM flag when using CONFIG genex. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85857e6d1c1859bdc8ab4206e0329e846b6ef020 commit 85857e6d1c1859bdc8ab4206e0329e846b6ef020 Author: Stephen Kelly AuthorDate: Fri Jan 23 00:14:32 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 23 00:15:02 2015 +0100 Help: Clarify INTERFACE_SYSTEM_INCLUDE_DIRECTORIES documentation. diff --git a/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst index b54b6c1..a0a97ad 100644 --- a/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst @@ -7,8 +7,15 @@ Targets may populate this property to publish the include directories which contain system headers, and therefore should not result in compiler warnings. The :command:`target_include_directories(SYSTEM)` command signature populates this property with values given to the -``PUBLIC`` and ``INTERFACE`` keywords. Projects may also get and set the -property directly. +``PUBLIC`` and ``INTERFACE`` keywords. + +Projects may also get and set the property directly, but must be aware that +adding directories to this property does not make those directories used +during compilation. Adding directories to this property marks directories +as ``SYSTEM`` which otherwise would be used in a non-``SYSTEM`` manner. This +can appear similar to 'duplication', so prefer the +high-level :command:`target_include_directories(SYSTEM)` command and avoid +setting the property by low-level means. When target dependencies are specified using :command:`target_link_libraries`, CMake will read this property from all target dependencies to mark the http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ee38062be8ccdb7f4c53156ef00db0d42a41a6a7 commit ee38062be8ccdb7f4c53156ef00db0d42a41a6a7 Author: Stephen Kelly AuthorDate: Thu Jan 22 23:40:27 2015 +0100 Commit: Stephen Kelly CommitDate: Fri Jan 23 00:08:18 2015 +0100 IncludeDirectories: Respect SYSTEM flag when using CONFIG genex. Update the Makefile and Ninja generators to use the config when requesting the include flags. diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index f8471fd..7ed0c10 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1870,7 +1870,8 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags, std::string includeFlags = this->LocalGenerator->GetIncludeFlags(includes, this->GeneratorTarget, - lang, false, useResponseFile); + lang, false, useResponseFile, + config); if(includeFlags.empty()) { return; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index c019ceb..67824c6 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -170,8 +170,10 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source, std::string includeFlags = this->LocalGenerator->GetIncludeFlags(includes, this->GeneratorTarget, language, - language == "RC" ? true : false); // full include paths for RC + language == "RC" ? true : false, // full include paths for RC // needed by cmcldeps + false, + this->GetConfigName()); if(cmGlobalNinjaGenerator::IsMinGW()) cmSystemTools::ReplaceString(includeFlags, "\\", "/"); diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt index abe9f74..0215e93 100644 --- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt @@ -14,8 +14,14 @@ target_include_directories(upstream SYSTEM PUBLIC $ ) +add_library(config_specific INTERFACE) +set(testConfig ${CMAKE_BUILD_TYPE}) +target_include_directories(config_specific SYSTEM INTERFACE + "$<$:${CMAKE_CURRENT_SOURCE_DIR}/config_specific>" +) + add_library(consumer consumer.cpp) -target_link_libraries(consumer upstream) +target_link_libraries(consumer upstream config_specific) target_compile_options(consumer PRIVATE -Werror=unused-variable) add_library(iface IMPORTED INTERFACE) diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h b/Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h new file mode 100644 index 0000000..05d3604 --- /dev/null +++ b/Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h @@ -0,0 +1,14 @@ + +#ifndef CONFIG_IFACE_H +#define CONFIG_IFACE_H + +#ifdef _WIN32 +__declspec(dllexport) +#endif +int configUnusedFunc() +{ + int unused; + return 0; +} + +#endif diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp b/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp index 197dae8..be18ebf 100644 --- a/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp +++ b/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp @@ -1,6 +1,8 @@ #include "upstream.h" +#include "config_iface.h" + int consumer() { return upstream(); ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst | 11 +++++++++-- Source/cmMakefileTargetGenerator.cxx | 3 ++- Source/cmNinjaTargetGenerator.cxx | 4 +++- .../SystemIncludeDirectories/CMakeLists.txt | 8 +++++++- .../config_specific/config_iface.h | 14 ++++++++++++++ .../SystemIncludeDirectories/consumer.cpp | 2 ++ 6 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 19:33:20 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 19:33:20 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2258-g1cb31f7 Message-ID: <20150123003321.85A30AA320@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 1cb31f76cf50ca5c734fa86483d8bfdbf984b647 (commit) via 40b69ceab5e3d0eb6dcbd48837af6213290609f5 (commit) from 73637b85b622bda8d327a19be52e4ba0947f5cc6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1cb31f76cf50ca5c734fa86483d8bfdbf984b647 commit 1cb31f76cf50ca5c734fa86483d8bfdbf984b647 Merge: 73637b8 40b69ce Author: Brad King AuthorDate: Thu Jan 22 19:33:13 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 19:33:13 2015 -0500 Merge topic 'if-test' into next 40b69cea Revert topic 'if-test' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=40b69ceab5e3d0eb6dcbd48837af6213290609f5 commit 40b69ceab5e3d0eb6dcbd48837af6213290609f5 Author: Brad King AuthorDate: Thu Jan 22 19:32:17 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 19:32:28 2015 -0500 Revert topic 'if-test' Making TEST a keyword in if() can break existing code that expects it to act like a string or variable. diff --git a/Help/command/if.rst b/Help/command/if.rst index 93ff6d3..79e5d21 100644 --- a/Help/command/if.rst +++ b/Help/command/if.rst @@ -70,10 +70,6 @@ Possible expressions are: created by the :command:`add_executable`, :command:`add_library`, or :command:`add_custom_target` commands. -``if(TEST test-name)`` - True if the given name is an existing test name created by the - :command:`add_test` command. - ``if(EXISTS path-to-file-or-directory)`` True if the named file or directory exists. Behavior is well-defined only for full paths. diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx index 29a71c7..aba26de 100644 --- a/Source/cmConditionEvaluator.cxx +++ b/Source/cmConditionEvaluator.cxx @@ -507,14 +507,6 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList &newArgs, this->Makefile.FindTargetToUse(argP1->GetValue())?true:false, reducible, arg, newArgs, argP1, argP2); } - // does a test exist - if (this->IsKeyword("TEST", *arg) && argP1 != newArgs.end()) - { - const cmTest* haveTest = this->Makefile.GetTest(argP1->c_str()); - this->HandlePredicate( - haveTest?true:false, - reducible, arg, newArgs, argP1, argP2); - } // is a variable defined if (this->IsKeyword("DEFINED", *arg) && argP1 != newArgs.end()) { diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index bbd5878..bf23d4a 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -21,7 +21,7 @@ if(TARGET NotATarget) message(FATAL_ERROR "if(TARGET NotATarget) returned true!") endif() -# Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to + # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) link_libraries(${COMPLEX_LIBS}) diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake b/Tests/RunCMake/if/RunCMakeTest.cmake index 9db79e9..6b6b74b 100644 --- a/Tests/RunCMake/if/RunCMakeTest.cmake +++ b/Tests/RunCMake/if/RunCMakeTest.cmake @@ -2,6 +2,3 @@ include(RunCMake) run_cmake(IsDirectory) run_cmake(IsDirectoryLong) - -run_cmake(TestNameThatExists) -run_cmake(TestNameThatDoesNotExist) diff --git a/Tests/RunCMake/if/TestNameThatDoesNotExist-stdout.txt b/Tests/RunCMake/if/TestNameThatDoesNotExist-stdout.txt deleted file mode 100644 index 8874ca8..0000000 --- a/Tests/RunCMake/if/TestNameThatDoesNotExist-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -TestThatDoesNotExist is false diff --git a/Tests/RunCMake/if/TestNameThatDoesNotExist.cmake b/Tests/RunCMake/if/TestNameThatDoesNotExist.cmake deleted file mode 100644 index 68ad6e3..0000000 --- a/Tests/RunCMake/if/TestNameThatDoesNotExist.cmake +++ /dev/null @@ -1,5 +0,0 @@ -if(TEST TestThatDoesNotExist) - message(FATAL_ERROR "if TestThatDoesNotExist is true") -else() - message(STATUS "if TestThatDoesNotExist is false") -endif() diff --git a/Tests/RunCMake/if/TestNameThatExists-stdout.txt b/Tests/RunCMake/if/TestNameThatExists-stdout.txt deleted file mode 100644 index 54911bc..0000000 --- a/Tests/RunCMake/if/TestNameThatExists-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -TestThatExists is true diff --git a/Tests/RunCMake/if/TestNameThatExists.cmake b/Tests/RunCMake/if/TestNameThatExists.cmake deleted file mode 100644 index e03e148..0000000 --- a/Tests/RunCMake/if/TestNameThatExists.cmake +++ /dev/null @@ -1,6 +0,0 @@ -add_test(NAME TestThatExists COMMAND ${CMAKE_COMMAND} -E echo "A CMake Test") -if(TEST TestThatExists) - message(STATUS "if TestThatExists is true") -else() - message(FATAL_ERROR "if TestThatExists is false") -endif() ----------------------------------------------------------------------- Summary of changes: Help/command/if.rst | 4 ---- Source/cmConditionEvaluator.cxx | 8 -------- Tests/Complex/Executable/CMakeLists.txt | 2 +- Tests/RunCMake/if/RunCMakeTest.cmake | 3 --- Tests/RunCMake/if/TestNameThatDoesNotExist-stdout.txt | 1 - Tests/RunCMake/if/TestNameThatDoesNotExist.cmake | 5 ----- Tests/RunCMake/if/TestNameThatExists-stdout.txt | 1 - Tests/RunCMake/if/TestNameThatExists.cmake | 6 ------ 8 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 Tests/RunCMake/if/TestNameThatDoesNotExist-stdout.txt delete mode 100644 Tests/RunCMake/if/TestNameThatDoesNotExist.cmake delete mode 100644 Tests/RunCMake/if/TestNameThatExists-stdout.txt delete mode 100644 Tests/RunCMake/if/TestNameThatExists.cmake hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 22 19:35:17 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 22 Jan 2015 19:35:17 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2260-g688d06a Message-ID: <20150123003518.CD7F9AA3E1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 688d06a039b3c1a3305bd73922e74d3f5eb3c5a2 (commit) via 9ab1060cf6496a63c33f767faa9ae208331fe1fe (commit) from 1cb31f76cf50ca5c734fa86483d8bfdbf984b647 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=688d06a039b3c1a3305bd73922e74d3f5eb3c5a2 commit 688d06a039b3c1a3305bd73922e74d3f5eb3c5a2 Merge: 1cb31f7 9ab1060 Author: Brad King AuthorDate: Thu Jan 22 19:35:16 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 19:35:16 2015 -0500 Merge topic 'if-test' into next 9ab1060c Tests: Restore Complex test change removed by topic conflict http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9ab1060cf6496a63c33f767faa9ae208331fe1fe commit 9ab1060cf6496a63c33f767faa9ae208331fe1fe Author: Brad King AuthorDate: Thu Jan 22 19:35:08 2015 -0500 Commit: Brad King CommitDate: Thu Jan 22 19:35:08 2015 -0500 Tests: Restore Complex test change removed by topic conflict diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index bf23d4a..bbd5878 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -21,7 +21,7 @@ if(TARGET NotATarget) message(FATAL_ERROR "if(TARGET NotATarget) returned true!") endif() - # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to +# Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) link_libraries(${COMPLEX_LIBS}) ----------------------------------------------------------------------- Summary of changes: Tests/Complex/Executable/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From matt.mccormick at kitware.com Thu Jan 22 19:54:19 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 22 Jan 2015 19:54:19 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2263-gf682e2a Message-ID: <20150123005421.34394A9E03@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f682e2a20b69b8bb1113ea25e907b03dd3fe4ba5 (commit) via 444a7331ef2da0270a1c2fef7eb16fbdea4c3976 (commit) via 78831279eade5a1e6490be244fc19b26d34366f1 (commit) from 688d06a039b3c1a3305bd73922e74d3f5eb3c5a2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f682e2a20b69b8bb1113ea25e907b03dd3fe4ba5 commit f682e2a20b69b8bb1113ea25e907b03dd3fe4ba5 Merge: 688d06a 444a733 Author: Matt McCormick AuthorDate: Thu Jan 22 19:54:07 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 22 19:54:07 2015 -0500 Merge topic 'try-run-link-libraries' into next 444a7331 try_run: Add tests for LINK_LIBRARIES with mock libraries. 78831279 try_run: Add test for bad link libraries. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=444a7331ef2da0270a1c2fef7eb16fbdea4c3976 commit 444a7331ef2da0270a1c2fef7eb16fbdea4c3976 Author: Matt McCormick AuthorDate: Thu Jan 22 19:53:16 2015 -0500 Commit: Matt McCormick CommitDate: Thu Jan 22 19:53:16 2015 -0500 try_run: Add tests for LINK_LIBRARIES with mock libraries. diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 9450c82..d64e917 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -311,6 +311,21 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA message(SEND_ERROR "EXP_ERROR_VARIABLE try_compile failed, but it was expected to succeed ${OUTPUT}.") endif() + if(NOT CMAKE_CROSSCOMPILING) + unset(EXP_RUN_VAR CACHE) + unset(EXP_COMPILE_VAR CACHE) + try_run(EXP_RUN_VAR EXP_COMPILE_VAR + "${CMAKE_CURRENT_SOURCE_DIR}/test_system" + "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp" + COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable" + LINK_LIBRARIES exp_systemlib + OUTPUT_VARIABLE OUTPUT + ) + if(NOT EXP_COMPILE_VAR OR NOT EXP_RUN_VAR EQUAL 0) + message(SEND_ERROR "try_run failed, but it was expected to succeed ${OUTPUT}.") + endif() + endif() + add_executable(test_system_bld test_system.cpp) target_link_libraries(test_system_bld bld_systemlib) target_compile_options(test_system_bld PRIVATE -Wunused-variable -Werror=unused-variable) @@ -326,5 +341,20 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA if(NOT BLD_ERROR_VARIABLE) message(SEND_ERROR "BLD_ERROR_VARIABLE try_compile failed, but it was expected to succeed.") endif() + + if(NOT CMAKE_CROSSCOMPILING) + unset(BLD_RUN_VAR CACHE) + unset(BLD_COMPILE_VAR CACHE) + try_run(BLD_RUN_VAR BLD_COMPILE_VAR + "${CMAKE_CURRENT_SOURCE_DIR}/test_system" + "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp" + COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable" + LINK_LIBRARIES bld_systemlib + OUTPUT_VARIABLE OUTPUT + ) + if(NOT BLD_COMPILE_VAR OR NOT BLD_RUN_VAR EQUAL 0) + message(SEND_ERROR "try_run failed, but it was expected to succeed ${OUTPUT}.") + endif() + endif() endif() endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78831279eade5a1e6490be244fc19b26d34366f1 commit 78831279eade5a1e6490be244fc19b26d34366f1 Author: Matt McCormick AuthorDate: Thu Jan 22 19:13:56 2015 -0500 Commit: Matt McCormick CommitDate: Thu Jan 22 19:14:32 2015 -0500 try_run: Add test for bad link libraries. Based off the corresponding try_compile test. diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 0030b84..2f58d96 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -109,7 +109,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) } default: this->Makefile->IssueMessage(cmake::FATAL_ERROR, - "Only libraries may be used as try_compile IMPORTED " + "Only libraries may be used as try_compile or try_run IMPORTED " "LINK_LIBRARIES. Got " + std::string(tgt->GetName()) + " of " "type " + tgt->GetTargetTypeName(tgt->GetType()) + "."); return -1; diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index b5e41d9..78d375e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -130,6 +130,7 @@ add_RunCMake_test(project) add_RunCMake_test(return) add_RunCMake_test(string) add_RunCMake_test(try_compile) +add_RunCMake_test(try_run) add_RunCMake_test(set) add_RunCMake_test(variable_watch) add_RunCMake_test(CMP0004) diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt index eceffec..652bcfc 100644 --- a/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt +++ b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt @@ -1,5 +1,5 @@ CMake Error at BadLinkLibraries.cmake:2 \(try_compile\): - Only libraries may be used as try_compile IMPORTED LINK_LIBRARIES. Got - not_a_library of type UTILITY. + Only libraries may be used as try_compile or try_run IMPORTED + LINK_LIBRARIES. Got not_a_library of type UTILITY. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_run/BadLinkLibraries-result.txt b/Tests/RunCMake/try_run/BadLinkLibraries-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_run/BadLinkLibraries-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt b/Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt new file mode 100644 index 0000000..dcd1bfc --- /dev/null +++ b/Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at BadLinkLibraries.cmake:2 \(try_run\): + Only libraries may be used as try_compile or try_run IMPORTED + LINK_LIBRARIES. Got not_a_library of type UTILITY. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_run/BadLinkLibraries.cmake b/Tests/RunCMake/try_run/BadLinkLibraries.cmake new file mode 100644 index 0000000..a124bf6 --- /dev/null +++ b/Tests/RunCMake/try_run/BadLinkLibraries.cmake @@ -0,0 +1,4 @@ +add_custom_target(not_a_library) +try_run(RUN_RESULT COMPILE_RESULT + ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c + LINK_LIBRARIES not_a_library) diff --git a/Tests/RunCMake/try_run/CMakeLists.txt b/Tests/RunCMake/try_run/CMakeLists.txt new file mode 100644 index 0000000..e034780 --- /dev/null +++ b/Tests/RunCMake/try_run/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.0) +project(${RunCMake_TEST} C) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/try_run/RunCMakeTest.cmake b/Tests/RunCMake/try_run/RunCMakeTest.cmake new file mode 100644 index 0000000..1ec9a55 --- /dev/null +++ b/Tests/RunCMake/try_run/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(BadLinkLibraries) diff --git a/Tests/RunCMake/try_run/src.c b/Tests/RunCMake/try_run/src.c new file mode 100644 index 0000000..78f2de1 --- /dev/null +++ b/Tests/RunCMake/try_run/src.c @@ -0,0 +1 @@ +int main(void) { return 0; } ----------------------------------------------------------------------- Summary of changes: Source/cmCoreTryCompile.cxx | 2 +- Tests/ExportImport/Import/A/CMakeLists.txt | 30 ++++++++++++++++++++ Tests/RunCMake/CMakeLists.txt | 1 + .../try_compile/BadLinkLibraries-stderr.txt | 4 +-- .../BadLinkLibraries-result.txt} | 0 Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt | 5 ++++ Tests/RunCMake/try_run/BadLinkLibraries.cmake | 4 +++ .../{ObjectLibrary => try_run}/CMakeLists.txt | 2 +- Tests/RunCMake/try_run/RunCMakeTest.cmake | 3 ++ Tests/RunCMake/{try_compile => try_run}/src.c | 0 10 files changed, 47 insertions(+), 4 deletions(-) copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => try_run/BadLinkLibraries-result.txt} (100%) create mode 100644 Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt create mode 100644 Tests/RunCMake/try_run/BadLinkLibraries.cmake copy Tests/RunCMake/{ObjectLibrary => try_run}/CMakeLists.txt (61%) create mode 100644 Tests/RunCMake/try_run/RunCMakeTest.cmake copy Tests/RunCMake/{try_compile => try_run}/src.c (100%) hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jan 23 00:01:22 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 23 Jan 2015 00:01:22 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-874-gc99e19a Message-ID: <20150123050122.C1B28A9FD1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via c99e19a4ac7e6e55345a073b13c36befaa8702d8 (commit) from 98bf613cd09e2187fa5002dac06e63d5450dbcf0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c99e19a4ac7e6e55345a073b13c36befaa8702d8 commit c99e19a4ac7e6e55345a073b13c36befaa8702d8 Author: Kitware Robot AuthorDate: Fri Jan 23 00:01:16 2015 -0500 Commit: Kitware Robot CommitDate: Fri Jan 23 00:01:16 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 2f4cb8a..25cde98 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 20150122) +set(CMake_VERSION_PATCH 20150123) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 08:34:24 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 08:34:24 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2265-gd07f9d2 Message-ID: <20150123133424.E1C31AAA56@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d07f9d28f1d7d552e5a42dd7bdd3a91856375e5c (commit) via 36f93b606c4a14efdccee80b6a6a738f6795408c (commit) from f682e2a20b69b8bb1113ea25e907b03dd3fe4ba5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d07f9d28f1d7d552e5a42dd7bdd3a91856375e5c commit d07f9d28f1d7d552e5a42dd7bdd3a91856375e5c Merge: f682e2a 36f93b6 Author: Brad King AuthorDate: Fri Jan 23 08:34:23 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 08:34:23 2015 -0500 Merge topic 'rpm_multi_prefix' into next 36f93b60 fixup! cpack rpm multiple path relocation prefixes http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=36f93b606c4a14efdccee80b6a6a738f6795408c commit 36f93b606c4a14efdccee80b6a6a738f6795408c Author: Domen Vrankar AuthorDate: Fri Jan 23 09:14:36 2015 +0100 Commit: Brad King CommitDate: Fri Jan 23 08:28:54 2015 -0500 fixup! cpack rpm multiple path relocation prefixes Relocatable prefix tests were failing on Fedora Linux distributions. diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt index ff40e30..b55594e 100644 --- a/Tests/CPackComponentsForAll/CMakeLists.txt +++ b/Tests/CPackComponentsForAll/CMakeLists.txt @@ -110,6 +110,12 @@ set(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Developer Full) set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) set(CPACK_COMPONENT_APPLICATIONS_INSTALL_TYPES Full) +# set CPACK_RPM_RELOCATION_PATHS here as GNUInstallDirs script +# can not be used in CPack scripts due to CMAKE_SIZEOF_VOID_P +# variable not being set +set(CPACK_RPM_RELOCATION_PATHS "${CMAKE_INSTALL_INCLUDEDIR}" + "${CMAKE_INSTALL_LIBDIR}" "${CMAKE_INSTALL_BINDIR}") + # We may use the CPack specific config file in order # to tailor CPack behavior on a CPack generator specific way # (Behavior would be different for RPM or TGZ or DEB ...) diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in index e597480..de0ee46 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -6,12 +6,7 @@ if(CPACK_GENERATOR MATCHES "ZIP") endif() if(CPACK_GENERATOR MATCHES "RPM") - # set gnu install prefixes - include(GNUInstallDirs) - set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") - set(CPACK_RPM_RELOCATION_PATHS "${CMAKE_INSTALL_INCLUDEDIR}" - "${CMAKE_INSTALL_LIBDIR}" "${CMAKE_INSTALL_BINDIR}") set(CPACK_RPM_COMPONENT_INSTALL "ON") set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index aeb7ebc..68d846f 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -141,6 +141,8 @@ if(CPackGen MATCHES "RPM") if(${CPackComponentWay} STREQUAL "IgnoreGroup") # set gnu install prefixes to what they are set during rpm creation + # CMAKE_SIZEOF_VOID_P is not set here but lib is prefix of lib64 so + # relocation path test won't fail on OSes with lib64 library location include(GNUInstallDirs) set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") diff --git a/Tests/CPackRPM/CMakeLists.txt b/Tests/CPackRPM/CMakeLists.txt index a951610..968f6d6 100644 --- a/Tests/CPackRPM/CMakeLists.txt +++ b/Tests/CPackRPM/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.1) +cmake_minimum_required(VERSION 3.1 FATAL_ERROR) project(CPackRPM) diff --git a/Tests/CPackRPM/RunCPack.cmake b/Tests/CPackRPM/RunCPack.cmake index 2547262..8bef611 100644 --- a/Tests/CPackRPM/RunCPack.cmake +++ b/Tests/CPackRPM/RunCPack.cmake @@ -1,13 +1,19 @@ +cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + file(MAKE_DIRECTORY "${dir}") +# run cmake +execute_process( + COMMAND "${CMAKE_CMAKE_COMMAND}" "${CMake_SOURCE_DIR}/Tests/CPackRPM" + WORKING_DIRECTORY "${dir}" + OUTPUT_QUIET) + +# package RPM execute_process( - COMMAND ${CMAKE_CMAKE_COMMAND} - "${CMake_SOURCE_DIR}/Tests/CPackRPM" COMMAND make package - RESULT_VARIABLE result - OUTPUT_VARIABLE stdout + WORKING_DIRECTORY "${dir}" ERROR_VARIABLE stderr - WORKING_DIRECTORY ${dir}) + OUTPUT_QUIET) # test for partial relocation warning if(NOT "${stderr}" MATCHES "CPackRPM:Warning: Path /not_relocatable/CMakeLists.txt is not on one of the.*relocatable paths! Package will be partially relocatable.") ----------------------------------------------------------------------- Summary of changes: Tests/CPackComponentsForAll/CMakeLists.txt | 6 ++++++ .../MyLibCPackConfig-IgnoreGroup.cmake.in | 5 ----- Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake | 2 ++ Tests/CPackRPM/CMakeLists.txt | 2 +- Tests/CPackRPM/RunCPack.cmake | 16 +++++++++++----- 5 files changed, 20 insertions(+), 11 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 09:03:49 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 09:03:49 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2267-ga1adb3a Message-ID: <20150123140349.A09BCAA7B8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a1adb3a956ac31b0494eebd69349d3c950e1a5a2 (commit) via b79d8f2934bc0dbe5f22fbb3ee709eb932baf3c6 (commit) from d07f9d28f1d7d552e5a42dd7bdd3a91856375e5c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a1adb3a956ac31b0494eebd69349d3c950e1a5a2 commit a1adb3a956ac31b0494eebd69349d3c950e1a5a2 Merge: d07f9d2 b79d8f2 Author: Brad King AuthorDate: Fri Jan 23 09:03:48 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 09:03:48 2015 -0500 Merge topic 'FeatureSummary-fix-doc-typo' into next b79d8f29 FeatureSummary: Fix bracket in documentation. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b79d8f2934bc0dbe5f22fbb3ee709eb932baf3c6 commit b79d8f2934bc0dbe5f22fbb3ee709eb932baf3c6 Author: Christoph Gr?ninger AuthorDate: Thu Jan 22 23:48:38 2015 +0100 Commit: Brad King CommitDate: Fri Jan 23 09:02:48 2015 -0500 FeatureSummary: Fix bracket in documentation. diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index 9016db8..3eea9db 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -40,7 +40,7 @@ # [FATAL_ON_MISSING_REQUIRED_PACKAGES] # [DESCRIPTION "Found packages:"] # WHAT (ALL | PACKAGES_FOUND | PACKAGES_NOT_FOUND -# | ENABLED_FEATURES | DISABLED_FEATURES] +# | ENABLED_FEATURES | DISABLED_FEATURES) # ) # # @@ -265,7 +265,7 @@ # Does the same as SET_PACKAGE_INFO( ) #============================================================================= -# Copyright 2007-2009 Kitware, Inc. +# Copyright 2007-2015 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. ----------------------------------------------------------------------- Summary of changes: Modules/FeatureSummary.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 09:16:41 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 09:16:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2271-gcda6e07 Message-ID: <20150123141641.B70F5A8E32@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via cda6e0784dbc387abf96a9b9ae1e3695aa3e7c17 (commit) via 0abd3e538eb92259e52c3d330e46dac7aa0be332 (commit) via 6ce346c53c67ba970cd04f0d8436aab006dbec71 (commit) via c99e19a4ac7e6e55345a073b13c36befaa8702d8 (commit) from a1adb3a956ac31b0494eebd69349d3c950e1a5a2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cda6e0784dbc387abf96a9b9ae1e3695aa3e7c17 commit cda6e0784dbc387abf96a9b9ae1e3695aa3e7c17 Merge: a1adb3a 0abd3e5 Author: Brad King AuthorDate: Fri Jan 23 09:16:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 09:16:40 2015 -0500 Merge topic 'curl-default-cainfo' into next 0abd3e53 cmake: Use a default CA path when not using system curl 6ce346c5 curl: Add CURL_CA_PATH option to CMake build process c99e19a4 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0abd3e538eb92259e52c3d330e46dac7aa0be332 commit 0abd3e538eb92259e52c3d330e46dac7aa0be332 Author: Brad King AuthorDate: Thu Jan 22 10:15:31 2015 -0500 Commit: Brad King CommitDate: Fri Jan 23 08:57:32 2015 -0500 cmake: Use a default CA path when not using system curl When using system curl, we trust it to be configured with desired CA certs. When using our own build of curl, we use os-configured CA certs on Windows and OS X. On other systems, try to achieve this by searching for common CA cert locations. According to a brief investigation, the curl packages on popular Linux distros are currently configured as: * Arch: /etc/ssl/certs/ca-certificates.crt * Debian with OpenSSL: /etc/ssl/certs * Debian with GNU TLS: /etc/ssl/certs/ca-certificates.crt * Debian with NSS: /etc/ssl/certs/ca-certificates.crt * Fedora: /etc/pki/tls/certs/ca-bundle.crt * Gentoo with OpenSSL: /etc/ssl/certs * Gentoo without OpenSSL: /etc/ssl/certs/ca-certificates.crt Teach CMake and CTest to look for these paths and use them as a CA path or bundle when no other os-configured or user-specified CAs are available. diff --git a/Help/release/dev/curl-default-cainfo.rst b/Help/release/dev/curl-default-cainfo.rst new file mode 100644 index 0000000..ed45d36 --- /dev/null +++ b/Help/release/dev/curl-default-cainfo.rst @@ -0,0 +1,8 @@ +curl-default-cainfo +------------------- + +* When CMake is built with OpenSSL on systems other than Windows + and OS X, commands supporting network communication via ``https``, + such as :command:`file(DOWNLOAD)`, :command:`file(UPLOAD)`, and + :command:`ctest_submit`, now search for OS-configured certificate + authorities in a few ``/etc`` paths to be trusted automatically. diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index c04cf9a..07839f3 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -175,6 +175,8 @@ set(SRCS cmCPackPropertiesGenerator.cxx cmCryptoHash.cxx cmCryptoHash.h + cmCurl.cxx + cmCurl.h cmCustomCommand.cxx cmCustomCommand.h cmCustomCommandGenerator.cxx @@ -497,6 +499,12 @@ if(WIN32 AND NOT CYGWIN) install(TARGETS cmcldeps DESTINATION bin) endif() +foreach(v CURL_CA_BUNDLE CURL_CA_PATH) + if(${v}) + set_property(SOURCE cmCurl.cxx APPEND PROPERTY COMPILE_DEFINITIONS ${v}="${${v}}") + endif() +endforeach() + # create a library used by the command line and the GUI add_library(CMakeLib ${SRCS}) target_link_libraries(CMakeLib cmsys diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 11e3343..3d9545f 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -26,7 +26,7 @@ #include // For curl submission -#include "cm_curl.h" +#include "cmCurl.h" #include "cmCTestCurl.h" #include @@ -366,6 +366,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, curl = curl_easy_init(); if(curl) { + cmCurlSetCAInfo(curl); if(verifyPeerOff) { cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 1ef4c92..f08b87c 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -9,7 +9,7 @@ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ -#include "cm_curl.h" +#include "cmCurl.h" // include before anything that includes windows.h #include "cmCTest.h" #include "cmake.h" @@ -192,6 +192,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method, FILE* file; ::curl_global_init(CURL_GLOBAL_ALL); curl = ::curl_easy_init(); + cmCurlSetCAInfo(curl); //set request options based on method switch(method) diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx new file mode 100644 index 0000000..96d3547 --- /dev/null +++ b/Source/cmCurl.cxx @@ -0,0 +1,64 @@ +/*============================================================================ + 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. +============================================================================*/ +#include "cmCurl.h" +#include "cmSystemTools.h" + +#define check_curl_result(result, errstr) \ + if (result != CURLE_OK) \ + { \ + e += e.empty()? "" : "\n"; \ + e += errstr; \ + e += ::curl_easy_strerror(result); \ + } + +//---------------------------------------------------------------------------- +std::string cmCurlSetCAInfo(::CURL *curl, const char* cafile) +{ + std::string e; + if(cafile && *cafile) + { + ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile); + check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); + } +#if !defined(CMAKE_USE_SYSTEM_CURL) && \ + !defined(_WIN32) && !defined(__APPLE__) && \ + !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH) +# define CMAKE_CAFILE_FEDORA "/etc/pki/tls/certs/ca-bundle.crt" + else if(cmSystemTools::FileExists(CMAKE_CAFILE_FEDORA, true)) + { + ::CURLcode res = + ::curl_easy_setopt(curl, CURLOPT_CAINFO, CMAKE_CAFILE_FEDORA); + check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); + } +# undef CMAKE_CAFILE_FEDORA + else + { +# define CMAKE_CAFILE_COMMON "/etc/ssl/certs/ca-certificates.crt" + if(cmSystemTools::FileExists(CMAKE_CAFILE_COMMON, true)) + { + ::CURLcode res = + ::curl_easy_setopt(curl, CURLOPT_CAINFO, CMAKE_CAFILE_COMMON); + check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); + } +# undef CMAKE_CAFILE_COMMON +# define CMAKE_CAPATH_COMMON "/etc/ssl/certs" + if(cmSystemTools::FileIsDirectory(CMAKE_CAPATH_COMMON)) + { + ::CURLcode res = + ::curl_easy_setopt(curl, CURLOPT_CAPATH, CMAKE_CAPATH_COMMON); + check_curl_result(res, "Unable to set TLS/SSL Verify CAPATH: "); + } +# undef CMAKE_CAPATH_COMMON + } +#endif + return e; +} diff --git a/Source/cmCurl.h b/Source/cmCurl.h new file mode 100644 index 0000000..0c5609c --- /dev/null +++ b/Source/cmCurl.h @@ -0,0 +1,21 @@ +/*============================================================================ + 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 cmCurl_h +#define cmCurl_h + +#include +#include "cm_curl.h" +#include "cmStandardIncludes.h" + +std::string cmCurlSetCAInfo(::CURL *curl, const char* cafile = 0); + +#endif diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 2c92db2..f125292 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -20,7 +20,7 @@ #include "cmTimestamp.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cm_curl.h" +#include "cmCurl.h" #include "cmFileLockResult.h" #endif @@ -3068,10 +3068,11 @@ cmFileCommand::HandleDownloadCommand(std::vector const& args) } // check to see if a CAINFO file has been specified // command arg comes first - if(cainfo && *cainfo) + std::string const& cainfo_err = cmCurlSetCAInfo(curl, cainfo); + if (!cainfo_err.empty()) { - res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cainfo); - check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: "); + this->SetError(cainfo_err); + return false; } cmFileCommandVectorOfChar chunkDebug; http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ce346c53c67ba970cd04f0d8436aab006dbec71 commit 6ce346c53c67ba970cd04f0d8436aab006dbec71 Author: Brad King AuthorDate: Wed Jan 21 16:42:18 2015 -0500 Commit: Brad King CommitDate: Fri Jan 23 08:23:52 2015 -0500 curl: Add CURL_CA_PATH option to CMake build process Move CMAKE_USE_OPENSSL and CURL_CA_BUNDLE up to the top of CMake so that CMake's own sources can know their values. Add the CURL_CA_PATH option at the top and honor it as part of the curl build. diff --git a/CMakeLists.txt b/CMakeLists.txt index bdc160d..28fd02f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,6 +287,13 @@ macro (CMAKE_BUILD_UTILITIES) if(CMAKE_TESTS_CDASH_SERVER) set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php") endif() + option(CMAKE_USE_OPENSSL "Use OpenSSL." OFF) + mark_as_advanced(CMAKE_USE_OPENSSL) + if(CMAKE_USE_OPENSSL) + set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle") + set(CURL_CA_PATH "" CACHE PATH "Path to SSL CA Certificate Directory") + mark_as_advanced(CURL_CA_BUNDLE CURL_CA_PATH) + endif() add_subdirectory(Utilities/cmcurl) CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty") diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index 0db741e..08bdff5 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -425,9 +425,6 @@ endif() #----------------------------------------------------------------------------- -option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" OFF) -mark_as_advanced(CMAKE_USE_OPENSSL) - set(USE_SSLEAY OFF) set(USE_OPENSSL OFF) set(HAVE_LIBCRYPTO OFF) @@ -454,11 +451,13 @@ if(CMAKE_USE_OPENSSL) check_include_file("openssl/rand.h" HAVE_OPENSSL_RAND_H) # Optionally build with a specific CA cert bundle. - set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle") - mark_as_advanced(CURL_CA_BUNDLE) if(CURL_CA_BUNDLE) add_definitions(-DCURL_CA_BUNDLE="${CURL_CA_BUNDLE}") endif() + # Optionally build with a specific CA cert dir. + if(CURL_CA_PATH) + add_definitions(-DCURL_CA_PATH="${CURL_CA_PATH}") + endif() endif(OPENSSL_FOUND) elseif(WIN32) # Use Windows SSL/TLS native implementation. diff --git a/Utilities/cmcurl/lib/curl_config.h.cmake b/Utilities/cmcurl/lib/curl_config.h.cmake index b5db3b6..a561c3d 100644 --- a/Utilities/cmcurl/lib/curl_config.h.cmake +++ b/Utilities/cmcurl/lib/curl_config.h.cmake @@ -3,12 +3,6 @@ /* when building libcurl itself */ #cmakedefine BUILDING_LIBCURL 1 -/* Location of default ca bundle */ -#cmakedefine CURL_CA_BUNDLE ${CURL_CA_BUNDLE} - -/* Location of default ca path */ -#cmakedefine CURL_CA_PATH ${CURL_CA_PATH} - /* to disable cookies support */ #cmakedefine CURL_DISABLE_COOKIES 1 ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 7 +++ Help/release/dev/curl-default-cainfo.rst | 8 +++ Source/CMakeLists.txt | 8 +++ Source/CMakeVersion.cmake | 2 +- Source/CTest/cmCTestSubmitHandler.cxx | 3 +- Source/cmCTest.cxx | 3 +- Source/cmCurl.cxx | 64 +++++++++++++++++++++++ Utilities/cm_jsoncpp_value.h => Source/cmCurl.h | 16 +++--- Source/cmFileCommand.cxx | 9 ++-- Utilities/cmcurl/CMakeLists.txt | 9 ++-- Utilities/cmcurl/lib/curl_config.h.cmake | 6 --- 11 files changed, 108 insertions(+), 27 deletions(-) create mode 100644 Help/release/dev/curl-default-cainfo.rst create mode 100644 Source/cmCurl.cxx copy Utilities/cm_jsoncpp_value.h => Source/cmCurl.h (70%) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 09:32:27 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 09:32:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2273-g852f738 Message-ID: <20150123143227.44213AA686@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 852f738c0911975d8f39491f288158fcf3795fe1 (commit) via a67be306809f9ecf87499fcb6f70f24e428d612f (commit) from cda6e0784dbc387abf96a9b9ae1e3695aa3e7c17 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=852f738c0911975d8f39491f288158fcf3795fe1 commit 852f738c0911975d8f39491f288158fcf3795fe1 Merge: cda6e07 a67be30 Author: Brad King AuthorDate: Fri Jan 23 09:32:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 09:32:26 2015 -0500 Merge topic 'ninja-generate-outputs' into next a67be306 Revert topic 'ninja-generate-outputs' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a67be306809f9ecf87499fcb6f70f24e428d612f commit a67be306809f9ecf87499fcb6f70f24e428d612f Author: Brad King AuthorDate: Fri Jan 23 09:30:55 2015 -0500 Commit: Brad King CommitDate: Fri Jan 23 09:31:12 2015 -0500 Revert topic 'ninja-generate-outputs' Byproducts like configure_file outputs cannot be listed as build rule outputs for Ninja or they will always be considered older than the CMakeCache.txt input. Another solution will be needed. diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 3b599be..3c07be1 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1119,12 +1119,11 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) /*deptype=*/ "", /*rspfile=*/ "", /*rspcontent*/ "", - /*restat=*/ "1", + /*restat=*/ "", /*generator=*/ true); cmLocalNinjaGenerator *ng = static_cast(lg); - cmNinjaDeps outputs; cmNinjaDeps implicitDeps; for(std::vector::const_iterator i = this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i) @@ -1135,30 +1134,13 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) { implicitDeps.push_back(ng->ConvertToNinjaPath(*fi)); } - std::vector const& localOutputs = - (*i)->GetMakefile()->GetOutputFiles(); - for(std::vector::const_iterator o = localOutputs.begin(); - o != localOutputs.end(); ++o) - { - outputs.push_back(ng->ConvertToNinjaPath(*o)); - } } - outputs.push_back(NINJA_BUILD_FILE); implicitDeps.push_back("CMakeCache.txt"); std::sort(implicitDeps.begin(), implicitDeps.end()); implicitDeps.erase(std::unique(implicitDeps.begin(), implicitDeps.end()), implicitDeps.end()); - std::sort(outputs.begin(), outputs.end()); - outputs.erase(std::unique(outputs.begin(), outputs.end()), - outputs.end()); - - cmNinjaDeps filteredOutputs; - std::set_difference(outputs.begin(), outputs.end(), - implicitDeps.begin(), implicitDeps.end(), - std::back_inserter(filteredOutputs)); - cmNinjaVars variables; // Use 'console' pool to get non buffered output of the CMake re-run call // Available since Ninja 1.5 @@ -1170,7 +1152,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os) this->WriteBuild(os, "Re-run CMake if any of its inputs changed.", "RERUN_CMAKE", - /*outputs=*/ filteredOutputs, + /*outputs=*/ cmNinjaDeps(1, NINJA_BUILD_FILE), /*explicitDeps=*/ cmNinjaDeps(), implicitDeps, /*orderOnlyDeps=*/ cmNinjaDeps(), diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 358a918..3a61751 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -175,7 +175,3 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) - -if(CMAKE_GENERATOR MATCHES "Ninja") - add_RunCMake_test(ninja) -endif() diff --git a/Tests/RunCMake/Configure/NinjaRerunCMake-nowork-stdout.txt b/Tests/RunCMake/Configure/NinjaRerunCMake-nowork-stdout.txt deleted file mode 100644 index 76f3cb7..0000000 --- a/Tests/RunCMake/Configure/NinjaRerunCMake-nowork-stdout.txt +++ /dev/null @@ -1 +0,0 @@ -^ninja: no work to do.$ diff --git a/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stderr.txt b/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stderr.txt deleted file mode 100644 index 3510266..0000000 --- a/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^FALSE$ diff --git a/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stdout.txt b/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stdout.txt deleted file mode 100644 index f6e9e57..0000000 --- a/Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stdout.txt +++ /dev/null @@ -1,3 +0,0 @@ -^\[1/1\] Re-running CMake\.\.\. -.* -ninja: no work to do.$ diff --git a/Tests/RunCMake/Configure/NinjaRerunCMake-stderr.txt b/Tests/RunCMake/Configure/NinjaRerunCMake-stderr.txt deleted file mode 100644 index 2093e5f..0000000 --- a/Tests/RunCMake/Configure/NinjaRerunCMake-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^TRUE$ diff --git a/Tests/RunCMake/Configure/NinjaRerunCMake.cmake b/Tests/RunCMake/Configure/NinjaRerunCMake.cmake deleted file mode 100644 index 69b269b..0000000 --- a/Tests/RunCMake/Configure/NinjaRerunCMake.cmake +++ /dev/null @@ -1,11 +0,0 @@ -enable_language(C) -configure_file( - "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in" - "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt" - @ONLY - ) -try_compile(res - "${CMAKE_CURRENT_BINARY_DIR}" - SOURCES "${CMAKE_CURRENT_BINARY_DIR}/TryCompileInput.c" - ) -message("${res}") diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake index 8fa7a09..58e1a2a 100644 --- a/Tests/RunCMake/Configure/RunCMakeTest.cmake +++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake @@ -23,41 +23,3 @@ file(WRITE "${depend}" "2") run_cmake_command(RerunCMake-build2 ${CMAKE_COMMAND} --build .) unset(RunCMake_TEST_BINARY_DIR) unset(RunCMake_TEST_NO_CLEAN) - -if(RunCMake_GENERATOR STREQUAL "Ninja") - # Use a single build tree for a few tests without cleaning. - set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/NinjaRerunCMake-build) - set(RunCMake_TEST_NO_CLEAN 1) - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - set(in_conf "${RunCMake_TEST_BINARY_DIR}/ConfigureFileInput.txt.in") - file(WRITE "${in_conf}" "1") - set(in_tc "${RunCMake_TEST_BINARY_DIR}/TryCompileInput.c") - file(WRITE "${in_tc}" "int main(void) { return 0; }\n") - - # Force NINJA_STATUS to be a certain style to not break the regex. - set(ENV{NINJA_STATUS} "[%s/%t] ") - - message(STATUS "NinjaRerunCMake - First configuration:") - run_cmake(NinjaRerunCMake) - run_cmake_command(NinjaRerunCMake-nowork ${CMAKE_COMMAND} --build .) - execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution - message(STATUS "NinjaRerunCMake - Modify try_compile input:") - file(WRITE "${in_tc}" "does-not-compile\n") - run_cmake_command(NinjaRerunCMake-rerun ${CMAKE_COMMAND} --build .) - run_cmake_command(NinjaRerunCMake-nowork ${CMAKE_COMMAND} --build .) - - message(STATUS "NinjaRerunCMake - Remove configure_file output:") - file(REMOVE "${RunCMake_TEST_BINARY_DIR}/ConfigureFileOutput.txt") - run_cmake_command(NinjaRerunCMake-rerun ${CMAKE_COMMAND} --build .) - run_cmake_command(NinjaRerunCMake-nowork ${CMAKE_COMMAND} --build .) - - execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution - message(STATUS "NinjaRerunCMake - Modify configure_file input:") - file(WRITE "${in_conf}" "2") - run_cmake_command(NinjaRerunCMake-rerun ${CMAKE_COMMAND} --build .) - run_cmake_command(NinjaRerunCMake-nowork ${CMAKE_COMMAND} --build .) - - unset(RunCMake_TEST_BINARY_DIR) - unset(RunCMake_TEST_NO_CLEAN) -endif() diff --git a/Tests/RunCMake/ninja/CMakeLists.txt b/Tests/RunCMake/ninja/CMakeLists.txt deleted file mode 100644 index 67a38be..0000000 --- a/Tests/RunCMake/ninja/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -cmake_minimum_required(VERSION 2.8.4) - -set(test_binary_dir "${test_binary_root}/init-build") - -project(${RunCMake_TEST} NONE) -include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ninja/RunCMakeTest.cmake b/Tests/RunCMake/ninja/RunCMakeTest.cmake deleted file mode 100644 index 4bf4ed1..0000000 --- a/Tests/RunCMake/ninja/RunCMakeTest.cmake +++ /dev/null @@ -1,21 +0,0 @@ -include(RunCMake) - -# Test that Ninja is rerun properly. -set(test_dir "${CMAKE_CURRENT_BINARY_DIR}/ninja/test") - -set(RunCMake_BINARY_DIR "${test_dir}") -run_cmake(init) - -function (busy_loop) - execute_process( - COMMAND "${CMAKE_COMMAND}" -E sleep - 2) -endfunction () - -set(RunCMake_TEST_OPTIONS "-Dtest_binary_root=${test_dir}") -busy_loop() -run_cmake(touch_try_compile) -busy_loop() -run_cmake(remove_configured_file) -busy_loop() -run_cmake(touch_configure) diff --git a/Tests/RunCMake/ninja/check_build.cmake b/Tests/RunCMake/ninja/check_build.cmake deleted file mode 100644 index 093f18e..0000000 --- a/Tests/RunCMake/ninja/check_build.cmake +++ /dev/null @@ -1,41 +0,0 @@ -function (busy_loop) - execute_process( - COMMAND "${CMAKE_COMMAND}" -E sleep - 2) -endfunction () - -file(TIMESTAMP "${test_binary_dir}/build.ninja" orig_time "%Y%m%d%H%M%S") - -busy_loop() -# Force NINJA_STATUS to be a certain style to not break the regex. -set(ENV{NINJA_STATUS} "[%s/%t] ") -execute_process( - COMMAND "${CMAKE_COMMAND}" - --build . - OUTPUT_VARIABLE out - ERROR_VARIABLE err - WORKING_DIRECTORY "${test_binary_dir}") -message("-->${out}<--") -message("-->${err}<--") - -file(TIMESTAMP "${test_binary_dir}/build.ninja" rerun_time "%Y%m%d%H%M%S") - -if (NOT rerun_time GREATER orig_time) - message(FATAL_ERROR "Ninja did not rerun? (old: ${orig_time}; new: ${rerun_time})") -endif () - -busy_loop() -execute_process( - COMMAND "${CMAKE_COMMAND}" - --build . - OUTPUT_VARIABLE out - ERROR_VARIABLE err - WORKING_DIRECTORY "${test_binary_dir}") -message("-->${out}<--") -message("-->${err}<--") - -file(TIMESTAMP "${test_binary_dir}/build.ninja" noop_time "%Y%m%d%H%M%S") - -if (NOT rerun_time EQUAL noop_time) - message(FATAL_ERROR "Ninja found something to do? (old: ${rerun_time}; new: ${noop_time})") -endif () diff --git a/Tests/RunCMake/ninja/init-stderr.txt b/Tests/RunCMake/ninja/init-stderr.txt deleted file mode 100644 index 3510266..0000000 --- a/Tests/RunCMake/ninja/init-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^FALSE$ diff --git a/Tests/RunCMake/ninja/init.cmake b/Tests/RunCMake/ninja/init.cmake deleted file mode 100644 index 33f4be1..0000000 --- a/Tests/RunCMake/ninja/init.cmake +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(ninja C) - -set(in_conf "${CMAKE_CURRENT_BINARY_DIR}/test.txt.in") - -if (NOT EXISTS "${in_conf}") - file(WRITE "${in_conf}" "") -endif () - -configure_file( - "${in_conf}" - "${CMAKE_CURRENT_BINARY_DIR}/test.txt") - -set(in_try_compile "${CMAKE_CURRENT_BINARY_DIR}/tc.c") - -if (NOT EXISTS "${in_try_compile}") - file(WRITE "${in_try_compile}" "int main(int, char**) { return 0; }") -endif () - -try_compile(res - "${CMAKE_CURRENT_BINARY_DIR}/bin" - SOURCES "${in_try_compile}") -message("${res}") diff --git a/Tests/RunCMake/ninja/remove_configured_file-stderr.txt b/Tests/RunCMake/ninja/remove_configured_file-stderr.txt deleted file mode 100644 index 0ba5a9b..0000000 --- a/Tests/RunCMake/ninja/remove_configured_file-stderr.txt +++ /dev/null @@ -1,9 +0,0 @@ -^-->\[1/1\] Re-running CMake\.\.\. -.* -ninja: no work to do. -<-- --->FALSE -<-- --->ninja: no work to do. -<-- ---><--$ diff --git a/Tests/RunCMake/ninja/remove_configured_file.cmake b/Tests/RunCMake/ninja/remove_configured_file.cmake deleted file mode 100644 index 6cd9d61..0000000 --- a/Tests/RunCMake/ninja/remove_configured_file.cmake +++ /dev/null @@ -1,3 +0,0 @@ -file(REMOVE "${test_binary_dir}/test.txt") - -include("${CMAKE_CURRENT_LIST_DIR}/check_build.cmake") diff --git a/Tests/RunCMake/ninja/touch_configure-stderr.txt b/Tests/RunCMake/ninja/touch_configure-stderr.txt deleted file mode 100644 index 0ba5a9b..0000000 --- a/Tests/RunCMake/ninja/touch_configure-stderr.txt +++ /dev/null @@ -1,9 +0,0 @@ -^-->\[1/1\] Re-running CMake\.\.\. -.* -ninja: no work to do. -<-- --->FALSE -<-- --->ninja: no work to do. -<-- ---><--$ diff --git a/Tests/RunCMake/ninja/touch_configure.cmake b/Tests/RunCMake/ninja/touch_configure.cmake deleted file mode 100644 index a9f4a44..0000000 --- a/Tests/RunCMake/ninja/touch_configure.cmake +++ /dev/null @@ -1,5 +0,0 @@ -execute_process( - COMMAND "${CMAKE_COMMAND}" -E touch - "${test_binary_dir}/test.txt.in") - -include("${CMAKE_CURRENT_LIST_DIR}/check_build.cmake") diff --git a/Tests/RunCMake/ninja/touch_try_compile-stderr.txt b/Tests/RunCMake/ninja/touch_try_compile-stderr.txt deleted file mode 100644 index 0ba5a9b..0000000 --- a/Tests/RunCMake/ninja/touch_try_compile-stderr.txt +++ /dev/null @@ -1,9 +0,0 @@ -^-->\[1/1\] Re-running CMake\.\.\. -.* -ninja: no work to do. -<-- --->FALSE -<-- --->ninja: no work to do. -<-- ---><--$ diff --git a/Tests/RunCMake/ninja/touch_try_compile.cmake b/Tests/RunCMake/ninja/touch_try_compile.cmake deleted file mode 100644 index 43936d0..0000000 --- a/Tests/RunCMake/ninja/touch_try_compile.cmake +++ /dev/null @@ -1,5 +0,0 @@ -execute_process( - COMMAND "${CMAKE_COMMAND}" -E touch - "${test_binary_dir}/tc.c") - -include("${CMAKE_CURRENT_LIST_DIR}/check_build.cmake") ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalNinjaGenerator.cxx | 22 +---------- Tests/RunCMake/CMakeLists.txt | 4 -- .../Configure/NinjaRerunCMake-nowork-stdout.txt | 1 - .../Configure/NinjaRerunCMake-rerun-stderr.txt | 1 - .../Configure/NinjaRerunCMake-rerun-stdout.txt | 3 -- .../RunCMake/Configure/NinjaRerunCMake-stderr.txt | 1 - Tests/RunCMake/Configure/NinjaRerunCMake.cmake | 11 ------ Tests/RunCMake/Configure/RunCMakeTest.cmake | 38 ------------------ Tests/RunCMake/ninja/CMakeLists.txt | 6 --- Tests/RunCMake/ninja/RunCMakeTest.cmake | 21 ---------- Tests/RunCMake/ninja/check_build.cmake | 41 -------------------- Tests/RunCMake/ninja/init-stderr.txt | 1 - Tests/RunCMake/ninja/init.cmake | 23 ----------- .../ninja/remove_configured_file-stderr.txt | 9 ----- Tests/RunCMake/ninja/remove_configured_file.cmake | 3 -- Tests/RunCMake/ninja/touch_configure-stderr.txt | 9 ----- Tests/RunCMake/ninja/touch_configure.cmake | 5 --- Tests/RunCMake/ninja/touch_try_compile-stderr.txt | 9 ----- Tests/RunCMake/ninja/touch_try_compile.cmake | 5 --- 19 files changed, 2 insertions(+), 211 deletions(-) delete mode 100644 Tests/RunCMake/Configure/NinjaRerunCMake-nowork-stdout.txt delete mode 100644 Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stderr.txt delete mode 100644 Tests/RunCMake/Configure/NinjaRerunCMake-rerun-stdout.txt delete mode 100644 Tests/RunCMake/Configure/NinjaRerunCMake-stderr.txt delete mode 100644 Tests/RunCMake/Configure/NinjaRerunCMake.cmake delete mode 100644 Tests/RunCMake/ninja/CMakeLists.txt delete mode 100644 Tests/RunCMake/ninja/RunCMakeTest.cmake delete mode 100644 Tests/RunCMake/ninja/check_build.cmake delete mode 100644 Tests/RunCMake/ninja/init-stderr.txt delete mode 100644 Tests/RunCMake/ninja/init.cmake delete mode 100644 Tests/RunCMake/ninja/remove_configured_file-stderr.txt delete mode 100644 Tests/RunCMake/ninja/remove_configured_file.cmake delete mode 100644 Tests/RunCMake/ninja/touch_configure-stderr.txt delete mode 100644 Tests/RunCMake/ninja/touch_configure.cmake delete mode 100644 Tests/RunCMake/ninja/touch_try_compile-stderr.txt delete mode 100644 Tests/RunCMake/ninja/touch_try_compile.cmake hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 10:37:31 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 10:37:31 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2276-ge00d75e Message-ID: <20150123153731.C1934AA9D7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e00d75e25aaa93c38b59df54163ba468adac1c8a (commit) via 3084142a708ce9107e357649bb6323dcca17b87d (commit) via b358e734b867669fe086be98502f2f4bd1bd7425 (commit) from 852f738c0911975d8f39491f288158fcf3795fe1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e00d75e25aaa93c38b59df54163ba468adac1c8a commit e00d75e25aaa93c38b59df54163ba468adac1c8a Merge: 852f738 3084142 Author: Brad King AuthorDate: Fri Jan 23 10:37:30 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 10:37:30 2015 -0500 Merge topic 'test-rerun-cmake' into next 3084142a configure_file: Test that CMake re-runs on input change or output missing b358e734 try_compile: Test that CMake re-runs on input change http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3084142a708ce9107e357649bb6323dcca17b87d commit 3084142a708ce9107e357649bb6323dcca17b87d Author: Brad King AuthorDate: Fri Jan 23 10:02:04 2015 -0500 Commit: Brad King CommitDate: Fri Jan 23 10:36:02 2015 -0500 configure_file: Test that CMake re-runs on input change or output missing With the Makefile generators we expect that touching or modifying the input file of a configure_file, or removing its output, will cause CMake to re-run on the next build. Extend the RunCMake.configure_file test with a case covering this. Also check that CMake does not re-run if nothing has changed. diff --git a/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt b/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt new file mode 100644 index 0000000..26e07b6 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt @@ -0,0 +1 @@ +^Running CMake on RerunCMake$ diff --git a/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt new file mode 100644 index 0000000..1bd5be7 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*Tests/RunCMake/configure_file/RerunCMake-build diff --git a/Tests/RunCMake/configure_file/RerunCMake-stderr.txt b/Tests/RunCMake/configure_file/RerunCMake-stderr.txt new file mode 100644 index 0000000..26e07b6 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-stderr.txt @@ -0,0 +1 @@ +^Running CMake on RerunCMake$ diff --git a/Tests/RunCMake/configure_file/RerunCMake-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt new file mode 100644 index 0000000..1bd5be7 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*Tests/RunCMake/configure_file/RerunCMake-build diff --git a/Tests/RunCMake/configure_file/RerunCMake.cmake b/Tests/RunCMake/configure_file/RerunCMake.cmake new file mode 100644 index 0000000..890cc1f --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake.cmake @@ -0,0 +1,8 @@ +message("Running CMake on RerunCMake") # write to stderr if cmake reruns +configure_file( + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in" + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt" + @ONLY + ) +# make sure CMakeCache.txt is newer than ConfigureFileOutput.txt +execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake index c010256..489652b 100644 --- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake +++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake @@ -7,3 +7,37 @@ run_cmake(UTF16BE-BOM) run_cmake(UTF32LE-BOM) run_cmake(UTF32BE-BOM) run_cmake(UnknownArg) + +if(RunCMake_GENERATOR MATCHES "Make") + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + set(in_conf "${RunCMake_TEST_BINARY_DIR}/ConfigureFileInput.txt.in") + file(WRITE "${in_conf}" "1") + + message(STATUS "RerunCMake: first configuration...") + run_cmake(RerunCMake) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution + message(STATUS "RerunCMake: touch configure_file input...") + file(WRITE "${in_conf}" "1") + run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution + message(STATUS "RerunCMake: modify configure_file input...") + file(WRITE "${in_conf}" "2") + run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + message(STATUS "RerunCMake: remove configure_file output...") + file(REMOVE "${RunCMake_TEST_BINARY_DIR}/ConfigureFileOutput.txt") + run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) +endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b358e734b867669fe086be98502f2f4bd1bd7425 commit b358e734b867669fe086be98502f2f4bd1bd7425 Author: Brad King AuthorDate: Fri Jan 23 09:45:00 2015 -0500 Commit: Brad King CommitDate: Fri Jan 23 10:36:01 2015 -0500 try_compile: Test that CMake re-runs on input change With the Makefile and Ninja generators we expect that touching the input source file for a try_compile will cause CMake to re-run on the next build. Extend the RunCMake.try_compile test with a case covering this. Also check that CMake does not re-run if nothing has changed. diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt new file mode 100644 index 0000000..88e54b1 --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt @@ -0,0 +1,2 @@ +^Running CMake on RerunCMake +FALSE$ diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt new file mode 100644 index 0000000..867db5f --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake-stderr.txt b/Tests/RunCMake/try_compile/RerunCMake-stderr.txt new file mode 100644 index 0000000..45d305a --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-stderr.txt @@ -0,0 +1,2 @@ +^Running CMake on RerunCMake +TRUE$ diff --git a/Tests/RunCMake/try_compile/RerunCMake-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt new file mode 100644 index 0000000..867db5f --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake.cmake b/Tests/RunCMake/try_compile/RerunCMake.cmake new file mode 100644 index 0000000..5a9f1d4 --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake.cmake @@ -0,0 +1,7 @@ +message("Running CMake on RerunCMake") # write to stderr if cmake reruns +enable_language(C) +try_compile(res + "${CMAKE_CURRENT_BINARY_DIR}" + SOURCES "${CMAKE_CURRENT_BINARY_DIR}/TryCompileInput.c" + ) +message("${res}") diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index 06096b2..f9e43fe 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -17,3 +17,26 @@ run_cmake(NonSourceCopyFile) run_cmake(NonSourceCompileDefinitions) run_cmake(CMP0056) + +if(RunCMake_GENERATOR MATCHES "Make|Ninja") + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + set(in_tc "${RunCMake_TEST_BINARY_DIR}/TryCompileInput.c") + file(WRITE "${in_tc}" "int main(void) { return 0; }\n") + + message(STATUS "RerunCMake: first configuration...") + run_cmake(RerunCMake) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution + message(STATUS "RerunCMake: modify try_compile input...") + file(WRITE "${in_tc}" "does-not-compile\n") + run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) +endif() ----------------------------------------------------------------------- Summary of changes: .../configure_file/RerunCMake-rerun-stderr.txt | 1 + .../configure_file/RerunCMake-rerun-stdout.txt | 3 ++ .../RunCMake/configure_file/RerunCMake-stderr.txt | 1 + .../RunCMake/configure_file/RerunCMake-stdout.txt | 3 ++ Tests/RunCMake/configure_file/RerunCMake.cmake | 8 +++++ Tests/RunCMake/configure_file/RunCMakeTest.cmake | 34 ++++++++++++++++++++ .../try_compile/RerunCMake-rerun-stderr.txt | 2 ++ .../try_compile/RerunCMake-rerun-stdout.txt | 3 ++ Tests/RunCMake/try_compile/RerunCMake-stderr.txt | 2 ++ Tests/RunCMake/try_compile/RerunCMake-stdout.txt | 3 ++ Tests/RunCMake/try_compile/RerunCMake.cmake | 7 ++++ Tests/RunCMake/try_compile/RunCMakeTest.cmake | 23 +++++++++++++ 12 files changed, 90 insertions(+) create mode 100644 Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt create mode 100644 Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt create mode 100644 Tests/RunCMake/configure_file/RerunCMake-stderr.txt create mode 100644 Tests/RunCMake/configure_file/RerunCMake-stdout.txt create mode 100644 Tests/RunCMake/configure_file/RerunCMake.cmake create mode 100644 Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt create mode 100644 Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt create mode 100644 Tests/RunCMake/try_compile/RerunCMake-stderr.txt create mode 100644 Tests/RunCMake/try_compile/RerunCMake-stdout.txt create mode 100644 Tests/RunCMake/try_compile/RerunCMake.cmake hooks/post-receive -- CMake From matt.mccormick at kitware.com Fri Jan 23 10:40:19 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 23 Jan 2015 10:40:19 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2278-ga80a6fc Message-ID: <20150123154019.815D52277@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a80a6fc857c5f77840c27caa89b499e22518f68d (commit) via fe6b4fad790428480b0b7f69b77da12ec795af8d (commit) from e00d75e25aaa93c38b59df54163ba468adac1c8a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a80a6fc857c5f77840c27caa89b499e22518f68d commit a80a6fc857c5f77840c27caa89b499e22518f68d Merge: e00d75e fe6b4fa Author: Matt McCormick AuthorDate: Fri Jan 23 10:40:18 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 10:40:18 2015 -0500 Merge topic 'try-run-link-libraries' into next fe6b4fad try_run: Do not expect ImportExport runs to succeed. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe6b4fad790428480b0b7f69b77da12ec795af8d commit fe6b4fad790428480b0b7f69b77da12ec795af8d Author: Matt McCormick AuthorDate: Fri Jan 23 10:39:27 2015 -0500 Commit: Matt McCormick CommitDate: Fri Jan 23 10:39:27 2015 -0500 try_run: Do not expect ImportExport runs to succeed. Some exotic systems have trouble finding the mock system library at execute time. diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index d64e917..358776b 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -321,8 +321,8 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA LINK_LIBRARIES exp_systemlib OUTPUT_VARIABLE OUTPUT ) - if(NOT EXP_COMPILE_VAR OR NOT EXP_RUN_VAR EQUAL 0) - message(SEND_ERROR "try_run failed, but it was expected to succeed ${OUTPUT}.") + if(NOT EXP_COMPILE_VAR) + message(SEND_ERROR "try_run compile failed, but it was expected to succeed ${OUTPUT}.") endif() endif() @@ -352,8 +352,8 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA LINK_LIBRARIES bld_systemlib OUTPUT_VARIABLE OUTPUT ) - if(NOT BLD_COMPILE_VAR OR NOT BLD_RUN_VAR EQUAL 0) - message(SEND_ERROR "try_run failed, but it was expected to succeed ${OUTPUT}.") + if(NOT BLD_COMPILE_VAR) + message(SEND_ERROR "try_run compile failed, but it was expected to succeed ${OUTPUT}.") endif() endif() endif() ----------------------------------------------------------------------- Summary of changes: Tests/ExportImport/Import/A/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 10:50:18 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 10:50:18 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-876-g6e66fb6 Message-ID: <20150123155018.830E8A98CC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 6e66fb6e88305e7b906f60882610bac48fd7146f (commit) via bebdb4540b94aae3f213af586dbd7d1445ef25e5 (commit) from c99e19a4ac7e6e55345a073b13c36befaa8702d8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e66fb6e88305e7b906f60882610bac48fd7146f commit 6e66fb6e88305e7b906f60882610bac48fd7146f Merge: c99e19a bebdb45 Author: Brad King AuthorDate: Fri Jan 23 10:50:17 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 10:50:17 2015 -0500 Merge topic 'add-missing-variable-docs' bebdb454 Help: add missing MINGW variable documentation ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-variables.7.rst | 1 + Help/variable/MINGW.rst | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 Help/variable/MINGW.rst hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 10:50:20 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 10:50:20 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-878-g0bda22f Message-ID: <20150123155020.BDF9AA98D5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0bda22f247bffa75abc184e96451835f4450145c (commit) via b79d8f2934bc0dbe5f22fbb3ee709eb932baf3c6 (commit) from 6e66fb6e88305e7b906f60882610bac48fd7146f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0bda22f247bffa75abc184e96451835f4450145c commit 0bda22f247bffa75abc184e96451835f4450145c Merge: 6e66fb6 b79d8f2 Author: Brad King AuthorDate: Fri Jan 23 10:50:19 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 10:50:19 2015 -0500 Merge topic 'FeatureSummary-fix-doc-typo' b79d8f29 FeatureSummary: Fix bracket in documentation. ----------------------------------------------------------------------- Summary of changes: Modules/FeatureSummary.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 10:50:23 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 10:50:23 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-880-g9f559a2 Message-ID: <20150123155023.65C89A9A66@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 9f559a26080a7c76210277999385e50a9412300c (commit) via 374a66b58ced947d9713dfd6f439a52b6646e923 (commit) from 0bda22f247bffa75abc184e96451835f4450145c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9f559a26080a7c76210277999385e50a9412300c commit 9f559a26080a7c76210277999385e50a9412300c Merge: 0bda22f 374a66b Author: Brad King AuthorDate: Fri Jan 23 10:50:22 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 10:50:22 2015 -0500 Merge topic 'GNU-4.4-compile-features' 374a66b5 Features: Blacklist raw string literals test for GNU 4.4 diff --cc Tests/CompileFeatures/CMakeLists.txt index ef37dcb,0642487..aacf4c1 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@@ -51,18 -51,15 +51,26 @@@ if (CMAKE_CXX_COMPILER_ID STREQUAL "App ) 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.5) + # The cxx_raw_string_literals feature happens to work in some distributions + # of GNU 4.4, but it is first documented as available with GNU 4.5. + list(REMOVE_ITEM CXX_non_features + cxx_raw_string_literals + ) + 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 # GNU 4.5, but it is first documented as available with GNU 4.6. ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 10:50:25 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 10:50:25 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-882-g29ef8fb Message-ID: <20150123155025.E3873A98FA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 29ef8fb5be529f87b7e18a728604268cc008a9f6 (commit) via 53df9bce19586858ad7c9b0e80d660433be757ed (commit) from 9f559a26080a7c76210277999385e50a9412300c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=29ef8fb5be529f87b7e18a728604268cc008a9f6 commit 29ef8fb5be529f87b7e18a728604268cc008a9f6 Merge: 9f559a2 53df9bc Author: Brad King AuthorDate: Fri Jan 23 10:50:24 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 10:50:24 2015 -0500 Merge topic 'update-curl' 53df9bce curl: Add README-CMake.txt ----------------------------------------------------------------------- Summary of changes: Utilities/cmcurl/README-CMake.txt | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Utilities/cmcurl/README-CMake.txt hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 10:50:28 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 10:50:28 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-884-g7961171 Message-ID: <20150123155028.0979A227F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 7961171db522619ea2a46c378359108e7a2a8bb8 (commit) via 005b409d6acc5b681b0614b778c1c3e76a2227c9 (commit) from 29ef8fb5be529f87b7e18a728604268cc008a9f6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7961171db522619ea2a46c378359108e7a2a8bb8 commit 7961171db522619ea2a46c378359108e7a2a8bb8 Merge: 29ef8fb 005b409 Author: Brad King AuthorDate: Fri Jan 23 10:50:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 10:50:26 2015 -0500 Merge topic 'FindCUDA-more-advanced-cache-entries' 005b409d FindCUDA: Mark more cache variables as advanced ----------------------------------------------------------------------- Summary of changes: Modules/FindCUDA.cmake | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 10:50:29 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 10:50:29 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-886-g103f77e Message-ID: <20150123155030.8C872A9DC6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 103f77e5122edf60b51e5c49af9231b657eed300 (commit) via 560b3e9f1df04808593997e7d1f6ac43c7b0c141 (commit) from 7961171db522619ea2a46c378359108e7a2a8bb8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=103f77e5122edf60b51e5c49af9231b657eed300 commit 103f77e5122edf60b51e5c49af9231b657eed300 Merge: 7961171 560b3e9 Author: Brad King AuthorDate: Fri Jan 23 10:50:28 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 10:50:28 2015 -0500 Merge topic 'test-complex-remove-bad-indentation' 560b3e9f Tests: Remove incorrect indentation from Complex test comment ----------------------------------------------------------------------- Summary of changes: Tests/Complex/Executable/CMakeLists.txt | 2 +- Tests/ComplexOneConfig/Executable/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 10:50:33 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 10:50:33 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-889-g154bf8d Message-ID: <20150123155036.2EF89A9DF0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 154bf8da991a6cbc82e5ef89979549b10d19f561 (commit) via 85857e6d1c1859bdc8ab4206e0329e846b6ef020 (commit) via ee38062be8ccdb7f4c53156ef00db0d42a41a6a7 (commit) from 103f77e5122edf60b51e5c49af9231b657eed300 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=154bf8da991a6cbc82e5ef89979549b10d19f561 commit 154bf8da991a6cbc82e5ef89979549b10d19f561 Merge: 103f77e 85857e6 Author: Brad King AuthorDate: Fri Jan 23 10:50:31 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 10:50:31 2015 -0500 Merge topic 'INTERFACE_SYSTEM_INCLUDE_DIRECTORIES-update' 85857e6d Help: Clarify INTERFACE_SYSTEM_INCLUDE_DIRECTORIES documentation. ee38062b IncludeDirectories: Respect SYSTEM flag when using CONFIG genex. ----------------------------------------------------------------------- Summary of changes: Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst | 11 +++++++++-- Source/cmMakefileTargetGenerator.cxx | 3 ++- Source/cmNinjaTargetGenerator.cxx | 4 +++- .../SystemIncludeDirectories/CMakeLists.txt | 8 +++++++- .../config_specific/config_iface.h | 14 ++++++++++++++ .../SystemIncludeDirectories/consumer.cpp | 2 ++ 6 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 Tests/IncludeDirectories/SystemIncludeDirectories/config_specific/config_iface.h hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 10:50:58 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 10:50:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2286-g0a0c008 Message-ID: <20150123155058.E5597A9E03@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0a0c008eb5bc0e6380d5166315f417f5c97cc66f (commit) via 154bf8da991a6cbc82e5ef89979549b10d19f561 (commit) via 103f77e5122edf60b51e5c49af9231b657eed300 (commit) via 7961171db522619ea2a46c378359108e7a2a8bb8 (commit) via 29ef8fb5be529f87b7e18a728604268cc008a9f6 (commit) via 9f559a26080a7c76210277999385e50a9412300c (commit) via 0bda22f247bffa75abc184e96451835f4450145c (commit) via 6e66fb6e88305e7b906f60882610bac48fd7146f (commit) from a80a6fc857c5f77840c27caa89b499e22518f68d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a0c008eb5bc0e6380d5166315f417f5c97cc66f commit 0a0c008eb5bc0e6380d5166315f417f5c97cc66f Merge: a80a6fc 154bf8d Author: Brad King AuthorDate: Fri Jan 23 10:50:48 2015 -0500 Commit: Brad King CommitDate: Fri Jan 23 10:50:48 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 10:54:21 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 10:54:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2288-g57e6b1c Message-ID: <20150123155421.E3700A7E59@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 57e6b1c3eff6a8179e98517081b3258849e75884 (commit) via 097e26f4908b3099f112c3fdc5e043234f9adc53 (commit) from 0a0c008eb5bc0e6380d5166315f417f5c97cc66f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57e6b1c3eff6a8179e98517081b3258849e75884 commit 57e6b1c3eff6a8179e98517081b3258849e75884 Merge: 0a0c008 097e26f Author: Brad King AuthorDate: Fri Jan 23 10:54:21 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 10:54:21 2015 -0500 Merge topic 'ninja-rsp_file-calculation' into next 097e26f4 ninja: use the minimum of all command line length limits (#14892) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=097e26f4908b3099f112c3fdc5e043234f9adc53 commit 097e26f4908b3099f112c3fdc5e043234f9adc53 Author: Ben Boeckel AuthorDate: Wed Jan 14 13:11:44 2015 -0500 Commit: Brad King CommitDate: Fri Jan 23 10:54:13 2015 -0500 ninja: use the minimum of all command line length limits (#14892) When choosing whether to use a response file, consider several possible command line length limits for the current operating system, and choose the smallest. diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index a05719d..5595557 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -22,6 +22,7 @@ #include #include +#include #ifndef _WIN32 #include @@ -371,15 +372,29 @@ cmNinjaNormalTargetGenerator static int calculateCommandLineLengthLimit(int linkRuleLength) { + static int const limits[] = { #ifdef _WIN32 - return 8000 - linkRuleLength; -#elif defined(__linux) || defined(__APPLE__) || defined(__HAIKU__) - // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac - return ((int)sysconf(_SC_ARG_MAX)) - linkRuleLength - 1000; -#else - (void)linkRuleLength; - return -1; + 8000, #endif +#if defined(__APPLE__) || defined(__HAIKU__) || defined(__linux) + // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac + ((int)sysconf(_SC_ARG_MAX)) - 1000, +#endif +#if defined(__linux) + // #define MAX_ARG_STRLEN (PAGE_SIZE * 32) in Linux's binfmts.h + ((int)sysconf(_SC_PAGESIZE) * 32) - 1000, +#endif + std::numeric_limits::max() + }; + + size_t const arrSz = cmArraySize(limits); + int const sz = *std::min_element(limits, limits + arrSz); + if (sz == std::numeric_limits::max()) + { + return -1; + } + + return sz - linkRuleLength; } ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 11:00:09 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 11:00:09 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2290-gd1b3125 Message-ID: <20150123160009.B58ACAA88E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d1b31254f24c2383c072ab88282abfedfb5ccc40 (commit) via d5d3d0c9e43004d139939fa71bf3901fa96ce756 (commit) from 57e6b1c3eff6a8179e98517081b3258849e75884 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d1b31254f24c2383c072ab88282abfedfb5ccc40 commit d1b31254f24c2383c072ab88282abfedfb5ccc40 Merge: 57e6b1c d5d3d0c Author: Brad King AuthorDate: Fri Jan 23 11:00:08 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 11:00:08 2015 -0500 Merge topic 'FindCUDA-cusolver' into next d5d3d0c9 Help: Add notes for topic 'FindCUDA-cusolver' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5d3d0c9e43004d139939fa71bf3901fa96ce756 commit d5d3d0c9e43004d139939fa71bf3901fa96ce756 Author: Brad King AuthorDate: Fri Jan 23 10:58:51 2015 -0500 Commit: Brad King CommitDate: Fri Jan 23 10:58:51 2015 -0500 Help: Add notes for topic 'FindCUDA-cusolver' diff --git a/Help/release/dev/FindCUDA-cusolver.rst b/Help/release/dev/FindCUDA-cusolver.rst new file mode 100644 index 0000000..7a61e78 --- /dev/null +++ b/Help/release/dev/FindCUDA-cusolver.rst @@ -0,0 +1,5 @@ +FindCUDA-cusolver +----------------- + +* The :module:`FindCUDA` module learned about the ``cusolver`` + library in CUDA 7.0. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/FindCUDA-cusolver.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Help/release/dev/FindCUDA-cusolver.rst hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 23 13:41:43 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 23 Jan 2015 13:41:43 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2292-g57b028d Message-ID: <20150123184143.A5598249A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 57b028dffc1408e39e7112c5fdde4b2efb067280 (commit) via a4605973ff116d11ca96c7b06aa6516bd638429a (commit) from d1b31254f24c2383c072ab88282abfedfb5ccc40 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=57b028dffc1408e39e7112c5fdde4b2efb067280 commit 57b028dffc1408e39e7112c5fdde4b2efb067280 Merge: d1b3125 a460597 Author: Brad King AuthorDate: Fri Jan 23 13:41:42 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 23 13:41:42 2015 -0500 Merge topic 'ExternalProject-switch-ALWAYS' into next a4605973 ExternalProject: Allow ALWAYS step property to be switched (#15368) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a4605973ff116d11ca96c7b06aa6516bd638429a commit a4605973ff116d11ca96c7b06aa6516bd638429a Author: Brad King AuthorDate: Fri Jan 23 13:28:49 2015 -0500 Commit: Brad King CommitDate: Fri Jan 23 13:38:59 2015 -0500 ExternalProject: Allow ALWAYS step property to be switched (#15368) Within an existing build tree, if the stamp for a step already exists when one activates the ALWAYS option, we still want it to always build. Remove the step stamp file during CMake configuration to ensure it does not exist when the ALWAYS option is enabled. diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 52d41eb..74e8ae2 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1456,6 +1456,15 @@ function(ExternalProject_Add_Step name step) if(always) set_property(SOURCE ${stamp_file} PROPERTY SYMBOLIC 1) set(touch) + # Remove any existing stamp in case the option changed in an existing tree. + if(CMAKE_CONFIGURATION_TYPES) + foreach(cfg ${CMAKE_CONFIGURATION_TYPES}) + string(REPLACE "/${CMAKE_CFG_INTDIR}" "/${cfg}" stamp_file_config "${stamp_file}") + file(REMOVE ${stamp_file_config}) + endforeach() + else() + file(REMOVE ${stamp_file}) + endif() else() set(touch ${CMAKE_COMMAND} -E touch ${stamp_file}) endif() ----------------------------------------------------------------------- Summary of changes: Modules/ExternalProject.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jan 24 00:01:11 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 24 Jan 2015 00:01:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-890-g97502ba Message-ID: <20150124050111.E7738AA03A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 97502ba77b6d589e2ff48a22b703f6908d5b5fdc (commit) from 154bf8da991a6cbc82e5ef89979549b10d19f561 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97502ba77b6d589e2ff48a22b703f6908d5b5fdc commit 97502ba77b6d589e2ff48a22b703f6908d5b5fdc Author: Kitware Robot AuthorDate: Sat Jan 24 00:01:09 2015 -0500 Commit: Kitware Robot CommitDate: Sat Jan 24 00:01:09 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 25cde98..07f8fd2 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 20150123) +set(CMake_VERSION_PATCH 20150124) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Sat Jan 24 07:35:17 2015 From: brad.king at kitware.com (Brad King) Date: Sat, 24 Jan 2015 07:35:17 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2295-gc0130af Message-ID: <20150124123517.B86A5AA904@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c0130af037373d853ee78465e9f5ef6547991bbd (commit) via 9928a397deee6c6aa148ab27cdd15b5ff732b4e5 (commit) via c663ec799e1f02efcf192d652e67095da4c134cc (commit) from 57b028dffc1408e39e7112c5fdde4b2efb067280 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c0130af037373d853ee78465e9f5ef6547991bbd commit c0130af037373d853ee78465e9f5ef6547991bbd Merge: 57b028d 9928a39 Author: Brad King AuthorDate: Sat Jan 24 07:35:15 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 24 07:35:15 2015 -0500 Merge topic 'test-rerun-cmake' into next 9928a397 fixup! try_compile: Test that CMake re-runs on input change c663ec79 Tests/RunCMake: Honor CMAKE_MAKE_PROGRAM http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9928a397deee6c6aa148ab27cdd15b5ff732b4e5 commit 9928a397deee6c6aa148ab27cdd15b5ff732b4e5 Author: Brad King AuthorDate: Sat Jan 24 07:29:27 2015 -0500 Commit: Brad King CommitDate: Sat Jan 24 07:29:50 2015 -0500 fixup! try_compile: Test that CMake re-runs on input change Fix to work with ninja < 1.5. diff --git a/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt new file mode 100644 index 0000000..e600b9b --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt @@ -0,0 +1 @@ +^ninja: no work to do\.$ diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt new file mode 100644 index 0000000..e1a1b5a --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt @@ -0,0 +1,5 @@ +Running CMake on RerunCMake +FALSE +-- Configuring done +-- Generating done +-- Build files have been written to: .*Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index f9e43fe..6cdbafa 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -27,15 +27,25 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja") set(in_tc "${RunCMake_TEST_BINARY_DIR}/TryCompileInput.c") file(WRITE "${in_tc}" "int main(void) { return 0; }\n") + # Older Ninja keeps all rerun output on stdout + set(ninja "") + if(RunCMake_GENERATOR STREQUAL "Ninja") + execute_process(COMMAND ${RunCMake_MAKE_PROGRAM} --version + OUTPUT_VARIABLE ninja_version OUTPUT_STRIP_TRAILING_WHITESPACE) + if(ninja_version VERSION_LESS 1.5) + set(ninja -ninja-no-console) + endif() + endif() + message(STATUS "RerunCMake: first configuration...") run_cmake(RerunCMake) - run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .) execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution message(STATUS "RerunCMake: modify try_compile input...") file(WRITE "${in_tc}" "does-not-compile\n") - run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) - run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-rerun${ninja} ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .) unset(RunCMake_TEST_BINARY_DIR) unset(RunCMake_TEST_NO_CLEAN) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c663ec799e1f02efcf192d652e67095da4c134cc commit c663ec799e1f02efcf192d652e67095da4c134cc Author: Brad King AuthorDate: Sat Jan 24 07:08:12 2015 -0500 Commit: Brad King CommitDate: Sat Jan 24 07:25:00 2015 -0500 Tests/RunCMake: Honor CMAKE_MAKE_PROGRAM If tests are using an explicit make program, pass it through to RunCMake tests so that any that actually do build use the expected tool. diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3a61751..12c1f47 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -6,6 +6,7 @@ macro(add_RunCMake_test test) -DRunCMake_GENERATOR=${CMAKE_GENERATOR} -DRunCMake_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DRunCMake_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET} + -DRunCMake_MAKE_PROGRAM=${CMake_TEST_EXPLICIT_MAKE_PROGRAM} -DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${test} -DRunCMake_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/${test} ${${test}_ARGS} diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 1625741..23f2f97 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -48,6 +48,9 @@ function(run_cmake test) if(APPLE) list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW) endif() + if(RunCMake_MAKE_PROGRAM) + list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}") + endif() if(RunCMake_TEST_COMMAND) execute_process( COMMAND ${RunCMake_TEST_COMMAND} ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/RunCMake.cmake | 3 +++ .../RerunCMake-nowork-ninja-no-console-stdout.txt | 1 + ...xt => RerunCMake-rerun-ninja-no-console-stdout.txt} | 2 ++ Tests/RunCMake/try_compile/RunCMakeTest.cmake | 16 +++++++++++++--- 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt copy Tests/RunCMake/try_compile/{RerunCMake-stdout.txt => RerunCMake-rerun-ninja-no-console-stdout.txt} (78%) hooks/post-receive -- CMake From brad.king at kitware.com Sat Jan 24 07:37:56 2015 From: brad.king at kitware.com (Brad King) Date: Sat, 24 Jan 2015 07:37:56 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2299-g3a70f6e Message-ID: <20150124123756.10E50AAB20@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3a70f6e34c49ceab09e36bfd5bb623bbc312707b (commit) via 5c306429b25dfd03b8f662bb1189d55c03afdbf9 (commit) via 59f6995bfd214152cf6d66e188e84216b7e7db60 (commit) via 23bf98fc04eccc85f216fdab4166107c3d958d43 (commit) from c0130af037373d853ee78465e9f5ef6547991bbd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a70f6e34c49ceab09e36bfd5bb623bbc312707b commit 3a70f6e34c49ceab09e36bfd5bb623bbc312707b Merge: c0130af 5c30642 Author: Brad King AuthorDate: Sat Jan 24 07:37:55 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 24 07:37:55 2015 -0500 Merge topic 'test-rerun-cmake' into next 5c306429 configure_file: Test that CMake re-runs on input change or output missing 59f6995b try_compile: Test that CMake re-runs on input change 23bf98fc Tests/RunCMake: Honor CMAKE_MAKE_PROGRAM http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5c306429b25dfd03b8f662bb1189d55c03afdbf9 commit 5c306429b25dfd03b8f662bb1189d55c03afdbf9 Author: Brad King AuthorDate: Fri Jan 23 10:02:04 2015 -0500 Commit: Brad King CommitDate: Sat Jan 24 07:35:45 2015 -0500 configure_file: Test that CMake re-runs on input change or output missing With the Makefile generators we expect that touching or modifying the input file of a configure_file, or removing its output, will cause CMake to re-run on the next build. Extend the RunCMake.configure_file test with a case covering this. Also check that CMake does not re-run if nothing has changed. diff --git a/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt b/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt new file mode 100644 index 0000000..26e07b6 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt @@ -0,0 +1 @@ +^Running CMake on RerunCMake$ diff --git a/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt new file mode 100644 index 0000000..1bd5be7 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*Tests/RunCMake/configure_file/RerunCMake-build diff --git a/Tests/RunCMake/configure_file/RerunCMake-stderr.txt b/Tests/RunCMake/configure_file/RerunCMake-stderr.txt new file mode 100644 index 0000000..26e07b6 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-stderr.txt @@ -0,0 +1 @@ +^Running CMake on RerunCMake$ diff --git a/Tests/RunCMake/configure_file/RerunCMake-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt new file mode 100644 index 0000000..1bd5be7 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*Tests/RunCMake/configure_file/RerunCMake-build diff --git a/Tests/RunCMake/configure_file/RerunCMake.cmake b/Tests/RunCMake/configure_file/RerunCMake.cmake new file mode 100644 index 0000000..890cc1f --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake.cmake @@ -0,0 +1,8 @@ +message("Running CMake on RerunCMake") # write to stderr if cmake reruns +configure_file( + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in" + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt" + @ONLY + ) +# make sure CMakeCache.txt is newer than ConfigureFileOutput.txt +execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake index c010256..489652b 100644 --- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake +++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake @@ -7,3 +7,37 @@ run_cmake(UTF16BE-BOM) run_cmake(UTF32LE-BOM) run_cmake(UTF32BE-BOM) run_cmake(UnknownArg) + +if(RunCMake_GENERATOR MATCHES "Make") + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + set(in_conf "${RunCMake_TEST_BINARY_DIR}/ConfigureFileInput.txt.in") + file(WRITE "${in_conf}" "1") + + message(STATUS "RerunCMake: first configuration...") + run_cmake(RerunCMake) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution + message(STATUS "RerunCMake: touch configure_file input...") + file(WRITE "${in_conf}" "1") + run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution + message(STATUS "RerunCMake: modify configure_file input...") + file(WRITE "${in_conf}" "2") + run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + message(STATUS "RerunCMake: remove configure_file output...") + file(REMOVE "${RunCMake_TEST_BINARY_DIR}/ConfigureFileOutput.txt") + run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) +endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59f6995bfd214152cf6d66e188e84216b7e7db60 commit 59f6995bfd214152cf6d66e188e84216b7e7db60 Author: Brad King AuthorDate: Fri Jan 23 09:45:00 2015 -0500 Commit: Brad King CommitDate: Sat Jan 24 07:35:45 2015 -0500 try_compile: Test that CMake re-runs on input change With the Makefile and Ninja generators we expect that touching the input source file for a try_compile will cause CMake to re-run on the next build. Extend the RunCMake.try_compile test with a case covering this. Also check that CMake does not re-run if nothing has changed. diff --git a/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt new file mode 100644 index 0000000..e600b9b --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt @@ -0,0 +1 @@ +^ninja: no work to do\.$ diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt new file mode 100644 index 0000000..e1a1b5a --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt @@ -0,0 +1,5 @@ +Running CMake on RerunCMake +FALSE +-- Configuring done +-- Generating done +-- Build files have been written to: .*Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt new file mode 100644 index 0000000..88e54b1 --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt @@ -0,0 +1,2 @@ +^Running CMake on RerunCMake +FALSE$ diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt new file mode 100644 index 0000000..867db5f --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake-stderr.txt b/Tests/RunCMake/try_compile/RerunCMake-stderr.txt new file mode 100644 index 0000000..45d305a --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-stderr.txt @@ -0,0 +1,2 @@ +^Running CMake on RerunCMake +TRUE$ diff --git a/Tests/RunCMake/try_compile/RerunCMake-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt new file mode 100644 index 0000000..867db5f --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake.cmake b/Tests/RunCMake/try_compile/RerunCMake.cmake new file mode 100644 index 0000000..5a9f1d4 --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake.cmake @@ -0,0 +1,7 @@ +message("Running CMake on RerunCMake") # write to stderr if cmake reruns +enable_language(C) +try_compile(res + "${CMAKE_CURRENT_BINARY_DIR}" + SOURCES "${CMAKE_CURRENT_BINARY_DIR}/TryCompileInput.c" + ) +message("${res}") diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index 06096b2..6cdbafa 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -17,3 +17,36 @@ run_cmake(NonSourceCopyFile) run_cmake(NonSourceCompileDefinitions) run_cmake(CMP0056) + +if(RunCMake_GENERATOR MATCHES "Make|Ninja") + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + set(in_tc "${RunCMake_TEST_BINARY_DIR}/TryCompileInput.c") + file(WRITE "${in_tc}" "int main(void) { return 0; }\n") + + # Older Ninja keeps all rerun output on stdout + set(ninja "") + if(RunCMake_GENERATOR STREQUAL "Ninja") + execute_process(COMMAND ${RunCMake_MAKE_PROGRAM} --version + OUTPUT_VARIABLE ninja_version OUTPUT_STRIP_TRAILING_WHITESPACE) + if(ninja_version VERSION_LESS 1.5) + set(ninja -ninja-no-console) + endif() + endif() + + message(STATUS "RerunCMake: first configuration...") + run_cmake(RerunCMake) + run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .) + + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution + message(STATUS "RerunCMake: modify try_compile input...") + file(WRITE "${in_tc}" "does-not-compile\n") + run_cmake_command(RerunCMake-rerun${ninja} ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) +endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23bf98fc04eccc85f216fdab4166107c3d958d43 commit 23bf98fc04eccc85f216fdab4166107c3d958d43 Author: Brad King AuthorDate: Sat Jan 24 07:08:12 2015 -0500 Commit: Brad King CommitDate: Sat Jan 24 07:35:44 2015 -0500 Tests/RunCMake: Honor CMAKE_MAKE_PROGRAM If tests are using an explicit make program, pass it through to RunCMake tests so that any that actually do build use the expected tool. diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3a61751..12c1f47 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -6,6 +6,7 @@ macro(add_RunCMake_test test) -DRunCMake_GENERATOR=${CMAKE_GENERATOR} -DRunCMake_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DRunCMake_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET} + -DRunCMake_MAKE_PROGRAM=${CMake_TEST_EXPLICIT_MAKE_PROGRAM} -DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${test} -DRunCMake_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/${test} ${${test}_ARGS} diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 1625741..23f2f97 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -48,6 +48,9 @@ function(run_cmake test) if(APPLE) list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW) endif() + if(RunCMake_MAKE_PROGRAM) + list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}") + endif() if(RunCMake_TEST_COMMAND) execute_process( COMMAND ${RunCMake_TEST_COMMAND} ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Sat Jan 24 07:39:40 2015 From: brad.king at kitware.com (Brad King) Date: Sat, 24 Jan 2015 07:39:40 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2303-g7bd3663 Message-ID: <20150124123940.8B5932205@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7bd36637c767f0a8e4dd159d36037b7058ae7b81 (commit) via 391748d57e090c53f6c55ea265e038fde1bca032 (commit) via 0b9aad7568bc5f1cf56e01fe2b3dc57f5dff5133 (commit) via 97502ba77b6d589e2ff48a22b703f6908d5b5fdc (commit) from 3a70f6e34c49ceab09e36bfd5bb623bbc312707b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7bd36637c767f0a8e4dd159d36037b7058ae7b81 commit 7bd36637c767f0a8e4dd159d36037b7058ae7b81 Merge: 3a70f6e 391748d Author: Brad King AuthorDate: Sat Jan 24 07:39:39 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 24 07:39:39 2015 -0500 Merge topic 'update-kwsys' into next 391748d5 Merge branch 'upstream-kwsys' into update-kwsys 0b9aad75 KWSys 2015-01-23 (d4e7f08e) 97502ba7 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=391748d57e090c53f6c55ea265e038fde1bca032 commit 391748d57e090c53f6c55ea265e038fde1bca032 Merge: 97502ba 0b9aad7 Author: Brad King AuthorDate: Sat Jan 24 07:38:51 2015 -0500 Commit: Brad King CommitDate: Sat Jan 24 07:38:51 2015 -0500 Merge branch 'upstream-kwsys' into update-kwsys http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0b9aad7568bc5f1cf56e01fe2b3dc57f5dff5133 commit 0b9aad7568bc5f1cf56e01fe2b3dc57f5dff5133 Author: KWSys Robot AuthorDate: Fri Jan 23 13:14:29 2015 -0500 Commit: Brad King CommitDate: Sat Jan 24 07:38:43 2015 -0500 KWSys 2015-01-23 (d4e7f08e) Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ d4e7f08e | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' b33e7b96..d4e7f08e Brad King (1): d4e7f08e Directory: Check opendir return value before using it Change-Id: I3485ec9c7ad3b7f25df610d4d1898c5150a995f0 diff --git a/Directory.cxx b/Directory.cxx index 04b2866..58cea63 100644 --- a/Directory.cxx +++ b/Directory.cxx @@ -244,6 +244,11 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na { DIR* dir = opendir(name.c_str()); + if (!dir) + { + return 0; + } + unsigned long count = 0; for (kwsys_dirent* d = readdir(dir); d; d = readdir(dir) ) { ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- Source/kwsys/Directory.cxx | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Sun Jan 25 00:01:10 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sun, 25 Jan 2015 00:01:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-891-g5a9d54a Message-ID: <20150125050110.413E6AA090@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 5a9d54a67a90aeaad87b7366d6f41211529e6c41 (commit) from 97502ba77b6d589e2ff48a22b703f6908d5b5fdc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5a9d54a67a90aeaad87b7366d6f41211529e6c41 commit 5a9d54a67a90aeaad87b7366d6f41211529e6c41 Author: Kitware Robot AuthorDate: Sun Jan 25 00:01:08 2015 -0500 Commit: Kitware Robot CommitDate: Sun Jan 25 00:01:08 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 07f8fd2..3a6e489 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 20150124) +set(CMake_VERSION_PATCH 20150125) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 25 07:57:16 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 25 Jan 2015 07:57:16 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2306-g5b5d8da Message-ID: <20150125125716.734E9A95FB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5b5d8daf1082dbc0c4c9cdb6097dd6663aea81fb (commit) via b7a1769bdee9169dbda0d7e46fee9ff0bfa3c0fd (commit) via f4bd6712fabf24cd78c72c6d6c2d428a828aa97f (commit) from 7bd36637c767f0a8e4dd159d36037b7058ae7b81 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5b5d8daf1082dbc0c4c9cdb6097dd6663aea81fb commit 5b5d8daf1082dbc0c4c9cdb6097dd6663aea81fb Merge: 7bd3663 b7a1769 Author: Brad King AuthorDate: Sun Jan 25 07:57:15 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 25 07:57:15 2015 -0500 Merge topic 'test-rerun-cmake' into next b7a1769b fixup! try_compile: Test that CMake re-runs on input change f4bd6712 fixup! configure_file: Test that CMake re-runs on input change http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b7a1769bdee9169dbda0d7e46fee9ff0bfa3c0fd commit b7a1769bdee9169dbda0d7e46fee9ff0bfa3c0fd Author: Brad King AuthorDate: Sun Jan 25 07:43:50 2015 -0500 Commit: Brad King CommitDate: Sun Jan 25 07:43:50 2015 -0500 fixup! try_compile: Test that CMake re-runs on input change diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt index e1a1b5a..b0438f5 100644 --- a/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt @@ -2,4 +2,4 @@ Running CMake on RerunCMake FALSE -- Configuring done -- Generating done --- Build files have been written to: .*Tests/RunCMake/try_compile/RerunCMake-build +-- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt index 867db5f..9c78b26 100644 --- a/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt @@ -1,3 +1,3 @@ -- Configuring done -- Generating done --- Build files have been written to: .*Tests/RunCMake/try_compile/RerunCMake-build +-- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt index 867db5f..9c78b26 100644 --- a/Tests/RunCMake/try_compile/RerunCMake-stdout.txt +++ b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt @@ -1,3 +1,3 @@ -- Configuring done -- Generating done --- Build files have been written to: .*Tests/RunCMake/try_compile/RerunCMake-build +-- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4bd6712fabf24cd78c72c6d6c2d428a828aa97f commit f4bd6712fabf24cd78c72c6d6c2d428a828aa97f Author: Brad King AuthorDate: Sun Jan 25 07:43:14 2015 -0500 Commit: Brad King CommitDate: Sun Jan 25 07:43:23 2015 -0500 fixup! configure_file: Test that CMake re-runs on input change diff --git a/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt index 1bd5be7..34c873c 100644 --- a/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt +++ b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt @@ -1,3 +1,3 @@ -- Configuring done -- Generating done --- Build files have been written to: .*Tests/RunCMake/configure_file/RerunCMake-build +-- Build files have been written to: .*/Tests/RunCMake/configure_file/RerunCMake-build diff --git a/Tests/RunCMake/configure_file/RerunCMake-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt index 1bd5be7..34c873c 100644 --- a/Tests/RunCMake/configure_file/RerunCMake-stdout.txt +++ b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt @@ -1,3 +1,3 @@ -- Configuring done -- Generating done --- Build files have been written to: .*Tests/RunCMake/configure_file/RerunCMake-build +-- Build files have been written to: .*/Tests/RunCMake/configure_file/RerunCMake-build ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt | 2 +- Tests/RunCMake/configure_file/RerunCMake-stdout.txt | 2 +- .../try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt | 2 +- Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt | 2 +- Tests/RunCMake/try_compile/RerunCMake-stdout.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Sun Jan 25 08:12:46 2015 From: brad.king at kitware.com (Brad King) Date: Sun, 25 Jan 2015 08:12:46 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2308-g82e1359 Message-ID: <20150125131246.D5E164880@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 82e135908ad68429d857e6439b9e10398b2668d7 (commit) via 494f6e8d5b9f2e556a2b2db2c165a56c01fd1827 (commit) from 5b5d8daf1082dbc0c4c9cdb6097dd6663aea81fb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82e135908ad68429d857e6439b9e10398b2668d7 commit 82e135908ad68429d857e6439b9e10398b2668d7 Merge: 5b5d8da 494f6e8 Author: Brad King AuthorDate: Sun Jan 25 08:12:45 2015 -0500 Commit: CMake Topic Stage CommitDate: Sun Jan 25 08:12:45 2015 -0500 Merge topic 'shorten-test-paths' into next 494f6e8d Tests: Shorten paths in CompileDefinitions http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=494f6e8d5b9f2e556a2b2db2c165a56c01fd1827 commit 494f6e8d5b9f2e556a2b2db2c165a56c01fd1827 Author: Brad King AuthorDate: Sun Jan 25 08:09:10 2015 -0500 Commit: Brad King CommitDate: Sun Jan 25 08:12:12 2015 -0500 Tests: Shorten paths in CompileDefinitions Shorten the add_definitions command test directory and target names to avoid creating really long paths that fail with some tools on Windows. While at it, remove unnecessary project() command calls. diff --git a/Tests/CompileDefinitions/CMakeLists.txt b/Tests/CompileDefinitions/CMakeLists.txt index 930d220..13d1b01 100644 --- a/Tests/CompileDefinitions/CMakeLists.txt +++ b/Tests/CompileDefinitions/CMakeLists.txt @@ -1,6 +1,4 @@ - cmake_minimum_required(VERSION 2.8) - project(CompileDefinitions) if ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 6") @@ -19,8 +17,8 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_CONFIG_NAME=\"$\"" ) -add_subdirectory(add_definitions_command) +add_subdirectory(add_def_cmd) add_subdirectory(target_prop) -add_subdirectory(add_definitions_command_with_target_prop) +add_subdirectory(add_def_cmd_tprop) add_executable(CompileDefinitions runtest.c) diff --git a/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt b/Tests/CompileDefinitions/add_def_cmd/CMakeLists.txt similarity index 80% rename from Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt rename to Tests/CompileDefinitions/add_def_cmd/CMakeLists.txt index 23e0134..2bce602 100644 --- a/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt +++ b/Tests/CompileDefinitions/add_def_cmd/CMakeLists.txt @@ -1,6 +1,3 @@ - -project(add_definitions_command) - add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun -DCMAKE_IS_="Fun") if (NOT NO_SPACES_IN_DEFINE_VALUES) add_definitions(-DCMAKE_IS_REALLY="Very Fun") @@ -12,4 +9,4 @@ endif() add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun) add_definitions(-DBUILD_IS_DEBUG=$ -DBUILD_IS_NOT_DEBUG=$>) -add_executable(add_definitions_command_executable ../compiletest.cpp) +add_executable(add_def_cmd_exe ../compiletest.cpp) diff --git a/Tests/CompileDefinitions/add_def_cmd_tprop/CMakeLists.txt b/Tests/CompileDefinitions/add_def_cmd_tprop/CMakeLists.txt new file mode 100644 index 0000000..4ef8a09 --- /dev/null +++ b/Tests/CompileDefinitions/add_def_cmd_tprop/CMakeLists.txt @@ -0,0 +1,16 @@ +add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun) + +add_executable(add_def_cmd_tprop_exe ../compiletest.cpp) + +set_target_properties(add_def_cmd_tprop_exe PROPERTIES COMPILE_DEFINITIONS CMAKE_IS_="Fun") + +if (NOT NO_SPACES_IN_DEFINE_VALUES) + set_property(TARGET add_def_cmd_tprop_exe APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun") +endif() + +add_definitions(-DCMAKE_IS_FUN) + +set_property(TARGET add_def_cmd_tprop_exe APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS=Fun CMAKE_IS_="Fun") + +add_definitions(-DBUILD_IS_DEBUG=$) +set_property(TARGET add_def_cmd_tprop_exe APPEND PROPERTY COMPILE_DEFINITIONS BUILD_IS_NOT_DEBUG=$>) diff --git a/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt b/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt deleted file mode 100644 index 55108db..0000000 --- a/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -project(add_definitions_command_with_target_prop) - -add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun) - -add_executable(add_definitions_command_with_target_prop_executable ../compiletest.cpp) - -set_target_properties(add_definitions_command_with_target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAKE_IS_="Fun") - -if (NOT NO_SPACES_IN_DEFINE_VALUES) - set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun") -endif() - -add_definitions(-DCMAKE_IS_FUN) - -set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS=Fun CMAKE_IS_="Fun") - -add_definitions(-DBUILD_IS_DEBUG=$) -set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS BUILD_IS_NOT_DEBUG=$>) ----------------------------------------------------------------------- Summary of changes: Tests/CompileDefinitions/CMakeLists.txt | 6 ++---- .../CMakeLists.txt | 5 +---- .../add_def_cmd_tprop/CMakeLists.txt | 16 ++++++++++++++++ .../CMakeLists.txt | 19 ------------------- 4 files changed, 19 insertions(+), 27 deletions(-) rename Tests/CompileDefinitions/{add_definitions_command => add_def_cmd}/CMakeLists.txt (80%) create mode 100644 Tests/CompileDefinitions/add_def_cmd_tprop/CMakeLists.txt delete mode 100644 Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt hooks/post-receive -- CMake From kwrobot at kitware.com Mon Jan 26 00:01:11 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Mon, 26 Jan 2015 00:01:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-892-ge71c35f Message-ID: <20150126050111.AA21FAA94A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e71c35ff26df370121871dc7cc7fe9b585dac570 (commit) from 5a9d54a67a90aeaad87b7366d6f41211529e6c41 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e71c35ff26df370121871dc7cc7fe9b585dac570 commit e71c35ff26df370121871dc7cc7fe9b585dac570 Author: Kitware Robot AuthorDate: Mon Jan 26 00:01:09 2015 -0500 Commit: Kitware Robot CommitDate: Mon Jan 26 00:01:09 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 3a6e489..4f1867e 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 20150125) +set(CMake_VERSION_PATCH 20150126) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 08:32:08 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 08:32:08 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2310-gc4c05f4 Message-ID: <20150126133208.DC7BEAA93E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c4c05f4d6619641c241f90e43301e924013d0e69 (commit) via 539c5c252ef679d15f3af828da304ad9313640e2 (commit) from 82e135908ad68429d857e6439b9e10398b2668d7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4c05f4d6619641c241f90e43301e924013d0e69 commit c4c05f4d6619641c241f90e43301e924013d0e69 Merge: 82e1359 539c5c2 Author: Brad King AuthorDate: Mon Jan 26 08:32:07 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 08:32:07 2015 -0500 Merge topic 'shorten-test-paths' into next 539c5c25 Tests: Shorten paths in RunCMake.CompileFeatures http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=539c5c252ef679d15f3af828da304ad9313640e2 commit 539c5c252ef679d15f3af828da304ad9313640e2 Author: Brad King AuthorDate: Sun Jan 25 08:09:10 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 08:30:57 2015 -0500 Tests: Shorten paths in RunCMake.CompileFeatures Shorten the NotAFeature_OriginDebug_target_compile_features case name to avoid creating really long paths that fail with some tools on Windows. diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-result.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-result.txt similarity index 100% rename from Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-result.txt rename to Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-result.txt diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-stderr.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-stderr.txt similarity index 61% rename from Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-stderr.txt rename to Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-stderr.txt index d819d15..1f2c113 100644 --- a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-stderr.txt +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at NotAFeature_OriginDebug_target_compile_features.cmake:4 \(target_compile_features\): +CMake Error at NotAFeature_OriginDebugCommand.cmake:4 \(target_compile_features\): target_compile_features specified unknown feature "not_a_feature" for target "somelib". Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features.cmake b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand.cmake similarity index 100% rename from Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features.cmake rename to Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand.cmake diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..376f75a 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -6,7 +6,7 @@ run_cmake(NotAFeatureTransitive) run_cmake(NotAFeature_OriginDebug) run_cmake(NotAFeature_OriginDebugGenex) run_cmake(NotAFeature_OriginDebugTransitive) -run_cmake(NotAFeature_OriginDebug_target_compile_features) +run_cmake(NotAFeature_OriginDebugCommand) run_cmake(generate_feature_list) file(READ ----------------------------------------------------------------------- Summary of changes: ...features-result.txt => NotAFeature_OriginDebugCommand-result.txt} | 0 ...features-stderr.txt => NotAFeature_OriginDebugCommand-stderr.txt} | 2 +- ...t_compile_features.cmake => NotAFeature_OriginDebugCommand.cmake} | 0 Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename Tests/RunCMake/CompileFeatures/{NotAFeature_OriginDebug_target_compile_features-result.txt => NotAFeature_OriginDebugCommand-result.txt} (100%) rename Tests/RunCMake/CompileFeatures/{NotAFeature_OriginDebug_target_compile_features-stderr.txt => NotAFeature_OriginDebugCommand-stderr.txt} (61%) rename Tests/RunCMake/CompileFeatures/{NotAFeature_OriginDebug_target_compile_features.cmake => NotAFeature_OriginDebugCommand.cmake} (100%) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 09:15:43 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 09:15:43 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2312-g8bc5b3c Message-ID: <20150126141543.B5967A772F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8bc5b3cfb1b0e7af49b9e0c6a4c269b5be273f5a (commit) via c7310917e6b5efa6ef867ef5cabc5b5649d97b67 (commit) from c4c05f4d6619641c241f90e43301e924013d0e69 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8bc5b3cfb1b0e7af49b9e0c6a4c269b5be273f5a commit 8bc5b3cfb1b0e7af49b9e0c6a4c269b5be273f5a Merge: c4c05f4 c731091 Author: Brad King AuthorDate: Mon Jan 26 09:15:43 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 09:15:43 2015 -0500 Merge topic 'doc-link_libraries-note' into next c7310917 Help: Clarify status of link_libraries command http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c7310917e6b5efa6ef867ef5cabc5b5649d97b67 commit c7310917e6b5efa6ef867ef5cabc5b5649d97b67 Author: Brad King AuthorDate: Mon Jan 26 09:13:47 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 09:15:00 2015 -0500 Help: Clarify status of link_libraries command The command has been documented as 'deprecated', but it is not really slated for removal and can still be used. Clarify this in the documentation. While at it, revise the documentation to use wording more consistent with that now in target_link_libraries. Suggested-by: Christoph Gr?ninger diff --git a/Help/command/link_libraries.rst b/Help/command/link_libraries.rst index d690c9b..fd5dc37 100644 --- a/Help/command/link_libraries.rst +++ b/Help/command/link_libraries.rst @@ -1,16 +1,19 @@ link_libraries -------------- -Deprecated. Use the target_link_libraries() command instead. - Link libraries to all targets added later. :: - link_libraries(library1 library2 ...) + link_libraries([item1 [item2 [...]]] + [[debug|optimized|general] ] ...) + +Specify libraries or flags to use when linking any targets created later in +the current directory or below by commands such as :command:`add_executable` +or :command:`add_library`. See the :command:`target_link_libraries` command +for meaning of arguments. -Specify a list of libraries to be linked into any following targets -(typically added with the add_executable or add_library calls). This -command is passed down to all subdirectories. The debug and optimized -strings may be used to indicate that the next library listed is to be -used only for that specific type of build. +.. note:: + The :command:`target_link_libraries` command should be preferred whenever + possible. Library dependencies are chained automatically, so directory-wide + specification of link libraries is rarely needed. diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst index 9c1d3b9..14871f2 100644 --- a/Help/manual/cmake-commands.7.rst +++ b/Help/manual/cmake-commands.7.rst @@ -67,6 +67,7 @@ These commands may be used freely in CMake projects. /command/include /command/install /command/link_directories + /command/link_libraries /command/list /command/load_cache /command/load_command @@ -117,7 +118,6 @@ versions of CMake. Do not use them in new code. /command/install_files /command/install_programs /command/install_targets - /command/link_libraries /command/make_directory /command/output_required_files /command/remove ----------------------------------------------------------------------- Summary of changes: Help/command/link_libraries.rst | 19 +++++++++++-------- Help/manual/cmake-commands.7.rst | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 09:46:53 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 09:46:53 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2314-gfce896b Message-ID: <20150126144653.BFC28A9E15@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fce896b44813a1babddc2451d26223e7dfdfae45 (commit) via 6cc0f6b512d08caabf088d22f3f25432e6307b6a (commit) from 8bc5b3cfb1b0e7af49b9e0c6a4c269b5be273f5a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fce896b44813a1babddc2451d26223e7dfdfae45 commit fce896b44813a1babddc2451d26223e7dfdfae45 Merge: 8bc5b3c 6cc0f6b Author: Brad King AuthorDate: Mon Jan 26 09:46:52 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 09:46:52 2015 -0500 Merge topic 'load-initial-cache-from-stderr-to-stdout' into next 6cc0f6b5 cmake: Display "loading initial cache" message on stdout http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6cc0f6b512d08caabf088d22f3f25432e6307b6a commit 6cc0f6b512d08caabf088d22f3f25432e6307b6a Author: Jean-Christophe Fillion-Robin AuthorDate: Sat Jan 24 20:15:28 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 09:44:44 2015 -0500 cmake: Display "loading initial cache" message on stdout This message has been on stderr since the "-C" option was first added, but it is informational and not an error. Other informational messages go to stdout, so send this one there too. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 29d8206..652e451 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -437,7 +437,7 @@ bool cmake::SetCacheArgs(const std::vector& args) return false; } } - std::cerr << "loading initial cache file " << path << "\n"; + std::cout << "loading initial cache file " << path << "\n"; this->ReadListFile(args, path.c_str()); } else if(arg.find("-P",0) == 0) ----------------------------------------------------------------------- Summary of changes: Source/cmake.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 09:51:51 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 09:51:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-895-g1337576 Message-ID: <20150126145152.13768AA151@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 1337576b24feef973fca7cc45c695b495b3f8a5e (commit) via 0abd3e538eb92259e52c3d330e46dac7aa0be332 (commit) via 6ce346c53c67ba970cd04f0d8436aab006dbec71 (commit) from e71c35ff26df370121871dc7cc7fe9b585dac570 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1337576b24feef973fca7cc45c695b495b3f8a5e commit 1337576b24feef973fca7cc45c695b495b3f8a5e Merge: e71c35f 0abd3e5 Author: Brad King AuthorDate: Mon Jan 26 09:51:50 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 09:51:50 2015 -0500 Merge topic 'curl-default-cainfo' 0abd3e53 cmake: Use a default CA path when not using system curl 6ce346c5 curl: Add CURL_CA_PATH option to CMake build process ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 7 +++ Help/release/dev/curl-default-cainfo.rst | 8 +++ Source/CMakeLists.txt | 8 +++ Source/CTest/cmCTestSubmitHandler.cxx | 3 +- Source/cmCTest.cxx | 3 +- Source/cmCurl.cxx | 64 +++++++++++++++++++++++ Utilities/cm_jsoncpp_value.h => Source/cmCurl.h | 16 +++--- Source/cmFileCommand.cxx | 9 ++-- Utilities/cmcurl/CMakeLists.txt | 9 ++-- Utilities/cmcurl/lib/curl_config.h.cmake | 6 --- 10 files changed, 107 insertions(+), 26 deletions(-) create mode 100644 Help/release/dev/curl-default-cainfo.rst create mode 100644 Source/cmCurl.cxx copy Utilities/cm_jsoncpp_value.h => Source/cmCurl.h (70%) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 09:51:54 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 09:51:54 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-897-gdfdcc42 Message-ID: <20150126145154.620D4AA14B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via dfdcc42c60c723200a0ec9dc0c49e9765384733a (commit) via 097e26f4908b3099f112c3fdc5e043234f9adc53 (commit) from 1337576b24feef973fca7cc45c695b495b3f8a5e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dfdcc42c60c723200a0ec9dc0c49e9765384733a commit dfdcc42c60c723200a0ec9dc0c49e9765384733a Merge: 1337576 097e26f Author: Brad King AuthorDate: Mon Jan 26 09:51:53 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 09:51:53 2015 -0500 Merge topic 'ninja-rsp_file-calculation' 097e26f4 ninja: use the minimum of all command line length limits (#14892) ----------------------------------------------------------------------- Summary of changes: Source/cmNinjaNormalTargetGenerator.cxx | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 09:51:56 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 09:51:56 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-900-gcb243cc Message-ID: <20150126145156.9BA06AA154@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via cb243cce13e23882ca5d39b860cc747812874f04 (commit) via 391748d57e090c53f6c55ea265e038fde1bca032 (commit) via 0b9aad7568bc5f1cf56e01fe2b3dc57f5dff5133 (commit) from dfdcc42c60c723200a0ec9dc0c49e9765384733a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb243cce13e23882ca5d39b860cc747812874f04 commit cb243cce13e23882ca5d39b860cc747812874f04 Merge: dfdcc42 391748d Author: Brad King AuthorDate: Mon Jan 26 09:51:55 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 09:51:55 2015 -0500 Merge topic 'update-kwsys' 391748d5 Merge branch 'upstream-kwsys' into update-kwsys 0b9aad75 KWSys 2015-01-23 (d4e7f08e) ----------------------------------------------------------------------- Summary of changes: Source/kwsys/Directory.cxx | 5 +++++ 1 file changed, 5 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 09:51:58 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 09:51:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-902-ga65f794 Message-ID: <20150126145158.7A34EAA15D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via a65f7944a018f255d50e80ee45a6cef965f9b508 (commit) via a4605973ff116d11ca96c7b06aa6516bd638429a (commit) from cb243cce13e23882ca5d39b860cc747812874f04 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a65f7944a018f255d50e80ee45a6cef965f9b508 commit a65f7944a018f255d50e80ee45a6cef965f9b508 Merge: cb243cc a460597 Author: Brad King AuthorDate: Mon Jan 26 09:51:57 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 09:51:57 2015 -0500 Merge topic 'ExternalProject-switch-ALWAYS' a4605973 ExternalProject: Allow ALWAYS step property to be switched (#15368) ----------------------------------------------------------------------- Summary of changes: Modules/ExternalProject.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 09:52:00 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 09:52:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-904-g7fefb97 Message-ID: <20150126145200.977C2AA154@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 7fefb97ed770e8ac32729cf50be52e5c913bd7b7 (commit) via d5d3d0c9e43004d139939fa71bf3901fa96ce756 (commit) from a65f7944a018f255d50e80ee45a6cef965f9b508 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7fefb97ed770e8ac32729cf50be52e5c913bd7b7 commit 7fefb97ed770e8ac32729cf50be52e5c913bd7b7 Merge: a65f794 d5d3d0c Author: Brad King AuthorDate: Mon Jan 26 09:51:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 09:51:59 2015 -0500 Merge topic 'FindCUDA-cusolver' d5d3d0c9 Help: Add notes for topic 'FindCUDA-cusolver' ----------------------------------------------------------------------- Summary of changes: Help/release/dev/FindCUDA-cusolver.rst | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Help/release/dev/FindCUDA-cusolver.rst hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 09:53:21 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 09:53:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2322-g04344c3 Message-ID: <20150126145321.9734DAA22E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 04344c3f69d61444dca18bc3c4ca6c07c7197fd7 (commit) via 7fefb97ed770e8ac32729cf50be52e5c913bd7b7 (commit) via a65f7944a018f255d50e80ee45a6cef965f9b508 (commit) via cb243cce13e23882ca5d39b860cc747812874f04 (commit) via dfdcc42c60c723200a0ec9dc0c49e9765384733a (commit) via 1337576b24feef973fca7cc45c695b495b3f8a5e (commit) via e71c35ff26df370121871dc7cc7fe9b585dac570 (commit) via 5a9d54a67a90aeaad87b7366d6f41211529e6c41 (commit) from fce896b44813a1babddc2451d26223e7dfdfae45 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=04344c3f69d61444dca18bc3c4ca6c07c7197fd7 commit 04344c3f69d61444dca18bc3c4ca6c07c7197fd7 Merge: fce896b 7fefb97 Author: Brad King AuthorDate: Mon Jan 26 09:53:12 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 09:53:12 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 10:03:51 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 10:03:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2325-g5dce3cf Message-ID: <20150126150351.954E7AA9EB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5dce3cf7343b50d95a87f68ed9ffadd936d74c53 (commit) via d7f4b5673d4f68a3de0fa5d0dc71322dd575e443 (commit) via 8b0b49061310e2d14c34fe60d41b1082eaa72e77 (commit) from 04344c3f69d61444dca18bc3c4ca6c07c7197fd7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5dce3cf7343b50d95a87f68ed9ffadd936d74c53 commit 5dce3cf7343b50d95a87f68ed9ffadd936d74c53 Merge: 04344c3 d7f4b56 Author: Brad King AuthorDate: Mon Jan 26 10:03:50 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 10:03:50 2015 -0500 Merge topic 'try-run-link-libraries' into next d7f4b567 Help: Document try_run LINK_LIBRARIES option 8b0b4906 Help: Add notes for topic 'try-run-link-libraries' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7f4b5673d4f68a3de0fa5d0dc71322dd575e443 commit d7f4b5673d4f68a3de0fa5d0dc71322dd575e443 Author: Brad King AuthorDate: Mon Jan 26 10:03:12 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 10:03:12 2015 -0500 Help: Document try_run LINK_LIBRARIES option diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst index 66245f6..b8ea0fe 100644 --- a/Help/command/try_run.rst +++ b/Help/command/try_run.rst @@ -23,6 +23,12 @@ where the output from the compile step goes. RUN_OUTPUT_VARIABLE specifies the variable where the output from the running executable goes. +The srcfile signature also accepts a LINK_LIBRARIES argument which may +contain a list of libraries or IMPORTED targets which will be linked +to in the generated project. If LINK_LIBRARIES is specified as a +parameter to try_run, then any LINK_LIBRARIES passed as +CMAKE_FLAGS will be ignored. + For compatibility reasons OUTPUT_VARIABLE is still supported, which gives you the output from the compile and run step combined. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b0b49061310e2d14c34fe60d41b1082eaa72e77 commit 8b0b49061310e2d14c34fe60d41b1082eaa72e77 Author: Brad King AuthorDate: Mon Jan 26 09:57:55 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 09:57:55 2015 -0500 Help: Add notes for topic 'try-run-link-libraries' diff --git a/Help/release/dev/try-run-link-libraries.rst b/Help/release/dev/try-run-link-libraries.rst new file mode 100644 index 0000000..4f20cbd --- /dev/null +++ b/Help/release/dev/try-run-link-libraries.rst @@ -0,0 +1,5 @@ +try-run-link-libraries +---------------------- + +* The :command:`try_run` command learned to honor the ``LINK_LIBRARIES`` + option just as :command:`try_compile` already does. ----------------------------------------------------------------------- Summary of changes: Help/command/try_run.rst | 6 ++++++ Help/release/dev/try-run-link-libraries.rst | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 Help/release/dev/try-run-link-libraries.rst hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 10:06:48 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 10:06:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2329-gdbb7339 Message-ID: <20150126150648.EA3ADAAA4F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via dbb73396e7c7172ae58e42dd9840cf7f89f35da4 (commit) via d0adcccbf4321437f5ecb677c7f88b3e4af484ed (commit) via 223c5cb70b30b6a790fd916321f60c86d459e15e (commit) via e2b1f0583f7293bce280dfab397e96acf8a5b26e (commit) from 5dce3cf7343b50d95a87f68ed9ffadd936d74c53 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dbb73396e7c7172ae58e42dd9840cf7f89f35da4 commit dbb73396e7c7172ae58e42dd9840cf7f89f35da4 Merge: 5dce3cf d0adccc Author: Brad King AuthorDate: Mon Jan 26 10:06:47 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 10:06:47 2015 -0500 Merge topic 'try-run-link-libraries' into next d0adcccb try_run: Add tests for LINK_LIBRARIES with mock libraries. 223c5cb7 try_run: Add test for bad link libraries. e2b1f058 try_run: Add support for LINK_LIBRARIES option. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d0adcccbf4321437f5ecb677c7f88b3e4af484ed commit d0adcccbf4321437f5ecb677c7f88b3e4af484ed Author: Matt McCormick AuthorDate: Thu Jan 22 19:53:16 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 10:05:59 2015 -0500 try_run: Add tests for LINK_LIBRARIES with mock libraries. Extend the ExportImport test to try using an imported library with try_run. diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 9450c82..358776b 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -311,6 +311,21 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA message(SEND_ERROR "EXP_ERROR_VARIABLE try_compile failed, but it was expected to succeed ${OUTPUT}.") endif() + if(NOT CMAKE_CROSSCOMPILING) + unset(EXP_RUN_VAR CACHE) + unset(EXP_COMPILE_VAR CACHE) + try_run(EXP_RUN_VAR EXP_COMPILE_VAR + "${CMAKE_CURRENT_SOURCE_DIR}/test_system" + "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp" + COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable" + LINK_LIBRARIES exp_systemlib + OUTPUT_VARIABLE OUTPUT + ) + if(NOT EXP_COMPILE_VAR) + message(SEND_ERROR "try_run compile failed, but it was expected to succeed ${OUTPUT}.") + endif() + endif() + add_executable(test_system_bld test_system.cpp) target_link_libraries(test_system_bld bld_systemlib) target_compile_options(test_system_bld PRIVATE -Wunused-variable -Werror=unused-variable) @@ -326,5 +341,20 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA if(NOT BLD_ERROR_VARIABLE) message(SEND_ERROR "BLD_ERROR_VARIABLE try_compile failed, but it was expected to succeed.") endif() + + if(NOT CMAKE_CROSSCOMPILING) + unset(BLD_RUN_VAR CACHE) + unset(BLD_COMPILE_VAR CACHE) + try_run(BLD_RUN_VAR BLD_COMPILE_VAR + "${CMAKE_CURRENT_SOURCE_DIR}/test_system" + "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp" + COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable" + LINK_LIBRARIES bld_systemlib + OUTPUT_VARIABLE OUTPUT + ) + if(NOT BLD_COMPILE_VAR) + message(SEND_ERROR "try_run compile failed, but it was expected to succeed ${OUTPUT}.") + endif() + endif() endif() endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=223c5cb70b30b6a790fd916321f60c86d459e15e commit 223c5cb70b30b6a790fd916321f60c86d459e15e Author: Matt McCormick AuthorDate: Thu Jan 22 19:13:56 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 10:05:30 2015 -0500 try_run: Add test for bad link libraries. Based off the corresponding try_compile test. diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index b5e41d9..78d375e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -130,6 +130,7 @@ add_RunCMake_test(project) add_RunCMake_test(return) add_RunCMake_test(string) add_RunCMake_test(try_compile) +add_RunCMake_test(try_run) add_RunCMake_test(set) add_RunCMake_test(variable_watch) add_RunCMake_test(CMP0004) diff --git a/Tests/RunCMake/try_run/BadLinkLibraries-result.txt b/Tests/RunCMake/try_run/BadLinkLibraries-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_run/BadLinkLibraries-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt b/Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt new file mode 100644 index 0000000..dcd1bfc --- /dev/null +++ b/Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at BadLinkLibraries.cmake:2 \(try_run\): + Only libraries may be used as try_compile or try_run IMPORTED + LINK_LIBRARIES. Got not_a_library of type UTILITY. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_run/BadLinkLibraries.cmake b/Tests/RunCMake/try_run/BadLinkLibraries.cmake new file mode 100644 index 0000000..a124bf6 --- /dev/null +++ b/Tests/RunCMake/try_run/BadLinkLibraries.cmake @@ -0,0 +1,4 @@ +add_custom_target(not_a_library) +try_run(RUN_RESULT COMPILE_RESULT + ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c + LINK_LIBRARIES not_a_library) diff --git a/Tests/RunCMake/try_run/CMakeLists.txt b/Tests/RunCMake/try_run/CMakeLists.txt new file mode 100644 index 0000000..e034780 --- /dev/null +++ b/Tests/RunCMake/try_run/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.0) +project(${RunCMake_TEST} C) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/try_run/RunCMakeTest.cmake b/Tests/RunCMake/try_run/RunCMakeTest.cmake new file mode 100644 index 0000000..1ec9a55 --- /dev/null +++ b/Tests/RunCMake/try_run/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(BadLinkLibraries) diff --git a/Tests/RunCMake/try_run/src.c b/Tests/RunCMake/try_run/src.c new file mode 100644 index 0000000..78f2de1 --- /dev/null +++ b/Tests/RunCMake/try_run/src.c @@ -0,0 +1 @@ +int main(void) { return 0; } http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e2b1f0583f7293bce280dfab397e96acf8a5b26e commit e2b1f0583f7293bce280dfab397e96acf8a5b26e Author: Matt McCormick AuthorDate: Thu Jan 1 22:30:08 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 10:05:26 2015 -0500 try_run: Add support for LINK_LIBRARIES option. Most functionality is already implemented in Source/cmCoreTryCompile.{h,cxx}. Document and improve argument parsing. This functionality is already being used by a number of modules, like CheckCSourceCompiles.cmake, but it is not documented. diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst index 9a17ad9..b8ea0fe 100644 --- a/Help/command/try_run.rst +++ b/Help/command/try_run.rst @@ -6,8 +6,9 @@ Try compiling and then running some code. :: try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR - bindir srcfile [CMAKE_FLAGS ] + bindir srcfile [CMAKE_FLAGS ] [COMPILE_DEFINITIONS ] + [LINK_LIBRARIES ] [COMPILE_OUTPUT_VARIABLE comp] [RUN_OUTPUT_VARIABLE run] [OUTPUT_VARIABLE var] @@ -22,6 +23,12 @@ where the output from the compile step goes. RUN_OUTPUT_VARIABLE specifies the variable where the output from the running executable goes. +The srcfile signature also accepts a LINK_LIBRARIES argument which may +contain a list of libraries or IMPORTED targets which will be linked +to in the generated project. If LINK_LIBRARIES is specified as a +parameter to try_run, then any LINK_LIBRARIES passed as +CMAKE_FLAGS will be ignored. + For compatibility reasons OUTPUT_VARIABLE is still supported, which gives you the output from the compile and run step combined. diff --git a/Help/release/dev/try-run-link-libraries.rst b/Help/release/dev/try-run-link-libraries.rst new file mode 100644 index 0000000..4f20cbd --- /dev/null +++ b/Help/release/dev/try-run-link-libraries.rst @@ -0,0 +1,5 @@ +try-run-link-libraries +---------------------- + +* The :command:`try_run` command learned to honor the ``LINK_LIBRARIES`` + option just as :command:`try_compile` already does. diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 0030b84..2f58d96 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -109,7 +109,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector const& argv) } default: this->Makefile->IssueMessage(cmake::FATAL_ERROR, - "Only libraries may be used as try_compile IMPORTED " + "Only libraries may be used as try_compile or try_run IMPORTED " "LINK_LIBRARIES. Got " + std::string(tgt->GetName()) + " of " "type " + tgt->GetTargetTypeName(tgt->GetType()) + "."); return -1; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 8f2deeb..8bd33d0 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -48,7 +48,8 @@ bool cmTryRunCommand { ++i; while (i < argv.size() && argv[i] != "COMPILE_DEFINITIONS" && - argv[i] != "CMAKE_FLAGS") + argv[i] != "CMAKE_FLAGS" && + argv[i] != "LINK_LIBRARIES") { runArgs += " "; runArgs += argv[i]; diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt index eceffec..652bcfc 100644 --- a/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt +++ b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt @@ -1,5 +1,5 @@ CMake Error at BadLinkLibraries.cmake:2 \(try_compile\): - Only libraries may be used as try_compile IMPORTED LINK_LIBRARIES. Got - not_a_library of type UTILITY. + Only libraries may be used as try_compile or try_run IMPORTED + LINK_LIBRARIES. Got not_a_library of type UTILITY. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 10:07:26 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 10:07:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2331-g9dfe97f Message-ID: <20150126150726.2BA12AAAE4@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9dfe97f83ff4472e34e161d978efcfba7ed793a2 (commit) via 482c84759fb6df983d519ca2ac61e3c92c0ae7e3 (commit) from dbb73396e7c7172ae58e42dd9840cf7f89f35da4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9dfe97f83ff4472e34e161d978efcfba7ed793a2 commit 9dfe97f83ff4472e34e161d978efcfba7ed793a2 Merge: dbb7339 482c847 Author: Brad King AuthorDate: Mon Jan 26 10:07:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 10:07:25 2015 -0500 Merge topic 'backport-kwsys-directory-check-opendir' into next 482c8475 KWSys Directory: Check opendir return value before using it (#15367) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=482c84759fb6df983d519ca2ac61e3c92c0ae7e3 commit 482c84759fb6df983d519ca2ac61e3c92c0ae7e3 Author: Brad King AuthorDate: Fri Jan 23 13:14:01 2015 -0500 Commit: Brad King CommitDate: Fri Jan 23 13:19:07 2015 -0500 KWSys Directory: Check opendir return value before using it (#15367) In Directory::GetNumberOfFilesInDirectory add a missing check for NULL. diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx index 741bcba..7041f7b 100644 --- a/Source/kwsys/Directory.cxx +++ b/Source/kwsys/Directory.cxx @@ -239,6 +239,11 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na { DIR* dir = opendir(name.c_str()); + if (!dir) + { + return 0; + } + unsigned long count = 0; for (dirent* d = readdir(dir); d; d = readdir(dir) ) { ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 10:24:22 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 10:24:22 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2333-g909bcad Message-ID: <20150126152422.AB849AA436@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 909bcad178c51bef0a063ab1d00e9a64c466261c (commit) via 148ad4b304ddc7cd151e022edf71b0fa89e50dcb (commit) from 9dfe97f83ff4472e34e161d978efcfba7ed793a2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=909bcad178c51bef0a063ab1d00e9a64c466261c commit 909bcad178c51bef0a063ab1d00e9a64c466261c Merge: 9dfe97f 148ad4b Author: Brad King AuthorDate: Mon Jan 26 10:24:21 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 10:24:21 2015 -0500 Merge topic 'cmake-builtin-targets-use-ninja-terminal' into next 148ad4b3 Configure some CMake-provided targets with USES_TERMINAL (#14915) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=148ad4b304ddc7cd151e022edf71b0fa89e50dcb commit 148ad4b304ddc7cd151e022edf71b0fa89e50dcb Author: Sylvain Joubert AuthorDate: Sat Jan 24 19:42:31 2015 +0100 Commit: Brad King CommitDate: Mon Jan 26 10:16:58 2015 -0500 Configure some CMake-provided targets with USES_TERMINAL (#14915) This will make them use the 'console' pool with the Ninja generator. Impacted targets are: - Built-in targets: install, install/local, install/strip, tests, package, package_source, rebuild_cache - Targets provided by the CTestTargets module: Nightly, Continuous, Experimental, and all their variants (*Start, *Configure, ...) diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake index 5b6e062..1157850 100644 --- a/Modules/CTestTargets.cmake +++ b/Modules/CTestTargets.cmake @@ -67,6 +67,7 @@ if(NOT _CTEST_TARGETS_ADDED) foreach(mode Experimental Nightly Continuous NightlyMemoryCheck) add_custom_target(${mode} ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode} + USES_TERMINAL ) set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "") set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets") @@ -82,6 +83,7 @@ if(NOT _CTEST_TARGETS_ADDED) ) add_custom_target(${mode}${testtype} ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype} + USES_TERMINAL ) set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "") set_property(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets") @@ -94,6 +96,7 @@ if(NOT _CTEST_TARGETS_ADDED) if(CTEST_TEST_TARGET_ALIAS) add_custom_target(${CTEST_TEST_TARGET_ALIAS} ${CMAKE_CTEST_COMMAND} ${__conf_types} + USES_TERMINAL ) endif() endif() diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index dd3b1ec..4c95a9f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2191,7 +2191,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) = this->CreateGlobalTarget(this->GetPackageTargetName(), "Run CPack packaging tool...", &cpackCommandLines, depends, - workingDir.c_str(), /*uses_terminal*/false); + workingDir.c_str(), /*uses_terminal*/true); } // CPack source const char* packageSourceTargetName = this->GetPackageSourceTargetName(); @@ -2215,7 +2215,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) = this->CreateGlobalTarget(packageSourceTargetName, "Run CPack packaging tool for source...", &cpackCommandLines, depends, - workingDir.c_str(), /*uses_terminal*/false); + workingDir.c_str(), /*uses_terminal*/true); } } @@ -2241,7 +2241,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[this->GetTestTargetName()] = this->CreateGlobalTarget(this->GetTestTargetName(), "Running tests...", &cpackCommandLines, depends, 0, - /*uses_terminal*/false); + /*uses_terminal*/true); } //Edit Cache @@ -2296,7 +2296,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[rebuildCacheTargetName] = this->CreateGlobalTarget( rebuildCacheTargetName, "Running CMake to regenerate build system...", - &cpackCommandLines, depends, 0, /*uses_terminal*/false); + &cpackCommandLines, depends, 0, /*uses_terminal*/true); } //Install @@ -2377,7 +2377,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[this->GetInstallTargetName()] = this->CreateGlobalTarget( this->GetInstallTargetName(), "Install the project...", - &cpackCommandLines, depends, 0, /*uses_terminal*/false); + &cpackCommandLines, depends, 0, /*uses_terminal*/true); // install_local if(const char* install_local = this->GetInstallLocalTargetName()) @@ -2393,7 +2393,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[install_local] = this->CreateGlobalTarget( install_local, "Installing only the local directory...", - &cpackCommandLines, depends, 0, /*uses_terminal*/false); + &cpackCommandLines, depends, 0, /*uses_terminal*/true); } // install_strip @@ -2410,7 +2410,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[install_strip] = this->CreateGlobalTarget( install_strip, "Installing the project stripped...", - &cpackCommandLines, depends, 0, /*uses_terminal*/false); + &cpackCommandLines, depends, 0, /*uses_terminal*/true); } } } ----------------------------------------------------------------------- Summary of changes: Modules/CTestTargets.cmake | 3 +++ Source/cmGlobalGenerator.cxx | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 10:28:27 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 10:28:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-908-g8def825 Message-ID: <20150126152827.637CDAA93C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 8def82585c8fe81de8ee4c852f8065e19435532e (commit) via d0adcccbf4321437f5ecb677c7f88b3e4af484ed (commit) via 223c5cb70b30b6a790fd916321f60c86d459e15e (commit) via e2b1f0583f7293bce280dfab397e96acf8a5b26e (commit) from 7fefb97ed770e8ac32729cf50be52e5c913bd7b7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8def82585c8fe81de8ee4c852f8065e19435532e commit 8def82585c8fe81de8ee4c852f8065e19435532e Merge: 7fefb97 d0adccc Author: Brad King AuthorDate: Mon Jan 26 10:28:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 10:28:25 2015 -0500 Merge topic 'try-run-link-libraries' d0adcccb try_run: Add tests for LINK_LIBRARIES with mock libraries. 223c5cb7 try_run: Add test for bad link libraries. e2b1f058 try_run: Add support for LINK_LIBRARIES option. ----------------------------------------------------------------------- Summary of changes: Help/command/try_run.rst | 9 +++++- Help/release/dev/try-run-link-libraries.rst | 5 ++++ Source/cmCoreTryCompile.cxx | 2 +- Source/cmTryRunCommand.cxx | 3 +- Tests/ExportImport/Import/A/CMakeLists.txt | 30 ++++++++++++++++++++ Tests/RunCMake/CMakeLists.txt | 1 + .../try_compile/BadLinkLibraries-stderr.txt | 4 +-- .../BadLinkLibraries-result.txt} | 0 Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt | 5 ++++ Tests/RunCMake/try_run/BadLinkLibraries.cmake | 4 +++ .../{ObjectLibrary => try_run}/CMakeLists.txt | 2 +- Tests/RunCMake/try_run/RunCMakeTest.cmake | 3 ++ Tests/RunCMake/{try_compile => try_run}/src.c | 0 13 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 Help/release/dev/try-run-link-libraries.rst copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => try_run/BadLinkLibraries-result.txt} (100%) create mode 100644 Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt create mode 100644 Tests/RunCMake/try_run/BadLinkLibraries.cmake copy Tests/RunCMake/{ObjectLibrary => try_run}/CMakeLists.txt (61%) create mode 100644 Tests/RunCMake/try_run/RunCMakeTest.cmake copy Tests/RunCMake/{try_compile => try_run}/src.c (100%) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 10:28:29 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 10:28:29 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-910-g3747337 Message-ID: <20150126152829.9AF2FAA93E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 37473374f969f476a7fec87cdc3465c9ab8f99ef (commit) via 482c84759fb6df983d519ca2ac61e3c92c0ae7e3 (commit) from 8def82585c8fe81de8ee4c852f8065e19435532e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37473374f969f476a7fec87cdc3465c9ab8f99ef commit 37473374f969f476a7fec87cdc3465c9ab8f99ef Merge: 8def825 482c847 Author: Brad King AuthorDate: Mon Jan 26 10:28:28 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 10:28:28 2015 -0500 Merge topic 'backport-kwsys-directory-check-opendir' 482c8475 KWSys Directory: Check opendir return value before using it (#15367) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 10:28:31 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 10:28:31 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-912-g19e57a4 Message-ID: <20150126152831.9AE1CAA93F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 19e57a48cd1ad562b277c8fb9dc8285ef96acfa0 (commit) via 23bf98fc04eccc85f216fdab4166107c3d958d43 (commit) from 37473374f969f476a7fec87cdc3465c9ab8f99ef (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=19e57a48cd1ad562b277c8fb9dc8285ef96acfa0 commit 19e57a48cd1ad562b277c8fb9dc8285ef96acfa0 Merge: 3747337 23bf98f Author: Brad King AuthorDate: Mon Jan 26 10:28:30 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 10:28:30 2015 -0500 Merge topic 'tests-RunCMake-make-program' 23bf98fc Tests/RunCMake: Honor CMAKE_MAKE_PROGRAM ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/CMakeLists.txt | 1 + Tests/RunCMake/RunCMake.cmake | 3 +++ 2 files changed, 4 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 10:28:51 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 10:28:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2337-ga274292 Message-ID: <20150126152851.54BEAAA93E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a2742925ced9b822a2249aad5982b5d8f07c8c02 (commit) via 19e57a48cd1ad562b277c8fb9dc8285ef96acfa0 (commit) via 37473374f969f476a7fec87cdc3465c9ab8f99ef (commit) via 8def82585c8fe81de8ee4c852f8065e19435532e (commit) from 909bcad178c51bef0a063ab1d00e9a64c466261c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2742925ced9b822a2249aad5982b5d8f07c8c02 commit a2742925ced9b822a2249aad5982b5d8f07c8c02 Merge: 909bcad 19e57a4 Author: Brad King AuthorDate: Mon Jan 26 10:28:42 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 10:28:42 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From clinton at elemtech.com Mon Jan 26 10:38:01 2015 From: clinton at elemtech.com (Clinton Stimpson) Date: Mon, 26 Jan 2015 10:38:01 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2342-gd4506d1 Message-ID: <20150126153801.7CB84AAB48@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d4506d1708d5da92f5ba26b43262db6d8b0077f9 (commit) via b17d835f7d6047dfb5ec33283eb75c4c5ebdc353 (commit) via f31d11f635edd36d6ef3d946a475565533b33854 (commit) via 0379c24d878e763ebb5918014fc58380a379ac18 (commit) via c805a31c2ced7199b2807cecc22213e96c0279c8 (commit) from a2742925ced9b822a2249aad5982b5d8f07c8c02 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4506d1708d5da92f5ba26b43262db6d8b0077f9 commit d4506d1708d5da92f5ba26b43262db6d8b0077f9 Merge: a274292 b17d835 Author: Clinton Stimpson AuthorDate: Mon Jan 26 10:38:00 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 10:38:00 2015 -0500 Merge topic 'file-strings-utf-16' into next b17d835f StringFileTest: Use LENGTH_MINIMUM instead of REGEX. f31d11f6 StringFileTest: read files using same encoding. Add tests for BOM use. 0379c24d Add test for file(STRINGS) with UTF-16 and UTF-32 encodings. c805a31c file STRINGS UTF-16 and UTF-32 convertible to ASCII http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b17d835f7d6047dfb5ec33283eb75c4c5ebdc353 commit b17d835f7d6047dfb5ec33283eb75c4c5ebdc353 Author: Clinton Stimpson AuthorDate: Mon Jan 26 08:27:59 2015 -0700 Commit: Clinton Stimpson CommitDate: Mon Jan 26 08:32:13 2015 -0700 StringFileTest: Use LENGTH_MINIMUM instead of REGEX. This clarifies the intent of getting strings longer than 4. diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 3998b7e..539b854 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -69,7 +69,7 @@ endif() foreach(bit 16 32) foreach(endian LE BE) set(file_to_check UTF-${bit}${endian}.txt) - file(STRINGS ${file_to_check} str ENCODING UTF-${bit}${endian} REGEX "....") + file(STRINGS ${file_to_check} str ENCODING UTF-${bit}${endian} LENGTH_MINIMUM 4) message("${file_to_check} as UTF-${bit}${endian}: ${str}") if(NOT str MATCHES "Hello World") message(SEND_ERROR http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f31d11f635edd36d6ef3d946a475565533b33854 commit f31d11f635edd36d6ef3d946a475565533b33854 Author: Justin Borodinsky AuthorDate: Fri Jan 16 20:13:01 2015 -0500 Commit: Clinton Stimpson CommitDate: Mon Jan 26 08:32:13 2015 -0700 StringFileTest: read files using same encoding. Add tests for BOM use. diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 7a818cb..3998b7e 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -69,22 +69,25 @@ endif() foreach(bit 16 32) foreach(endian LE BE) set(file_to_check UTF-${bit}${endian}.txt) - foreach(bit_check 16 32) - foreach(endian_check LE BE) - file(STRINGS ${file_to_check} str ENCODING UTF-${bit_check}${endian_check}) - if("${bit}" STREQUAL "${bitcheck}") - if(NOT str MATCHES "Hello World") - message(SEND_ERROR + file(STRINGS ${file_to_check} str ENCODING UTF-${bit}${endian} REGEX "....") + message("${file_to_check} as UTF-${bit}${endian}: ${str}") + if(NOT str MATCHES "Hello World") + message(SEND_ERROR "file(STRINGS) incorrectly read from ${file_to_check} file [${str}]") - endif() - else() - if(NOT "${str}" STREQUAL "") - message(SEND_ERROR + endif() + endforeach() +endforeach() + +# check files using BOM for encoding +foreach(bit 16 32) + foreach(endian LE BE) + set(file_to_check UTF-${bit}${endian}.txt) + file(STRINGS ${file_to_check} str REGEX "....") + message("${file_to_check} : ${str}") + if(NOT str MATCHES "Hello World") + message(SEND_ERROR "file(STRINGS) incorrectly read from ${file_to_check} file [${str}]") - endif() - endif() - endforeach() - endforeach() + endif() endforeach() endforeach() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0379c24d878e763ebb5918014fc58380a379ac18 commit 0379c24d878e763ebb5918014fc58380a379ac18 Author: Clinton Stimpson AuthorDate: Tue Jan 13 22:29:55 2015 -0700 Commit: Clinton Stimpson CommitDate: Mon Jan 26 08:32:13 2015 -0700 Add test for file(STRINGS) with UTF-16 and UTF-32 encodings. diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index faf3bc9..7a818cb 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -65,6 +65,29 @@ else() "file(STRINGS) incorrectly read from utf8 file [${infile_strings}]") endif() +# check files with UTF-16 or UTF-32 content +foreach(bit 16 32) + foreach(endian LE BE) + set(file_to_check UTF-${bit}${endian}.txt) + foreach(bit_check 16 32) + foreach(endian_check LE BE) + file(STRINGS ${file_to_check} str ENCODING UTF-${bit_check}${endian_check}) + if("${bit}" STREQUAL "${bitcheck}") + if(NOT str MATCHES "Hello World") + message(SEND_ERROR + "file(STRINGS) incorrectly read from ${file_to_check} file [${str}]") + endif() + else() + if(NOT "${str}" STREQUAL "") + message(SEND_ERROR + "file(STRINGS) incorrectly read from ${file_to_check} file [${str}]") + endif() + endif() + endforeach() + endforeach() + endforeach() +endforeach() + # String test string(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great") string(REGEX MATCHALL "[cC][mM][aA][kK][eE]" rmallvar "CMake is better than cmake or CMake") diff --git a/Tests/StringFileTest/UTF-16BE.txt b/Tests/StringFileTest/UTF-16BE.txt new file mode 100644 index 0000000..9d976bc Binary files /dev/null and b/Tests/StringFileTest/UTF-16BE.txt differ diff --git a/Tests/StringFileTest/UTF-16LE.txt b/Tests/StringFileTest/UTF-16LE.txt new file mode 100644 index 0000000..ebba874 Binary files /dev/null and b/Tests/StringFileTest/UTF-16LE.txt differ diff --git a/Tests/StringFileTest/UTF-32BE.txt b/Tests/StringFileTest/UTF-32BE.txt new file mode 100644 index 0000000..6725fbb Binary files /dev/null and b/Tests/StringFileTest/UTF-32BE.txt differ diff --git a/Tests/StringFileTest/UTF-32LE.txt b/Tests/StringFileTest/UTF-32LE.txt new file mode 100644 index 0000000..cf5102f Binary files /dev/null and b/Tests/StringFileTest/UTF-32LE.txt differ http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c805a31c2ced7199b2807cecc22213e96c0279c8 commit c805a31c2ced7199b2807cecc22213e96c0279c8 Author: Justin Borodinsky AuthorDate: Sun Jan 11 14:33:36 2015 -0500 Commit: Clinton Stimpson CommitDate: Mon Jan 26 08:32:13 2015 -0700 file STRINGS UTF-16 and UTF-32 convertible to ASCII diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index f125292..579e715 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -472,7 +472,13 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) bool have_regex = false; bool newline_consume = false; bool hex_conversion_enabled = true; - bool utf8_encoding = false; + enum { encoding_none = cmsys::FStream::BOM_None, + encoding_utf8 = cmsys::FStream::BOM_UTF8, + encoding_utf16le = cmsys::FStream::BOM_UTF16LE, + encoding_utf16be = cmsys::FStream::BOM_UTF16BE, + encoding_utf32le = cmsys::FStream::BOM_UTF32LE, + encoding_utf32be = cmsys::FStream::BOM_UTF32BE}; + int encoding = encoding_none; int arg_mode = arg_none; for(unsigned int i=3; i < args.size(); ++i) { @@ -599,7 +605,23 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) { if(args[i] == "UTF-8") { - utf8_encoding = true; + encoding = encoding_utf8; + } + else if(args[i] == "UTF-16LE") + { + encoding = encoding_utf16le; + } + else if(args[i] == "UTF-16BE") + { + encoding = encoding_utf16be; + } + else if(args[i] == "UTF-32LE") + { + encoding = encoding_utf32le; + } + else if(args[i] == "UTF-32BE") + { + encoding = encoding_utf32be; } else { @@ -647,6 +669,23 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) return false; } + //If BOM is found and encoding was not specified, use the BOM + int bom_found = cmsys::FStream::ReadBOM(fin); + if(encoding == encoding_none && bom_found != cmsys::FStream::BOM_None) + { + encoding = bom_found; + } + + unsigned int bytes_rem = 0; + if(encoding == encoding_utf16le || encoding == encoding_utf16be) + { + bytes_rem = 1; + } + if(encoding == encoding_utf32le || encoding == encoding_utf32be) + { + bytes_rem = 3; + } + // Parse strings out of the file. int output_size = 0; std::vector strings; @@ -658,6 +697,25 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) std::string current_str; int c = fin.get(); + for(unsigned int i=0; i(c1)); + break; + } + c = (c << 8) | c1; + } + if(encoding == encoding_utf16le) + { + c = ((c & 0xFF) << 8) | ((c & 0xFF00) >> 8); + } + else if(encoding == encoding_utf32le) + { + c = (((c & 0xFF) << 24) | ((c & 0xFF00) << 8) | + ((c & 0xFF0000) >> 8) | ((c & 0xFF000000) >> 24)); + } if(c == '\r') { @@ -673,7 +731,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) // c is guaranteed to fit in char by the above if... current_str += static_cast(c); } - else if(utf8_encoding) + else if(encoding == encoding_utf8) { // Check for UTF-8 encoded string (up to 4 octets) static const unsigned char utf8_check_table[3][2] = ----------------------------------------------------------------------- Summary of changes: Source/cmFileCommand.cxx | 64 +++++++++++++++++++++++++++++++++-- Tests/StringFileTest/CMakeLists.txt | 26 ++++++++++++++ Tests/StringFileTest/UTF-16BE.txt | Bin 0 -> 83 bytes Tests/StringFileTest/UTF-16LE.txt | Bin 0 -> 83 bytes Tests/StringFileTest/UTF-32BE.txt | Bin 0 -> 165 bytes Tests/StringFileTest/UTF-32LE.txt | Bin 0 -> 165 bytes 6 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 Tests/StringFileTest/UTF-16BE.txt create mode 100644 Tests/StringFileTest/UTF-16LE.txt create mode 100644 Tests/StringFileTest/UTF-32BE.txt create mode 100644 Tests/StringFileTest/UTF-32LE.txt hooks/post-receive -- CMake From clinton at elemtech.com Mon Jan 26 11:23:20 2015 From: clinton at elemtech.com (Clinton Stimpson) Date: Mon, 26 Jan 2015 11:23:20 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2346-gc350d78 Message-ID: <20150126162320.3682CA94B5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via c350d78f7baf5db77b808f99911bb07a069da1bf (commit) via 8ced6375dfd366a088c681e45c0d8cdb4ea04dde (commit) via b46a15194b7cf1d7aaabf9d0b2a80651ada2e23f (commit) via c19539c594c4099fd4de68c2e386347d1cb0667f (commit) from d4506d1708d5da92f5ba26b43262db6d8b0077f9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c350d78f7baf5db77b808f99911bb07a069da1bf commit c350d78f7baf5db77b808f99911bb07a069da1bf Merge: d4506d1 8ced637 Author: Clinton Stimpson AuthorDate: Mon Jan 26 11:23:19 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 11:23:19 2015 -0500 Merge topic 'cmake-gui-osx' into next 8ced6375 cmake-gui: Shrink spacing between search field and checkbox. b46a1519 cmake-gui: Change install buttons to activate on clicked instead of pressed. c19539c5 cmake-gui: Fix install menu to be available for Qt5 builds on OS X. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8ced6375dfd366a088c681e45c0d8cdb4ea04dde commit 8ced6375dfd366a088c681e45c0d8cdb4ea04dde Author: Kevin Wojniak AuthorDate: Mon Jan 26 07:49:25 2015 -0800 Commit: Clinton Stimpson CommitDate: Mon Jan 26 09:22:21 2015 -0700 cmake-gui: Shrink spacing between search field and checkbox. This allows the search field to show on OS X Yosemite diff --git a/Source/QtDialog/CMakeSetupDialog.ui b/Source/QtDialog/CMakeSetupDialog.ui index 98da249..b04bd93 100644 --- a/Source/QtDialog/CMakeSetupDialog.ui +++ b/Source/QtDialog/CMakeSetupDialog.ui @@ -134,7 +134,7 @@ - 40 + 12 23 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b46a15194b7cf1d7aaabf9d0b2a80651ada2e23f commit b46a15194b7cf1d7aaabf9d0b2a80651ada2e23f Author: Kevin Wojniak AuthorDate: Mon Jan 26 07:48:57 2015 -0800 Commit: Clinton Stimpson CommitDate: Mon Jan 26 09:21:36 2015 -0700 cmake-gui: Change install buttons to activate on clicked instead of pressed. This matches the behavior of other buttons. diff --git a/Source/QtDialog/QMacInstallDialog.cxx b/Source/QtDialog/QMacInstallDialog.cxx index 8b8c531..fa7df43 100644 --- a/Source/QtDialog/QMacInstallDialog.cxx +++ b/Source/QtDialog/QMacInstallDialog.cxx @@ -15,11 +15,11 @@ QMacInstallDialog::QMacInstallDialog(QWidget*w) { this->Internals = new QMacInstallDialogInternals; this->Internals->setupUi(this); - QObject::connect(this->Internals->choosePathButton, SIGNAL(pressed()), + QObject::connect(this->Internals->choosePathButton, SIGNAL(clicked(bool)), this, SLOT(ShowBrowser())); - QObject::connect(this->Internals->skipInstallButton, SIGNAL(pressed()), + QObject::connect(this->Internals->skipInstallButton, SIGNAL(clicked(bool)), this, SLOT(SkipInstall())); - QObject::connect(this->Internals->doInstallButton, SIGNAL(pressed()), + QObject::connect(this->Internals->doInstallButton, SIGNAL(clicked(bool)), this, SLOT(DoInstall())); this->Internals->InstallPrefix->setText("/usr/bin/"); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c19539c594c4099fd4de68c2e386347d1cb0667f commit c19539c594c4099fd4de68c2e386347d1cb0667f Author: Kevin Wojniak AuthorDate: Mon Jan 26 07:47:57 2015 -0800 Commit: Clinton Stimpson CommitDate: Mon Jan 26 09:20:49 2015 -0700 cmake-gui: Fix install menu to be available for Qt5 builds on OS X. diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 0574681..b8077f2 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -119,7 +119,7 @@ CMakeSetupDialog::CMakeSetupDialog() QAction* showChangesAction = ToolsMenu->addAction(tr("&Show My Changes")); QObject::connect(showChangesAction, SIGNAL(triggered(bool)), this, SLOT(showUserChanges())); -#if defined(Q_WS_MAC) +#if defined(Q_WS_MAC) || defined(Q_OS_MAC) this->InstallForCommandLineAction = ToolsMenu->addAction(tr("&Install For Command Line Use")); QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)), ----------------------------------------------------------------------- Summary of changes: Source/QtDialog/CMakeSetupDialog.cxx | 2 +- Source/QtDialog/CMakeSetupDialog.ui | 2 +- Source/QtDialog/QMacInstallDialog.cxx | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 13:29:55 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 13:29:55 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2348-gf4e833c Message-ID: <20150126182955.5D91AAA2D7@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f4e833c32a97a87918a463d5e234a76d993fdc42 (commit) via 44fd71decbca329d9cdfc196a073a62668af53f2 (commit) from c350d78f7baf5db77b808f99911bb07a069da1bf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4e833c32a97a87918a463d5e234a76d993fdc42 commit f4e833c32a97a87918a463d5e234a76d993fdc42 Merge: c350d78 44fd71d Author: Brad King AuthorDate: Mon Jan 26 13:29:54 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 13:29:54 2015 -0500 Merge topic 'cmake-E-tar-files-from' into next 44fd71de cmake: Teach "-E tar" command a "--files-from=" option http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44fd71decbca329d9cdfc196a073a62668af53f2 commit 44fd71decbca329d9cdfc196a073a62668af53f2 Author: Brad King AuthorDate: Mon Jan 26 13:28:31 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 13:28:31 2015 -0500 cmake: Teach "-E tar" command a "--files-from=" option Read file names from the lines of a specified file. Reject input lines starting in '-' to leave room for option parsing to be added later. Add just '--add-file=' now to allow files starting in '-' to be specified. diff --git a/Help/release/dev/cmake-E-tar-files-from.rst b/Help/release/dev/cmake-E-tar-files-from.rst new file mode 100644 index 0000000..f6087ff --- /dev/null +++ b/Help/release/dev/cmake-E-tar-files-from.rst @@ -0,0 +1,6 @@ +cmake-E-tar-files-from +---------------------- + +* The :manual:`cmake(1)` ``-E tar`` command learned a new + ``--files-from=`` option to specify file names using + lines in a file to overcome command-line length limits. diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 7ca3eb3..28fcd27 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -94,6 +94,51 @@ void CMakeCommandUsage(const char* program) cmSystemTools::Error(errorStream.str().c_str()); } +static bool cmTarFilesFrom(std::string const& file, + std::vector& files) +{ + if (cmSystemTools::FileIsDirectory(file)) + { + std::ostringstream e; + e << "-E tar --files-from= file '" << file << "' is a directory"; + cmSystemTools::Error(e.str().c_str()); + return false; + } + cmsys::ifstream fin(file.c_str()); + if (!fin) + { + std::ostringstream e; + e << "-E tar --files-from= file '" << file << "' not found"; + cmSystemTools::Error(e.str().c_str()); + return false; + } + std::string line; + while (cmSystemTools::GetLineFromStream(fin, line)) + { + if (line.empty()) + { + continue; + } + if (cmHasLiteralPrefix(line, "--add-file=")) + { + files.push_back(line.substr(11)); + } + else if (cmHasLiteralPrefix(line, "-")) + { + std::ostringstream e; + e << "-E tar --files-from='" << file << "' file invalid line:\n" + << line << "\n"; + cmSystemTools::Error(e.str().c_str()); + return false; + } + else + { + files.push_back(line); + } + } + return true; +} + int cmcmd::ExecuteCMakeCommand(std::vector& args) { // IF YOU ADD A NEW COMMAND, DOCUMENT IT ABOVE and in cmakemain.cxx @@ -744,6 +789,14 @@ int cmcmd::ExecuteCMakeCommand(std::vector& args) { mtime = arg.substr(8); } + else if (cmHasLiteralPrefix(arg, "--files-from=")) + { + std::string const& files_from = arg.substr(13); + if (!cmTarFilesFrom(files_from, files)) + { + return 1; + } + } else { cmSystemTools::Error("Unknown option to -E tar: ", arg.c_str()); diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from1-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt new file mode 100644 index 0000000..d67431d --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt @@ -0,0 +1 @@ +^CMake Error: -E tar --files-from= file 'bad' not found$ diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from2-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt new file mode 100644 index 0000000..d1d278c --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt @@ -0,0 +1 @@ +^CMake Error: -E tar --files-from= file '\.' is a directory$ diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt new file mode 100644 index 0000000..147bd80 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: -E tar --files-from='.*/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt' file invalid line: +-add-file=option-typo$ diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt new file mode 100644 index 0000000..5bad1c3 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from3.txt @@ -0,0 +1 @@ +-add-file=option-typo diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from4-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt new file mode 100644 index 0000000..1417d4d --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: archive_read_disk_entry_from_file 'does-not-exist':.* +CMake Error: Problem creating tar: bad.tar$ diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from4.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from4.txt new file mode 100644 index 0000000..4b97f79 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from4.txt @@ -0,0 +1,2 @@ + +does-not-exist diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5-result.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from5-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from5-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt new file mode 100644 index 0000000..1417d4d --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: archive_read_disk_entry_from_file 'does-not-exist':.* +CMake Error: Problem creating tar: bad.tar$ diff --git a/Tests/RunCMake/CommandLine/E_tar-bad-from5.txt b/Tests/RunCMake/CommandLine/E_tar-bad-from5.txt new file mode 100644 index 0000000..9ea755b --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_tar-bad-from5.txt @@ -0,0 +1,2 @@ + +--add-file=does-not-exist diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 2994f16..2be6651 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -2,6 +2,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-bad-from1 ${CMAKE_COMMAND} -E tar cvf bad.tar --files-from=bad) +run_cmake_command(E_tar-bad-from2 ${CMAKE_COMMAND} -E tar cvf bad.tar --files-from=.) +run_cmake_command(E_tar-bad-from3 ${CMAKE_COMMAND} -E tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/E_tar-bad-from3.txt) +run_cmake_command(E_tar-bad-from4 ${CMAKE_COMMAND} -E tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/E_tar-bad-from4.txt) +run_cmake_command(E_tar-bad-from5 ${CMAKE_COMMAND} -E tar cvf bad.tar --files-from=${CMAKE_CURRENT_LIST_DIR}/E_tar-bad-from5.txt) 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") ----------------------------------------------------------------------- Summary of changes: Help/release/dev/cmake-E-tar-files-from.rst | 6 +++ Source/cmcmd.cxx | 53 ++++++++++++++++++++ .../E_tar-bad-from1-result.txt} | 0 .../CommandLine/E_tar-bad-from1-stderr.txt | 1 + .../E_tar-bad-from2-result.txt} | 0 .../CommandLine/E_tar-bad-from2-stderr.txt | 1 + .../E_tar-bad-from3-result.txt} | 0 .../CommandLine/E_tar-bad-from3-stderr.txt | 2 + Tests/RunCMake/CommandLine/E_tar-bad-from3.txt | 1 + .../E_tar-bad-from4-result.txt} | 0 .../CommandLine/E_tar-bad-from4-stderr.txt | 2 + Tests/RunCMake/CommandLine/E_tar-bad-from4.txt | 2 + .../E_tar-bad-from5-result.txt} | 0 .../CommandLine/E_tar-bad-from5-stderr.txt | 2 + Tests/RunCMake/CommandLine/E_tar-bad-from5.txt | 2 + Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 5 ++ 16 files changed, 77 insertions(+) create mode 100644 Help/release/dev/cmake-E-tar-files-from.rst copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-from1-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-from2-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-from3-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from3.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-from4-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from4.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-from5-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from5.txt hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 13:50:08 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 13:50:08 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2350-g19a24c0 Message-ID: <20150126185008.C6293A9DF0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 19a24c0387819644e016194ce653946d772762b2 (commit) via d5604fc8008d0a86046d004914a6531b0cd940b9 (commit) from f4e833c32a97a87918a463d5e234a76d993fdc42 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=19a24c0387819644e016194ce653946d772762b2 commit 19a24c0387819644e016194ce653946d772762b2 Merge: f4e833c d5604fc Author: Brad King AuthorDate: Mon Jan 26 13:50:08 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 13:50:08 2015 -0500 Merge topic 'test-rerun-cmake' into next d5604fc8 Tests/RunCMake: Normalize newlines before checking actual output http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d5604fc8008d0a86046d004914a6531b0cd940b9 commit d5604fc8008d0a86046d004914a6531b0cd940b9 Author: Brad King AuthorDate: Mon Jan 26 13:41:38 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 13:41:38 2015 -0500 Tests/RunCMake: Normalize newlines before checking actual output We read the expected output with file(STRINGS) which converts CRLF newlines to LF. Do the same with the actual output before comparing. diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 23f2f97..33b745d 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -79,6 +79,7 @@ function(run_cmake test) set(msg "${msg}Result is [${actual_result}], not [${expect_result}].\n") endif() foreach(o out err) + string(REGEX REPLACE "\r\n" "\n" actual_std${o} "${actual_std${o}}") string(REGEX REPLACE "(^|\n)(==[0-9]+==[^\n]*\n)+" "\\1" actual_std${o} "${actual_std${o}}") string(REGEX REPLACE "\n+$" "" actual_std${o} "${actual_std${o}}") set(expect_${o} "") ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/RunCMake.cmake | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 14:14:26 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 14:14:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2352-g768ed74 Message-ID: <20150126191426.83CA0A8084@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 768ed74673d56ce22d79fdc2e58ecd2828694ab4 (commit) via 4c49ce96d7dfcf902d1af627a733ba732cb9b6a5 (commit) from 19a24c0387819644e016194ce653946d772762b2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=768ed74673d56ce22d79fdc2e58ecd2828694ab4 commit 768ed74673d56ce22d79fdc2e58ecd2828694ab4 Merge: 19a24c0 4c49ce9 Author: Brad King AuthorDate: Mon Jan 26 14:14:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 14:14:25 2015 -0500 Merge topic 'doc-cmake-E-mode' into next 4c49ce96 Help: Document 'cmake -E ' modes in cmake.1 manual http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c49ce96d7dfcf902d1af627a733ba732cb9b6a5 commit 4c49ce96d7dfcf902d1af627a733ba732cb9b6a5 Author: Brad King AuthorDate: Mon Jan 26 13:54:21 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 14:13:56 2015 -0500 Help: Document 'cmake -E ' modes in cmake.1 manual Add a dedicated manual section, move the -E command documentation there, and elaborate. diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 8dfc16a..da41bbb 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -11,7 +11,7 @@ Synopsis cmake [] ( | ) cmake [(-D=)...] -P cmake --build [] [-- ...] - cmake -E [] + cmake -E [...] cmake --find-package ... Description @@ -32,17 +32,8 @@ Options .. include:: OPTIONS_BUILD.txt -``-E`` - CMake command mode. - - For true platform independence, CMake provides a list of commands - that can be used on all systems. Run with -E help for the usage - information. Commands available are: chdir, compare_files, copy, - copy_directory, copy_if_different, echo, echo_append, env, environment, - make_directory, md5sum, remove, remove_directory, rename, sleep, tar, time, - touch, touch_nocreate. In addition, some platform specific commands - are available. On Windows: delete_regv, write_regv. On - UNIX: create_symlink. +``-E [...]`` + See `Command-Line Tool Mode`_. ``-L[A][H]`` List non-advanced cached variables. @@ -156,6 +147,111 @@ Options .. include:: OPTIONS_HELP.txt +Command-Line Tool Mode +====================== + +CMake provides builtin command-line tools through the signature:: + + cmake -E [...] + +Run ``cmake -E`` or ``cmake -E help`` for a summary of commands. +Available commands are: + +``chdir [...]`` + Change the current working directory and run a command. + +``compare_files `` + Check if file1 is same as file2. + +``copy `` + Copy file to destination (either file or directory). + +``copy_directory `` + Copy directory 'source' content to directory 'destination'. + +``copy_if_different `` + Copy file if input has changed. + +``echo [...]`` + Displays arguments as text. + +``echo_append [...]`` + Displays arguments as text but no new line. + +``env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...`` + Run command in a modified environment. + +``environment`` + Display the current environment. + +``make_directory `` + Create a directory. + +``md5sum [...]`` + Compute md5sum of files. + +``remove [-f] [...]`` + Remove the file(s), use ``-f`` to force it. + +``remove_directory `` + Remove a directory and its contents. + +``rename `` + Rename a file or directory (on one volume). + +``sleep ...`` + Sleep for given number of seconds. + +``tar [cxt][vf][zjJ] file.tar [...] [--] [...]`` + Create or extract a tar or zip archive. Options are: + + ``--`` + Stop interpreting options and treat all remaining arguments + as file names even if they start in ``-``. + ``--files-from=`` + Read file names from the given file, one per line. + Blank lines are ignored. Lines may not start in ``-`` + except for ``--add-file=`` to add files whose + names start in ``-``. + ``--mtime=`` + Specify modification time recorded in tarball entries. + +``time [...]`` + Run command and return elapsed time. + +``touch `` + Touch a file. + +``touch_nocreate `` + Touch a file if it exists but do not create it. + +UNIX-specific Command-Line Tools +-------------------------------- + +The following ``cmake -E`` commands are available only on UNIX: + +``create_symlink `` + Create a symbolic link ```` naming ````. + +Windows-specific Command-Line Tools +----------------------------------- + +The following ``cmake -E`` commands are available only on Windows: + +``delete_regv `` + Delete Windows registry value. + +``env_vs8_wince `` + Displays a batch file which sets the environment for the provided + Windows CE SDK installed in VS2005. + +``env_vs9_wince `` + Displays a batch file which sets the environment for the provided + Windows CE SDK installed in VS2008. + +``write_regv `` + Write Windows registry value. + See Also ======== ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake.1.rst | 120 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 108 insertions(+), 12 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 14:40:45 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 14:40:45 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2357-g2ae7b55 Message-ID: <20150126194045.DDB262271@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2ae7b5534897c95a1722e82a0551d8b07ce591b8 (commit) via 8580ac8409d19ba4a2b4b44a3c4933f93b4fb947 (commit) via 0e8952d11f583f72f92b360847a96c012f0c662c (commit) via 7343d054226778bea3899538b074bab8ab33c46a (commit) via 8e5a71296ddb0959b3d55232823eea9495a8a797 (commit) from 768ed74673d56ce22d79fdc2e58ecd2828694ab4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ae7b5534897c95a1722e82a0551d8b07ce591b8 commit 2ae7b5534897c95a1722e82a0551d8b07ce591b8 Merge: 768ed74 8580ac8 Author: Brad King AuthorDate: Mon Jan 26 14:40:44 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 14:40:44 2015 -0500 Merge topic 'feature-record-msvc' into next 8580ac84 Features: Move MSVC feature record logic to proper module 0e8952d1 fixup! Features: Extend CompileFeatures test for MSVC 7343d054 Features: Fix test to reject missing expectation definitions 8e5a7129 Features: Emit a test failure if 'override' is present but not expected http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8580ac8409d19ba4a2b4b44a3c4933f93b4fb947 commit 8580ac8409d19ba4a2b4b44a3c4933f93b4fb947 Author: Brad King AuthorDate: Mon Jan 26 14:28:29 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 14:40:12 2015 -0500 Features: Move MSVC feature record logic to proper module It goes in the Compiler module, not a platform-specific module. diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake similarity index 59% copy from Modules/Platform/Windows-MSVC-CXX.cmake copy to Modules/Compiler/MSVC-CXX.cmake index ad56f68..88ca206 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -1,13 +1,8 @@ -include(Platform/Windows-MSVC) -set(_COMPILE_CXX " /TP") -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) - set(_FS_CXX " /FS") -endif() -__windows_compiler_msvc(CXX) - # No version of MSVC has full conformance to C++11. Therefore the # __cplusplus macro always evaluates to 98 even if the compilers come with -# C++11/14/+ features enabled. +# C++11/14/+ features enabled. Later we should refactor the C++ side of +# this within CMake to allow us to specify that there are no language level +# flags for this compiler. set(CMAKE_CXX_STANDARD_DEFAULT 98) macro(cmake_record_cxx_compile_features) diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake index ad56f68..0e85005 100644 --- a/Modules/Platform/Windows-MSVC-CXX.cmake +++ b/Modules/Platform/Windows-MSVC-CXX.cmake @@ -4,12 +4,3 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) set(_FS_CXX " /FS") endif() __windows_compiler_msvc(CXX) - -# No version of MSVC has full conformance to C++11. Therefore the -# __cplusplus macro always evaluates to 98 even if the compilers come with -# C++11/14/+ features enabled. -set(CMAKE_CXX_STANDARD_DEFAULT 98) - -macro(cmake_record_cxx_compile_features) - record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) -endmacro() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0e8952d11f583f72f92b360847a96c012f0c662c commit 0e8952d11f583f72f92b360847a96c012f0c662c Author: Brad King AuthorDate: Mon Jan 26 14:26:43 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 14:40:09 2015 -0500 fixup! Features: Extend CompileFeatures test for MSVC diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index a0dc2a5..5f93abc 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -210,18 +210,21 @@ if (CMAKE_CXX_COMPILE_FEATURES) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=1 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 ) elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 -DEXPECT_INHERITING_CONSTRUCTORS=0 -DEXPECT_FINAL=1 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) else() add_definitions( + -DEXPECT_OVERRIDE_CONTROL=0 -DEXPECT_INHERITING_CONSTRUCTORS=0 -DEXPECT_FINAL=0 -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7343d054226778bea3899538b074bab8ab33c46a commit 7343d054226778bea3899538b074bab8ab33c46a Author: Brad King AuthorDate: Mon Jan 26 14:25:22 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 14:39:58 2015 -0500 Features: Fix test to reject missing expectation definitions Whenever feature support is added to a compiler, the CompileFeatures test needs to be updated to set expected availability of features. Add #error directives to ensure the test fails if expectations are not set. Suggested-by: Stephen Kelly diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index 7919eb4..2161bca 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -1,3 +1,15 @@ +#ifndef EXPECT_FINAL +# error EXPECT_FINAL not defined +#endif +#ifndef EXPECT_INHERITING_CONSTRUCTORS +# error EXPECT_INHERITING_CONSTRUCTORS not defined +#endif +#ifndef EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL +# error EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL not defined +#endif +#ifndef EXPECT_OVERRIDE_CONTROL +# error EXPECT_OVERRIDE_CONTROL not defined +#endif #if !HAVE_OVERRIDE_CONTROL #if EXPECT_OVERRIDE_CONTROL http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8e5a71296ddb0959b3d55232823eea9495a8a797 commit 8e5a71296ddb0959b3d55232823eea9495a8a797 Author: Stephen Kelly AuthorDate: Sat Jan 24 15:22:23 2015 +0100 Commit: Brad King CommitDate: Mon Jan 26 14:29:20 2015 -0500 Features: Emit a test failure if 'override' is present but not expected diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index d9c8eec..7919eb4 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -4,6 +4,9 @@ #error "Expect override control feature" #endif #else +#if !EXPECT_OVERRIDE_CONTROL +#error "Expect no override control feature" +#endif struct A { ----------------------------------------------------------------------- Summary of changes: .../Windows-MSVC-CXX.cmake => Compiler/MSVC-CXX.cmake} | 11 +++-------- Modules/Platform/Windows-MSVC-CXX.cmake | 9 --------- Tests/CompileFeatures/CMakeLists.txt | 3 +++ Tests/CompileFeatures/genex_test.cpp | 15 +++++++++++++++ 4 files changed, 21 insertions(+), 17 deletions(-) copy Modules/{Platform/Windows-MSVC-CXX.cmake => Compiler/MSVC-CXX.cmake} (59%) hooks/post-receive -- CMake From brad.king at kitware.com Mon Jan 26 15:00:58 2015 From: brad.king at kitware.com (Brad King) Date: Mon, 26 Jan 2015 15:00:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2361-g0492ede Message-ID: <20150126200058.53F90AA228@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0492ede11b4f4b396a5f2f5ccbcb0a7bcb0e2167 (commit) via 5abead04c62d1ca4ae3dc3436ccbd8049ddd7e0a (commit) via 67e76e82df0fe8466b4bf65265d0c6b7f6046dfb (commit) via 3046be77847ce54baae1d432dec224282dedcc16 (commit) from 2ae7b5534897c95a1722e82a0551d8b07ce591b8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0492ede11b4f4b396a5f2f5ccbcb0a7bcb0e2167 commit 0492ede11b4f4b396a5f2f5ccbcb0a7bcb0e2167 Merge: 2ae7b55 5abead0 Author: Brad King AuthorDate: Mon Jan 26 15:00:57 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 15:00:57 2015 -0500 Merge topic 'feature-record-msvc' into next 5abead04 Features: Record for MSVC 2010-2015 67e76e82 Features: Fix test to reject missing expectation definitions 3046be77 Features: Emit a test failure if 'override' is present but not expected http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5abead04c62d1ca4ae3dc3436ccbd8049ddd7e0a commit 5abead04c62d1ca4ae3dc3436ccbd8049ddd7e0a Author: Robert Maynard AuthorDate: Mon Jan 19 15:49:06 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 14:58:42 2015 -0500 Features: Record for MSVC 2010-2015 Notes: * Initializer lists are only properly supported in 2015 and above. Previous Visual Studio releases said they supported initializer lists. * VS2012 and above conform to cxx_decltype_incomplete_return_types proposal but without support for auto return types the feature is unusable. Activate support only in VS2015 and above. * VS2010 and above to conform to the updated cxx_contextual_conversions proposal. * In WCDH add MSVC Compatibility for cxx_align{of,as}. * Exclude MSVC from link feature cycle rejection test MSVC has no explicit flags to enable C++11/14/17 language standard levels. Instead each version of the compiler documents a list of supported features that are always on. Therefore no use of specific features will adjust the CXX_STANDARD level required for any target. Therefore we must exclude the RunCMake.CompileFeatures test case "LinkImplementationFeatureCycle" because it can never fail. Note that within the RunCMakeTest script no languages or toolchains are enabled so we cannot test if(MSVC) directly. Instead test it during configuration of the test and pass in a variable telling RunCMakeTest whether to activate this test case. Co-Author: Stephen Kelly diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..476f244 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,100 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +# In theory decltype incomplete return types was added in 2012 +# but without support for decltype_auto and return type deduction this +# feature is unusable +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Possibly broken: +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +# Microsoft now states they support contextual conversions +# see footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx + +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + + +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake new file mode 100644 index 0000000..88ca206 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -0,0 +1,10 @@ +# No version of MSVC has full conformance to C++11. Therefore the +# __cplusplus macro always evaluates to 98 even if the compilers come with +# C++11/14/+ features enabled. Later we should refactor the C++ side of +# this within CMake to allow us to specify that there are no language level +# flags for this compiler. +set(CMAKE_CXX_STANDARD_DEFAULT 98) + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index e81bc08..d18f47c 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC SunPro ) @@ -528,6 +529,8 @@ function(write_compiler_detection_header # define ${def_value} alignas(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __attribute__ ((__aligned__(X))) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __declspec(align(X)) # else # define ${def_value} # endif @@ -540,6 +543,8 @@ function(write_compiler_detection_header # define ${def_value} alignof(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __alignof__(X) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __alignof(X) # endif \n") endif() diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 5cd0836..5f93abc 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -207,6 +207,29 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=0 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=0 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") add_definitions( -DEXPECT_OVERRIDE_CONTROL=1 diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index b5e46c0..43e89ab 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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -67,6 +67,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -84,7 +96,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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3a61751..3e2624e 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -84,6 +84,9 @@ add_RunCMake_test(ObjectLibrary) add_RunCMake_test(TargetObjects) add_RunCMake_test(TargetSources) add_RunCMake_test(find_dependency) +if(MSVC) + set(CompileFeatures_ARGS "-DNO_LinkImplementationFeatureCycle=1") +endif() add_RunCMake_test(CompileFeatures) add_RunCMake_test(WriteCompilerDetectionHeader) if(NOT WIN32) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..4c04e78 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -27,7 +27,9 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) + if(NOT NO_LinkImplementationFeatureCycle) + run_cmake(LinkImplementationFeatureCycle) + endif() run_cmake(LinkImplementationFeatureCycleSolved) if (";${CXX_FEATURES};" MATCHES ";cxx_final;") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=67e76e82df0fe8466b4bf65265d0c6b7f6046dfb commit 67e76e82df0fe8466b4bf65265d0c6b7f6046dfb Author: Brad King AuthorDate: Mon Jan 26 14:25:22 2015 -0500 Commit: Brad King CommitDate: Mon Jan 26 14:41:33 2015 -0500 Features: Fix test to reject missing expectation definitions Whenever feature support is added to a compiler, the CompileFeatures test needs to be updated to set expected availability of features. Add #error directives to ensure the test fails if expectations are not set. Suggested-by: Stephen Kelly diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index 7919eb4..2161bca 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -1,3 +1,15 @@ +#ifndef EXPECT_FINAL +# error EXPECT_FINAL not defined +#endif +#ifndef EXPECT_INHERITING_CONSTRUCTORS +# error EXPECT_INHERITING_CONSTRUCTORS not defined +#endif +#ifndef EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL +# error EXPECT_INHERITING_CONSTRUCTORS_AND_FINAL not defined +#endif +#ifndef EXPECT_OVERRIDE_CONTROL +# error EXPECT_OVERRIDE_CONTROL not defined +#endif #if !HAVE_OVERRIDE_CONTROL #if EXPECT_OVERRIDE_CONTROL http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3046be77847ce54baae1d432dec224282dedcc16 commit 3046be77847ce54baae1d432dec224282dedcc16 Author: Stephen Kelly AuthorDate: Sat Jan 24 15:22:23 2015 +0100 Commit: Brad King CommitDate: Mon Jan 26 14:41:33 2015 -0500 Features: Emit a test failure if 'override' is present but not expected diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp index d9c8eec..7919eb4 100644 --- a/Tests/CompileFeatures/genex_test.cpp +++ b/Tests/CompileFeatures/genex_test.cpp @@ -4,6 +4,9 @@ #error "Expect override control feature" #endif #else +#if !EXPECT_OVERRIDE_CONTROL +#error "Expect no override control feature" +#endif struct A { ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From clinton at elemtech.com Mon Jan 26 18:30:27 2015 From: clinton at elemtech.com (Clinton Stimpson) Date: Mon, 26 Jan 2015 18:30:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2364-g6031673 Message-ID: <20150126233027.BF274AA3CE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 60316739d134a6c76e435746f4c6009220e533a9 (commit) via b359ee994ea80fccd7eff1b01e33cbcce879a545 (commit) via 4c53670b6444b16e8d39a46aebd39fc166895755 (commit) from 0492ede11b4f4b396a5f2f5ccbcb0a7bcb0e2167 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=60316739d134a6c76e435746f4c6009220e533a9 commit 60316739d134a6c76e435746f4c6009220e533a9 Merge: 0492ede b359ee9 Author: Clinton Stimpson AuthorDate: Mon Jan 26 18:30:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Mon Jan 26 18:30:26 2015 -0500 Merge topic 'file-strings-utf-16' into next b359ee99 Add documentation for new ENCODING options in file(STRINGS). 4c53670b Move test cases for file(STRINGS .. ENCODING ...) to Tests/RunCMake. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b359ee994ea80fccd7eff1b01e33cbcce879a545 commit b359ee994ea80fccd7eff1b01e33cbcce879a545 Author: Clinton Stimpson AuthorDate: Mon Jan 26 16:28:00 2015 -0700 Commit: Clinton Stimpson CommitDate: Mon Jan 26 16:30:05 2015 -0700 Add documentation for new ENCODING options in file(STRINGS). diff --git a/Help/command/file.rst b/Help/command/file.rst index b0d4792..73d4cfa 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -65,7 +65,10 @@ Parse a list of ASCII strings from ```` and store it in Consider only strings that match the given regular expression. ``ENCODING `` - Consider strings of a given encoding. "UTF-8" is currently supported. + Consider strings of a given encoding. Currently supported encodings are: + UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE. If the ENCODING option + is not provided and the file has a Byte Order Mark, the ENCODING option + will be defaulted to respect the Byte Order Mark. For example, the code diff --git a/Help/release/dev/file-strings-utf-16.rst b/Help/release/dev/file-strings-utf-16.rst new file mode 100644 index 0000000..f40b63e --- /dev/null +++ b/Help/release/dev/file-strings-utf-16.rst @@ -0,0 +1,5 @@ +file-strings-utf-16 +------------------- + +* The :command:`file(STRINGS)` now supports UTF-16LE, UTF-16BE, + UTF-32LE, UTF-32BE as ``ENCODING`` options. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c53670b6444b16e8d39a46aebd39fc166895755 commit 4c53670b6444b16e8d39a46aebd39fc166895755 Author: Clinton Stimpson AuthorDate: Mon Jan 26 15:27:36 2015 -0700 Commit: Clinton Stimpson CommitDate: Mon Jan 26 15:27:36 2015 -0700 Move test cases for file(STRINGS .. ENCODING ...) to Tests/RunCMake. diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake index fc913c6..89f7ea5 100644 --- a/Tests/RunCMake/string/RunCMakeTest.cmake +++ b/Tests/RunCMake/string/RunCMakeTest.cmake @@ -12,3 +12,8 @@ run_cmake(UuidMissingTypeValue) run_cmake(UuidBadType) run_cmake(RegexClear) + +run_cmake(UTF-16BE) +run_cmake(UTF-16LE) +run_cmake(UTF-32BE) +run_cmake(UTF-32LE) diff --git a/Tests/RunCMake/string/UTF-16BE-stderr.txt b/Tests/RunCMake/string/UTF-16BE-stderr.txt new file mode 100644 index 0000000..8254f87 --- /dev/null +++ b/Tests/RunCMake/string/UTF-16BE-stderr.txt @@ -0,0 +1,2 @@ +Hello World +Hello World diff --git a/Tests/RunCMake/string/UTF-16BE.cmake b/Tests/RunCMake/string/UTF-16BE.cmake new file mode 100644 index 0000000..da986c0 --- /dev/null +++ b/Tests/RunCMake/string/UTF-16BE.cmake @@ -0,0 +1,4 @@ +file(STRINGS UTF-16BE.txt str ENCODING UTF-16BE LENGTH_MINIMUM 4) +message("${str}") +file(STRINGS UTF-16BE.txt str LENGTH_MINIMUM 4) +message("${str}") diff --git a/Tests/StringFileTest/UTF-16BE.txt b/Tests/RunCMake/string/UTF-16BE.txt similarity index 100% rename from Tests/StringFileTest/UTF-16BE.txt rename to Tests/RunCMake/string/UTF-16BE.txt diff --git a/Tests/RunCMake/string/UTF-16LE-stderr.txt b/Tests/RunCMake/string/UTF-16LE-stderr.txt new file mode 100644 index 0000000..8254f87 --- /dev/null +++ b/Tests/RunCMake/string/UTF-16LE-stderr.txt @@ -0,0 +1,2 @@ +Hello World +Hello World diff --git a/Tests/RunCMake/string/UTF-16LE.cmake b/Tests/RunCMake/string/UTF-16LE.cmake new file mode 100644 index 0000000..326d848 --- /dev/null +++ b/Tests/RunCMake/string/UTF-16LE.cmake @@ -0,0 +1,4 @@ +file(STRINGS UTF-16LE.txt str ENCODING UTF-16LE LENGTH_MINIMUM 4) +message("${str}") +file(STRINGS UTF-16LE.txt str LENGTH_MINIMUM 4) +message("${str}") diff --git a/Tests/StringFileTest/UTF-16LE.txt b/Tests/RunCMake/string/UTF-16LE.txt similarity index 100% rename from Tests/StringFileTest/UTF-16LE.txt rename to Tests/RunCMake/string/UTF-16LE.txt diff --git a/Tests/RunCMake/string/UTF-32BE-stderr.txt b/Tests/RunCMake/string/UTF-32BE-stderr.txt new file mode 100644 index 0000000..8254f87 --- /dev/null +++ b/Tests/RunCMake/string/UTF-32BE-stderr.txt @@ -0,0 +1,2 @@ +Hello World +Hello World diff --git a/Tests/RunCMake/string/UTF-32BE.cmake b/Tests/RunCMake/string/UTF-32BE.cmake new file mode 100644 index 0000000..debdeaa --- /dev/null +++ b/Tests/RunCMake/string/UTF-32BE.cmake @@ -0,0 +1,4 @@ +file(STRINGS UTF-32BE.txt str ENCODING UTF-32BE LENGTH_MINIMUM 4) +message("${str}") +file(STRINGS UTF-32BE.txt str LENGTH_MINIMUM 4) +message("${str}") diff --git a/Tests/StringFileTest/UTF-32BE.txt b/Tests/RunCMake/string/UTF-32BE.txt similarity index 100% rename from Tests/StringFileTest/UTF-32BE.txt rename to Tests/RunCMake/string/UTF-32BE.txt diff --git a/Tests/RunCMake/string/UTF-32LE-stderr.txt b/Tests/RunCMake/string/UTF-32LE-stderr.txt new file mode 100644 index 0000000..8254f87 --- /dev/null +++ b/Tests/RunCMake/string/UTF-32LE-stderr.txt @@ -0,0 +1,2 @@ +Hello World +Hello World diff --git a/Tests/RunCMake/string/UTF-32LE.cmake b/Tests/RunCMake/string/UTF-32LE.cmake new file mode 100644 index 0000000..22aab5f --- /dev/null +++ b/Tests/RunCMake/string/UTF-32LE.cmake @@ -0,0 +1,4 @@ +file(STRINGS UTF-32LE.txt str ENCODING UTF-32LE LENGTH_MINIMUM 4) +message("${str}") +file(STRINGS UTF-32LE.txt str LENGTH_MINIMUM 4) +message("${str}") diff --git a/Tests/StringFileTest/UTF-32LE.txt b/Tests/RunCMake/string/UTF-32LE.txt similarity index 100% rename from Tests/StringFileTest/UTF-32LE.txt rename to Tests/RunCMake/string/UTF-32LE.txt diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 539b854..faf3bc9 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -65,32 +65,6 @@ else() "file(STRINGS) incorrectly read from utf8 file [${infile_strings}]") endif() -# check files with UTF-16 or UTF-32 content -foreach(bit 16 32) - foreach(endian LE BE) - set(file_to_check UTF-${bit}${endian}.txt) - file(STRINGS ${file_to_check} str ENCODING UTF-${bit}${endian} LENGTH_MINIMUM 4) - message("${file_to_check} as UTF-${bit}${endian}: ${str}") - if(NOT str MATCHES "Hello World") - message(SEND_ERROR - "file(STRINGS) incorrectly read from ${file_to_check} file [${str}]") - endif() - endforeach() -endforeach() - -# check files using BOM for encoding -foreach(bit 16 32) - foreach(endian LE BE) - set(file_to_check UTF-${bit}${endian}.txt) - file(STRINGS ${file_to_check} str REGEX "....") - message("${file_to_check} : ${str}") - if(NOT str MATCHES "Hello World") - message(SEND_ERROR - "file(STRINGS) incorrectly read from ${file_to_check} file [${str}]") - endif() - endforeach() -endforeach() - # String test string(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great") string(REGEX MATCHALL "[cC][mM][aA][kK][eE]" rmallvar "CMake is better than cmake or CMake") ----------------------------------------------------------------------- Summary of changes: Help/command/file.rst | 5 +++- Help/release/dev/file-strings-utf-16.rst | 5 ++++ Tests/RunCMake/string/RunCMakeTest.cmake | 5 ++++ .../NO-BOM.txt.in => string/UTF-16BE-stderr.txt} | 1 + Tests/RunCMake/string/UTF-16BE.cmake | 4 +++ .../string}/UTF-16BE.txt | Bin 83 -> 83 bytes .../NO-BOM.txt.in => string/UTF-16LE-stderr.txt} | 1 + Tests/RunCMake/string/UTF-16LE.cmake | 4 +++ .../string}/UTF-16LE.txt | Bin 83 -> 83 bytes .../NO-BOM.txt.in => string/UTF-32BE-stderr.txt} | 1 + Tests/RunCMake/string/UTF-32BE.cmake | 4 +++ .../string}/UTF-32BE.txt | Bin 165 -> 165 bytes .../NO-BOM.txt.in => string/UTF-32LE-stderr.txt} | 1 + Tests/RunCMake/string/UTF-32LE.cmake | 4 +++ .../string}/UTF-32LE.txt | Bin 165 -> 165 bytes Tests/StringFileTest/CMakeLists.txt | 26 -------------------- 16 files changed, 34 insertions(+), 27 deletions(-) create mode 100644 Help/release/dev/file-strings-utf-16.rst copy Tests/RunCMake/{configure_file/NO-BOM.txt.in => string/UTF-16BE-stderr.txt} (50%) create mode 100644 Tests/RunCMake/string/UTF-16BE.cmake rename Tests/{StringFileTest => RunCMake/string}/UTF-16BE.txt (100%) copy Tests/RunCMake/{configure_file/NO-BOM.txt.in => string/UTF-16LE-stderr.txt} (50%) create mode 100644 Tests/RunCMake/string/UTF-16LE.cmake rename Tests/{StringFileTest => RunCMake/string}/UTF-16LE.txt (100%) copy Tests/RunCMake/{configure_file/NO-BOM.txt.in => string/UTF-32BE-stderr.txt} (50%) create mode 100644 Tests/RunCMake/string/UTF-32BE.cmake rename Tests/{StringFileTest => RunCMake/string}/UTF-32BE.txt (100%) copy Tests/RunCMake/{configure_file/NO-BOM.txt.in => string/UTF-32LE-stderr.txt} (50%) create mode 100644 Tests/RunCMake/string/UTF-32LE.cmake rename Tests/{StringFileTest => RunCMake/string}/UTF-32LE.txt (100%) hooks/post-receive -- CMake From kwrobot at kitware.com Tue Jan 27 00:01:13 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Tue, 27 Jan 2015 00:01:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-913-g82ba503 Message-ID: <20150127050113.3B235AA11F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 82ba50390f52226bdd4162e4108bc4f5226150d6 (commit) from 19e57a48cd1ad562b277c8fb9dc8285ef96acfa0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=82ba50390f52226bdd4162e4108bc4f5226150d6 commit 82ba50390f52226bdd4162e4108bc4f5226150d6 Author: Kitware Robot AuthorDate: Tue Jan 27 00:01:10 2015 -0500 Commit: Kitware Robot CommitDate: Tue Jan 27 00:01:10 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 4f1867e..edd2e5a 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 20150126) +set(CMake_VERSION_PATCH 20150127) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From eike at sf-mail.de Tue Jan 27 07:39:21 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Tue, 27 Jan 2015 07:39:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2367-g0db065f Message-ID: <20150127123921.401F012E5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0db065f14a128556135b29fc9bde2bd9eac653ff (commit) via 43eca4026def688e27c981154a36948273c6497c (commit) via 82ba50390f52226bdd4162e4108bc4f5226150d6 (commit) from 60316739d134a6c76e435746f4c6009220e533a9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0db065f14a128556135b29fc9bde2bd9eac653ff commit 0db065f14a128556135b29fc9bde2bd9eac653ff Merge: 6031673 43eca40 Author: Rolf Eike Beer AuthorDate: Tue Jan 27 07:39:20 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 07:39:20 2015 -0500 Merge topic 'drop-win9x-reference' into next 43eca402 drop reference to removed Windows 9x support 82ba5039 CMake Nightly Date Stamp http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=43eca4026def688e27c981154a36948273c6497c commit 43eca4026def688e27c981154a36948273c6497c Author: Rolf Eike Beer AuthorDate: Mon Jan 26 19:56:03 2015 +0100 Commit: Rolf Eike Beer CommitDate: Tue Jan 27 13:38:22 2015 +0100 drop reference to removed Windows 9x support diff --git a/CMakeLists.txt b/CMakeLists.txt index 28fd02f..8ad1be8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -628,7 +628,6 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) if(BUILD_TESTING) CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests") endif() - CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat") if(TARGET documentation) CMAKE_SET_TARGET_FOLDER(documentation "Documentation") endif() ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 1 - Source/CMakeVersion.cmake | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 08:59:09 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 08:59:09 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2369-ga8197c1 Message-ID: <20150127135909.E0990AA5DD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a8197c1a4affcaf6021bef8323381d05d155258d (commit) via 70c50962fb405cfb89637f24aa38c3e0fd5cbd87 (commit) from 0db065f14a128556135b29fc9bde2bd9eac653ff (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a8197c1a4affcaf6021bef8323381d05d155258d commit a8197c1a4affcaf6021bef8323381d05d155258d Merge: 0db065f 70c5096 Author: Brad King AuthorDate: Tue Jan 27 08:59:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 08:59:09 2015 -0500 Merge topic 'shorten-test-paths' into next 70c50962 Tests: Shorten paths in ExternalProjectLocal http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=70c50962fb405cfb89637f24aa38c3e0fd5cbd87 commit 70c50962fb405cfb89637f24aa38c3e0fd5cbd87 Author: Brad King AuthorDate: Tue Jan 27 08:57:35 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 08:57:57 2015 -0500 Tests: Shorten paths in ExternalProjectLocal Use a shorter name for the external project base directory to allow longer CMake build tree directory names on Windows. diff --git a/Tests/ExternalProjectLocal/CMakeLists.txt b/Tests/ExternalProjectLocal/CMakeLists.txt index 9476ab4..e1a67db 100644 --- a/Tests/ExternalProjectLocal/CMakeLists.txt +++ b/Tests/ExternalProjectLocal/CMakeLists.txt @@ -15,7 +15,7 @@ endif() set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakePredefinedTargets-in-ExternalProjectTest") -set(base "${CMAKE_BINARY_DIR}/CMakeExternals") +set(base "${CMAKE_BINARY_DIR}/Ext") set(binary_base "${base}/Build") set_property(DIRECTORY PROPERTY EP_BASE ${base}) set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) ----------------------------------------------------------------------- Summary of changes: Tests/ExternalProjectLocal/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 09:04:51 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 09:04:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2371-g5f57e82 Message-ID: <20150127140451.2FA89AA56D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5f57e8282cb1aec7d34f7ab42cdd6f1fb0fe36b7 (commit) via ef8dcd30a0d2c3fd43105bdc598ced2115157cd4 (commit) from a8197c1a4affcaf6021bef8323381d05d155258d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5f57e8282cb1aec7d34f7ab42cdd6f1fb0fe36b7 commit 5f57e8282cb1aec7d34f7ab42cdd6f1fb0fe36b7 Merge: a8197c1 ef8dcd3 Author: Brad King AuthorDate: Tue Jan 27 09:04:49 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 09:04:49 2015 -0500 Merge topic 'feature-record-msvc' into next ef8dcd30 Features: Define meaning for no language standard default http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ef8dcd30a0d2c3fd43105bdc598ced2115157cd4 commit ef8dcd30a0d2c3fd43105bdc598ced2115157cd4 Author: Brad King AuthorDate: Mon Jan 26 16:42:36 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 09:00:28 2015 -0500 Features: Define meaning for no language standard default Define an empty string in CMAKE__STANDARD_DEFAULT to mean that the toolchain has no notion of lanuage standard levels. In this case the _STANDARD[_REQUIRED] properties will have no effect. diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake index 88ca206..962aaeb 100644 --- a/Modules/Compiler/MSVC-CXX.cmake +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -1,9 +1,5 @@ -# No version of MSVC has full conformance to C++11. Therefore the -# __cplusplus macro always evaluates to 98 even if the compilers come with -# C++11/14/+ features enabled. Later we should refactor the C++ side of -# this within CMake to allow us to specify that there are no language level -# flags for this compiler. -set(CMAKE_CXX_STANDARD_DEFAULT 98) +# MSVC has no specific language level or flags to change it. +set(CMAKE_CXX_STANDARD_DEFAULT "") macro(cmake_record_cxx_compile_features) record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 834f705..af4c950 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2207,6 +2207,13 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, { return; } + const char* defaultStd + = this->Makefile->GetDefinition("CMAKE_" + lang + "_STANDARD_DEFAULT"); + if (defaultStd && !*defaultStd) + { + // This compiler has no notion of language standard levels. + return; + } std::string stdProp = lang + "_STANDARD"; const char *standardProp = target->GetProperty(stdProp); if (!standardProp) @@ -2269,8 +2276,6 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, std::find(stds.begin(), stds.end(), standard); assert(stdIt != stds.end()); - const char* defaultStd - = this->Makefile->GetDefinition("CMAKE_" + lang + "_STANDARD_DEFAULT"); std::vector::const_iterator defaultStdIt; if (defaultStd) { diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 87e62d7..b5ff732 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -5253,6 +5253,33 @@ bool cmMakefile:: HaveCStandardAvailable(cmTarget const* target, const std::string& feature) const { + const char* defaultCStandard = + this->GetDefinition("CMAKE_C_STANDARD_DEFAULT"); + if (!defaultCStandard) + { + std::ostringstream e; + e << "CMAKE_C_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " + "not fully configured for this compiler."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + // Return true so the caller does not try to lookup the default standard. + return true; + } + if (!*defaultCStandard) + { + // This compiler has no notion of language standard levels. + // All features known for the language are always available. + return true; + } + if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), + cmStrCmp(defaultCStandard)) == cmArrayEnd(C_STANDARDS)) + { + std::ostringstream e; + e << "The CMAKE_C_STANDARD_DEFAULT variable contains an " + "invalid value: \"" << defaultCStandard << "\"."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + return false; + } + bool needC90 = false; bool needC99 = false; bool needC11 = false; @@ -5262,7 +5289,7 @@ HaveCStandardAvailable(cmTarget const* target, const char *existingCStandard = target->GetProperty("C_STANDARD"); if (!existingCStandard) { - existingCStandard = this->GetDefinition("CMAKE_C_STANDARD_DEFAULT"); + existingCStandard = defaultCStandard; } if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), @@ -5331,6 +5358,33 @@ bool cmMakefile::IsLaterStandard(std::string const& lang, bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const { + const char* defaultCxxStandard = + this->GetDefinition("CMAKE_CXX_STANDARD_DEFAULT"); + if (!defaultCxxStandard) + { + std::ostringstream e; + e << "CMAKE_CXX_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " + "not fully configured for this compiler."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + // Return true so the caller does not try to lookup the default standard. + return true; + } + if (!*defaultCxxStandard) + { + // This compiler has no notion of language standard levels. + // All features known for the language are always available. + return true; + } + if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), + cmStrCmp(defaultCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) + { + std::ostringstream e; + e << "The CMAKE_CXX_STANDARD_DEFAULT variable contains an " + "invalid value: \"" << defaultCxxStandard << "\"."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + return false; + } + bool needCxx98 = false; bool needCxx11 = false; bool needCxx14 = false; @@ -5339,7 +5393,7 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const char *existingCxxStandard = target->GetProperty("CXX_STANDARD"); if (!existingCxxStandard) { - existingCxxStandard = this->GetDefinition("CMAKE_CXX_STANDARD_DEFAULT"); + existingCxxStandard = defaultCxxStandard; } if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 3e2624e..3a61751 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -84,9 +84,6 @@ add_RunCMake_test(ObjectLibrary) add_RunCMake_test(TargetObjects) add_RunCMake_test(TargetSources) add_RunCMake_test(find_dependency) -if(MSVC) - set(CompileFeatures_ARGS "-DNO_LinkImplementationFeatureCycle=1") -endif() add_RunCMake_test(CompileFeatures) add_RunCMake_test(WriteCompilerDetectionHeader) if(NOT WIN32) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 4c04e78..efea371 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -17,6 +17,8 @@ file(READ "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx_features.txt" CXX_FEATURES ) +include("${RunCMake_BINARY_DIR}/generate_feature_list-build/c_standard_default.cmake") +include("${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx_standard_default.cmake") if (NOT C_FEATURES) run_cmake(NoSupportedCFeatures) @@ -27,7 +29,7 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - if(NOT NO_LinkImplementationFeatureCycle) + if(CXX_STANDARD_DEFAULT) run_cmake(LinkImplementationFeatureCycle) endif() run_cmake(LinkImplementationFeatureCycleSolved) @@ -40,17 +42,19 @@ else() unset(RunCMake_TEST_OPTIONS) endif() -foreach(standard 98 11) - file(READ - "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx${standard}_flag.txt" - CXX${standard}_FLAG - ) - if (CXX${standard}_FLAG STREQUAL NOTFOUND) - run_cmake(RequireCXX${standard}) - run_cmake(RequireCXX${standard}Variable) - endif() - if (CXX${standard}EXT_FLAG STREQUAL NOTFOUND) - run_cmake(RequireCXX${standard}Ext) - run_cmake(RequireCXX${standard}ExtVariable) - endif() -endforeach() +if(CXX_STANDARD_DEFAULT) + foreach(standard 98 11) + file(READ + "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx${standard}_flag.txt" + CXX${standard}_FLAG + ) + if (CXX${standard}_FLAG STREQUAL NOTFOUND) + run_cmake(RequireCXX${standard}) + run_cmake(RequireCXX${standard}Variable) + endif() + if (CXX${standard}EXT_FLAG STREQUAL NOTFOUND) + run_cmake(RequireCXX${standard}Ext) + run_cmake(RequireCXX${standard}ExtVariable) + endif() + endforeach() +endif() diff --git a/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake index 09e17b1..5c58052 100644 --- a/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake +++ b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake @@ -9,6 +9,20 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_features.txt" "${CMAKE_CXX_COMPILE_FEATURES}" ) +if(DEFINED CMAKE_C_STANDARD_DEFAULT) + set(c_standard_default_code "set(C_STANDARD_DEFAULT \"${CMAKE_C_STANDARD_DEFAULT}\")\n") +else() + set(c_standard_default_code "unset(C_STANDARD_DEFAULT)\n") +endif() +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/c_standard_default.cmake" "${c_standard_default_code}") + +if(DEFINED CMAKE_CXX_STANDARD_DEFAULT) + set(cxx_standard_default_code "set(CXX_STANDARD_DEFAULT \"${CMAKE_CXX_STANDARD_DEFAULT}\")\n") +else() + set(cxx_standard_default_code "unset(CXX_STANDARD_DEFAULT)\n") +endif() +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_standard_default.cmake" "${cxx_standard_default_code}") + foreach(standard 98 11) set(CXX${standard}_FLAG NOTFOUND) if (DEFINED CMAKE_CXX${standard}_STANDARD_COMPILE_OPTION) ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/MSVC-CXX.cmake | 8 +-- Source/cmLocalGenerator.cxx | 9 ++- Source/cmMakefile.cxx | 58 +++++++++++++++++++- Tests/RunCMake/CMakeLists.txt | 3 - Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake | 34 +++++++----- .../CompileFeatures/generate_feature_list.cmake | 14 +++++ 6 files changed, 98 insertions(+), 28 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 10:44:03 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 10:44:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2373-gda9cd65 Message-ID: <20150127154403.7E2665F028@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via da9cd65f4013ae4ebf7f215594cb5424d79a22d1 (commit) via ea7edc917464acae53dcf6a82a03abdfa18fd9b2 (commit) from 5f57e8282cb1aec7d34f7ab42cdd6f1fb0fe36b7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da9cd65f4013ae4ebf7f215594cb5424d79a22d1 commit da9cd65f4013ae4ebf7f215594cb5424d79a22d1 Merge: 5f57e82 ea7edc9 Author: Brad King AuthorDate: Tue Jan 27 10:44:02 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 10:44:02 2015 -0500 Merge topic 'feature-record-msvc' into next ea7edc91 fixup! Features: Define meaning for no language standard default http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ea7edc917464acae53dcf6a82a03abdfa18fd9b2 commit ea7edc917464acae53dcf6a82a03abdfa18fd9b2 Author: Brad King AuthorDate: Tue Jan 27 10:35:02 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 10:35:08 2015 -0500 fixup! Features: Define meaning for no language standard default diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 5f93abc..5f8fbc0 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -119,26 +119,30 @@ foreach(lang CXX C) endforeach() if (CMAKE_C_COMPILE_FEATURES) - string(FIND "${CMAKE_C_FLAGS}" "-std=" std_flag_idx) - if (std_flag_idx EQUAL -1) - add_executable(default_dialect_C default_dialect.c) - target_compile_definitions(default_dialect_C PRIVATE - DEFAULT_C11=$ - DEFAULT_C99=$ - DEFAULT_C90=$ - ) + if (CMAKE_C_STANDARD_DEFAULT) + string(FIND "${CMAKE_C_FLAGS}" "-std=" std_flag_idx) + if (std_flag_idx EQUAL -1) + add_executable(default_dialect_C default_dialect.c) + target_compile_definitions(default_dialect_C PRIVATE + DEFAULT_C11=$ + DEFAULT_C99=$ + DEFAULT_C90=$ + ) + endif() endif() endif() if (CMAKE_CXX_COMPILE_FEATURES) - string(FIND "${CMAKE_CXX_FLAGS}" "-std=" std_flag_idx) - if (std_flag_idx EQUAL -1) - add_executable(default_dialect default_dialect.cpp) - target_compile_definitions(default_dialect PRIVATE - DEFAULT_CXX14=$ - DEFAULT_CXX11=$ - DEFAULT_CXX98=$ - ) + if (CMAKE_CXX_STANDARD_DEFAULT) + string(FIND "${CMAKE_CXX_FLAGS}" "-std=" std_flag_idx) + if (std_flag_idx EQUAL -1) + add_executable(default_dialect default_dialect.cpp) + target_compile_definitions(default_dialect PRIVATE + DEFAULT_CXX14=$ + DEFAULT_CXX11=$ + DEFAULT_CXX98=$ + ) + endif() endif() add_executable(CompileFeatures main.cpp) ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/CMakeLists.txt | 36 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:08:57 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:08:57 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2375-g3c5ce70 Message-ID: <20150127160857.E1436AAA39@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3c5ce70fa8c1b4f7e27045a37a4bf9478e466751 (commit) via 050dc316b6668708811311225ad923dc24e77950 (commit) from da9cd65f4013ae4ebf7f215594cb5424d79a22d1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c5ce70fa8c1b4f7e27045a37a4bf9478e466751 commit 3c5ce70fa8c1b4f7e27045a37a4bf9478e466751 Merge: da9cd65 050dc31 Author: Brad King AuthorDate: Tue Jan 27 11:08:56 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:08:56 2015 -0500 Merge topic 'fix-OBJECT_DEPENDS-after-path-normalization' into next 050dc316 Normalize OBJECT_DEPENDS paths to match custom commands (#15366) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=050dc316b6668708811311225ad923dc24e77950 commit 050dc316b6668708811311225ad923dc24e77950 Author: Brad King AuthorDate: Tue Jan 27 10:57:17 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 11:07:30 2015 -0500 Normalize OBJECT_DEPENDS paths to match custom commands (#15366) Custom command path normalization added in commit v3.1.0-rc1~471^2 (add_custom_command: Normalize OUTPUT and DEPENDS paths, 2014-05-28) broke use of OBJECT_DEPENDS to bring in custom commands because the latter paths were not normalized too. Normalize them and add a test case. Reported-by: Daniel v. Gerpen diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 14b5a92..0c60237 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -676,6 +676,14 @@ void cmTargetTraceDependencies::Trace() { std::vector objDeps; cmSystemTools::ExpandListArgument(additionalDeps, objDeps); + for(std::vector::iterator odi = objDeps.begin(); + odi != objDeps.end(); ++odi) + { + if (cmSystemTools::FileIsFullPath(*odi)) + { + *odi = cmSystemTools::CollapseFullPath(*odi); + } + } this->FollowNames(objDeps); } diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index b97cd16..7ef3540 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -153,6 +153,19 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.c ${PROJECT_BINARY_DIR}/foo.c ) +# Test using OBJECT_DEPENDS to bring in a custom command. +# Use a path that can be simplified to make sure paths +# are consistently normalized. +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/subdir/../subdir/subdir.h + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/subdir.h.in + ${CMAKE_CURRENT_BINARY_DIR}/subdir/subdir.h + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/subdir.h.in + ) +set_property(SOURCE ${PROJECT_BINARY_DIR}/foo.c PROPERTY + OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/subdir/../subdir/subdir.h) + # Add custom command to generate not_included.h, which is a header # file that is not included by any source in this project. This will # test whether all custom command outputs explicitly listed as sources diff --git a/Tests/CustomCommand/foo.in b/Tests/CustomCommand/foo.in index 0c5021c..5ca6315 100644 --- a/Tests/CustomCommand/foo.in +++ b/Tests/CustomCommand/foo.in @@ -7,6 +7,11 @@ int generated(); int wrapped(); +#include "subdir/subdir.h" +#ifndef SUBDIR_DEF +# error SUBDIR_DEF not defined +#endif + int main () { if (generated()*wrapped()*doc() == 3*5*7) diff --git a/Tests/CustomCommand/subdir.h.in b/Tests/CustomCommand/subdir.h.in new file mode 100644 index 0000000..1e50750 --- /dev/null +++ b/Tests/CustomCommand/subdir.h.in @@ -0,0 +1 @@ +#define SUBDIR_DEF ----------------------------------------------------------------------- Summary of changes: Source/cmGeneratorTarget.cxx | 8 ++++++++ Tests/CustomCommand/CMakeLists.txt | 13 +++++++++++++ Tests/CustomCommand/foo.in | 5 +++++ Tests/CustomCommand/subdir.h.in | 1 + 4 files changed, 27 insertions(+) create mode 100644 Tests/CustomCommand/subdir.h.in hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:16:45 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:16:45 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2377-g5da1636 Message-ID: <20150127161645.1C0BE5D091@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5da1636116edaeda9bf32cd67de2bdfa543e743f (commit) via f4d53ea06e2b1890ed7736f0cf90339e7f2efc84 (commit) from 3c5ce70fa8c1b4f7e27045a37a4bf9478e466751 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5da1636116edaeda9bf32cd67de2bdfa543e743f commit 5da1636116edaeda9bf32cd67de2bdfa543e743f Merge: 3c5ce70 f4d53ea Author: Brad King AuthorDate: Tue Jan 27 11:16:44 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:16:44 2015 -0500 Merge topic 'cmake-builtin-targets-use-ninja-terminal' into next f4d53ea0 fixup! Configure some CMake-provided targets with USES_TERMINAL (#14915) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4d53ea06e2b1890ed7736f0cf90339e7f2efc84 commit f4d53ea06e2b1890ed7736f0cf90339e7f2efc84 Author: Brad King AuthorDate: Tue Jan 27 11:15:53 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 11:15:53 2015 -0500 fixup! Configure some CMake-provided targets with USES_TERMINAL (#14915) diff --git a/Help/release/dev/console-pool.rst b/Help/release/dev/console-pool.rst index 19c2f19..1d9bdb8 100644 --- a/Help/release/dev/console-pool.rst +++ b/Help/release/dev/console-pool.rst @@ -5,4 +5,6 @@ console-pool commands learned a new ``USES_TERMINAL`` option to request that the command be given direct access to the terminal if possible. The :generator:`Ninja` generator will places such commands in the - ``console`` pool. + ``console`` pool. Build targets provided by CMake that are meant + for individual interactive use, such as ``install``, are now + placed in this pool. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/console-pool.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:17:01 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:17:01 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2379-gd39e049 Message-ID: <20150127161701.262F29D574@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d39e049069f3214ec70117a5f865ff9968914b33 (commit) via bbffaa0e6cf3802644453713e80a84345e96148b (commit) from 5da1636116edaeda9bf32cd67de2bdfa543e743f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d39e049069f3214ec70117a5f865ff9968914b33 commit d39e049069f3214ec70117a5f865ff9968914b33 Merge: 5da1636 bbffaa0 Author: Brad King AuthorDate: Tue Jan 27 11:17:00 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:17:00 2015 -0500 Merge topic 'cmake-builtin-targets-use-ninja-terminal' into next bbffaa0e Configure some CMake-provided targets with USES_TERMINAL (#14915) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bbffaa0e6cf3802644453713e80a84345e96148b commit bbffaa0e6cf3802644453713e80a84345e96148b Author: Sylvain Joubert AuthorDate: Sat Jan 24 19:42:31 2015 +0100 Commit: Brad King CommitDate: Tue Jan 27 11:16:48 2015 -0500 Configure some CMake-provided targets with USES_TERMINAL (#14915) This will make them use the 'console' pool with the Ninja generator. Impacted targets are: - Built-in targets: install, install/local, install/strip, tests, package, package_source, rebuild_cache - Targets provided by the CTestTargets module: Nightly, Continuous, Experimental, and all their variants (*Start, *Configure, ...) diff --git a/Help/release/dev/console-pool.rst b/Help/release/dev/console-pool.rst index 19c2f19..1d9bdb8 100644 --- a/Help/release/dev/console-pool.rst +++ b/Help/release/dev/console-pool.rst @@ -5,4 +5,6 @@ console-pool commands learned a new ``USES_TERMINAL`` option to request that the command be given direct access to the terminal if possible. The :generator:`Ninja` generator will places such commands in the - ``console`` pool. + ``console`` pool. Build targets provided by CMake that are meant + for individual interactive use, such as ``install``, are now + placed in this pool. diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake index 5b6e062..1157850 100644 --- a/Modules/CTestTargets.cmake +++ b/Modules/CTestTargets.cmake @@ -67,6 +67,7 @@ if(NOT _CTEST_TARGETS_ADDED) foreach(mode Experimental Nightly Continuous NightlyMemoryCheck) add_custom_target(${mode} ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode} + USES_TERMINAL ) set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "") set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets") @@ -82,6 +83,7 @@ if(NOT _CTEST_TARGETS_ADDED) ) add_custom_target(${mode}${testtype} ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype} + USES_TERMINAL ) set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "") set_property(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets") @@ -94,6 +96,7 @@ if(NOT _CTEST_TARGETS_ADDED) if(CTEST_TEST_TARGET_ALIAS) add_custom_target(${CTEST_TEST_TARGET_ALIAS} ${CMAKE_CTEST_COMMAND} ${__conf_types} + USES_TERMINAL ) endif() endif() diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index dd3b1ec..4c95a9f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2191,7 +2191,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) = this->CreateGlobalTarget(this->GetPackageTargetName(), "Run CPack packaging tool...", &cpackCommandLines, depends, - workingDir.c_str(), /*uses_terminal*/false); + workingDir.c_str(), /*uses_terminal*/true); } // CPack source const char* packageSourceTargetName = this->GetPackageSourceTargetName(); @@ -2215,7 +2215,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) = this->CreateGlobalTarget(packageSourceTargetName, "Run CPack packaging tool for source...", &cpackCommandLines, depends, - workingDir.c_str(), /*uses_terminal*/false); + workingDir.c_str(), /*uses_terminal*/true); } } @@ -2241,7 +2241,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[this->GetTestTargetName()] = this->CreateGlobalTarget(this->GetTestTargetName(), "Running tests...", &cpackCommandLines, depends, 0, - /*uses_terminal*/false); + /*uses_terminal*/true); } //Edit Cache @@ -2296,7 +2296,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[rebuildCacheTargetName] = this->CreateGlobalTarget( rebuildCacheTargetName, "Running CMake to regenerate build system...", - &cpackCommandLines, depends, 0, /*uses_terminal*/false); + &cpackCommandLines, depends, 0, /*uses_terminal*/true); } //Install @@ -2377,7 +2377,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[this->GetInstallTargetName()] = this->CreateGlobalTarget( this->GetInstallTargetName(), "Install the project...", - &cpackCommandLines, depends, 0, /*uses_terminal*/false); + &cpackCommandLines, depends, 0, /*uses_terminal*/true); // install_local if(const char* install_local = this->GetInstallLocalTargetName()) @@ -2393,7 +2393,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[install_local] = this->CreateGlobalTarget( install_local, "Installing only the local directory...", - &cpackCommandLines, depends, 0, /*uses_terminal*/false); + &cpackCommandLines, depends, 0, /*uses_terminal*/true); } // install_strip @@ -2410,7 +2410,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) (*targets)[install_strip] = this->CreateGlobalTarget( install_strip, "Installing the project stripped...", - &cpackCommandLines, depends, 0, /*uses_terminal*/false); + &cpackCommandLines, depends, 0, /*uses_terminal*/true); } } } ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:19:03 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:19:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2383-g86a7940 Message-ID: <20150127161903.54976A97BF@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 86a7940fe1fc85caec68f51599a4ec403534e3ad (commit) via 7f2dc8dc54fa6486423477dd673725bc40d3fdeb (commit) via daf95a38277f4c732987933a63143dde77dd0a10 (commit) via bf05938b8f186c397c918c1cf8bd9ce853c86123 (commit) from d39e049069f3214ec70117a5f865ff9968914b33 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86a7940fe1fc85caec68f51599a4ec403534e3ad commit 86a7940fe1fc85caec68f51599a4ec403534e3ad Merge: d39e049 7f2dc8d Author: Brad King AuthorDate: Tue Jan 27 11:19:02 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:19:02 2015 -0500 Merge topic 'test-rerun-cmake' into next 7f2dc8dc configure_file: Test that CMake re-runs on input change or output missing daf95a38 try_compile: Test that CMake re-runs on input change bf05938b Tests/RunCMake: Normalize newlines before checking actual output http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f2dc8dc54fa6486423477dd673725bc40d3fdeb commit 7f2dc8dc54fa6486423477dd673725bc40d3fdeb Author: Brad King AuthorDate: Fri Jan 23 10:02:04 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 11:18:37 2015 -0500 configure_file: Test that CMake re-runs on input change or output missing With the Makefile generators we expect that touching or modifying the input file of a configure_file, or removing its output, will cause CMake to re-run on the next build. Extend the RunCMake.configure_file test with a case covering this. Also check that CMake does not re-run if nothing has changed. diff --git a/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt b/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt new file mode 100644 index 0000000..26e07b6 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt @@ -0,0 +1 @@ +^Running CMake on RerunCMake$ diff --git a/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt new file mode 100644 index 0000000..34c873c --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*/Tests/RunCMake/configure_file/RerunCMake-build diff --git a/Tests/RunCMake/configure_file/RerunCMake-stderr.txt b/Tests/RunCMake/configure_file/RerunCMake-stderr.txt new file mode 100644 index 0000000..26e07b6 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-stderr.txt @@ -0,0 +1 @@ +^Running CMake on RerunCMake$ diff --git a/Tests/RunCMake/configure_file/RerunCMake-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt new file mode 100644 index 0000000..34c873c --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*/Tests/RunCMake/configure_file/RerunCMake-build diff --git a/Tests/RunCMake/configure_file/RerunCMake.cmake b/Tests/RunCMake/configure_file/RerunCMake.cmake new file mode 100644 index 0000000..890cc1f --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake.cmake @@ -0,0 +1,8 @@ +message("Running CMake on RerunCMake") # write to stderr if cmake reruns +configure_file( + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in" + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt" + @ONLY + ) +# make sure CMakeCache.txt is newer than ConfigureFileOutput.txt +execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake index c010256..489652b 100644 --- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake +++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake @@ -7,3 +7,37 @@ run_cmake(UTF16BE-BOM) run_cmake(UTF32LE-BOM) run_cmake(UTF32BE-BOM) run_cmake(UnknownArg) + +if(RunCMake_GENERATOR MATCHES "Make") + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + set(in_conf "${RunCMake_TEST_BINARY_DIR}/ConfigureFileInput.txt.in") + file(WRITE "${in_conf}" "1") + + message(STATUS "RerunCMake: first configuration...") + run_cmake(RerunCMake) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution + message(STATUS "RerunCMake: touch configure_file input...") + file(WRITE "${in_conf}" "1") + run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution + message(STATUS "RerunCMake: modify configure_file input...") + file(WRITE "${in_conf}" "2") + run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + message(STATUS "RerunCMake: remove configure_file output...") + file(REMOVE "${RunCMake_TEST_BINARY_DIR}/ConfigureFileOutput.txt") + run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) +endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=daf95a38277f4c732987933a63143dde77dd0a10 commit daf95a38277f4c732987933a63143dde77dd0a10 Author: Brad King AuthorDate: Fri Jan 23 09:45:00 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 11:18:36 2015 -0500 try_compile: Test that CMake re-runs on input change With the Makefile and Ninja generators we expect that touching the input source file for a try_compile will cause CMake to re-run on the next build. Extend the RunCMake.try_compile test with a case covering this. Also check that CMake does not re-run if nothing has changed. diff --git a/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt new file mode 100644 index 0000000..e600b9b --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt @@ -0,0 +1 @@ +^ninja: no work to do\.$ diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt new file mode 100644 index 0000000..b0438f5 --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt @@ -0,0 +1,5 @@ +Running CMake on RerunCMake +FALSE +-- Configuring done +-- Generating done +-- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt new file mode 100644 index 0000000..88e54b1 --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt @@ -0,0 +1,2 @@ +^Running CMake on RerunCMake +FALSE$ diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt new file mode 100644 index 0000000..9c78b26 --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake-stderr.txt b/Tests/RunCMake/try_compile/RerunCMake-stderr.txt new file mode 100644 index 0000000..45d305a --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-stderr.txt @@ -0,0 +1,2 @@ +^Running CMake on RerunCMake +TRUE$ diff --git a/Tests/RunCMake/try_compile/RerunCMake-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt new file mode 100644 index 0000000..9c78b26 --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring done +-- Generating done +-- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build diff --git a/Tests/RunCMake/try_compile/RerunCMake.cmake b/Tests/RunCMake/try_compile/RerunCMake.cmake new file mode 100644 index 0000000..5a9f1d4 --- /dev/null +++ b/Tests/RunCMake/try_compile/RerunCMake.cmake @@ -0,0 +1,7 @@ +message("Running CMake on RerunCMake") # write to stderr if cmake reruns +enable_language(C) +try_compile(res + "${CMAKE_CURRENT_BINARY_DIR}" + SOURCES "${CMAKE_CURRENT_BINARY_DIR}/TryCompileInput.c" + ) +message("${res}") diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index 06096b2..6cdbafa 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -17,3 +17,36 @@ run_cmake(NonSourceCopyFile) run_cmake(NonSourceCompileDefinitions) run_cmake(CMP0056) + +if(RunCMake_GENERATOR MATCHES "Make|Ninja") + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + set(in_tc "${RunCMake_TEST_BINARY_DIR}/TryCompileInput.c") + file(WRITE "${in_tc}" "int main(void) { return 0; }\n") + + # Older Ninja keeps all rerun output on stdout + set(ninja "") + if(RunCMake_GENERATOR STREQUAL "Ninja") + execute_process(COMMAND ${RunCMake_MAKE_PROGRAM} --version + OUTPUT_VARIABLE ninja_version OUTPUT_STRIP_TRAILING_WHITESPACE) + if(ninja_version VERSION_LESS 1.5) + set(ninja -ninja-no-console) + endif() + endif() + + message(STATUS "RerunCMake: first configuration...") + run_cmake(RerunCMake) + run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .) + + execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution + message(STATUS "RerunCMake: modify try_compile input...") + file(WRITE "${in_tc}" "does-not-compile\n") + run_cmake_command(RerunCMake-rerun${ninja} ${CMAKE_COMMAND} --build .) + run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) +endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf05938b8f186c397c918c1cf8bd9ce853c86123 commit bf05938b8f186c397c918c1cf8bd9ce853c86123 Author: Brad King AuthorDate: Mon Jan 26 13:41:38 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 11:18:36 2015 -0500 Tests/RunCMake: Normalize newlines before checking actual output We read the expected output with file(STRINGS) which converts CRLF newlines to LF. Do the same with the actual output before comparing. diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 23f2f97..33b745d 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -79,6 +79,7 @@ function(run_cmake test) set(msg "${msg}Result is [${actual_result}], not [${expect_result}].\n") endif() foreach(o out err) + string(REGEX REPLACE "\r\n" "\n" actual_std${o} "${actual_std${o}}") string(REGEX REPLACE "(^|\n)(==[0-9]+==[^\n]*\n)+" "\\1" actual_std${o} "${actual_std${o}}") string(REGEX REPLACE "\n+$" "" actual_std${o} "${actual_std${o}}") set(expect_${o} "") ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:21:56 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:21:56 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-915-g095fc28 Message-ID: <20150127162156.71DF6A9EBE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 095fc28a7e077441daf2e3e59fe34f85f3ea6775 (commit) via c7310917e6b5efa6ef867ef5cabc5b5649d97b67 (commit) from 82ba50390f52226bdd4162e4108bc4f5226150d6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=095fc28a7e077441daf2e3e59fe34f85f3ea6775 commit 095fc28a7e077441daf2e3e59fe34f85f3ea6775 Merge: 82ba503 c731091 Author: Brad King AuthorDate: Tue Jan 27 11:21:55 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:21:55 2015 -0500 Merge topic 'doc-link_libraries-note' c7310917 Help: Clarify status of link_libraries command ----------------------------------------------------------------------- Summary of changes: Help/command/link_libraries.rst | 19 +++++++++++-------- Help/manual/cmake-commands.7.rst | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:21:58 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:21:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-917-g4ef0f7f Message-ID: <20150127162158.968B9A9ECD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 4ef0f7f62f3944eed29031ab9878f7213c7dd402 (commit) via 6cc0f6b512d08caabf088d22f3f25432e6307b6a (commit) from 095fc28a7e077441daf2e3e59fe34f85f3ea6775 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ef0f7f62f3944eed29031ab9878f7213c7dd402 commit 4ef0f7f62f3944eed29031ab9878f7213c7dd402 Merge: 095fc28 6cc0f6b Author: Brad King AuthorDate: Tue Jan 27 11:21:57 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:21:57 2015 -0500 Merge topic 'load-initial-cache-from-stderr-to-stdout' 6cc0f6b5 cmake: Display "loading initial cache" message on stdout ----------------------------------------------------------------------- Summary of changes: Source/cmake.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:22:00 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:22:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-919-gef6d030 Message-ID: <20150127162200.B4109A9EDA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via ef6d030c95e813ed368ac28b55110cb0f159df6b (commit) via bbffaa0e6cf3802644453713e80a84345e96148b (commit) from 4ef0f7f62f3944eed29031ab9878f7213c7dd402 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ef6d030c95e813ed368ac28b55110cb0f159df6b commit ef6d030c95e813ed368ac28b55110cb0f159df6b Merge: 4ef0f7f bbffaa0 Author: Brad King AuthorDate: Tue Jan 27 11:21:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:21:59 2015 -0500 Merge topic 'cmake-builtin-targets-use-ninja-terminal' bbffaa0e Configure some CMake-provided targets with USES_TERMINAL (#14915) ----------------------------------------------------------------------- Summary of changes: Help/release/dev/console-pool.rst | 4 +++- Modules/CTestTargets.cmake | 3 +++ Source/cmGlobalGenerator.cxx | 14 +++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:22:03 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:22:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-923-gd1b3370 Message-ID: <20150127162203.18D02A9F07@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via d1b3370d5210d4262e58a523d19393e9ea9ee782 (commit) via 8ced6375dfd366a088c681e45c0d8cdb4ea04dde (commit) via b46a15194b7cf1d7aaabf9d0b2a80651ada2e23f (commit) via c19539c594c4099fd4de68c2e386347d1cb0667f (commit) from ef6d030c95e813ed368ac28b55110cb0f159df6b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d1b3370d5210d4262e58a523d19393e9ea9ee782 commit d1b3370d5210d4262e58a523d19393e9ea9ee782 Merge: ef6d030 8ced637 Author: Brad King AuthorDate: Tue Jan 27 11:22:01 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:22:01 2015 -0500 Merge topic 'cmake-gui-osx' 8ced6375 cmake-gui: Shrink spacing between search field and checkbox. b46a1519 cmake-gui: Change install buttons to activate on clicked instead of pressed. c19539c5 cmake-gui: Fix install menu to be available for Qt5 builds on OS X. ----------------------------------------------------------------------- Summary of changes: Source/QtDialog/CMakeSetupDialog.cxx | 2 +- Source/QtDialog/CMakeSetupDialog.ui | 2 +- Source/QtDialog/QMacInstallDialog.cxx | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:22:05 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:22:05 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-925-g34ce0dd Message-ID: <20150127162205.6501FA9F07@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 34ce0dd22f1c2091c5870e25677b100f753c44a0 (commit) via bf05938b8f186c397c918c1cf8bd9ce853c86123 (commit) from d1b3370d5210d4262e58a523d19393e9ea9ee782 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=34ce0dd22f1c2091c5870e25677b100f753c44a0 commit 34ce0dd22f1c2091c5870e25677b100f753c44a0 Merge: d1b3370 bf05938 Author: Brad King AuthorDate: Tue Jan 27 11:22:04 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:22:04 2015 -0500 Merge topic 'tests-RunCMake-normalize-newlines' bf05938b Tests/RunCMake: Normalize newlines before checking actual output ----------------------------------------------------------------------- Summary of changes: Tests/RunCMake/RunCMake.cmake | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:22:07 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:22:07 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-928-g33daec1 Message-ID: <20150127162207.90CDFA9F0A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 33daec1ae96752817a268fdca2518032cb9453f8 (commit) via 7f2dc8dc54fa6486423477dd673725bc40d3fdeb (commit) via daf95a38277f4c732987933a63143dde77dd0a10 (commit) from 34ce0dd22f1c2091c5870e25677b100f753c44a0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=33daec1ae96752817a268fdca2518032cb9453f8 commit 33daec1ae96752817a268fdca2518032cb9453f8 Merge: 34ce0dd 7f2dc8d Author: Brad King AuthorDate: Tue Jan 27 11:22:06 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:22:06 2015 -0500 Merge topic 'test-rerun-cmake' 7f2dc8dc configure_file: Test that CMake re-runs on input change or output missing daf95a38 try_compile: Test that CMake re-runs on input change ----------------------------------------------------------------------- Summary of changes: .../configure_file/RerunCMake-rerun-stderr.txt | 1 + .../configure_file/RerunCMake-rerun-stdout.txt | 3 ++ .../RunCMake/configure_file/RerunCMake-stderr.txt | 1 + .../RunCMake/configure_file/RerunCMake-stdout.txt | 3 ++ Tests/RunCMake/configure_file/RerunCMake.cmake | 8 +++++ Tests/RunCMake/configure_file/RunCMakeTest.cmake | 34 ++++++++++++++++++++ .../RerunCMake-nowork-ninja-no-console-stdout.txt | 1 + .../RerunCMake-rerun-ninja-no-console-stdout.txt | 5 +++ .../try_compile/RerunCMake-rerun-stderr.txt | 2 ++ .../try_compile/RerunCMake-rerun-stdout.txt | 3 ++ Tests/RunCMake/try_compile/RerunCMake-stderr.txt | 2 ++ Tests/RunCMake/try_compile/RerunCMake-stdout.txt | 3 ++ Tests/RunCMake/try_compile/RerunCMake.cmake | 7 ++++ Tests/RunCMake/try_compile/RunCMakeTest.cmake | 33 +++++++++++++++++++ 14 files changed, 106 insertions(+) create mode 100644 Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt create mode 100644 Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt create mode 100644 Tests/RunCMake/configure_file/RerunCMake-stderr.txt create mode 100644 Tests/RunCMake/configure_file/RerunCMake-stdout.txt create mode 100644 Tests/RunCMake/configure_file/RerunCMake.cmake create mode 100644 Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt create mode 100644 Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt create mode 100644 Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt create mode 100644 Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt create mode 100644 Tests/RunCMake/try_compile/RerunCMake-stderr.txt create mode 100644 Tests/RunCMake/try_compile/RerunCMake-stdout.txt create mode 100644 Tests/RunCMake/try_compile/RerunCMake.cmake hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:22:09 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:22:09 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-930-gaf9cf04 Message-ID: <20150127162209.F1FEDA9ECD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via af9cf04647a14897b4402447c04117d82fc6e39d (commit) via 44fd71decbca329d9cdfc196a073a62668af53f2 (commit) from 33daec1ae96752817a268fdca2518032cb9453f8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af9cf04647a14897b4402447c04117d82fc6e39d commit af9cf04647a14897b4402447c04117d82fc6e39d Merge: 33daec1 44fd71d Author: Brad King AuthorDate: Tue Jan 27 11:22:08 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:22:08 2015 -0500 Merge topic 'cmake-E-tar-files-from' 44fd71de cmake: Teach "-E tar" command a "--files-from=" option ----------------------------------------------------------------------- Summary of changes: Help/release/dev/cmake-E-tar-files-from.rst | 6 +++ Source/cmcmd.cxx | 53 ++++++++++++++++++++ .../E_tar-bad-from1-result.txt} | 0 .../CommandLine/E_tar-bad-from1-stderr.txt | 1 + .../E_tar-bad-from2-result.txt} | 0 .../CommandLine/E_tar-bad-from2-stderr.txt | 1 + .../E_tar-bad-from3-result.txt} | 0 .../CommandLine/E_tar-bad-from3-stderr.txt | 2 + Tests/RunCMake/CommandLine/E_tar-bad-from3.txt | 1 + .../E_tar-bad-from4-result.txt} | 0 .../CommandLine/E_tar-bad-from4-stderr.txt | 2 + Tests/RunCMake/CommandLine/E_tar-bad-from4.txt | 2 + .../E_tar-bad-from5-result.txt} | 0 .../CommandLine/E_tar-bad-from5-stderr.txt | 2 + Tests/RunCMake/CommandLine/E_tar-bad-from5.txt | 2 + Tests/RunCMake/CommandLine/RunCMakeTest.cmake | 5 ++ 16 files changed, 77 insertions(+) create mode 100644 Help/release/dev/cmake-E-tar-files-from.rst copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-from1-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from1-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-from2-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from2-stderr.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-from3-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from3-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from3.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-from4-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from4-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from4.txt copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => CommandLine/E_tar-bad-from5-result.txt} (100%) create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from5-stderr.txt create mode 100644 Tests/RunCMake/CommandLine/E_tar-bad-from5.txt hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:22:11 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:22:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-932-g8eb3033 Message-ID: <20150127162211.C53CDA9F0A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 8eb30339b497a04c4ac2d0879bbeb764a6d51133 (commit) via 4c49ce96d7dfcf902d1af627a733ba732cb9b6a5 (commit) from af9cf04647a14897b4402447c04117d82fc6e39d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8eb30339b497a04c4ac2d0879bbeb764a6d51133 commit 8eb30339b497a04c4ac2d0879bbeb764a6d51133 Merge: af9cf04 4c49ce9 Author: Brad King AuthorDate: Tue Jan 27 11:22:10 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:22:10 2015 -0500 Merge topic 'doc-cmake-E-mode' 4c49ce96 Help: Document 'cmake -E ' modes in cmake.1 manual ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake.1.rst | 120 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 108 insertions(+), 12 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:22:13 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:22:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-935-gc1f5d6e Message-ID: <20150127162213.976A8A9F07@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via c1f5d6e6f54f8b61d223476459970d336098429c (commit) via 67e76e82df0fe8466b4bf65265d0c6b7f6046dfb (commit) via 3046be77847ce54baae1d432dec224282dedcc16 (commit) from 8eb30339b497a04c4ac2d0879bbeb764a6d51133 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1f5d6e6f54f8b61d223476459970d336098429c commit c1f5d6e6f54f8b61d223476459970d336098429c Merge: 8eb3033 67e76e8 Author: Brad King AuthorDate: Tue Jan 27 11:22:12 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:22:12 2015 -0500 Merge topic 'test-features-enforce-expectation' 67e76e82 Features: Fix test to reject missing expectation definitions 3046be77 Features: Emit a test failure if 'override' is present but not expected ----------------------------------------------------------------------- Summary of changes: Tests/CompileFeatures/genex_test.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:22:40 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:22:40 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2393-g8c27ca4 Message-ID: <20150127162240.AA467A9F3B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8c27ca48d548abad83d2eae3816e6ef9af8d63bf (commit) via c1f5d6e6f54f8b61d223476459970d336098429c (commit) via 8eb30339b497a04c4ac2d0879bbeb764a6d51133 (commit) via af9cf04647a14897b4402447c04117d82fc6e39d (commit) via 33daec1ae96752817a268fdca2518032cb9453f8 (commit) via 34ce0dd22f1c2091c5870e25677b100f753c44a0 (commit) via d1b3370d5210d4262e58a523d19393e9ea9ee782 (commit) via ef6d030c95e813ed368ac28b55110cb0f159df6b (commit) via 4ef0f7f62f3944eed29031ab9878f7213c7dd402 (commit) via 095fc28a7e077441daf2e3e59fe34f85f3ea6775 (commit) from 86a7940fe1fc85caec68f51599a4ec403534e3ad (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c27ca48d548abad83d2eae3816e6ef9af8d63bf commit 8c27ca48d548abad83d2eae3816e6ef9af8d63bf Merge: 86a7940 c1f5d6e Author: Brad King AuthorDate: Tue Jan 27 11:22:31 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 11:22:31 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:30:54 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:30:54 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2395-gba9bd14 Message-ID: <20150127163054.C86B3AA16F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ba9bd140a68861152734e2371b20793393b4a534 (commit) via 1f77a7001b2e3f8f9224cb603e5acfee45573064 (commit) from 8c27ca48d548abad83d2eae3816e6ef9af8d63bf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ba9bd140a68861152734e2371b20793393b4a534 commit ba9bd140a68861152734e2371b20793393b4a534 Merge: 8c27ca4 1f77a70 Author: Brad King AuthorDate: Tue Jan 27 11:30:54 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:30:54 2015 -0500 Merge topic 'file-strings-utf-16' into next 1f77a700 file: Teach STRINGS to support UTF-16 and UTF-32 encodings http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f77a7001b2e3f8f9224cb603e5acfee45573064 commit 1f77a7001b2e3f8f9224cb603e5acfee45573064 Author: Justin Borodinsky AuthorDate: Sun Jan 11 14:33:36 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 11:30:26 2015 -0500 file: Teach STRINGS to support UTF-16 and UTF-32 encodings diff --git a/Help/command/file.rst b/Help/command/file.rst index b0d4792..73d4cfa 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -65,7 +65,10 @@ Parse a list of ASCII strings from ```` and store it in Consider only strings that match the given regular expression. ``ENCODING `` - Consider strings of a given encoding. "UTF-8" is currently supported. + Consider strings of a given encoding. Currently supported encodings are: + UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE. If the ENCODING option + is not provided and the file has a Byte Order Mark, the ENCODING option + will be defaulted to respect the Byte Order Mark. For example, the code diff --git a/Help/release/dev/file-strings-utf-16.rst b/Help/release/dev/file-strings-utf-16.rst new file mode 100644 index 0000000..f40b63e --- /dev/null +++ b/Help/release/dev/file-strings-utf-16.rst @@ -0,0 +1,5 @@ +file-strings-utf-16 +------------------- + +* The :command:`file(STRINGS)` now supports UTF-16LE, UTF-16BE, + UTF-32LE, UTF-32BE as ``ENCODING`` options. diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index f125292..579e715 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -472,7 +472,13 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) bool have_regex = false; bool newline_consume = false; bool hex_conversion_enabled = true; - bool utf8_encoding = false; + enum { encoding_none = cmsys::FStream::BOM_None, + encoding_utf8 = cmsys::FStream::BOM_UTF8, + encoding_utf16le = cmsys::FStream::BOM_UTF16LE, + encoding_utf16be = cmsys::FStream::BOM_UTF16BE, + encoding_utf32le = cmsys::FStream::BOM_UTF32LE, + encoding_utf32be = cmsys::FStream::BOM_UTF32BE}; + int encoding = encoding_none; int arg_mode = arg_none; for(unsigned int i=3; i < args.size(); ++i) { @@ -599,7 +605,23 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) { if(args[i] == "UTF-8") { - utf8_encoding = true; + encoding = encoding_utf8; + } + else if(args[i] == "UTF-16LE") + { + encoding = encoding_utf16le; + } + else if(args[i] == "UTF-16BE") + { + encoding = encoding_utf16be; + } + else if(args[i] == "UTF-32LE") + { + encoding = encoding_utf32le; + } + else if(args[i] == "UTF-32BE") + { + encoding = encoding_utf32be; } else { @@ -647,6 +669,23 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) return false; } + //If BOM is found and encoding was not specified, use the BOM + int bom_found = cmsys::FStream::ReadBOM(fin); + if(encoding == encoding_none && bom_found != cmsys::FStream::BOM_None) + { + encoding = bom_found; + } + + unsigned int bytes_rem = 0; + if(encoding == encoding_utf16le || encoding == encoding_utf16be) + { + bytes_rem = 1; + } + if(encoding == encoding_utf32le || encoding == encoding_utf32be) + { + bytes_rem = 3; + } + // Parse strings out of the file. int output_size = 0; std::vector strings; @@ -658,6 +697,25 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) std::string current_str; int c = fin.get(); + for(unsigned int i=0; i(c1)); + break; + } + c = (c << 8) | c1; + } + if(encoding == encoding_utf16le) + { + c = ((c & 0xFF) << 8) | ((c & 0xFF00) >> 8); + } + else if(encoding == encoding_utf32le) + { + c = (((c & 0xFF) << 24) | ((c & 0xFF00) << 8) | + ((c & 0xFF0000) >> 8) | ((c & 0xFF000000) >> 24)); + } if(c == '\r') { @@ -673,7 +731,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) // c is guaranteed to fit in char by the above if... current_str += static_cast(c); } - else if(utf8_encoding) + else if(encoding == encoding_utf8) { // Check for UTF-8 encoded string (up to 4 octets) static const unsigned char utf8_check_table[3][2] = diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake index fc913c6..89f7ea5 100644 --- a/Tests/RunCMake/string/RunCMakeTest.cmake +++ b/Tests/RunCMake/string/RunCMakeTest.cmake @@ -12,3 +12,8 @@ run_cmake(UuidMissingTypeValue) run_cmake(UuidBadType) run_cmake(RegexClear) + +run_cmake(UTF-16BE) +run_cmake(UTF-16LE) +run_cmake(UTF-32BE) +run_cmake(UTF-32LE) diff --git a/Tests/RunCMake/string/UTF-16BE-stderr.txt b/Tests/RunCMake/string/UTF-16BE-stderr.txt new file mode 100644 index 0000000..8254f87 --- /dev/null +++ b/Tests/RunCMake/string/UTF-16BE-stderr.txt @@ -0,0 +1,2 @@ +Hello World +Hello World diff --git a/Tests/RunCMake/string/UTF-16BE.cmake b/Tests/RunCMake/string/UTF-16BE.cmake new file mode 100644 index 0000000..da986c0 --- /dev/null +++ b/Tests/RunCMake/string/UTF-16BE.cmake @@ -0,0 +1,4 @@ +file(STRINGS UTF-16BE.txt str ENCODING UTF-16BE LENGTH_MINIMUM 4) +message("${str}") +file(STRINGS UTF-16BE.txt str LENGTH_MINIMUM 4) +message("${str}") diff --git a/Tests/RunCMake/string/UTF-16BE.txt b/Tests/RunCMake/string/UTF-16BE.txt new file mode 100644 index 0000000..9d976bc Binary files /dev/null and b/Tests/RunCMake/string/UTF-16BE.txt differ diff --git a/Tests/RunCMake/string/UTF-16LE-stderr.txt b/Tests/RunCMake/string/UTF-16LE-stderr.txt new file mode 100644 index 0000000..8254f87 --- /dev/null +++ b/Tests/RunCMake/string/UTF-16LE-stderr.txt @@ -0,0 +1,2 @@ +Hello World +Hello World diff --git a/Tests/RunCMake/string/UTF-16LE.cmake b/Tests/RunCMake/string/UTF-16LE.cmake new file mode 100644 index 0000000..326d848 --- /dev/null +++ b/Tests/RunCMake/string/UTF-16LE.cmake @@ -0,0 +1,4 @@ +file(STRINGS UTF-16LE.txt str ENCODING UTF-16LE LENGTH_MINIMUM 4) +message("${str}") +file(STRINGS UTF-16LE.txt str LENGTH_MINIMUM 4) +message("${str}") diff --git a/Tests/RunCMake/string/UTF-16LE.txt b/Tests/RunCMake/string/UTF-16LE.txt new file mode 100644 index 0000000..ebba874 Binary files /dev/null and b/Tests/RunCMake/string/UTF-16LE.txt differ diff --git a/Tests/RunCMake/string/UTF-32BE-stderr.txt b/Tests/RunCMake/string/UTF-32BE-stderr.txt new file mode 100644 index 0000000..8254f87 --- /dev/null +++ b/Tests/RunCMake/string/UTF-32BE-stderr.txt @@ -0,0 +1,2 @@ +Hello World +Hello World diff --git a/Tests/RunCMake/string/UTF-32BE.cmake b/Tests/RunCMake/string/UTF-32BE.cmake new file mode 100644 index 0000000..debdeaa --- /dev/null +++ b/Tests/RunCMake/string/UTF-32BE.cmake @@ -0,0 +1,4 @@ +file(STRINGS UTF-32BE.txt str ENCODING UTF-32BE LENGTH_MINIMUM 4) +message("${str}") +file(STRINGS UTF-32BE.txt str LENGTH_MINIMUM 4) +message("${str}") diff --git a/Tests/RunCMake/string/UTF-32BE.txt b/Tests/RunCMake/string/UTF-32BE.txt new file mode 100644 index 0000000..6725fbb Binary files /dev/null and b/Tests/RunCMake/string/UTF-32BE.txt differ diff --git a/Tests/RunCMake/string/UTF-32LE-stderr.txt b/Tests/RunCMake/string/UTF-32LE-stderr.txt new file mode 100644 index 0000000..8254f87 --- /dev/null +++ b/Tests/RunCMake/string/UTF-32LE-stderr.txt @@ -0,0 +1,2 @@ +Hello World +Hello World diff --git a/Tests/RunCMake/string/UTF-32LE.cmake b/Tests/RunCMake/string/UTF-32LE.cmake new file mode 100644 index 0000000..22aab5f --- /dev/null +++ b/Tests/RunCMake/string/UTF-32LE.cmake @@ -0,0 +1,4 @@ +file(STRINGS UTF-32LE.txt str ENCODING UTF-32LE LENGTH_MINIMUM 4) +message("${str}") +file(STRINGS UTF-32LE.txt str LENGTH_MINIMUM 4) +message("${str}") diff --git a/Tests/RunCMake/string/UTF-32LE.txt b/Tests/RunCMake/string/UTF-32LE.txt new file mode 100644 index 0000000..cf5102f Binary files /dev/null and b/Tests/RunCMake/string/UTF-32LE.txt differ ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:36:46 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:36:46 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-937-ga47b904 Message-ID: <20150127163646.B7020AA9AC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via a47b904db242abb903a968bd6109bc8a07d3c39a (commit) via 1f77a7001b2e3f8f9224cb603e5acfee45573064 (commit) from c1f5d6e6f54f8b61d223476459970d336098429c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a47b904db242abb903a968bd6109bc8a07d3c39a commit a47b904db242abb903a968bd6109bc8a07d3c39a Merge: c1f5d6e 1f77a70 Author: Brad King AuthorDate: Tue Jan 27 11:36:45 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 11:36:45 2015 -0500 Merge topic 'file-strings-utf-16' 1f77a700 file: Teach STRINGS to support UTF-16 and UTF-32 encodings ----------------------------------------------------------------------- Summary of changes: Help/command/file.rst | 5 +- Help/release/dev/file-strings-utf-16.rst | 5 ++ Source/cmFileCommand.cxx | 64 +++++++++++++++++++- Tests/RunCMake/string/RunCMakeTest.cmake | 5 ++ .../NO-BOM.txt.in => string/UTF-16BE-stderr.txt} | 1 + Tests/RunCMake/string/UTF-16BE.cmake | 4 ++ Tests/RunCMake/string/UTF-16BE.txt | Bin 0 -> 83 bytes .../NO-BOM.txt.in => string/UTF-16LE-stderr.txt} | 1 + Tests/RunCMake/string/UTF-16LE.cmake | 4 ++ Tests/RunCMake/string/UTF-16LE.txt | Bin 0 -> 83 bytes .../NO-BOM.txt.in => string/UTF-32BE-stderr.txt} | 1 + Tests/RunCMake/string/UTF-32BE.cmake | 4 ++ Tests/RunCMake/string/UTF-32BE.txt | Bin 0 -> 165 bytes .../NO-BOM.txt.in => string/UTF-32LE-stderr.txt} | 1 + Tests/RunCMake/string/UTF-32LE.cmake | 4 ++ Tests/RunCMake/string/UTF-32LE.txt | Bin 0 -> 165 bytes 16 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 Help/release/dev/file-strings-utf-16.rst copy Tests/RunCMake/{configure_file/NO-BOM.txt.in => string/UTF-16BE-stderr.txt} (50%) create mode 100644 Tests/RunCMake/string/UTF-16BE.cmake create mode 100644 Tests/RunCMake/string/UTF-16BE.txt copy Tests/RunCMake/{configure_file/NO-BOM.txt.in => string/UTF-16LE-stderr.txt} (50%) create mode 100644 Tests/RunCMake/string/UTF-16LE.cmake create mode 100644 Tests/RunCMake/string/UTF-16LE.txt copy Tests/RunCMake/{configure_file/NO-BOM.txt.in => string/UTF-32BE-stderr.txt} (50%) create mode 100644 Tests/RunCMake/string/UTF-32BE.cmake create mode 100644 Tests/RunCMake/string/UTF-32BE.txt copy Tests/RunCMake/{configure_file/NO-BOM.txt.in => string/UTF-32LE-stderr.txt} (50%) create mode 100644 Tests/RunCMake/string/UTF-32LE.cmake create mode 100644 Tests/RunCMake/string/UTF-32LE.txt hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 11:38:15 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 11:38:15 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2397-g4457266 Message-ID: <20150127163815.7F042AA9D1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 4457266e0b54b8b0bbe65bb58637b53e4e03a0c2 (commit) via a47b904db242abb903a968bd6109bc8a07d3c39a (commit) from ba9bd140a68861152734e2371b20793393b4a534 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4457266e0b54b8b0bbe65bb58637b53e4e03a0c2 commit 4457266e0b54b8b0bbe65bb58637b53e4e03a0c2 Merge: ba9bd14 a47b904 Author: Brad King AuthorDate: Tue Jan 27 11:38:08 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 11:38:08 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 12:29:26 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 12:29:26 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2400-ga64545d Message-ID: <20150127172926.4AC71AA112@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a64545de6ce4da2f2dc50deecc632ccf8e2d4ef8 (commit) via d3e921ef87838fff6b8778966fc2fc530638a831 (commit) via 3837f15096592ee85e4a459b11fccf0722a7318f (commit) from 4457266e0b54b8b0bbe65bb58637b53e4e03a0c2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a64545de6ce4da2f2dc50deecc632ccf8e2d4ef8 commit a64545de6ce4da2f2dc50deecc632ccf8e2d4ef8 Merge: 4457266 d3e921e Author: Brad King AuthorDate: Tue Jan 27 12:29:25 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 12:29:25 2015 -0500 Merge topic 'feature-record-msvc' into next d3e921ef Features: Record for MSVC 2010-2015 3837f150 Features: Define meaning for no language standard default http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3e921ef87838fff6b8778966fc2fc530638a831 commit d3e921ef87838fff6b8778966fc2fc530638a831 Author: Robert Maynard AuthorDate: Mon Jan 19 15:49:06 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 10:44:53 2015 -0500 Features: Record for MSVC 2010-2015 Notes: * Initializer lists are only properly supported in 2015 and above. Previous Visual Studio releases said they supported initializer lists. * VS2012 and above conform to cxx_decltype_incomplete_return_types proposal but without support for auto return types the feature is unusable. Activate support only in VS2015 and above. * VS2010 and above to conform to the updated cxx_contextual_conversions proposal. * In WCDH add MSVC Compatibility for cxx_align{of,as}. Co-Author: Stephen Kelly diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..476f244 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,100 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +# In theory decltype incomplete return types was added in 2012 +# but without support for decltype_auto and return type deduction this +# feature is unusable +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Possibly broken: +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +# Microsoft now states they support contextual conversions +# see footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx + +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + + +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake new file mode 100644 index 0000000..962aaeb --- /dev/null +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -0,0 +1,6 @@ +# MSVC has no specific language level or flags to change it. +set(CMAKE_CXX_STANDARD_DEFAULT "") + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index e81bc08..d18f47c 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC SunPro ) @@ -528,6 +529,8 @@ function(write_compiler_detection_header # define ${def_value} alignas(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __attribute__ ((__aligned__(X))) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __declspec(align(X)) # else # define ${def_value} # endif @@ -540,6 +543,8 @@ function(write_compiler_detection_header # define ${def_value} alignof(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __alignof__(X) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __alignof(X) # endif \n") endif() diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index a8b85d6..5f8fbc0 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -211,6 +211,29 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=0 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=0 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") add_definitions( -DEXPECT_OVERRIDE_CONTROL=1 diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index b5e46c0..43e89ab 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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -67,6 +67,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +# Both variadic templates and delegating constructors support exist in +# all versions that we write compile headers for. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND + ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -84,7 +96,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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3837f15096592ee85e4a459b11fccf0722a7318f commit 3837f15096592ee85e4a459b11fccf0722a7318f Author: Brad King AuthorDate: Mon Jan 26 16:42:36 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 10:44:53 2015 -0500 Features: Define meaning for no language standard default Define an empty string in CMAKE__STANDARD_DEFAULT to mean that the toolchain has no notion of lanuage standard levels. In this case the _STANDARD[_REQUIRED] properties will have no effect. Update the RunCMake.CompileFeatures test to exclude the LinkImplementationFeatureCycle test when there is no standard default. It can never fail because no use of specific features will adjust the CXX_STANDARD level required for any target since the standard levels have no meaning in this case. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 834f705..af4c950 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2207,6 +2207,13 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, { return; } + const char* defaultStd + = this->Makefile->GetDefinition("CMAKE_" + lang + "_STANDARD_DEFAULT"); + if (defaultStd && !*defaultStd) + { + // This compiler has no notion of language standard levels. + return; + } std::string stdProp = lang + "_STANDARD"; const char *standardProp = target->GetProperty(stdProp); if (!standardProp) @@ -2269,8 +2276,6 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, std::find(stds.begin(), stds.end(), standard); assert(stdIt != stds.end()); - const char* defaultStd - = this->Makefile->GetDefinition("CMAKE_" + lang + "_STANDARD_DEFAULT"); std::vector::const_iterator defaultStdIt; if (defaultStd) { diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 87e62d7..b5ff732 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -5253,6 +5253,33 @@ bool cmMakefile:: HaveCStandardAvailable(cmTarget const* target, const std::string& feature) const { + const char* defaultCStandard = + this->GetDefinition("CMAKE_C_STANDARD_DEFAULT"); + if (!defaultCStandard) + { + std::ostringstream e; + e << "CMAKE_C_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " + "not fully configured for this compiler."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + // Return true so the caller does not try to lookup the default standard. + return true; + } + if (!*defaultCStandard) + { + // This compiler has no notion of language standard levels. + // All features known for the language are always available. + return true; + } + if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), + cmStrCmp(defaultCStandard)) == cmArrayEnd(C_STANDARDS)) + { + std::ostringstream e; + e << "The CMAKE_C_STANDARD_DEFAULT variable contains an " + "invalid value: \"" << defaultCStandard << "\"."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + return false; + } + bool needC90 = false; bool needC99 = false; bool needC11 = false; @@ -5262,7 +5289,7 @@ HaveCStandardAvailable(cmTarget const* target, const char *existingCStandard = target->GetProperty("C_STANDARD"); if (!existingCStandard) { - existingCStandard = this->GetDefinition("CMAKE_C_STANDARD_DEFAULT"); + existingCStandard = defaultCStandard; } if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), @@ -5331,6 +5358,33 @@ bool cmMakefile::IsLaterStandard(std::string const& lang, bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const { + const char* defaultCxxStandard = + this->GetDefinition("CMAKE_CXX_STANDARD_DEFAULT"); + if (!defaultCxxStandard) + { + std::ostringstream e; + e << "CMAKE_CXX_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " + "not fully configured for this compiler."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + // Return true so the caller does not try to lookup the default standard. + return true; + } + if (!*defaultCxxStandard) + { + // This compiler has no notion of language standard levels. + // All features known for the language are always available. + return true; + } + if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), + cmStrCmp(defaultCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) + { + std::ostringstream e; + e << "The CMAKE_CXX_STANDARD_DEFAULT variable contains an " + "invalid value: \"" << defaultCxxStandard << "\"."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + return false; + } + bool needCxx98 = false; bool needCxx11 = false; bool needCxx14 = false; @@ -5339,7 +5393,7 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const char *existingCxxStandard = target->GetProperty("CXX_STANDARD"); if (!existingCxxStandard) { - existingCxxStandard = this->GetDefinition("CMAKE_CXX_STANDARD_DEFAULT"); + existingCxxStandard = defaultCxxStandard; } if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 5cd0836..a8b85d6 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -119,26 +119,30 @@ foreach(lang CXX C) endforeach() if (CMAKE_C_COMPILE_FEATURES) - string(FIND "${CMAKE_C_FLAGS}" "-std=" std_flag_idx) - if (std_flag_idx EQUAL -1) - add_executable(default_dialect_C default_dialect.c) - target_compile_definitions(default_dialect_C PRIVATE - DEFAULT_C11=$ - DEFAULT_C99=$ - DEFAULT_C90=$ - ) + if (CMAKE_C_STANDARD_DEFAULT) + string(FIND "${CMAKE_C_FLAGS}" "-std=" std_flag_idx) + if (std_flag_idx EQUAL -1) + add_executable(default_dialect_C default_dialect.c) + target_compile_definitions(default_dialect_C PRIVATE + DEFAULT_C11=$ + DEFAULT_C99=$ + DEFAULT_C90=$ + ) + endif() endif() endif() if (CMAKE_CXX_COMPILE_FEATURES) - string(FIND "${CMAKE_CXX_FLAGS}" "-std=" std_flag_idx) - if (std_flag_idx EQUAL -1) - add_executable(default_dialect default_dialect.cpp) - target_compile_definitions(default_dialect PRIVATE - DEFAULT_CXX14=$ - DEFAULT_CXX11=$ - DEFAULT_CXX98=$ - ) + if (CMAKE_CXX_STANDARD_DEFAULT) + string(FIND "${CMAKE_CXX_FLAGS}" "-std=" std_flag_idx) + if (std_flag_idx EQUAL -1) + add_executable(default_dialect default_dialect.cpp) + target_compile_definitions(default_dialect PRIVATE + DEFAULT_CXX14=$ + DEFAULT_CXX11=$ + DEFAULT_CXX98=$ + ) + endif() endif() add_executable(CompileFeatures main.cpp) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..efea371 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -17,6 +17,8 @@ file(READ "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx_features.txt" CXX_FEATURES ) +include("${RunCMake_BINARY_DIR}/generate_feature_list-build/c_standard_default.cmake") +include("${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx_standard_default.cmake") if (NOT C_FEATURES) run_cmake(NoSupportedCFeatures) @@ -27,7 +29,9 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) + if(CXX_STANDARD_DEFAULT) + run_cmake(LinkImplementationFeatureCycle) + endif() run_cmake(LinkImplementationFeatureCycleSolved) if (";${CXX_FEATURES};" MATCHES ";cxx_final;") @@ -38,17 +42,19 @@ else() unset(RunCMake_TEST_OPTIONS) endif() -foreach(standard 98 11) - file(READ - "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx${standard}_flag.txt" - CXX${standard}_FLAG - ) - if (CXX${standard}_FLAG STREQUAL NOTFOUND) - run_cmake(RequireCXX${standard}) - run_cmake(RequireCXX${standard}Variable) - endif() - if (CXX${standard}EXT_FLAG STREQUAL NOTFOUND) - run_cmake(RequireCXX${standard}Ext) - run_cmake(RequireCXX${standard}ExtVariable) - endif() -endforeach() +if(CXX_STANDARD_DEFAULT) + foreach(standard 98 11) + file(READ + "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx${standard}_flag.txt" + CXX${standard}_FLAG + ) + if (CXX${standard}_FLAG STREQUAL NOTFOUND) + run_cmake(RequireCXX${standard}) + run_cmake(RequireCXX${standard}Variable) + endif() + if (CXX${standard}EXT_FLAG STREQUAL NOTFOUND) + run_cmake(RequireCXX${standard}Ext) + run_cmake(RequireCXX${standard}ExtVariable) + endif() + endforeach() +endif() diff --git a/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake index 09e17b1..5c58052 100644 --- a/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake +++ b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake @@ -9,6 +9,20 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_features.txt" "${CMAKE_CXX_COMPILE_FEATURES}" ) +if(DEFINED CMAKE_C_STANDARD_DEFAULT) + set(c_standard_default_code "set(C_STANDARD_DEFAULT \"${CMAKE_C_STANDARD_DEFAULT}\")\n") +else() + set(c_standard_default_code "unset(C_STANDARD_DEFAULT)\n") +endif() +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/c_standard_default.cmake" "${c_standard_default_code}") + +if(DEFINED CMAKE_CXX_STANDARD_DEFAULT) + set(cxx_standard_default_code "set(CXX_STANDARD_DEFAULT \"${CMAKE_CXX_STANDARD_DEFAULT}\")\n") +else() + set(cxx_standard_default_code "unset(CXX_STANDARD_DEFAULT)\n") +endif() +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_standard_default.cmake" "${cxx_standard_default_code}") + foreach(standard 98 11) set(CXX${standard}_FLAG NOTFOUND) if (DEFINED CMAKE_CXX${standard}_STANDARD_COMPILE_OPTION) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Tue Jan 27 12:58:04 2015 From: brad.king at kitware.com (Brad King) Date: Tue, 27 Jan 2015 12:58:04 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2402-g8dced12 Message-ID: <20150127175804.72976AA22A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8dced126375dba8ba8a4d8718331c77898e0da68 (commit) via 6b9bd82789d918843753e30fd798af89b85c6453 (commit) from a64545de6ce4da2f2dc50deecc632ccf8e2d4ef8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8dced126375dba8ba8a4d8718331c77898e0da68 commit 8dced126375dba8ba8a4d8718331c77898e0da68 Merge: a64545d 6b9bd82 Author: Brad King AuthorDate: Tue Jan 27 12:58:03 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 12:58:03 2015 -0500 Merge topic 'vs-shader-flags' into next 6b9bd827 VS: Add source file property to set extra hlsl shader flags http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b9bd82789d918843753e30fd798af89b85c6453 commit 6b9bd82789d918843753e30fd798af89b85c6453 Author: Robert Goulet AuthorDate: Mon Jan 26 14:16:42 2015 -0500 Commit: Brad King CommitDate: Tue Jan 27 12:55:43 2015 -0500 VS: Add source file property to set extra hlsl shader flags Create a VS_SHADER_FLAGS source file property so that we can set all other Visual Studio .hlsl shader file compilation flags. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 68954c5..25f989f 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -294,6 +294,7 @@ Properties on Source Files /prop_sf/VS_DEPLOYMENT_CONTENT /prop_sf/VS_DEPLOYMENT_LOCATION /prop_sf/VS_SHADER_ENTRYPOINT + /prop_sf/VS_SHADER_FLAGS /prop_sf/VS_SHADER_MODEL /prop_sf/VS_SHADER_TYPE /prop_sf/WRAP_EXCLUDE diff --git a/Help/prop_sf/VS_SHADER_FLAGS.rst b/Help/prop_sf/VS_SHADER_FLAGS.rst new file mode 100644 index 0000000..0901123 --- /dev/null +++ b/Help/prop_sf/VS_SHADER_FLAGS.rst @@ -0,0 +1,4 @@ +VS_SHADER_FLAGS +--------------- + +Set additional VS shader flags of a ``.hlsl`` source file. diff --git a/Help/release/dev/vs-shader-flags.rst b/Help/release/dev/vs-shader-flags.rst new file mode 100644 index 0000000..0d3f6cc --- /dev/null +++ b/Help/release/dev/vs-shader-flags.rst @@ -0,0 +1,5 @@ +vs-shader-flags +--------------- + +* A :prop_sf:`VS_SHADER_FLAGS` source file property was added to specify + additional shader flags to ``.hlsl`` files, for the Visual Studio generators. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b265c0e..d2f6ffd 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1211,6 +1211,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) std::string shaderType; std::string shaderEntryPoint; std::string shaderModel; + std::string shaderAdditionalFlags; std::string ext = cmSystemTools::LowerCase(sf->GetExtension()); if(ext == "hlsl") { @@ -1233,6 +1234,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) shaderModel = sm; toolHasSettings = true; } + // Figure out if there's any additional flags to use + if (const char* saf = sf->GetProperty("VS_SHADER_FLAGS")) + { + shaderAdditionalFlags = saf; + toolHasSettings = true; + } } else if(ext == "jpg" || ext == "png") @@ -1342,6 +1349,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) (*this->BuildFileStream) << cmVS10EscapeXML(shaderModel) << "\n"; } + if(!shaderAdditionalFlags.empty()) + { + this->WriteString("", 3); + (*this->BuildFileStream) << cmVS10EscapeXML(shaderAdditionalFlags) + << "\n"; + } this->WriteString("BuildFileStream) << tool << ">\n"; } diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt index 7227fcc..719a594 100644 --- a/Tests/VSWinStorePhone/CMakeLists.txt +++ b/Tests/VSWinStorePhone/CMakeLists.txt @@ -110,10 +110,12 @@ set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_TYPE Pixel) set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainPS) set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3) +set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/Fh $(OutDir)%(Filename).h") set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_TYPE Vertex) set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainVS) set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3) +set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/Fh $(OutDir)%(Filename).h") source_group("Source Files" FILES ${SOURCE_FILES}) ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 1 + Help/prop_sf/VS_SHADER_FLAGS.rst | 4 ++++ Help/release/dev/vs-shader-flags.rst | 5 +++++ Source/cmVisualStudio10TargetGenerator.cxx | 13 +++++++++++++ Tests/VSWinStorePhone/CMakeLists.txt | 2 ++ 5 files changed, 25 insertions(+) create mode 100644 Help/prop_sf/VS_SHADER_FLAGS.rst create mode 100644 Help/release/dev/vs-shader-flags.rst hooks/post-receive -- CMake From robert.maynard at kitware.com Tue Jan 27 15:04:33 2015 From: robert.maynard at kitware.com (Robert Maynard) Date: Tue, 27 Jan 2015 15:04:33 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2404-g081c724 Message-ID: <20150127200433.068E6AA411@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 081c724ccb82ed1bae3f629f4b6f0b3afc79fdfc (commit) via 13530ca17efc81a393effa80efc527eeca28cbe4 (commit) from 8dced126375dba8ba8a4d8718331c77898e0da68 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=081c724ccb82ed1bae3f629f4b6f0b3afc79fdfc commit 081c724ccb82ed1bae3f629f4b6f0b3afc79fdfc Merge: 8dced12 13530ca Author: Robert Maynard AuthorDate: Tue Jan 27 15:04:32 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 15:04:32 2015 -0500 Merge topic 'feature-record-msvc' into next 13530ca1 Help: Add notes for topic 'feature-record-msvc' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13530ca17efc81a393effa80efc527eeca28cbe4 commit 13530ca17efc81a393effa80efc527eeca28cbe4 Author: Robert Maynard AuthorDate: Tue Jan 27 15:03:10 2015 -0500 Commit: Robert Maynard CommitDate: Tue Jan 27 15:03:10 2015 -0500 Help: Add notes for topic 'feature-record-msvc' diff --git a/Help/release/dev/feature-record-msvc.rst b/Help/release/dev/feature-record-msvc.rst new file mode 100644 index 0000000..226a338 --- /dev/null +++ b/Help/release/dev/feature-record-msvc.rst @@ -0,0 +1,5 @@ +feature-record-msvc +------------------------------ + +* The :manual:`Compile Features ` functionality + is now aware of features supported by Microsoft Visual Studio (``MSVC``). ----------------------------------------------------------------------- Summary of changes: ...{SolarisStudio-compile-features.rst => feature-record-msvc.rst} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) copy Help/release/dev/{SolarisStudio-compile-features.rst => feature-record-msvc.rst} (50%) hooks/post-receive -- CMake From eike at sf-mail.de Tue Jan 27 16:55:08 2015 From: eike at sf-mail.de (Rolf Eike Beer) Date: Tue, 27 Jan 2015 16:55:08 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2406-g27da8cf Message-ID: <20150127215508.AD6C2A9160@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 27da8cf2d3ddf34acd9eeccf630d83ccbf89cd38 (commit) via c5d9a8283cfac15b4a5a07f18d5eb10c1f388505 (commit) from 081c724ccb82ed1bae3f629f4b6f0b3afc79fdfc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27da8cf2d3ddf34acd9eeccf630d83ccbf89cd38 commit 27da8cf2d3ddf34acd9eeccf630d83ccbf89cd38 Merge: 081c724 c5d9a82 Author: Rolf Eike Beer AuthorDate: Tue Jan 27 16:55:07 2015 -0500 Commit: CMake Topic Stage CommitDate: Tue Jan 27 16:55:07 2015 -0500 Merge topic 'OpenSSL_102' into next c5d9a828 FindOpenSSL: fix detection of OpenSSL 1.0.2 diff --cc Modules/FindOpenSSL.cmake index bfbe01f,6b4f985..3adc269 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@@ -283,9 -275,11 +283,9 @@@ function(from_hex HEX DEC endfunction() if (OPENSSL_INCLUDE_DIR) - if (_OPENSSL_VERSION) - set(OPENSSL_VERSION "${_OPENSSL_VERSION}") - elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") + if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str - REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") + REGEX "^# *define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") # The version number is encoded as 0xMNNFFPPS: major minor fix patch status # The status gives if this is a developer or prerelease and is ignored here. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c5d9a8283cfac15b4a5a07f18d5eb10c1f388505 commit c5d9a8283cfac15b4a5a07f18d5eb10c1f388505 Author: Guillaume Belz AuthorDate: Tue Jan 27 22:53:54 2015 +0100 Commit: Rolf Eike Beer CommitDate: Tue Jan 27 22:53:54 2015 +0100 FindOpenSSL: fix detection of OpenSSL 1.0.2 diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 340b417..6b4f985 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -279,7 +279,7 @@ if (OPENSSL_INCLUDE_DIR) set(OPENSSL_VERSION "${_OPENSSL_VERSION}") elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str - REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") + REGEX "^# *define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") # The version number is encoded as 0xMNNFFPPS: major minor fix patch status # The status gives if this is a developer or prerelease and is ignored here. ----------------------------------------------------------------------- Summary of changes: Modules/FindOpenSSL.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From kwrobot at kitware.com Wed Jan 28 00:01:12 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Wed, 28 Jan 2015 00:01:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-938-g0d59fa3 Message-ID: <20150128050112.47E50AA10F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 0d59fa3ca4943e1ca5da36573b055a381642332a (commit) from a47b904db242abb903a968bd6109bc8a07d3c39a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d59fa3ca4943e1ca5da36573b055a381642332a commit 0d59fa3ca4943e1ca5da36573b055a381642332a Author: Kitware Robot AuthorDate: Wed Jan 28 00:01:09 2015 -0500 Commit: Kitware Robot CommitDate: Wed Jan 28 00:01:09 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index edd2e5a..5db595c 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 20150127) +set(CMake_VERSION_PATCH 20150128) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 28 09:06:17 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 28 Jan 2015 09:06:17 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2408-g0fa3dd3 Message-ID: <20150128140617.86B02AAA9A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0fa3dd31464cbccc9bc401eabdfb75d94b5579bd (commit) via 94193f7375b8e3490a71cc8baf0ca42e3e070afe (commit) from 27da8cf2d3ddf34acd9eeccf630d83ccbf89cd38 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fa3dd31464cbccc9bc401eabdfb75d94b5579bd commit 0fa3dd31464cbccc9bc401eabdfb75d94b5579bd Merge: 27da8cf 94193f7 Author: Brad King AuthorDate: Wed Jan 28 09:06:16 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 28 09:06:16 2015 -0500 Merge topic 'fix-OBJECT_DEPENDS-after-path-normalization' into next 94193f73 fixup! Normalize OBJECT_DEPENDS paths to match custom commands (#15366) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=94193f7375b8e3490a71cc8baf0ca42e3e070afe commit 94193f7375b8e3490a71cc8baf0ca42e3e070afe Author: Brad King AuthorDate: Wed Jan 28 08:58:54 2015 -0500 Commit: Brad King CommitDate: Wed Jan 28 08:59:29 2015 -0500 fixup! Normalize OBJECT_DEPENDS paths to match custom commands (#15366) diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index b8cc5fb..33000d6 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -600,6 +600,14 @@ cmNinjaTargetGenerator if(const char* objectDeps = source->GetProperty("OBJECT_DEPENDS")) { std::vector depList; cmSystemTools::ExpandListArgument(objectDeps, depList); + for(std::vector::iterator odi = depList.begin(); + odi != depList.end(); ++odi) + { + if (cmSystemTools::FileIsFullPath(*odi)) + { + *odi = cmSystemTools::CollapseFullPath(*odi); + } + } std::transform(depList.begin(), depList.end(), std::back_inserter(implicitDeps), MapToNinjaPath()); } ----------------------------------------------------------------------- Summary of changes: Source/cmNinjaTargetGenerator.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 28 09:07:27 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 28 Jan 2015 09:07:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2410-g37a1606 Message-ID: <20150128140727.7B46CAAABE@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 37a16068b3fae9304bcc471b6361297ee4c1c534 (commit) via 9259d7788193ad23aa429652af983afc3bc4a953 (commit) from 0fa3dd31464cbccc9bc401eabdfb75d94b5579bd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37a16068b3fae9304bcc471b6361297ee4c1c534 commit 37a16068b3fae9304bcc471b6361297ee4c1c534 Merge: 0fa3dd3 9259d77 Author: Brad King AuthorDate: Wed Jan 28 09:07:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 28 09:07:26 2015 -0500 Merge topic 'fix-OBJECT_DEPENDS-after-path-normalization' into next 9259d778 Normalize OBJECT_DEPENDS paths to match custom commands (#15366) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9259d7788193ad23aa429652af983afc3bc4a953 commit 9259d7788193ad23aa429652af983afc3bc4a953 Author: Brad King AuthorDate: Tue Jan 27 10:57:17 2015 -0500 Commit: Brad King CommitDate: Wed Jan 28 09:06:21 2015 -0500 Normalize OBJECT_DEPENDS paths to match custom commands (#15366) Custom command path normalization added in commit v3.1.0-rc1~471^2 (add_custom_command: Normalize OUTPUT and DEPENDS paths, 2014-05-28) broke use of OBJECT_DEPENDS to bring in custom commands because the latter paths were not normalized too. Normalize them and add a test case. Reported-by: Daniel v. Gerpen diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 14b5a92..0c60237 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -676,6 +676,14 @@ void cmTargetTraceDependencies::Trace() { std::vector objDeps; cmSystemTools::ExpandListArgument(additionalDeps, objDeps); + for(std::vector::iterator odi = objDeps.begin(); + odi != objDeps.end(); ++odi) + { + if (cmSystemTools::FileIsFullPath(*odi)) + { + *odi = cmSystemTools::CollapseFullPath(*odi); + } + } this->FollowNames(objDeps); } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index b8cc5fb..33000d6 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -600,6 +600,14 @@ cmNinjaTargetGenerator if(const char* objectDeps = source->GetProperty("OBJECT_DEPENDS")) { std::vector depList; cmSystemTools::ExpandListArgument(objectDeps, depList); + for(std::vector::iterator odi = depList.begin(); + odi != depList.end(); ++odi) + { + if (cmSystemTools::FileIsFullPath(*odi)) + { + *odi = cmSystemTools::CollapseFullPath(*odi); + } + } std::transform(depList.begin(), depList.end(), std::back_inserter(implicitDeps), MapToNinjaPath()); } diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index b97cd16..7ef3540 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -153,6 +153,19 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.c ${PROJECT_BINARY_DIR}/foo.c ) +# Test using OBJECT_DEPENDS to bring in a custom command. +# Use a path that can be simplified to make sure paths +# are consistently normalized. +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/subdir/../subdir/subdir.h + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/subdir.h.in + ${CMAKE_CURRENT_BINARY_DIR}/subdir/subdir.h + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/subdir.h.in + ) +set_property(SOURCE ${PROJECT_BINARY_DIR}/foo.c PROPERTY + OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/subdir/../subdir/subdir.h) + # Add custom command to generate not_included.h, which is a header # file that is not included by any source in this project. This will # test whether all custom command outputs explicitly listed as sources diff --git a/Tests/CustomCommand/foo.in b/Tests/CustomCommand/foo.in index 0c5021c..5ca6315 100644 --- a/Tests/CustomCommand/foo.in +++ b/Tests/CustomCommand/foo.in @@ -7,6 +7,11 @@ int generated(); int wrapped(); +#include "subdir/subdir.h" +#ifndef SUBDIR_DEF +# error SUBDIR_DEF not defined +#endif + int main () { if (generated()*wrapped()*doc() == 3*5*7) diff --git a/Tests/CustomCommand/subdir.h.in b/Tests/CustomCommand/subdir.h.in new file mode 100644 index 0000000..1e50750 --- /dev/null +++ b/Tests/CustomCommand/subdir.h.in @@ -0,0 +1 @@ +#define SUBDIR_DEF ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 28 09:29:46 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 28 Jan 2015 09:29:46 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2412-g9bae20c Message-ID: <20150128142946.5EB8BAA90F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9bae20cd9565fa3f5b2197d20316d79239f14848 (commit) via a30dc4776c1c853e26cbb4a819b2471f7b1242e0 (commit) from 37a16068b3fae9304bcc471b6361297ee4c1c534 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9bae20cd9565fa3f5b2197d20316d79239f14848 commit 9bae20cd9565fa3f5b2197d20316d79239f14848 Merge: 37a1606 a30dc47 Author: Brad King AuthorDate: Wed Jan 28 09:29:45 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 28 09:29:45 2015 -0500 Merge topic 'vs-shader-flags' into next a30dc477 fixup! VS: Add source file property to set extra hlsl shader flags http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a30dc4776c1c853e26cbb4a819b2471f7b1242e0 commit a30dc4776c1c853e26cbb4a819b2471f7b1242e0 Author: Brad King AuthorDate: Wed Jan 28 06:28:44 2015 -0800 Commit: Brad King CommitDate: Wed Jan 28 09:29:25 2015 -0500 fixup! VS: Add source file property to set extra hlsl shader flags diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt index 719a594..8357d5f 100644 --- a/Tests/VSWinStorePhone/CMakeLists.txt +++ b/Tests/VSWinStorePhone/CMakeLists.txt @@ -110,12 +110,12 @@ set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_TYPE Pixel) set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainPS) set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3) -set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/Fh $(OutDir)%(Filename).h") +set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/DFLAGS_ADDED /Fh \"$(OutDir)%(Filename).h\"") set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_TYPE Vertex) set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainVS) set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3) -set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/Fh $(OutDir)%(Filename).h") +set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/DFLAGS_ADDED /Fh \"$(OutDir)%(Filename).h\"") source_group("Source Files" FILES ${SOURCE_FILES}) diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl index 6796da1..b2fe7be 100644 --- a/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl +++ b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl @@ -1,3 +1,7 @@ +#if !defined(FLAGS_ADDED) +# error FLAGS_ADDED not defined +#endif + struct PixelShaderInput { float4 pos : SV_POSITION; diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl index 0963060..3f9a4eb 100644 --- a/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl +++ b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl @@ -1,3 +1,7 @@ +#if !defined(FLAGS_ADDED) +# error FLAGS_ADDED not defined +#endif + cbuffer ModelViewProjectionConstantBuffer : register(b0) { matrix model; ----------------------------------------------------------------------- Summary of changes: Tests/VSWinStorePhone/CMakeLists.txt | 4 ++-- Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl | 4 ++++ Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 28 09:30:13 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 28 Jan 2015 09:30:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2414-g15bc849 Message-ID: <20150128143013.702B7AA92B@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 15bc8492469ca587ad24840f73eeb094a779bd9c (commit) via 4775c90145da7ec8a5a87ce5b8b88dc4fc8c1925 (commit) from 9bae20cd9565fa3f5b2197d20316d79239f14848 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15bc8492469ca587ad24840f73eeb094a779bd9c commit 15bc8492469ca587ad24840f73eeb094a779bd9c Merge: 9bae20c 4775c90 Author: Brad King AuthorDate: Wed Jan 28 09:30:12 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 28 09:30:12 2015 -0500 Merge topic 'vs-shader-flags' into next 4775c901 VS: Add source file property to set extra hlsl shader flags http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4775c90145da7ec8a5a87ce5b8b88dc4fc8c1925 commit 4775c90145da7ec8a5a87ce5b8b88dc4fc8c1925 Author: Robert Goulet AuthorDate: Mon Jan 26 14:16:42 2015 -0500 Commit: Brad King CommitDate: Wed Jan 28 09:29:50 2015 -0500 VS: Add source file property to set extra hlsl shader flags Create a VS_SHADER_FLAGS source file property so that we can set all other Visual Studio .hlsl shader file compilation flags. diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 68954c5..25f989f 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -294,6 +294,7 @@ Properties on Source Files /prop_sf/VS_DEPLOYMENT_CONTENT /prop_sf/VS_DEPLOYMENT_LOCATION /prop_sf/VS_SHADER_ENTRYPOINT + /prop_sf/VS_SHADER_FLAGS /prop_sf/VS_SHADER_MODEL /prop_sf/VS_SHADER_TYPE /prop_sf/WRAP_EXCLUDE diff --git a/Help/prop_sf/VS_SHADER_FLAGS.rst b/Help/prop_sf/VS_SHADER_FLAGS.rst new file mode 100644 index 0000000..0901123 --- /dev/null +++ b/Help/prop_sf/VS_SHADER_FLAGS.rst @@ -0,0 +1,4 @@ +VS_SHADER_FLAGS +--------------- + +Set additional VS shader flags of a ``.hlsl`` source file. diff --git a/Help/release/dev/vs-shader-flags.rst b/Help/release/dev/vs-shader-flags.rst new file mode 100644 index 0000000..0d3f6cc --- /dev/null +++ b/Help/release/dev/vs-shader-flags.rst @@ -0,0 +1,5 @@ +vs-shader-flags +--------------- + +* A :prop_sf:`VS_SHADER_FLAGS` source file property was added to specify + additional shader flags to ``.hlsl`` files, for the Visual Studio generators. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b265c0e..d2f6ffd 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1211,6 +1211,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) std::string shaderType; std::string shaderEntryPoint; std::string shaderModel; + std::string shaderAdditionalFlags; std::string ext = cmSystemTools::LowerCase(sf->GetExtension()); if(ext == "hlsl") { @@ -1233,6 +1234,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) shaderModel = sm; toolHasSettings = true; } + // Figure out if there's any additional flags to use + if (const char* saf = sf->GetProperty("VS_SHADER_FLAGS")) + { + shaderAdditionalFlags = saf; + toolHasSettings = true; + } } else if(ext == "jpg" || ext == "png") @@ -1342,6 +1349,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf) (*this->BuildFileStream) << cmVS10EscapeXML(shaderModel) << "\n"; } + if(!shaderAdditionalFlags.empty()) + { + this->WriteString("", 3); + (*this->BuildFileStream) << cmVS10EscapeXML(shaderAdditionalFlags) + << "\n"; + } this->WriteString("BuildFileStream) << tool << ">\n"; } diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt index 7227fcc..8357d5f 100644 --- a/Tests/VSWinStorePhone/CMakeLists.txt +++ b/Tests/VSWinStorePhone/CMakeLists.txt @@ -110,10 +110,12 @@ set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_TYPE Pixel) set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainPS) set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3) +set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/DFLAGS_ADDED /Fh \"$(OutDir)%(Filename).h\"") set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_TYPE Vertex) set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainVS) set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3) +set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/DFLAGS_ADDED /Fh \"$(OutDir)%(Filename).h\"") source_group("Source Files" FILES ${SOURCE_FILES}) diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl index 6796da1..b2fe7be 100644 --- a/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl +++ b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl @@ -1,3 +1,7 @@ +#if !defined(FLAGS_ADDED) +# error FLAGS_ADDED not defined +#endif + struct PixelShaderInput { float4 pos : SV_POSITION; diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl index 0963060..3f9a4eb 100644 --- a/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl +++ b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl @@ -1,3 +1,7 @@ +#if !defined(FLAGS_ADDED) +# error FLAGS_ADDED not defined +#endif + cbuffer ModelViewProjectionConstantBuffer : register(b0) { matrix model; ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 28 09:33:39 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 28 Jan 2015 09:33:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-942-g6a0a407 Message-ID: <20150128143339.A6B29AA96A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 6a0a4079efb032ec993b73358037b9bdd33dcfa5 (commit) via 70c50962fb405cfb89637f24aa38c3e0fd5cbd87 (commit) via 539c5c252ef679d15f3af828da304ad9313640e2 (commit) via 494f6e8d5b9f2e556a2b2db2c165a56c01fd1827 (commit) from 0d59fa3ca4943e1ca5da36573b055a381642332a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6a0a4079efb032ec993b73358037b9bdd33dcfa5 commit 6a0a4079efb032ec993b73358037b9bdd33dcfa5 Merge: 0d59fa3 70c5096 Author: Brad King AuthorDate: Wed Jan 28 09:33:38 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 28 09:33:38 2015 -0500 Merge topic 'shorten-test-paths' 70c50962 Tests: Shorten paths in ExternalProjectLocal 539c5c25 Tests: Shorten paths in RunCMake.CompileFeatures 494f6e8d Tests: Shorten paths in CompileDefinitions ----------------------------------------------------------------------- Summary of changes: Tests/CompileDefinitions/CMakeLists.txt | 6 ++---- .../CMakeLists.txt | 5 +---- .../add_def_cmd_tprop/CMakeLists.txt | 16 ++++++++++++++++ .../CMakeLists.txt | 19 ------------------- Tests/ExternalProjectLocal/CMakeLists.txt | 2 +- ...xt => NotAFeature_OriginDebugCommand-result.txt} | 0 ...xt => NotAFeature_OriginDebugCommand-stderr.txt} | 2 +- ...s.cmake => NotAFeature_OriginDebugCommand.cmake} | 0 Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake | 2 +- 9 files changed, 22 insertions(+), 30 deletions(-) rename Tests/CompileDefinitions/{add_definitions_command => add_def_cmd}/CMakeLists.txt (80%) create mode 100644 Tests/CompileDefinitions/add_def_cmd_tprop/CMakeLists.txt delete mode 100644 Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt rename Tests/RunCMake/CompileFeatures/{NotAFeature_OriginDebug_target_compile_features-result.txt => NotAFeature_OriginDebugCommand-result.txt} (100%) rename Tests/RunCMake/CompileFeatures/{NotAFeature_OriginDebug_target_compile_features-stderr.txt => NotAFeature_OriginDebugCommand-stderr.txt} (61%) rename Tests/RunCMake/CompileFeatures/{NotAFeature_OriginDebug_target_compile_features.cmake => NotAFeature_OriginDebugCommand.cmake} (100%) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 28 09:33:41 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 28 Jan 2015 09:33:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-944-gb7d7b30 Message-ID: <20150128143341.966DAAA97D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via b7d7b306541a8ff1a7e8384f5c44baabec3ec94d (commit) via 43eca4026def688e27c981154a36948273c6497c (commit) from 6a0a4079efb032ec993b73358037b9bdd33dcfa5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b7d7b306541a8ff1a7e8384f5c44baabec3ec94d commit b7d7b306541a8ff1a7e8384f5c44baabec3ec94d Merge: 6a0a407 43eca40 Author: Brad King AuthorDate: Wed Jan 28 09:33:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 28 09:33:40 2015 -0500 Merge topic 'drop-win9x-reference' 43eca402 drop reference to removed Windows 9x support ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 28 09:33:43 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 28 Jan 2015 09:33:43 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-946-gde4ccee Message-ID: <20150128143343.E3B5BAA96F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via de4ccee75a89519f95fcbcca75abc46577bfefea (commit) via c5d9a8283cfac15b4a5a07f18d5eb10c1f388505 (commit) from b7d7b306541a8ff1a7e8384f5c44baabec3ec94d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de4ccee75a89519f95fcbcca75abc46577bfefea commit de4ccee75a89519f95fcbcca75abc46577bfefea Merge: b7d7b30 c5d9a82 Author: Brad King AuthorDate: Wed Jan 28 09:33:42 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 28 09:33:42 2015 -0500 Merge topic 'OpenSSL_102' c5d9a828 FindOpenSSL: fix detection of OpenSSL 1.0.2 diff --cc Modules/FindOpenSSL.cmake index bfbe01f,6b4f985..3adc269 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@@ -283,9 -275,11 +283,9 @@@ function(from_hex HEX DEC endfunction() if (OPENSSL_INCLUDE_DIR) - if (_OPENSSL_VERSION) - set(OPENSSL_VERSION "${_OPENSSL_VERSION}") - elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") + if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str - REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") + REGEX "^# *define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") # The version number is encoded as 0xMNNFFPPS: major minor fix patch status # The status gives if this is a developer or prerelease and is ignored here. ----------------------------------------------------------------------- Summary of changes: Modules/FindOpenSSL.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 28 09:34:04 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 28 Jan 2015 09:34:04 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2419-g7f8ae89 Message-ID: <20150128143404.E98A8AA98F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 7f8ae89fd03bf2d31a52a1e9665791e5934b0657 (commit) via de4ccee75a89519f95fcbcca75abc46577bfefea (commit) via b7d7b306541a8ff1a7e8384f5c44baabec3ec94d (commit) via 6a0a4079efb032ec993b73358037b9bdd33dcfa5 (commit) via 0d59fa3ca4943e1ca5da36573b055a381642332a (commit) from 15bc8492469ca587ad24840f73eeb094a779bd9c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f8ae89fd03bf2d31a52a1e9665791e5934b0657 commit 7f8ae89fd03bf2d31a52a1e9665791e5934b0657 Merge: 15bc849 de4ccee Author: Brad King AuthorDate: Wed Jan 28 09:33:53 2015 -0500 Commit: Brad King CommitDate: Wed Jan 28 09:33:53 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 28 10:41:10 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 28 Jan 2015 10:41:10 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2421-g5257503 Message-ID: <20150128154110.338991A6A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5257503e78c4d779e41f93643677ae89b1d16022 (commit) via d52b5f8835a1768dc3b16e8b8cc465b5f80098ad (commit) from 7f8ae89fd03bf2d31a52a1e9665791e5934b0657 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5257503e78c4d779e41f93643677ae89b1d16022 commit 5257503e78c4d779e41f93643677ae89b1d16022 Merge: 7f8ae89 d52b5f8 Author: Brad King AuthorDate: Wed Jan 28 10:41:09 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 28 10:41:09 2015 -0500 Merge topic 'ctest-update-gmake-error-match' into next d52b5f88 ctest_build: Update GNU make error message matching (#15379) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d52b5f8835a1768dc3b16e8b8cc465b5f80098ad commit d52b5f8835a1768dc3b16e8b8cc465b5f80098ad Author: Marco Nolden AuthorDate: Wed Jan 28 16:25:53 2015 +0100 Commit: Brad King CommitDate: Wed Jan 28 10:32:06 2015 -0500 ctest_build: Update GNU make error message matching (#15379) The "No rule to make target" error message of gmake is not correctly recognized since GNU make changed the quoting style in commit 23c2b99e9d (Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines, 2012-03-04). Fix our regex to match both old and new quoting styles. diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 2ec1365..13404a8 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -70,13 +70,13 @@ static const char* cmCTestErrorMatches[] = { "^CMake Error.*:", ":[ \\t]cannot find", ":[ \\t]can't find", - ": \\*\\*\\* No rule to make target \\`.*\\'. Stop", + ": \\*\\*\\* No rule to make target \\[`'].*\\'. Stop", ": \\*\\*\\* No targets specified and no makefile found", ": Invalid loader fixup for symbol", ": Invalid fixups exist", ": Can't find library for", ": internal link edit command failed", - ": Unrecognized option \\`.*\\'", + ": Unrecognized option \\[`'].*\\'", "\", line [0-9]+\\.[0-9]+: [0-9]+-[0-9]+ \\([^WI]\\)", "ld: 0706-006 Cannot find or open library file: -l ", "ild: \\(argument error\\) can't find library argument ::", ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestBuildHandler.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 28 14:16:02 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 28 Jan 2015 14:16:02 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2425-g5348b1f Message-ID: <20150128191602.C8F3E4990@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 5348b1f86b070d6c4f4402aa09d2bc9c606908ba (commit) via 6eca2590558ae1ad4de989718a496a2f68ab68d4 (commit) via 11e2e6cadf7f0ee36b7ccecaa11457949382b75f (commit) via e4055a6144c63c83fe2f39440ecfb9a0bcbfae0d (commit) from 5257503e78c4d779e41f93643677ae89b1d16022 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5348b1f86b070d6c4f4402aa09d2bc9c606908ba commit 5348b1f86b070d6c4f4402aa09d2bc9c606908ba Merge: 5257503 6eca259 Author: Brad King AuthorDate: Wed Jan 28 14:16:01 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 28 14:16:01 2015 -0500 Merge topic 'xcode-revise-make-program' into next 6eca2590 Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator (#15324) 11e2e6ca Xcode: Select make program at build time e4055a61 Xcode: Add internal API to find xcodebuild http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6eca2590558ae1ad4de989718a496a2f68ab68d4 commit 6eca2590558ae1ad4de989718a496a2f68ab68d4 Author: Brad King AuthorDate: Wed Jan 28 14:00:02 2015 -0500 Commit: Brad King CommitDate: Wed Jan 28 14:02:07 2015 -0500 Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator (#15324) The "cmakexbuild" wrapper is not needed for Xcode 4 and above, and the path to it may change when CMake moves. Avoid storing a specific path to a build program in CMakeCache.txt and instead compute the value for CMAKE_MAKE_PROGRAM on demand. However, if a user does set the value explicitly then honor it. This does for Xcode what commit v3.0.0-rc1~260^2~4 (VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators, 2013-11-15) did for Visual Studio generators. diff --git a/Help/release/dev/xcode-revise-make-program.rst b/Help/release/dev/xcode-revise-make-program.rst new file mode 100644 index 0000000..f50cf44 --- /dev/null +++ b/Help/release/dev/xcode-revise-make-program.rst @@ -0,0 +1,6 @@ +xcode-revise-make-program +------------------------- + +* The :generator:`Xcode` generator no longer requires a value for + the :variable:`CMAKE_MAKE_PROGRAM` variable to be located up front. + It now locates ``xcodebuild`` when needed at build time. diff --git a/Help/variable/CMAKE_MAKE_PROGRAM.rst b/Help/variable/CMAKE_MAKE_PROGRAM.rst index 97caa8a..f1d88a5 100644 --- a/Help/variable/CMAKE_MAKE_PROGRAM.rst +++ b/Help/variable/CMAKE_MAKE_PROGRAM.rst @@ -23,8 +23,15 @@ to configure the project: otherwise undocumented ``cmakexbuild`` wrapper implementing some workarounds). - This generator stores ``CMAKE_MAKE_PROGRAM`` in the CMake cache - so that it may be edited by the user. + This generator prefers to lookup the build tool at build time + rather than to store ``CMAKE_MAKE_PROGRAM`` in the CMake cache + ahead of time. This is because ``xcodebuild`` is easy to find, + the ``cmakexbuild`` wrapper is needed only for older Xcode versions, + and the path to ``cmakexbuild`` may be outdated if CMake itself moves. + + For compatibility with versions of CMake prior to 3.2, if + a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to + the CMake cache then CMake will use the specified value. * The Visual Studio generators set this to the full path to ``MSBuild.exe`` (VS >= 10), ``devenv.com`` (VS 7,8,9), diff --git a/Modules/CMakeFindXCode.cmake b/Modules/CMakeFindXCode.cmake deleted file mode 100644 index 5c4f596..0000000 --- a/Modules/CMakeFindXCode.cmake +++ /dev/null @@ -1,20 +0,0 @@ - -#============================================================================= -# Copyright 2005-2009 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_program(CMAKE_MAKE_PROGRAM - NAMES xcodebuild - PATHS - /usr/bin - ) -mark_as_advanced(CMAKE_MAKE_PROGRAM) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4c95a9f..6d0fedc 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -315,25 +315,6 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) "make program", cmCacheManager::FILEPATH); } - - if(makeProgram.find("xcodebuild") != makeProgram.npos) - { - // due to the text file busy /bin/sh problem with xcodebuild - // use the cmakexbuild wrapper instead. This program - // will run xcodebuild and if it sees the error text file busy - // it will stop forwarding output, and let the build finish. - // Then it will retry the build. It will continue this - // until no text file busy errors occur. - std::string cmakexbuild = - this->CMakeInstance->GetCacheManager()->GetCacheValue("CMAKE_COMMAND"); - cmakexbuild = cmakexbuild.substr(0, cmakexbuild.length()-5); - cmakexbuild += "cmakexbuild"; - - mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", - cmakexbuild.c_str(), - "make program", - cmCacheManager::FILEPATH); - } } // enable the given language diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index ebad7da..cd0dcc6 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -136,7 +136,6 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version) sscanf(this->VersionString.c_str(), "%u.%u", &v[0], &v[1]); this->XcodeVersion = 10*v[0] + v[1]; - this->FindMakeProgramFile = "CMakeFindXCode.cmake"; this->RootObject = 0; this->MainGroupChildren = 0; this->SourcesGroupChildren = 0; @@ -203,6 +202,19 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory } //---------------------------------------------------------------------------- +void cmGlobalXCodeGenerator::FindMakeProgram(cmMakefile* mf) +{ + // The Xcode generator knows how to lookup its build tool + // directly instead of needing a helper module to do it, so we + // do not actually need to put CMAKE_MAKE_PROGRAM into the cache. + if(cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) + { + mf->AddDefinition("CMAKE_MAKE_PROGRAM", + this->GetXcodeBuildCommand().c_str()); + } +} + +//---------------------------------------------------------------------------- std::string const& cmGlobalXCodeGenerator::GetXcodeBuildCommand() { if(!this->XcodeBuildCommandInitialized) diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index e54bb37..f513e28 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -70,6 +70,8 @@ public: const std::string& suffix, std::string& dir); + virtual void FindMakeProgram(cmMakefile*); + ///! What is the configurations directory variable called? virtual const char* GetCMakeCFGIntDir() const; ///! expand CFGIntDir diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 3aecd9b..035f161 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -51,7 +51,7 @@ if(BUILD_TESTING) set(CMake_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}") endif() - if(CMAKE_GENERATOR MATCHES "Visual Studio") + if(CMAKE_GENERATOR MATCHES "Visual Studio|Xcode") set(CMake_TEST_EXPLICIT_MAKE_PROGRAM "") else() set(CMake_TEST_EXPLICIT_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}") http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=11e2e6cadf7f0ee36b7ccecaa11457949382b75f commit 11e2e6cadf7f0ee36b7ccecaa11457949382b75f Author: Brad King AuthorDate: Wed Jan 28 13:59:32 2015 -0500 Commit: Brad King CommitDate: Wed Jan 28 14:01:55 2015 -0500 Xcode: Select make program at build time Extend the change made in commit v3.0.0-rc1~260^2~16 (Teach GenerateBuildCommand to find its own make program, 2013-11-13) to have the Xcode generator pick between "xcodebuild" and CMake's own copy of "cmakexbuild" at build time based on the version of Xcode. diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 3b4dd17..ebad7da 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -303,7 +303,7 @@ cmGlobalXCodeGenerator::GenerateBuildCommand( { // now build the test makeCommand.push_back( - this->SelectMakeProgram(makeProgram, "xcodebuild") + this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand()) ); makeCommand.push_back("-project"); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e4055a6144c63c83fe2f39440ecfb9a0bcbfae0d commit e4055a6144c63c83fe2f39440ecfb9a0bcbfae0d Author: Brad King AuthorDate: Wed Jan 28 13:31:18 2015 -0500 Commit: Brad King CommitDate: Wed Jan 28 13:41:55 2015 -0500 Xcode: Add internal API to find xcodebuild Teach the Xcode generator to compute the location of this tool or the cmakexbuild wrapper. Add internal APIs to get the locations on demand. Use the "cmakexbuild" wrapper for Xcode < 4, and "xcodebuild" for modern Xcode. diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index b6c428b..3b4dd17 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -143,6 +143,7 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version) this->ResourcesGroupChildren = 0; this->CurrentMakefile = 0; this->CurrentLocalGenerator = 0; + this->XcodeBuildCommandInitialized = false; } //---------------------------------------------------------------------------- @@ -202,6 +203,36 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory } //---------------------------------------------------------------------------- +std::string const& cmGlobalXCodeGenerator::GetXcodeBuildCommand() +{ + if(!this->XcodeBuildCommandInitialized) + { + this->XcodeBuildCommandInitialized = true; + this->XcodeBuildCommand = this->FindXcodeBuildCommand(); + } + return this->XcodeBuildCommand; +} + +//---------------------------------------------------------------------------- +std::string cmGlobalXCodeGenerator::FindXcodeBuildCommand() +{ + if (this->XcodeVersion >= 40) + { + std::string makeProgram = cmSystemTools::FindProgram("xcodebuild"); + if (makeProgram.empty()) + { + makeProgram = "xcodebuild"; + } + return makeProgram; + } + else + { + // Use cmakexbuild wrapper to suppress environment dump from output. + return cmSystemTools::GetCMakeCommand() + "xbuild"; + } +} + +//---------------------------------------------------------------------------- bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts, cmMakefile* mf) { diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index a39c8c7..e54bb37 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -212,6 +212,11 @@ protected: std::vector XCodeObjects; cmXCodeObject* RootObject; private: + std::string const& GetXcodeBuildCommand(); + std::string FindXcodeBuildCommand(); + std::string XcodeBuildCommand; + bool XcodeBuildCommandInitialized; + void PrintCompilerAdvice(std::ostream&, std::string const&, const char*) const {} ----------------------------------------------------------------------- Summary of changes: Help/release/dev/xcode-revise-make-program.rst | 6 +++ Help/variable/CMAKE_MAKE_PROGRAM.rst | 11 +++++- Modules/CMakeFindXCode.cmake | 20 ---------- Source/cmGlobalGenerator.cxx | 19 ---------- Source/cmGlobalXCodeGenerator.cxx | 47 +++++++++++++++++++++++- Source/cmGlobalXCodeGenerator.h | 7 ++++ Tests/CMakeLists.txt | 2 +- 7 files changed, 68 insertions(+), 44 deletions(-) create mode 100644 Help/release/dev/xcode-revise-make-program.rst delete mode 100644 Modules/CMakeFindXCode.cmake hooks/post-receive -- CMake From brad.king at kitware.com Wed Jan 28 19:20:58 2015 From: brad.king at kitware.com (Brad King) Date: Wed, 28 Jan 2015 19:20:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2427-g8694595 Message-ID: <20150129002059.829264A12@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 86945954ccf2d3649180c3bd6ea9faedb3a02ddf (commit) via baf5bfb5725d77368e4b33ffabb9ea8958e8c89a (commit) from 5348b1f86b070d6c4f4402aa09d2bc9c606908ba (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86945954ccf2d3649180c3bd6ea9faedb3a02ddf commit 86945954ccf2d3649180c3bd6ea9faedb3a02ddf Merge: 5348b1f baf5bfb Author: Brad King AuthorDate: Wed Jan 28 19:20:49 2015 -0500 Commit: CMake Topic Stage CommitDate: Wed Jan 28 19:20:49 2015 -0500 Merge topic 'xcode-revise-make-program' into next baf5bfb5 fixup! Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=baf5bfb5725d77368e4b33ffabb9ea8958e8c89a commit baf5bfb5725d77368e4b33ffabb9ea8958e8c89a Author: Brad King AuthorDate: Wed Jan 28 19:19:32 2015 -0500 Commit: Brad King CommitDate: Wed Jan 28 19:19:32 2015 -0500 fixup! Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator diff --git a/Modules/CMakeFindXCode.cmake b/Modules/CMakeFindXCode.cmake new file mode 100644 index 0000000..b1a4c43 --- /dev/null +++ b/Modules/CMakeFindXCode.cmake @@ -0,0 +1,3 @@ + +# Empty placeholder for input dependencies in existing +# build trees produced by older versions of CMake. ----------------------------------------------------------------------- Summary of changes: Modules/CMakeFindXCode.cmake | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Modules/CMakeFindXCode.cmake hooks/post-receive -- CMake From kwrobot at kitware.com Thu Jan 29 00:01:11 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Thu, 29 Jan 2015 00:01:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-947-g5968ad5 Message-ID: <20150129050111.309FFAA5DC@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 5968ad58fd85e9703c36cd9154137f24c55e5413 (commit) from de4ccee75a89519f95fcbcca75abc46577bfefea (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5968ad58fd85e9703c36cd9154137f24c55e5413 commit 5968ad58fd85e9703c36cd9154137f24c55e5413 Author: Kitware Robot AuthorDate: Thu Jan 29 00:01:09 2015 -0500 Commit: Kitware Robot CommitDate: Thu Jan 29 00:01:09 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 5db595c..ef49c4b 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 20150128) +set(CMake_VERSION_PATCH 20150129) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 08:46:58 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 08:46:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2429-g9d274b4 Message-ID: <20150129134659.0F04D5125@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9d274b4f3ffba3ad339522375180d2bf568d016c (commit) via 3526daf5a2667d4bf8aee442d6e73f8b71ea6efc (commit) from 86945954ccf2d3649180c3bd6ea9faedb3a02ddf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d274b4f3ffba3ad339522375180d2bf568d016c commit 9d274b4f3ffba3ad339522375180d2bf568d016c Merge: 8694595 3526daf Author: Brad King AuthorDate: Thu Jan 29 08:46:57 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 08:46:57 2015 -0500 Merge topic 'build-require-libarchive-3' into next 3526daf5 Require libarchive 3.0.0 or later http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3526daf5a2667d4bf8aee442d6e73f8b71ea6efc commit 3526daf5a2667d4bf8aee442d6e73f8b71ea6efc Author: Gregor Jasny AuthorDate: Wed Jan 28 22:31:37 2015 -0800 Commit: Brad King CommitDate: Thu Jan 29 08:46:01 2015 -0500 Require libarchive 3.0.0 or later Older versions do not provide archive_entry_copy_sourcepath_w. diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ad1be8..e61621d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -336,7 +336,7 @@ macro (CMAKE_BUILD_UTILITIES) #--------------------------------------------------------------------- # Build or use system libarchive for CMake and CTest. if(CMAKE_USE_SYSTEM_LIBARCHIVE) - find_package(LibArchive) + find_package(LibArchive 3.0.0) if(NOT LibArchive_FOUND) message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!") endif() ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 08:55:00 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 08:55:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2431-gba1bdf7 Message-ID: <20150129135500.54DA4AA01F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ba1bdf72bc7fb34ac897056d5ec0c94e80bac393 (commit) via d84329c78b043ec77dbfe8130a737e7bddaaab3d (commit) from 9d274b4f3ffba3ad339522375180d2bf568d016c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ba1bdf72bc7fb34ac897056d5ec0c94e80bac393 commit ba1bdf72bc7fb34ac897056d5ec0c94e80bac393 Merge: 9d274b4 d84329c Author: Brad King AuthorDate: Thu Jan 29 08:54:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 08:54:59 2015 -0500 Merge topic 'xcode-revise-make-program' into next d84329c7 fixup! Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d84329c78b043ec77dbfe8130a737e7bddaaab3d commit d84329c78b043ec77dbfe8130a737e7bddaaab3d Author: Brad King AuthorDate: Thu Jan 29 08:54:50 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 08:54:50 2015 -0500 fixup! Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator diff --git a/Modules/CMakeFindXCode.cmake b/Modules/CMakeFindXCode.cmake index b1a4c43..da0b97b 100644 --- a/Modules/CMakeFindXCode.cmake +++ b/Modules/CMakeFindXCode.cmake @@ -1,3 +1,16 @@ +#============================================================================= +# Copyright 2005-2009 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.) + # Empty placeholder for input dependencies in existing # build trees produced by older versions of CMake. ----------------------------------------------------------------------- Summary of changes: Modules/CMakeFindXCode.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 09:02:34 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 09:02:34 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2433-g6682a9b Message-ID: <20150129140234.F3B32AA2C0@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 6682a9b18838c15070d7aed2be0dc9364910575c (commit) via 319326525a7ecfae55fed4f3e5ce2b2dad2449be (commit) from ba1bdf72bc7fb34ac897056d5ec0c94e80bac393 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6682a9b18838c15070d7aed2be0dc9364910575c commit 6682a9b18838c15070d7aed2be0dc9364910575c Merge: ba1bdf7 3193265 Author: Brad King AuthorDate: Thu Jan 29 09:02:33 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 09:02:33 2015 -0500 Merge topic 'rpm_multi_prefix' into next 31932652 fixup! cpack rpm multiple path relocation prefixes http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=319326525a7ecfae55fed4f3e5ce2b2dad2449be commit 319326525a7ecfae55fed4f3e5ce2b2dad2449be Author: Domen Vrankar AuthorDate: Wed Jan 28 23:48:57 2015 +0100 Commit: Brad King CommitDate: Thu Jan 29 08:57:11 2015 -0500 fixup! cpack rpm multiple path relocation prefixes CPackRPM test was refactored to use RunCMake infrastructure. diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 007f735..dea30e4 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -832,15 +832,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release # Do not try to build RPM if (NOT RPMBUILD) set(CPACK_BINARY_RPM OFF) - else() - add_test(CPack-RPM ${CMAKE_CMAKE_COMMAND} - -D dir=${CMake_BINARY_DIR}/Tests/CPackRPM - -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} - -D CMAKE_CMAKE_COMMAND=${CMAKE_CMAKE_COMMAND} - -P ${CMake_SOURCE_DIR}/Tests/CPackRPM/RunCPack.cmake - ) - list(APPEND TEST_BUILD_DIRS - "${CMake_BINARY_DIR}/Tests/CPackRPM") endif() find_program(NSIS_MAKENSIS_EXECUTABLE NAMES makensis diff --git a/Tests/CPackRPM/RunCPack.cmake b/Tests/CPackRPM/RunCPack.cmake deleted file mode 100644 index 8bef611..0000000 --- a/Tests/CPackRPM/RunCPack.cmake +++ /dev/null @@ -1,21 +0,0 @@ -cmake_minimum_required(VERSION 3.1 FATAL_ERROR) - -file(MAKE_DIRECTORY "${dir}") - -# run cmake -execute_process( - COMMAND "${CMAKE_CMAKE_COMMAND}" "${CMake_SOURCE_DIR}/Tests/CPackRPM" - WORKING_DIRECTORY "${dir}" - OUTPUT_QUIET) - -# package RPM -execute_process( - COMMAND make package - WORKING_DIRECTORY "${dir}" - ERROR_VARIABLE stderr - OUTPUT_QUIET) - -# test for partial relocation warning -if(NOT "${stderr}" MATCHES "CPackRPM:Warning: Path /not_relocatable/CMakeLists.txt is not on one of the.*relocatable paths! Package will be partially relocatable.") - message(FATAL_ERROR "CPack/RPM missing partially relocatable warning; stderr output: '${stderr}'") -endif() diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index b5e41d9..15a24de 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -173,3 +173,7 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) + +if(RPMBUILD) + add_RunCMake_test(CPackRPM) +endif() diff --git a/Tests/RunCMake/CPackRPM/CMakeLists.txt b/Tests/RunCMake/CPackRPM/CMakeLists.txt new file mode 100644 index 0000000..b7d170b --- /dev/null +++ b/Tests/RunCMake/CPackRPM/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) + +set(CPACK_GENERATOR "RPM") +include(CPack) diff --git a/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt new file mode 100644 index 0000000..3b63d5b --- /dev/null +++ b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt @@ -0,0 +1 @@ +CPackRPM:Warning: Path /not_relocatable/CMakeLists.txt is not on one of the.*relocatable paths! Package will be partially relocatable. diff --git a/Tests/CPackRPM/CMakeLists.txt b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake similarity index 70% rename from Tests/CPackRPM/CMakeLists.txt rename to Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake index 968f6d6..3ace6a8 100644 --- a/Tests/CPackRPM/CMakeLists.txt +++ b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake @@ -1,14 +1,7 @@ -cmake_minimum_required(VERSION 3.1 FATAL_ERROR) - -project(CPackRPM) - install(FILES CMakeLists.txt DESTINATION /not_relocatable COMPONENT static) install(FILES CMakeLists.txt DESTINATION relocatable COMPONENT relocatable) set(CPACK_PACKAGE_RELOCATABLE TRUE) -set(CPACK_GENERATOR "RPM") set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") set(CPACK_RPM_COMPONENT_INSTALL ON) - -include(CPack) diff --git a/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake b/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake new file mode 100644 index 0000000..1935e32 --- /dev/null +++ b/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake @@ -0,0 +1,17 @@ +include(RunCMake) + +function(run_cpack_rpm_test TEST_NAME) + set(RunCMake_TEST_NO_CLEAN TRUE) + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${TEST_NAME}-build") + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + execute_process( + COMMAND "${CMAKE_COMMAND}" -D RunCMake_TEST=${TEST_NAME} "${RunCMake_SOURCE_DIR}" + WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}" + OUTPUT_QUIET + ERROR_QUIET + ) + run_cmake_command(${TEST_NAME} ${CMAKE_CPACK_COMMAND}) +endfunction() + +run_cpack_rpm_test(CPackRPM_PARTIALLY_RELOCATABLE_WARNING) ----------------------------------------------------------------------- Summary of changes: Tests/CMakeLists.txt | 9 --------- Tests/CPackRPM/RunCPack.cmake | 21 -------------------- Tests/RunCMake/CMakeLists.txt | 4 ++++ Tests/RunCMake/CPackRPM/CMakeLists.txt | 7 +++++++ ...ackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt | 1 + .../CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake} | 7 ------- Tests/RunCMake/CPackRPM/RunCMakeTest.cmake | 17 ++++++++++++++++ 7 files changed, 29 insertions(+), 37 deletions(-) delete mode 100644 Tests/CPackRPM/RunCPack.cmake create mode 100644 Tests/RunCMake/CPackRPM/CMakeLists.txt create mode 100644 Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt rename Tests/{CPackRPM/CMakeLists.txt => RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake} (70%) create mode 100644 Tests/RunCMake/CPackRPM/RunCMakeTest.cmake hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 09:04:05 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 09:04:05 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2435-gaf57023 Message-ID: <20150129140405.B54B5AA043@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via af570233d5fe47ee49e67e8e3c8554ad4065830c (commit) via d9eebde0b025a6b93950e1c197b0f5a50deffa1a (commit) from 6682a9b18838c15070d7aed2be0dc9364910575c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af570233d5fe47ee49e67e8e3c8554ad4065830c commit af570233d5fe47ee49e67e8e3c8554ad4065830c Merge: 6682a9b d9eebde Author: Brad King AuthorDate: Thu Jan 29 09:04:04 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 09:04:04 2015 -0500 Merge topic 'rpm_multi_prefix' into next d9eebde0 cpack rpm multiple path relocation prefixes http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9eebde0b025a6b93950e1c197b0f5a50deffa1a commit d9eebde0b025a6b93950e1c197b0f5a50deffa1a Author: Domen Vrankar AuthorDate: Wed Jan 21 00:29:46 2015 +0100 Commit: Brad King CommitDate: Thu Jan 29 09:02:44 2015 -0500 cpack rpm multiple path relocation prefixes Allow multiple path relocation prefixes for a single rpm package. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index d2cb2ee..43e3fe0 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -379,6 +379,34 @@ # # May be used to add more exclude path (directories or files) from the initial # default list of excluded paths. See CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST. +# +# .. variable:: CPACK_RPM_RELOCATION_PATHS +# +# * Mandatory : NO +# * Default : - +# +# May be used to specify more than one relocation path per relocatable RPM. +# Variable contains a list of relocation paths that if relative are prefixed +# by the value of CPACK_RPM__PACKAGE_PREFIX or by the value of +# CPACK_PACKAGING_INSTALL_PREFIX if the component version is not provided. +# Variable is not component based as its content can be used to set a different +# path prefix for e.g. binary dir and documentation dir at the same time. +# Only prefixes that are required by a certain component are added to that +# component - component must contain at least one file/directory/symbolic link +# with CPACK_RPM_RELOCATION_PATHS prefix for a certain relocation path +# to be added. Package will not contain any relocation paths if there are no +# files/directories/symbolic links on any of the provided prefix locations. +# Packages that either do not contain any relocation paths or contain +# files/directories/symbolic links that are outside relocation paths print +# out an AUTHOR_WARNING that RPM will be partially relocatable. +# +# .. variable:: CPACK_RPM__PACKAGE_PREFIX +# +# * Mandatory : NO +# * Default : CPACK_PACKAGING_INSTALL_PREFIX +# +# May be used to set per component CPACK_PACKAGING_INSTALL_PREFIX for +# relocatable RPM packages. #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -395,6 +423,62 @@ # Author: Eric Noulard with the help of Alexander Neundorf. +function(cpack_rpm_prepare_relocation_paths) + # set appropriate prefix, remove possible trailing slash and convert backslashes to slashes + if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX) + file(TO_CMAKE_PATH "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX}" PATH_PREFIX) + else() + file(TO_CMAKE_PATH "${CPACK_PACKAGING_INSTALL_PREFIX}" PATH_PREFIX) + endif() + + set(RPM_RELOCATION_PATHS "${CPACK_RPM_RELOCATION_PATHS}") + list(REMOVE_DUPLICATES RPM_RELOCATION_PATHS) + + # set base path prefix + if(EXISTS "${WDIR}/${PATH_PREFIX}") + set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}Prefix: ${PATH_PREFIX}\n") + list(APPEND RPM_USED_PACKAGE_PREFIXES "${PATH_PREFIX}") + endif() + + # set other path prefixes + foreach(RELOCATION_PATH ${RPM_RELOCATION_PATHS}) + if(IS_ABSOLUTE "${RELOCATE_PATH}") + set(PREPARED_RELOCATION_PATH "${RELOCATION_PATH}") + else() + set(PREPARED_RELOCATION_PATH "${PATH_PREFIX}/${RELOCATION_PATH}") + endif() + + if(EXISTS "${WDIR}/${PREPARED_RELOCATION_PATH}") + set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}Prefix: ${PREPARED_RELOCATION_PATH}\n") + list(APPEND RPM_USED_PACKAGE_PREFIXES "${PREPARED_RELOCATION_PATH}") + endif() + endforeach() + + # warn about all the paths that are not relocatable + file(GLOB_RECURSE FILE_PATHS_ "${WDIR}/*") + foreach(TMP_PATH ${FILE_PATHS_}) + string(LENGTH "${WDIR}" WDIR_LEN) + string(SUBSTRING "${TMP_PATH}" ${WDIR_LEN} -1 TMP_PATH) + unset(TMP_PATH_FOUND_) + + foreach(RELOCATION_PATH ${RPM_USED_PACKAGE_PREFIXES}) + file(RELATIVE_PATH REL_PATH_ "${RELOCATION_PATH}" "${TMP_PATH}") + string(SUBSTRING "${REL_PATH_}" 0 2 PREFIX_) + + if(NOT "${PREFIX_}" STREQUAL "..") + set(TPM_PATH_FOUND_ TRUE) + break() + endif() + endforeach() + + if(NOT TPM_PATH_FOUND_) + message(AUTHOR_WARNING "CPackRPM:Warning: Path ${TMP_PATH} is not on one of the relocatable paths! Package will be partially relocatable.") + endif() + endforeach() + + set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}" PARENT_SCOPE) +endfunction() + if(CMAKE_BINARY_DIR) message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.") endif() @@ -636,13 +720,16 @@ if(CPACK_PACKAGE_RELOCATABLE) set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE) endif() if(CPACK_RPM_PACKAGE_RELOCATABLE) + unset(TMP_RPM_PREFIXES) + if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: Trying to build a relocatable package") endif() if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.") else() - set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) + set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) # kept for back compatibility (provided external RPM spec files) + cpack_rpm_prepare_relocation_paths() endif() endif() @@ -856,15 +943,21 @@ if(CPACK_RPM_PACKAGE_RELOCATABLE) # get a list of the elements in CPACK_RPM_PACKAGE_PREFIX and remove # the final element (so the install-prefix dir itself is not omitted # from the RPM's content-list) - string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${CPACK_RPM_PACKAGE_PREFIX}") - list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1) - # Now generate all of the parent dirs of CPACK_RPM_PACKAGE_PREFIX - foreach(_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS}) - list(APPEND _TMP_LIST "${_ELEM}") - string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}") - set(_OMIT_DIR "-o -path ${_OMIT_DIR}") - separate_arguments(_OMIT_DIR) - list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR}) + foreach(CPACK_RPM_PACKAGE_PREFIX ${RPM_PACKAGE_PREFIXES}) + string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${CPACK_RPM_PACKAGE_PREFIX}") + list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1) + unset(_TMP_LIST) + # Now generate all of the parent dirs of CPACK_RPM_PACKAGE_PREFIX + foreach(_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS}) + list(APPEND _TMP_LIST "${_ELEM}") + string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}") + list(FIND _RPM_DIRS_TO_OMIT "${_OMIT_DIR}" _DUPLICATE_FOUND) + if(_DUPLICATE_FOUND EQUAL -1) + set(_OMIT_DIR "-o -path ${_OMIT_DIR}") + separate_arguments(_OMIT_DIR) + list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR}) + endif() + endforeach() endforeach() endif() @@ -1101,7 +1194,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_AUTOREQ\@ \@TMP_RPM_AUTOREQPROV\@ \@TMP_RPM_BUILDARCH\@ -\@TMP_RPM_PREFIX\@ +\@TMP_RPM_PREFIXES\@ %define _rpmdir \@CPACK_RPM_DIRECTORY\@ %define _rpmfilename \@CPACK_RPM_FILE_NAME\@ diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt index ff40e30..b55594e 100644 --- a/Tests/CPackComponentsForAll/CMakeLists.txt +++ b/Tests/CPackComponentsForAll/CMakeLists.txt @@ -110,6 +110,12 @@ set(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Developer Full) set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) set(CPACK_COMPONENT_APPLICATIONS_INSTALL_TYPES Full) +# set CPACK_RPM_RELOCATION_PATHS here as GNUInstallDirs script +# can not be used in CPack scripts due to CMAKE_SIZEOF_VOID_P +# variable not being set +set(CPACK_RPM_RELOCATION_PATHS "${CMAKE_INSTALL_INCLUDEDIR}" + "${CMAKE_INSTALL_LIBDIR}" "${CMAKE_INSTALL_BINDIR}") + # We may use the CPack specific config file in order # to tailor CPack behavior on a CPack generator specific way # (Behavior would be different for RPM or TGZ or DEB ...) diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in index 8c01b32..de0ee46 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -6,15 +6,17 @@ if(CPACK_GENERATOR MATCHES "ZIP") endif() if(CPACK_GENERATOR MATCHES "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") + set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") - # test package summary override - set(CPACK_RPM_PACKAGE_SUMMARY "default summary") - set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") + set(CPACK_RPM_COMPONENT_INSTALL "ON") + set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") - # test package description override - set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") + # test package summary override + set(CPACK_RPM_PACKAGE_SUMMARY "default summary") + set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") + + # test package description override + set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") endif() if(CPACK_GENERATOR MATCHES "DEB") diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 4d56218..68d846f 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -140,6 +140,12 @@ if(CPackGen MATCHES "RPM") "C/C\\+\\+ header files for use with MyLib") if(${CPackComponentWay} STREQUAL "IgnoreGroup") + # set gnu install prefixes to what they are set during rpm creation + # CMAKE_SIZEOF_VOID_P is not set here but lib is prefix of lib64 so + # relocation path test won't fail on OSes with lib64 library location + include(GNUInstallDirs) + set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") + foreach(check_file ${expected_file}) string(REGEX MATCH ".*libraries.*" check_file_libraries_match ${check_file}) string(REGEX MATCH ".*headers.*" check_file_headers_match ${check_file}) @@ -154,15 +160,23 @@ if(CPackGen MATCHES "RPM") if(check_file_libraries_match) set(check_file_match_expected_summary ".*${CPACK_RPM_libraries_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_RPM_libraries_PACKAGE_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + set(spec_regex "*libraries*") elseif(check_file_headers_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_HEADERS_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") + set(spec_regex "*headers*") elseif(check_file_applications_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_APPLICATIONS_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(spec_regex "*applications*") elseif(check_file_Unspecified_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*DESCRIPTION.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(spec_regex "*Unspecified*") else() message(FATAL_ERROR "error: unexpected rpm package '${check_file}'") endif() @@ -170,13 +184,25 @@ if(CPackGen MATCHES "RPM") string(REGEX MATCH ${check_file_match_expected_summary} check_file_match_summary ${check_file_content}) if(NOT check_file_match_summary) - message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'") + message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'; RPM output: '${check_file_content}'") endif() string(REGEX MATCH ${check_file_match_expected_description} check_file_match_description ${check_file_content}) if(NOT check_file_match_description) - message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'") + message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'; RPM output: '${check_file_content}'") + endif() + + string(REGEX MATCH ${check_file_match_expected_relocation_path} check_file_match_relocation_path ${check_file_content}) + + if(NOT check_file_match_relocation_path) + file(GLOB_RECURSE spec_file "${CPackComponentsForAll_BINARY_DIR}/${spec_regex}.spec") + + if(spec_file) + file(READ ${spec_file} spec_file_content) + endif() + + message(FATAL_ERROR "error: '${check_file}' rpm package relocation path does not match expected value - regex '${check_file_match_expected_relocation_path}'; RPM output: '${check_file_content}'; generated spec file: '${spec_file_content}'") endif() endforeach() elseif(${CPackComponentWay} STREQUAL "IgnoreGroup") diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index b5e41d9..15a24de 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -173,3 +173,7 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) + +if(RPMBUILD) + add_RunCMake_test(CPackRPM) +endif() diff --git a/Tests/RunCMake/CPackRPM/CMakeLists.txt b/Tests/RunCMake/CPackRPM/CMakeLists.txt new file mode 100644 index 0000000..b7d170b --- /dev/null +++ b/Tests/RunCMake/CPackRPM/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) + +set(CPACK_GENERATOR "RPM") +include(CPack) diff --git a/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt new file mode 100644 index 0000000..3b63d5b --- /dev/null +++ b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt @@ -0,0 +1 @@ +CPackRPM:Warning: Path /not_relocatable/CMakeLists.txt is not on one of the.*relocatable paths! Package will be partially relocatable. diff --git a/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake new file mode 100644 index 0000000..3ace6a8 --- /dev/null +++ b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake @@ -0,0 +1,7 @@ +install(FILES CMakeLists.txt DESTINATION /not_relocatable COMPONENT static) +install(FILES CMakeLists.txt DESTINATION relocatable COMPONENT relocatable) + +set(CPACK_PACKAGE_RELOCATABLE TRUE) +set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") + +set(CPACK_RPM_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake b/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake new file mode 100644 index 0000000..1935e32 --- /dev/null +++ b/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake @@ -0,0 +1,17 @@ +include(RunCMake) + +function(run_cpack_rpm_test TEST_NAME) + set(RunCMake_TEST_NO_CLEAN TRUE) + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${TEST_NAME}-build") + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + execute_process( + COMMAND "${CMAKE_COMMAND}" -D RunCMake_TEST=${TEST_NAME} "${RunCMake_SOURCE_DIR}" + WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}" + OUTPUT_QUIET + ERROR_QUIET + ) + run_cmake_command(${TEST_NAME} ${CMAKE_CPACK_COMMAND}) +endfunction() + +run_cpack_rpm_test(CPackRPM_PARTIALLY_RELOCATABLE_WARNING) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 09:13:36 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 09:13:36 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2437-g55ec478 Message-ID: <20150129141336.EDCD84931@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 55ec478171d30dbb8c3f6bfaed8131a8ada29bba (commit) via ab9fa54d4841e5b0eff8d241ad8edb47401b0394 (commit) from af570233d5fe47ee49e67e8e3c8554ad4065830c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=55ec478171d30dbb8c3f6bfaed8131a8ada29bba commit 55ec478171d30dbb8c3f6bfaed8131a8ada29bba Merge: af57023 ab9fa54 Author: Brad King AuthorDate: Thu Jan 29 09:13:34 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 09:13:34 2015 -0500 Merge topic 'xcode-revise-make-program' into next ab9fa54d Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator (#15324) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ab9fa54d4841e5b0eff8d241ad8edb47401b0394 commit ab9fa54d4841e5b0eff8d241ad8edb47401b0394 Author: Brad King AuthorDate: Wed Jan 28 14:00:02 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 09:11:11 2015 -0500 Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator (#15324) The "cmakexbuild" wrapper is not needed for Xcode 4 and above, and the path to it may change when CMake moves. Avoid storing a specific path to a build program in CMakeCache.txt and instead compute the value for CMAKE_MAKE_PROGRAM on demand. However, if a user does set the value explicitly then honor it. This does for Xcode what commit v3.0.0-rc1~260^2~4 (VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators, 2013-11-15) did for Visual Studio generators. diff --git a/Help/release/dev/xcode-revise-make-program.rst b/Help/release/dev/xcode-revise-make-program.rst new file mode 100644 index 0000000..f50cf44 --- /dev/null +++ b/Help/release/dev/xcode-revise-make-program.rst @@ -0,0 +1,6 @@ +xcode-revise-make-program +------------------------- + +* The :generator:`Xcode` generator no longer requires a value for + the :variable:`CMAKE_MAKE_PROGRAM` variable to be located up front. + It now locates ``xcodebuild`` when needed at build time. diff --git a/Help/variable/CMAKE_MAKE_PROGRAM.rst b/Help/variable/CMAKE_MAKE_PROGRAM.rst index 97caa8a..f1d88a5 100644 --- a/Help/variable/CMAKE_MAKE_PROGRAM.rst +++ b/Help/variable/CMAKE_MAKE_PROGRAM.rst @@ -23,8 +23,15 @@ to configure the project: otherwise undocumented ``cmakexbuild`` wrapper implementing some workarounds). - This generator stores ``CMAKE_MAKE_PROGRAM`` in the CMake cache - so that it may be edited by the user. + This generator prefers to lookup the build tool at build time + rather than to store ``CMAKE_MAKE_PROGRAM`` in the CMake cache + ahead of time. This is because ``xcodebuild`` is easy to find, + the ``cmakexbuild`` wrapper is needed only for older Xcode versions, + and the path to ``cmakexbuild`` may be outdated if CMake itself moves. + + For compatibility with versions of CMake prior to 3.2, if + a user or project explicitly adds ``CMAKE_MAKE_PROGRAM`` to + the CMake cache then CMake will use the specified value. * The Visual Studio generators set this to the full path to ``MSBuild.exe`` (VS >= 10), ``devenv.com`` (VS 7,8,9), diff --git a/Modules/CMakeFindXCode.cmake b/Modules/CMakeFindXCode.cmake index 5c4f596..da0b97b 100644 --- a/Modules/CMakeFindXCode.cmake +++ b/Modules/CMakeFindXCode.cmake @@ -12,9 +12,5 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -find_program(CMAKE_MAKE_PROGRAM - NAMES xcodebuild - PATHS - /usr/bin - ) -mark_as_advanced(CMAKE_MAKE_PROGRAM) +# Empty placeholder for input dependencies in existing +# build trees produced by older versions of CMake. diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4c95a9f..6d0fedc 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -315,25 +315,6 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) "make program", cmCacheManager::FILEPATH); } - - if(makeProgram.find("xcodebuild") != makeProgram.npos) - { - // due to the text file busy /bin/sh problem with xcodebuild - // use the cmakexbuild wrapper instead. This program - // will run xcodebuild and if it sees the error text file busy - // it will stop forwarding output, and let the build finish. - // Then it will retry the build. It will continue this - // until no text file busy errors occur. - std::string cmakexbuild = - this->CMakeInstance->GetCacheManager()->GetCacheValue("CMAKE_COMMAND"); - cmakexbuild = cmakexbuild.substr(0, cmakexbuild.length()-5); - cmakexbuild += "cmakexbuild"; - - mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", - cmakexbuild.c_str(), - "make program", - cmCacheManager::FILEPATH); - } } // enable the given language diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index ebad7da..cd0dcc6 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -136,7 +136,6 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version) sscanf(this->VersionString.c_str(), "%u.%u", &v[0], &v[1]); this->XcodeVersion = 10*v[0] + v[1]; - this->FindMakeProgramFile = "CMakeFindXCode.cmake"; this->RootObject = 0; this->MainGroupChildren = 0; this->SourcesGroupChildren = 0; @@ -203,6 +202,19 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory } //---------------------------------------------------------------------------- +void cmGlobalXCodeGenerator::FindMakeProgram(cmMakefile* mf) +{ + // The Xcode generator knows how to lookup its build tool + // directly instead of needing a helper module to do it, so we + // do not actually need to put CMAKE_MAKE_PROGRAM into the cache. + if(cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) + { + mf->AddDefinition("CMAKE_MAKE_PROGRAM", + this->GetXcodeBuildCommand().c_str()); + } +} + +//---------------------------------------------------------------------------- std::string const& cmGlobalXCodeGenerator::GetXcodeBuildCommand() { if(!this->XcodeBuildCommandInitialized) diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index e54bb37..f513e28 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -70,6 +70,8 @@ public: const std::string& suffix, std::string& dir); + virtual void FindMakeProgram(cmMakefile*); + ///! What is the configurations directory variable called? virtual const char* GetCMakeCFGIntDir() const; ///! expand CFGIntDir diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 3aecd9b..035f161 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -51,7 +51,7 @@ if(BUILD_TESTING) set(CMake_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}") endif() - if(CMAKE_GENERATOR MATCHES "Visual Studio") + if(CMAKE_GENERATOR MATCHES "Visual Studio|Xcode") set(CMake_TEST_EXPLICIT_MAKE_PROGRAM "") else() set(CMake_TEST_EXPLICIT_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}") ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 09:13:54 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 09:13:54 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-949-gabec421 Message-ID: <20150129141354.D99FF4931@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via abec4213d61cb74aba5da6f83220b38ef7882209 (commit) via 9259d7788193ad23aa429652af983afc3bc4a953 (commit) from 5968ad58fd85e9703c36cd9154137f24c55e5413 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=abec4213d61cb74aba5da6f83220b38ef7882209 commit abec4213d61cb74aba5da6f83220b38ef7882209 Merge: 5968ad5 9259d77 Author: Brad King AuthorDate: Thu Jan 29 09:13:53 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 09:13:53 2015 -0500 Merge topic 'fix-OBJECT_DEPENDS-after-path-normalization' 9259d778 Normalize OBJECT_DEPENDS paths to match custom commands (#15366) ----------------------------------------------------------------------- Summary of changes: Source/cmGeneratorTarget.cxx | 8 ++++++++ Source/cmNinjaTargetGenerator.cxx | 8 ++++++++ Tests/CustomCommand/CMakeLists.txt | 13 +++++++++++++ Tests/CustomCommand/foo.in | 5 +++++ Tests/CustomCommand/subdir.h.in | 1 + 5 files changed, 35 insertions(+) create mode 100644 Tests/CustomCommand/subdir.h.in hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 09:13:57 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 09:13:57 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-951-g983a98e Message-ID: <20150129141357.9C23B493C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 983a98e5b8118ff5063400d8ffac7a511ca8002a (commit) via d52b5f8835a1768dc3b16e8b8cc465b5f80098ad (commit) from abec4213d61cb74aba5da6f83220b38ef7882209 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=983a98e5b8118ff5063400d8ffac7a511ca8002a commit 983a98e5b8118ff5063400d8ffac7a511ca8002a Merge: abec421 d52b5f8 Author: Brad King AuthorDate: Thu Jan 29 09:13:56 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 09:13:56 2015 -0500 Merge topic 'ctest-update-gmake-error-match' d52b5f88 ctest_build: Update GNU make error message matching (#15379) ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestBuildHandler.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 09:13:59 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 09:13:59 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-953-g98659ae Message-ID: <20150129141400.04EFB4938@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 98659aecfd819eb1e7771f7420933316a628b057 (commit) via 4775c90145da7ec8a5a87ce5b8b88dc4fc8c1925 (commit) from 983a98e5b8118ff5063400d8ffac7a511ca8002a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98659aecfd819eb1e7771f7420933316a628b057 commit 98659aecfd819eb1e7771f7420933316a628b057 Merge: 983a98e 4775c90 Author: Brad King AuthorDate: Thu Jan 29 09:13:58 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 09:13:58 2015 -0500 Merge topic 'vs-shader-flags' 4775c901 VS: Add source file property to set extra hlsl shader flags ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-properties.7.rst | 1 + Help/prop_sf/VS_SHADER_FLAGS.rst | 4 ++++ Help/release/dev/vs-shader-flags.rst | 5 +++++ Source/cmVisualStudio10TargetGenerator.cxx | 13 +++++++++++++ Tests/VSWinStorePhone/CMakeLists.txt | 2 ++ Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl | 4 ++++ .../VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl | 4 ++++ 7 files changed, 33 insertions(+) create mode 100644 Help/prop_sf/VS_SHADER_FLAGS.rst create mode 100644 Help/release/dev/vs-shader-flags.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 09:14:02 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 09:14:02 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-957-g326cfe2 Message-ID: <20150129141402.39B30493C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 326cfe2b30f0223ba676b966dc49a74972e4e4fb (commit) via ab9fa54d4841e5b0eff8d241ad8edb47401b0394 (commit) via 11e2e6cadf7f0ee36b7ccecaa11457949382b75f (commit) via e4055a6144c63c83fe2f39440ecfb9a0bcbfae0d (commit) from 98659aecfd819eb1e7771f7420933316a628b057 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=326cfe2b30f0223ba676b966dc49a74972e4e4fb commit 326cfe2b30f0223ba676b966dc49a74972e4e4fb Merge: 98659ae ab9fa54 Author: Brad King AuthorDate: Thu Jan 29 09:14:00 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 09:14:00 2015 -0500 Merge topic 'xcode-revise-make-program' ab9fa54d Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator (#15324) 11e2e6ca Xcode: Select make program at build time e4055a61 Xcode: Add internal API to find xcodebuild ----------------------------------------------------------------------- Summary of changes: Help/release/dev/xcode-revise-make-program.rst | 6 +++ Help/variable/CMAKE_MAKE_PROGRAM.rst | 11 +++++- Modules/CMakeFindXCode.cmake | 8 +--- Source/cmGlobalGenerator.cxx | 19 ---------- Source/cmGlobalXCodeGenerator.cxx | 47 +++++++++++++++++++++++- Source/cmGlobalXCodeGenerator.h | 7 ++++ Tests/CMakeLists.txt | 2 +- 7 files changed, 70 insertions(+), 30 deletions(-) create mode 100644 Help/release/dev/xcode-revise-make-program.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 09:15:03 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 09:15:03 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2443-ga0577e5 Message-ID: <20150129141503.30132A5643@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via a0577e5891d64235e211ff38fd4def0b01865cde (commit) via 326cfe2b30f0223ba676b966dc49a74972e4e4fb (commit) via 98659aecfd819eb1e7771f7420933316a628b057 (commit) via 983a98e5b8118ff5063400d8ffac7a511ca8002a (commit) via abec4213d61cb74aba5da6f83220b38ef7882209 (commit) via 5968ad58fd85e9703c36cd9154137f24c55e5413 (commit) from 55ec478171d30dbb8c3f6bfaed8131a8ada29bba (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0577e5891d64235e211ff38fd4def0b01865cde commit a0577e5891d64235e211ff38fd4def0b01865cde Merge: 55ec478 326cfe2 Author: Brad King AuthorDate: Thu Jan 29 09:14:56 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 09:14:56 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 09:16:51 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 09:16:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-964-gea7ca13 Message-ID: <20150129141651.B09D1A7F0D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via ea7ca139ea4c3c88e432e722c9cfe1dd86a4359f (commit) via 048fb8e3d0dd41f73f3a12f6ce3b13c80148ea3e (commit) via e6214b9a52ca4e79148017ef43e9228806999c06 (commit) via 5d96094874c148365441612158acf2039d421538 (commit) via 163bbff24afb284f3de142354c6c6ec75a6a7b67 (commit) via f6308b01398fdb5095f28662be326c66806eef20 (commit) via 7ab7aa60bb88474ceb4119e79f349254910b853c (commit) from 326cfe2b30f0223ba676b966dc49a74972e4e4fb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 09:16:51 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 09:16:51 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2451-gf311a36 Message-ID: <20150129141651.DE4FFA7F1A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f311a36cf47cf16d704427d59a31f597097d8a24 (commit) via ea7ca139ea4c3c88e432e722c9cfe1dd86a4359f (commit) via 048fb8e3d0dd41f73f3a12f6ce3b13c80148ea3e (commit) via e6214b9a52ca4e79148017ef43e9228806999c06 (commit) via 5d96094874c148365441612158acf2039d421538 (commit) via 163bbff24afb284f3de142354c6c6ec75a6a7b67 (commit) via f6308b01398fdb5095f28662be326c66806eef20 (commit) via 7ab7aa60bb88474ceb4119e79f349254910b853c (commit) from a0577e5891d64235e211ff38fd4def0b01865cde (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f311a36cf47cf16d704427d59a31f597097d8a24 commit f311a36cf47cf16d704427d59a31f597097d8a24 Merge: a0577e5 ea7ca13 Author: Brad King AuthorDate: Thu Jan 29 09:16:32 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 09:16:32 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 09:16:52 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 09:16:52 -0500 (EST) Subject: [Cmake-commits] CMake branch, release, updated. v3.1.1-12-g048fb8e Message-ID: <20150129141652.086CCA7F21@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 048fb8e3d0dd41f73f3a12f6ce3b13c80148ea3e (commit) via d52b5f8835a1768dc3b16e8b8cc465b5f80098ad (commit) via e6214b9a52ca4e79148017ef43e9228806999c06 (commit) via 9259d7788193ad23aa429652af983afc3bc4a953 (commit) via 5d96094874c148365441612158acf2039d421538 (commit) via c5d9a8283cfac15b4a5a07f18d5eb10c1f388505 (commit) via 163bbff24afb284f3de142354c6c6ec75a6a7b67 (commit) via c7310917e6b5efa6ef867ef5cabc5b5649d97b67 (commit) via f6308b01398fdb5095f28662be326c66806eef20 (commit) via 482c84759fb6df983d519ca2ac61e3c92c0ae7e3 (commit) via 7ab7aa60bb88474ceb4119e79f349254910b853c (commit) via b79d8f2934bc0dbe5f22fbb3ee709eb932baf3c6 (commit) from 57622bd19d3fd013038d34f497b106a7e2bfd26d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Help/command/link_libraries.rst | 19 +++++++++++-------- Help/manual/cmake-commands.7.rst | 2 +- Modules/FeatureSummary.cmake | 4 ++-- Modules/FindOpenSSL.cmake | 2 +- Source/CTest/cmCTestBuildHandler.cxx | 4 ++-- Source/cmGeneratorTarget.cxx | 8 ++++++++ Source/cmNinjaTargetGenerator.cxx | 8 ++++++++ Source/kwsys/Directory.cxx | 5 +++++ Tests/CustomCommand/CMakeLists.txt | 13 +++++++++++++ Tests/CustomCommand/foo.in | 5 +++++ Tests/CustomCommand/subdir.h.in | 1 + 11 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 Tests/CustomCommand/subdir.h.in hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 10:25:41 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 10:25:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2455-gdb4f916 Message-ID: <20150129152541.90EB8AA903@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via db4f91629fc1ad0519713f3af9999ae84cb27b49 (commit) via 4931de8c2666436802ed96a31a8b76f01042b0f2 (commit) via 440242818dd9fc99c5034af5c299dab063c62c8d (commit) via c4ddc92f912576e1499478abcf178b351b9e07f8 (commit) from f311a36cf47cf16d704427d59a31f597097d8a24 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db4f91629fc1ad0519713f3af9999ae84cb27b49 commit db4f91629fc1ad0519713f3af9999ae84cb27b49 Merge: f311a36 4931de8 Author: Brad King AuthorDate: Thu Jan 29 10:25:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 10:25:40 2015 -0500 Merge topic 'feature-record-msvc' into next 4931de8c fixup! Features: Record for MSVC 2010-2015 44024281 fixup! Features: Define meaning for no language standard default c4ddc92f Help: Document _STANDARD having no effect for MSVC http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4931de8c2666436802ed96a31a8b76f01042b0f2 commit 4931de8c2666436802ed96a31a8b76f01042b0f2 Author: Brad King AuthorDate: Thu Jan 29 09:42:30 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 10:23:27 2015 -0500 fixup! Features: Record for MSVC 2010-2015 diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake index 476f244..d69a7ef 100644 --- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -21,7 +21,8 @@ set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") # http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx # Note 1. While previous version of VisualStudio said they supported this # they silently produced bad code, and are now marked as having partial -# support +# support in previous versions. The footnote says the support will be complete +# in MSVC 2015, so support the feature for that version, assuming that is true. set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") @@ -37,6 +38,10 @@ set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") set(MSVC_2013 "_MSC_VER >= 1800") set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +# Microsoft now states they support contextual conversions in 2013 and above. +# See footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}") set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") @@ -45,7 +50,8 @@ set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") -# Possibly broken: +# Support is documented, but possibly partly broken: +# https://msdn.microsoft.com/en-us/library/hh567368.aspx # http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") @@ -58,10 +64,6 @@ set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") set(MSVC_2010 "_MSC_VER >= 1600") set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") -# Microsoft now states they support contextual conversions -# see footnote 6 at: -# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2010}") set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 5f8fbc0..bc823ca 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -91,6 +91,15 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" cxx_return_type_deduction ) endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) + list(REMOVE_ITEM CXX_non_features + # The cxx_contextual_conversions feature happens to work + # (for *this* testcase) with VS 2010 and VS 2012, but + # they do not document support until VS 2013. + cxx_contextual_conversions + ) +endif() set(C_ext c) set(C_standard_flag 11) diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 43e89ab..65e60b2 100644 --- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt +++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt @@ -68,15 +68,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" endif() # for msvc the compiler version determines which c++11 features are available. -# Both variadic templates and delegating constructors support exist in -# all versions that we write compile headers for. -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND - ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") - list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) - list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) -else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) - list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) + else() + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) + endif() endif() if (CMAKE_C_COMPILER_ID STREQUAL "GNU" http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=440242818dd9fc99c5034af5c299dab063c62c8d commit 440242818dd9fc99c5034af5c299dab063c62c8d Author: Brad King AuthorDate: Thu Jan 29 09:40:20 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 10:23:27 2015 -0500 fixup! Features: Define meaning for no language standard default diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 5f246f9..6692a92 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1370,6 +1370,8 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode { std::vector const& langAvailable = availableFeatures[lit->first]; + const char* standardDefault = context->Makefile + ->GetDefinition("CMAKE_" + lit->first + "_STANDARD_DEFAULT"); for (std::vector::const_iterator it = lit->second.begin(); it != lit->second.end(); ++it) { @@ -1378,6 +1380,12 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode { return "0"; } + if (standardDefault && !*standardDefault) + { + // This compiler has no notion of language standard levels. + // All features known for the language are always available. + continue; + } if (!context->Makefile->HaveStandardAvailable(target, lit->first, *it)) { @@ -1386,8 +1394,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode const char* l = target->GetProperty(lit->first + "_STANDARD"); if (!l) { - l = context->Makefile - ->GetDefinition("CMAKE_" + lit->first + "_STANDARD_DEFAULT"); + l = standardDefault; } assert(l); context->MaxLanguageStandard[target][lit->first] = l; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b5ff732..ba914e1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -5264,12 +5264,6 @@ HaveCStandardAvailable(cmTarget const* target, // Return true so the caller does not try to lookup the default standard. return true; } - if (!*defaultCStandard) - { - // This compiler has no notion of language standard levels. - // All features known for the language are always available. - return true; - } if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), cmStrCmp(defaultCStandard)) == cmArrayEnd(C_STANDARDS)) { @@ -5369,12 +5363,6 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, // Return true so the caller does not try to lookup the default standard. return true; } - if (!*defaultCxxStandard) - { - // This compiler has no notion of language standard levels. - // All features known for the language are always available. - return true; - } if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), cmStrCmp(defaultCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4ddc92f912576e1499478abcf178b351b9e07f8 commit c4ddc92f912576e1499478abcf178b351b9e07f8 Author: Brad King AuthorDate: Thu Jan 29 09:35:49 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 09:35:49 2015 -0500 Help: Document _STANDARD having no effect for MSVC diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index 65b3a72..e18250c 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -80,7 +80,9 @@ When adding the first supported feature to a particular CompilerId, it is necessary to list support for all features known to cmake (See :variable:`CMAKE_C_COMPILE_FEATURES` and :variable:`CMAKE_CXX_COMPILE_FEATURES` as appropriate), where available for -the compiler. +the compiler. Furthermore, set ``CMAKE__STANDARD_DEFAULT`` to the +default language standard level the compiler uses, or to the empty string +if the compiler has no notion of standard levels (such as ``MSVC``). It is sensible to record the features for the most recent version of a particular CompilerId first, and then work backwards. It is sensible to diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst index 6329e34..65b30ec 100644 --- a/Help/prop_tgt/CXX_STANDARD.rst +++ b/Help/prop_tgt/CXX_STANDARD.rst @@ -5,7 +5,8 @@ The C++ standard whose features are requested to build this target. This property specifies the C++ standard whose features are requested to build this target. For some compilers, this results in adding a -flag such as ``-std=gnu++11`` to the compile line. +flag such as ``-std=gnu++11`` to the compile line. For compilers that +have no notion of a standard level, such as MSVC, this has no effect. Supported values are ``98``, ``11`` and ``14``. diff --git a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst index ac103a4..4e24e5e 100644 --- a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst @@ -7,7 +7,8 @@ If this property is set to ``ON``, then the value of the :prop_tgt:`CXX_STANDARD` target property is treated as a requirement. If this property is ``OFF`` or unset, the :prop_tgt:`CXX_STANDARD` target property is treated as optional and may "decay" to a previous standard if the requested is -not available. +not available. For compilers that have no notion of a standard level, such as +MSVC, this has no effect. See the :manual:`cmake-compile-features(7)` manual for information on compile features. diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst index 88ca926..3aa74af 100644 --- a/Help/prop_tgt/C_STANDARD.rst +++ b/Help/prop_tgt/C_STANDARD.rst @@ -5,7 +5,8 @@ The C standard whose features are requested to build this target. This property specifies the C standard whose features are requested to build this target. For some compilers, this results in adding a -flag such as ``-std=gnu11`` to the compile line. +flag such as ``-std=gnu11`` to the compile line. For compilers that +have no notion of a standard level, such as MSVC, this has no effect. Supported values are ``90``, ``99`` and ``11``. diff --git a/Help/prop_tgt/C_STANDARD_REQUIRED.rst b/Help/prop_tgt/C_STANDARD_REQUIRED.rst index a7304f4..743d568 100644 --- a/Help/prop_tgt/C_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/C_STANDARD_REQUIRED.rst @@ -7,7 +7,8 @@ If this property is set to ``ON``, then the value of the :prop_tgt:`C_STANDARD` target property is treated as a requirement. If this property is ``OFF`` or unset, the :prop_tgt:`C_STANDARD` target property is treated as optional and may "decay" to a previous standard if the requested is -not available. +not available. For compilers that have no notion of a standard level, such as +MSVC, this has no effect. See the :manual:`cmake-compile-features(7)` manual for information on compile features. ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-developer.7.rst | 4 +++- Help/prop_tgt/CXX_STANDARD.rst | 3 ++- Help/prop_tgt/CXX_STANDARD_REQUIRED.rst | 3 ++- Help/prop_tgt/C_STANDARD.rst | 3 ++- Help/prop_tgt/C_STANDARD_REQUIRED.rst | 3 ++- Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 14 ++++++++------ Source/cmGeneratorExpressionEvaluator.cxx | 11 +++++++++-- Source/cmMakefile.cxx | 12 ------------ Tests/CompileFeatures/CMakeLists.txt | 9 +++++++++ .../WriteCompilerDetectionHeader/CMakeLists.txt | 17 ++++++++--------- 10 files changed, 45 insertions(+), 34 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 10:27:35 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 10:27:35 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2457-gfacb1be Message-ID: <20150129152735.458C8AA95E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via facb1be1b508efc97430a9c2b1523d3a387e8cc5 (commit) via f4961f916a2d5e323c58c11e8dd3267444f1e8aa (commit) from db4f91629fc1ad0519713f3af9999ae84cb27b49 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=facb1be1b508efc97430a9c2b1523d3a387e8cc5 commit facb1be1b508efc97430a9c2b1523d3a387e8cc5 Merge: db4f916 f4961f9 Author: Brad King AuthorDate: Thu Jan 29 10:27:34 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 10:27:34 2015 -0500 Merge topic 'feature-record-msvc' into next f4961f91 fixup! Help: Add notes for topic 'feature-record-msvc' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f4961f916a2d5e323c58c11e8dd3267444f1e8aa commit f4961f916a2d5e323c58c11e8dd3267444f1e8aa Author: Brad King AuthorDate: Thu Jan 29 10:26:31 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 10:26:31 2015 -0500 fixup! Help: Add notes for topic 'feature-record-msvc' diff --git a/Help/release/dev/feature-record-msvc.rst b/Help/release/dev/feature-record-msvc.rst index 226a338..a8c9fd1 100644 --- a/Help/release/dev/feature-record-msvc.rst +++ b/Help/release/dev/feature-record-msvc.rst @@ -1,5 +1,5 @@ feature-record-msvc ------------------------------- +------------------- * The :manual:`Compile Features ` functionality is now aware of features supported by Microsoft Visual Studio (``MSVC``). ----------------------------------------------------------------------- Summary of changes: Help/release/dev/feature-record-msvc.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 10:42:12 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 10:42:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2460-gbefffb9 Message-ID: <20150129154212.82546493E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via befffb975434b159e82b6c750ede0762a1951672 (commit) via 01bbd07b7c6ae9709dd874e93a96ba26f161b773 (commit) via e4969c1d6db8765a0a430ab0172e35042821df4d (commit) from facb1be1b508efc97430a9c2b1523d3a387e8cc5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=befffb975434b159e82b6c750ede0762a1951672 commit befffb975434b159e82b6c750ede0762a1951672 Merge: facb1be 01bbd07 Author: Brad King AuthorDate: Thu Jan 29 10:42:11 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 10:42:11 2015 -0500 Merge topic 'feature-record-msvc' into next 01bbd07b Features: Record for MSVC 2010-2015 e4969c1d Features: Define meaning for no language standard default http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=01bbd07b7c6ae9709dd874e93a96ba26f161b773 commit 01bbd07b7c6ae9709dd874e93a96ba26f161b773 Author: Robert Maynard AuthorDate: Mon Jan 19 15:49:06 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 10:31:09 2015 -0500 Features: Record for MSVC 2010-2015 Also, in WCDH add MSVC Compatibility for cxx_align{of,as}. Co-Author: Stephen Kelly Co-Author: Brad King diff --git a/Help/release/dev/feature-record-msvc.rst b/Help/release/dev/feature-record-msvc.rst new file mode 100644 index 0000000..a8c9fd1 --- /dev/null +++ b/Help/release/dev/feature-record-msvc.rst @@ -0,0 +1,5 @@ +feature-record-msvc +------------------- + +* The :manual:`Compile Features ` functionality + is now aware of features supported by Microsoft Visual Studio (``MSVC``). diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..d69a7ef --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,102 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +# In theory decltype incomplete return types was added in 2012 +# but without support for decltype_auto and return type deduction this +# feature is unusable +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support in previous versions. The footnote says the support will be complete +# in MSVC 2015, so support the feature for that version, assuming that is true. +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +# Microsoft now states they support contextual conversions in 2013 and above. +# See footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Support is documented, but possibly partly broken: +# https://msdn.microsoft.com/en-us/library/hh567368.aspx +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx + +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + + +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake new file mode 100644 index 0000000..962aaeb --- /dev/null +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -0,0 +1,6 @@ +# MSVC has no specific language level or flags to change it. +set(CMAKE_CXX_STANDARD_DEFAULT "") + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index e81bc08..d18f47c 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC SunPro ) @@ -528,6 +529,8 @@ function(write_compiler_detection_header # define ${def_value} alignas(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __attribute__ ((__aligned__(X))) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __declspec(align(X)) # else # define ${def_value} # endif @@ -540,6 +543,8 @@ function(write_compiler_detection_header # define ${def_value} alignof(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __alignof__(X) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __alignof(X) # endif \n") endif() diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index a8b85d6..bc823ca 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -91,6 +91,15 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" cxx_return_type_deduction ) endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) + list(REMOVE_ITEM CXX_non_features + # The cxx_contextual_conversions feature happens to work + # (for *this* testcase) with VS 2010 and VS 2012, but + # they do not document support until VS 2013. + cxx_contextual_conversions + ) +endif() set(C_ext c) set(C_standard_flag 11) @@ -211,6 +220,29 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=0 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=0 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") add_definitions( -DEXPECT_OVERRIDE_CONTROL=1 diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index b5e46c0..65e60b2 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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -67,6 +67,17 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) + else() + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) + endif() +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -84,7 +95,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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e4969c1d6db8765a0a430ab0172e35042821df4d commit e4969c1d6db8765a0a430ab0172e35042821df4d Author: Brad King AuthorDate: Mon Jan 26 16:42:36 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 10:30:11 2015 -0500 Features: Define meaning for no language standard default Define an empty string in CMAKE__STANDARD_DEFAULT to mean that the toolchain has no notion of lanuage standard levels. In this case the _STANDARD[_REQUIRED] properties will have no effect. Update the RunCMake.CompileFeatures test to exclude the LinkImplementationFeatureCycle test when there is no standard default. It can never fail because no use of specific features will adjust the CXX_STANDARD level required for any target since the standard levels have no meaning in this case. diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index 65b3a72..e18250c 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -80,7 +80,9 @@ When adding the first supported feature to a particular CompilerId, it is necessary to list support for all features known to cmake (See :variable:`CMAKE_C_COMPILE_FEATURES` and :variable:`CMAKE_CXX_COMPILE_FEATURES` as appropriate), where available for -the compiler. +the compiler. Furthermore, set ``CMAKE__STANDARD_DEFAULT`` to the +default language standard level the compiler uses, or to the empty string +if the compiler has no notion of standard levels (such as ``MSVC``). It is sensible to record the features for the most recent version of a particular CompilerId first, and then work backwards. It is sensible to diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst index 6329e34..65b30ec 100644 --- a/Help/prop_tgt/CXX_STANDARD.rst +++ b/Help/prop_tgt/CXX_STANDARD.rst @@ -5,7 +5,8 @@ The C++ standard whose features are requested to build this target. This property specifies the C++ standard whose features are requested to build this target. For some compilers, this results in adding a -flag such as ``-std=gnu++11`` to the compile line. +flag such as ``-std=gnu++11`` to the compile line. For compilers that +have no notion of a standard level, such as MSVC, this has no effect. Supported values are ``98``, ``11`` and ``14``. diff --git a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst index ac103a4..4e24e5e 100644 --- a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst @@ -7,7 +7,8 @@ If this property is set to ``ON``, then the value of the :prop_tgt:`CXX_STANDARD` target property is treated as a requirement. If this property is ``OFF`` or unset, the :prop_tgt:`CXX_STANDARD` target property is treated as optional and may "decay" to a previous standard if the requested is -not available. +not available. For compilers that have no notion of a standard level, such as +MSVC, this has no effect. See the :manual:`cmake-compile-features(7)` manual for information on compile features. diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst index 88ca926..3aa74af 100644 --- a/Help/prop_tgt/C_STANDARD.rst +++ b/Help/prop_tgt/C_STANDARD.rst @@ -5,7 +5,8 @@ The C standard whose features are requested to build this target. This property specifies the C standard whose features are requested to build this target. For some compilers, this results in adding a -flag such as ``-std=gnu11`` to the compile line. +flag such as ``-std=gnu11`` to the compile line. For compilers that +have no notion of a standard level, such as MSVC, this has no effect. Supported values are ``90``, ``99`` and ``11``. diff --git a/Help/prop_tgt/C_STANDARD_REQUIRED.rst b/Help/prop_tgt/C_STANDARD_REQUIRED.rst index a7304f4..743d568 100644 --- a/Help/prop_tgt/C_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/C_STANDARD_REQUIRED.rst @@ -7,7 +7,8 @@ If this property is set to ``ON``, then the value of the :prop_tgt:`C_STANDARD` target property is treated as a requirement. If this property is ``OFF`` or unset, the :prop_tgt:`C_STANDARD` target property is treated as optional and may "decay" to a previous standard if the requested is -not available. +not available. For compilers that have no notion of a standard level, such as +MSVC, this has no effect. See the :manual:`cmake-compile-features(7)` manual for information on compile features. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 5f246f9..6692a92 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1370,6 +1370,8 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode { std::vector const& langAvailable = availableFeatures[lit->first]; + const char* standardDefault = context->Makefile + ->GetDefinition("CMAKE_" + lit->first + "_STANDARD_DEFAULT"); for (std::vector::const_iterator it = lit->second.begin(); it != lit->second.end(); ++it) { @@ -1378,6 +1380,12 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode { return "0"; } + if (standardDefault && !*standardDefault) + { + // This compiler has no notion of language standard levels. + // All features known for the language are always available. + continue; + } if (!context->Makefile->HaveStandardAvailable(target, lit->first, *it)) { @@ -1386,8 +1394,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode const char* l = target->GetProperty(lit->first + "_STANDARD"); if (!l) { - l = context->Makefile - ->GetDefinition("CMAKE_" + lit->first + "_STANDARD_DEFAULT"); + l = standardDefault; } assert(l); context->MaxLanguageStandard[target][lit->first] = l; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 834f705..af4c950 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2207,6 +2207,13 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, { return; } + const char* defaultStd + = this->Makefile->GetDefinition("CMAKE_" + lang + "_STANDARD_DEFAULT"); + if (defaultStd && !*defaultStd) + { + // This compiler has no notion of language standard levels. + return; + } std::string stdProp = lang + "_STANDARD"; const char *standardProp = target->GetProperty(stdProp); if (!standardProp) @@ -2269,8 +2276,6 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, std::find(stds.begin(), stds.end(), standard); assert(stdIt != stds.end()); - const char* defaultStd - = this->Makefile->GetDefinition("CMAKE_" + lang + "_STANDARD_DEFAULT"); std::vector::const_iterator defaultStdIt; if (defaultStd) { diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 87e62d7..ba914e1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -5253,6 +5253,27 @@ bool cmMakefile:: HaveCStandardAvailable(cmTarget const* target, const std::string& feature) const { + const char* defaultCStandard = + this->GetDefinition("CMAKE_C_STANDARD_DEFAULT"); + if (!defaultCStandard) + { + std::ostringstream e; + e << "CMAKE_C_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " + "not fully configured for this compiler."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + // Return true so the caller does not try to lookup the default standard. + return true; + } + if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), + cmStrCmp(defaultCStandard)) == cmArrayEnd(C_STANDARDS)) + { + std::ostringstream e; + e << "The CMAKE_C_STANDARD_DEFAULT variable contains an " + "invalid value: \"" << defaultCStandard << "\"."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + return false; + } + bool needC90 = false; bool needC99 = false; bool needC11 = false; @@ -5262,7 +5283,7 @@ HaveCStandardAvailable(cmTarget const* target, const char *existingCStandard = target->GetProperty("C_STANDARD"); if (!existingCStandard) { - existingCStandard = this->GetDefinition("CMAKE_C_STANDARD_DEFAULT"); + existingCStandard = defaultCStandard; } if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), @@ -5331,6 +5352,27 @@ bool cmMakefile::IsLaterStandard(std::string const& lang, bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const { + const char* defaultCxxStandard = + this->GetDefinition("CMAKE_CXX_STANDARD_DEFAULT"); + if (!defaultCxxStandard) + { + std::ostringstream e; + e << "CMAKE_CXX_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " + "not fully configured for this compiler."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + // Return true so the caller does not try to lookup the default standard. + return true; + } + if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), + cmStrCmp(defaultCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) + { + std::ostringstream e; + e << "The CMAKE_CXX_STANDARD_DEFAULT variable contains an " + "invalid value: \"" << defaultCxxStandard << "\"."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + return false; + } + bool needCxx98 = false; bool needCxx11 = false; bool needCxx14 = false; @@ -5339,7 +5381,7 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const char *existingCxxStandard = target->GetProperty("CXX_STANDARD"); if (!existingCxxStandard) { - existingCxxStandard = this->GetDefinition("CMAKE_CXX_STANDARD_DEFAULT"); + existingCxxStandard = defaultCxxStandard; } if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 5cd0836..a8b85d6 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -119,26 +119,30 @@ foreach(lang CXX C) endforeach() if (CMAKE_C_COMPILE_FEATURES) - string(FIND "${CMAKE_C_FLAGS}" "-std=" std_flag_idx) - if (std_flag_idx EQUAL -1) - add_executable(default_dialect_C default_dialect.c) - target_compile_definitions(default_dialect_C PRIVATE - DEFAULT_C11=$ - DEFAULT_C99=$ - DEFAULT_C90=$ - ) + if (CMAKE_C_STANDARD_DEFAULT) + string(FIND "${CMAKE_C_FLAGS}" "-std=" std_flag_idx) + if (std_flag_idx EQUAL -1) + add_executable(default_dialect_C default_dialect.c) + target_compile_definitions(default_dialect_C PRIVATE + DEFAULT_C11=$ + DEFAULT_C99=$ + DEFAULT_C90=$ + ) + endif() endif() endif() if (CMAKE_CXX_COMPILE_FEATURES) - string(FIND "${CMAKE_CXX_FLAGS}" "-std=" std_flag_idx) - if (std_flag_idx EQUAL -1) - add_executable(default_dialect default_dialect.cpp) - target_compile_definitions(default_dialect PRIVATE - DEFAULT_CXX14=$ - DEFAULT_CXX11=$ - DEFAULT_CXX98=$ - ) + if (CMAKE_CXX_STANDARD_DEFAULT) + string(FIND "${CMAKE_CXX_FLAGS}" "-std=" std_flag_idx) + if (std_flag_idx EQUAL -1) + add_executable(default_dialect default_dialect.cpp) + target_compile_definitions(default_dialect PRIVATE + DEFAULT_CXX14=$ + DEFAULT_CXX11=$ + DEFAULT_CXX98=$ + ) + endif() endif() add_executable(CompileFeatures main.cpp) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..efea371 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -17,6 +17,8 @@ file(READ "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx_features.txt" CXX_FEATURES ) +include("${RunCMake_BINARY_DIR}/generate_feature_list-build/c_standard_default.cmake") +include("${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx_standard_default.cmake") if (NOT C_FEATURES) run_cmake(NoSupportedCFeatures) @@ -27,7 +29,9 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) + if(CXX_STANDARD_DEFAULT) + run_cmake(LinkImplementationFeatureCycle) + endif() run_cmake(LinkImplementationFeatureCycleSolved) if (";${CXX_FEATURES};" MATCHES ";cxx_final;") @@ -38,17 +42,19 @@ else() unset(RunCMake_TEST_OPTIONS) endif() -foreach(standard 98 11) - file(READ - "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx${standard}_flag.txt" - CXX${standard}_FLAG - ) - if (CXX${standard}_FLAG STREQUAL NOTFOUND) - run_cmake(RequireCXX${standard}) - run_cmake(RequireCXX${standard}Variable) - endif() - if (CXX${standard}EXT_FLAG STREQUAL NOTFOUND) - run_cmake(RequireCXX${standard}Ext) - run_cmake(RequireCXX${standard}ExtVariable) - endif() -endforeach() +if(CXX_STANDARD_DEFAULT) + foreach(standard 98 11) + file(READ + "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx${standard}_flag.txt" + CXX${standard}_FLAG + ) + if (CXX${standard}_FLAG STREQUAL NOTFOUND) + run_cmake(RequireCXX${standard}) + run_cmake(RequireCXX${standard}Variable) + endif() + if (CXX${standard}EXT_FLAG STREQUAL NOTFOUND) + run_cmake(RequireCXX${standard}Ext) + run_cmake(RequireCXX${standard}ExtVariable) + endif() + endforeach() +endif() diff --git a/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake index 09e17b1..5c58052 100644 --- a/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake +++ b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake @@ -9,6 +9,20 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_features.txt" "${CMAKE_CXX_COMPILE_FEATURES}" ) +if(DEFINED CMAKE_C_STANDARD_DEFAULT) + set(c_standard_default_code "set(C_STANDARD_DEFAULT \"${CMAKE_C_STANDARD_DEFAULT}\")\n") +else() + set(c_standard_default_code "unset(C_STANDARD_DEFAULT)\n") +endif() +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/c_standard_default.cmake" "${c_standard_default_code}") + +if(DEFINED CMAKE_CXX_STANDARD_DEFAULT) + set(cxx_standard_default_code "set(CXX_STANDARD_DEFAULT \"${CMAKE_CXX_STANDARD_DEFAULT}\")\n") +else() + set(cxx_standard_default_code "unset(CXX_STANDARD_DEFAULT)\n") +endif() +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_standard_default.cmake" "${cxx_standard_default_code}") + foreach(standard 98 11) set(CXX${standard}_FLAG NOTFOUND) if (DEFINED CMAKE_CXX${standard}_STANDARD_COMPILE_OPTION) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 10:48:39 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 10:48:39 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2462-ge61e745 Message-ID: <20150129154839.2117FAA05C@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e61e74513542c2d0a6229b6b4bb4b014a6032de5 (commit) via 190bc8ed4589ee89c3405f8e44c2f7e9fe2ed2de (commit) from befffb975434b159e82b6c750ede0762a1951672 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e61e74513542c2d0a6229b6b4bb4b014a6032de5 commit e61e74513542c2d0a6229b6b4bb4b014a6032de5 Merge: befffb9 190bc8e Author: Brad King AuthorDate: Thu Jan 29 10:48:38 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 10:48:38 2015 -0500 Merge topic 'rpm_multi_prefix' into next 190bc8ed Help: Add notes for topic 'rpm_multi_prefix' http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=190bc8ed4589ee89c3405f8e44c2f7e9fe2ed2de commit 190bc8ed4589ee89c3405f8e44c2f7e9fe2ed2de Author: Brad King AuthorDate: Thu Jan 29 10:47:33 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 10:47:33 2015 -0500 Help: Add notes for topic 'rpm_multi_prefix' diff --git a/Help/release/dev/rpm_multi_prefix.rst b/Help/release/dev/rpm_multi_prefix.rst new file mode 100644 index 0000000..0329592 --- /dev/null +++ b/Help/release/dev/rpm_multi_prefix.rst @@ -0,0 +1,11 @@ +rpm_multi_prefix +---------------- + +* The :module:`CPackRPM` module learned a new + :variable:`CPACK_RPM__PACKAGE_PREFIX` variable to + specify a component-specific value to use instead of + :variable:`CPACK_PACKAGING_INSTALL_PREFIX`. + +* The :module:`CPackRPM` module learned a new + :variable:`CPACK_RPM_RELOCATION_PATHS` variable to + specify multiple relocation prefixes for a single rpm package. ----------------------------------------------------------------------- Summary of changes: Help/release/dev/rpm_multi_prefix.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Help/release/dev/rpm_multi_prefix.rst hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 10:49:35 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 10:49:35 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2464-g8157b25 Message-ID: <20150129154935.9C344AA0AA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8157b25c9bc92c415f486bb6107d8592571a4954 (commit) via 3ec025472735c22cb90b09bc171190005dd28bb1 (commit) from e61e74513542c2d0a6229b6b4bb4b014a6032de5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8157b25c9bc92c415f486bb6107d8592571a4954 commit 8157b25c9bc92c415f486bb6107d8592571a4954 Merge: e61e745 3ec0254 Author: Brad King AuthorDate: Thu Jan 29 10:49:34 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 10:49:34 2015 -0500 Merge topic 'rpm_multi_prefix' into next 3ec02547 CPackRPM: Allow multiple path relocation prefixes for one package http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3ec025472735c22cb90b09bc171190005dd28bb1 commit 3ec025472735c22cb90b09bc171190005dd28bb1 Author: Domen Vrankar AuthorDate: Wed Jan 21 00:29:46 2015 +0100 Commit: Brad King CommitDate: Thu Jan 29 10:48:58 2015 -0500 CPackRPM: Allow multiple path relocation prefixes for one package diff --git a/Help/release/dev/rpm_multi_prefix.rst b/Help/release/dev/rpm_multi_prefix.rst new file mode 100644 index 0000000..0329592 --- /dev/null +++ b/Help/release/dev/rpm_multi_prefix.rst @@ -0,0 +1,11 @@ +rpm_multi_prefix +---------------- + +* The :module:`CPackRPM` module learned a new + :variable:`CPACK_RPM__PACKAGE_PREFIX` variable to + specify a component-specific value to use instead of + :variable:`CPACK_PACKAGING_INSTALL_PREFIX`. + +* The :module:`CPackRPM` module learned a new + :variable:`CPACK_RPM_RELOCATION_PATHS` variable to + specify multiple relocation prefixes for a single rpm package. diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index d2cb2ee..43e3fe0 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -379,6 +379,34 @@ # # May be used to add more exclude path (directories or files) from the initial # default list of excluded paths. See CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST. +# +# .. variable:: CPACK_RPM_RELOCATION_PATHS +# +# * Mandatory : NO +# * Default : - +# +# May be used to specify more than one relocation path per relocatable RPM. +# Variable contains a list of relocation paths that if relative are prefixed +# by the value of CPACK_RPM__PACKAGE_PREFIX or by the value of +# CPACK_PACKAGING_INSTALL_PREFIX if the component version is not provided. +# Variable is not component based as its content can be used to set a different +# path prefix for e.g. binary dir and documentation dir at the same time. +# Only prefixes that are required by a certain component are added to that +# component - component must contain at least one file/directory/symbolic link +# with CPACK_RPM_RELOCATION_PATHS prefix for a certain relocation path +# to be added. Package will not contain any relocation paths if there are no +# files/directories/symbolic links on any of the provided prefix locations. +# Packages that either do not contain any relocation paths or contain +# files/directories/symbolic links that are outside relocation paths print +# out an AUTHOR_WARNING that RPM will be partially relocatable. +# +# .. variable:: CPACK_RPM__PACKAGE_PREFIX +# +# * Mandatory : NO +# * Default : CPACK_PACKAGING_INSTALL_PREFIX +# +# May be used to set per component CPACK_PACKAGING_INSTALL_PREFIX for +# relocatable RPM packages. #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -395,6 +423,62 @@ # Author: Eric Noulard with the help of Alexander Neundorf. +function(cpack_rpm_prepare_relocation_paths) + # set appropriate prefix, remove possible trailing slash and convert backslashes to slashes + if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX) + file(TO_CMAKE_PATH "${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_PREFIX}" PATH_PREFIX) + else() + file(TO_CMAKE_PATH "${CPACK_PACKAGING_INSTALL_PREFIX}" PATH_PREFIX) + endif() + + set(RPM_RELOCATION_PATHS "${CPACK_RPM_RELOCATION_PATHS}") + list(REMOVE_DUPLICATES RPM_RELOCATION_PATHS) + + # set base path prefix + if(EXISTS "${WDIR}/${PATH_PREFIX}") + set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}Prefix: ${PATH_PREFIX}\n") + list(APPEND RPM_USED_PACKAGE_PREFIXES "${PATH_PREFIX}") + endif() + + # set other path prefixes + foreach(RELOCATION_PATH ${RPM_RELOCATION_PATHS}) + if(IS_ABSOLUTE "${RELOCATE_PATH}") + set(PREPARED_RELOCATION_PATH "${RELOCATION_PATH}") + else() + set(PREPARED_RELOCATION_PATH "${PATH_PREFIX}/${RELOCATION_PATH}") + endif() + + if(EXISTS "${WDIR}/${PREPARED_RELOCATION_PATH}") + set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}Prefix: ${PREPARED_RELOCATION_PATH}\n") + list(APPEND RPM_USED_PACKAGE_PREFIXES "${PREPARED_RELOCATION_PATH}") + endif() + endforeach() + + # warn about all the paths that are not relocatable + file(GLOB_RECURSE FILE_PATHS_ "${WDIR}/*") + foreach(TMP_PATH ${FILE_PATHS_}) + string(LENGTH "${WDIR}" WDIR_LEN) + string(SUBSTRING "${TMP_PATH}" ${WDIR_LEN} -1 TMP_PATH) + unset(TMP_PATH_FOUND_) + + foreach(RELOCATION_PATH ${RPM_USED_PACKAGE_PREFIXES}) + file(RELATIVE_PATH REL_PATH_ "${RELOCATION_PATH}" "${TMP_PATH}") + string(SUBSTRING "${REL_PATH_}" 0 2 PREFIX_) + + if(NOT "${PREFIX_}" STREQUAL "..") + set(TPM_PATH_FOUND_ TRUE) + break() + endif() + endforeach() + + if(NOT TPM_PATH_FOUND_) + message(AUTHOR_WARNING "CPackRPM:Warning: Path ${TMP_PATH} is not on one of the relocatable paths! Package will be partially relocatable.") + endif() + endforeach() + + set(TMP_RPM_PREFIXES "${TMP_RPM_PREFIXES}" PARENT_SCOPE) +endfunction() + if(CMAKE_BINARY_DIR) message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.") endif() @@ -636,13 +720,16 @@ if(CPACK_PACKAGE_RELOCATABLE) set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE) endif() if(CPACK_RPM_PACKAGE_RELOCATABLE) + unset(TMP_RPM_PREFIXES) + if(CPACK_RPM_PACKAGE_DEBUG) message("CPackRPM:Debug: Trying to build a relocatable package") endif() if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.") else() - set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) + set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) # kept for back compatibility (provided external RPM spec files) + cpack_rpm_prepare_relocation_paths() endif() endif() @@ -856,15 +943,21 @@ if(CPACK_RPM_PACKAGE_RELOCATABLE) # get a list of the elements in CPACK_RPM_PACKAGE_PREFIX and remove # the final element (so the install-prefix dir itself is not omitted # from the RPM's content-list) - string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${CPACK_RPM_PACKAGE_PREFIX}") - list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1) - # Now generate all of the parent dirs of CPACK_RPM_PACKAGE_PREFIX - foreach(_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS}) - list(APPEND _TMP_LIST "${_ELEM}") - string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}") - set(_OMIT_DIR "-o -path ${_OMIT_DIR}") - separate_arguments(_OMIT_DIR) - list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR}) + foreach(CPACK_RPM_PACKAGE_PREFIX ${RPM_PACKAGE_PREFIXES}) + string(REPLACE "/" ";" _CPACK_RPM_PACKAGE_PREFIX_ELEMS ".${CPACK_RPM_PACKAGE_PREFIX}") + list(REMOVE_AT _CPACK_RPM_PACKAGE_PREFIX_ELEMS -1) + unset(_TMP_LIST) + # Now generate all of the parent dirs of CPACK_RPM_PACKAGE_PREFIX + foreach(_ELEM ${_CPACK_RPM_PACKAGE_PREFIX_ELEMS}) + list(APPEND _TMP_LIST "${_ELEM}") + string(REPLACE ";" "/" _OMIT_DIR "${_TMP_LIST}") + list(FIND _RPM_DIRS_TO_OMIT "${_OMIT_DIR}" _DUPLICATE_FOUND) + if(_DUPLICATE_FOUND EQUAL -1) + set(_OMIT_DIR "-o -path ${_OMIT_DIR}") + separate_arguments(_OMIT_DIR) + list(APPEND _RPM_DIRS_TO_OMIT ${_OMIT_DIR}) + endif() + endforeach() endforeach() endif() @@ -1101,7 +1194,7 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@ \@TMP_RPM_AUTOREQ\@ \@TMP_RPM_AUTOREQPROV\@ \@TMP_RPM_BUILDARCH\@ -\@TMP_RPM_PREFIX\@ +\@TMP_RPM_PREFIXES\@ %define _rpmdir \@CPACK_RPM_DIRECTORY\@ %define _rpmfilename \@CPACK_RPM_FILE_NAME\@ diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt index ff40e30..b55594e 100644 --- a/Tests/CPackComponentsForAll/CMakeLists.txt +++ b/Tests/CPackComponentsForAll/CMakeLists.txt @@ -110,6 +110,12 @@ set(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Developer Full) set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) set(CPACK_COMPONENT_APPLICATIONS_INSTALL_TYPES Full) +# set CPACK_RPM_RELOCATION_PATHS here as GNUInstallDirs script +# can not be used in CPack scripts due to CMAKE_SIZEOF_VOID_P +# variable not being set +set(CPACK_RPM_RELOCATION_PATHS "${CMAKE_INSTALL_INCLUDEDIR}" + "${CMAKE_INSTALL_LIBDIR}" "${CMAKE_INSTALL_BINDIR}") + # We may use the CPack specific config file in order # to tailor CPack behavior on a CPack generator specific way # (Behavior would be different for RPM or TGZ or DEB ...) diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in index 8c01b32..de0ee46 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -6,15 +6,17 @@ if(CPACK_GENERATOR MATCHES "ZIP") endif() if(CPACK_GENERATOR MATCHES "RPM") - set(CPACK_RPM_COMPONENT_INSTALL "ON") - set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") + set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") - # test package summary override - set(CPACK_RPM_PACKAGE_SUMMARY "default summary") - set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") + set(CPACK_RPM_COMPONENT_INSTALL "ON") + set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") - # test package description override - set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") + # test package summary override + set(CPACK_RPM_PACKAGE_SUMMARY "default summary") + set(CPACK_RPM_libraries_PACKAGE_SUMMARY "libraries summary") + + # test package description override + set(CPACK_RPM_libraries_PACKAGE_DESCRIPTION "libraries description") endif() if(CPACK_GENERATOR MATCHES "DEB") diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 4d56218..68d846f 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -140,6 +140,12 @@ if(CPackGen MATCHES "RPM") "C/C\\+\\+ header files for use with MyLib") if(${CPackComponentWay} STREQUAL "IgnoreGroup") + # set gnu install prefixes to what they are set during rpm creation + # CMAKE_SIZEOF_VOID_P is not set here but lib is prefix of lib64 so + # relocation path test won't fail on OSes with lib64 library location + include(GNUInstallDirs) + set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") + foreach(check_file ${expected_file}) string(REGEX MATCH ".*libraries.*" check_file_libraries_match ${check_file}) string(REGEX MATCH ".*headers.*" check_file_headers_match ${check_file}) @@ -154,15 +160,23 @@ if(CPackGen MATCHES "RPM") if(check_file_libraries_match) set(check_file_match_expected_summary ".*${CPACK_RPM_libraries_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_RPM_libraries_PACKAGE_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + set(spec_regex "*libraries*") elseif(check_file_headers_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_HEADERS_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") + set(spec_regex "*headers*") elseif(check_file_applications_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*${CPACK_COMPONENT_APPLICATIONS_DESCRIPTION}.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(spec_regex "*applications*") elseif(check_file_Unspecified_match) set(check_file_match_expected_summary ".*${CPACK_RPM_PACKAGE_SUMMARY}.*") set(check_file_match_expected_description ".*DESCRIPTION.*") + set(check_file_match_expected_relocation_path "Relocations : ${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}") + set(spec_regex "*Unspecified*") else() message(FATAL_ERROR "error: unexpected rpm package '${check_file}'") endif() @@ -170,13 +184,25 @@ if(CPackGen MATCHES "RPM") string(REGEX MATCH ${check_file_match_expected_summary} check_file_match_summary ${check_file_content}) if(NOT check_file_match_summary) - message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'") + message(FATAL_ERROR "error: '${check_file}' rpm package summary does not match expected value - regex '${check_file_match_expected_summary}'; RPM output: '${check_file_content}'") endif() string(REGEX MATCH ${check_file_match_expected_description} check_file_match_description ${check_file_content}) if(NOT check_file_match_description) - message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'") + message(FATAL_ERROR "error: '${check_file}' rpm package description does not match expected value - regex '${check_file_match_expected_description}'; RPM output: '${check_file_content}'") + endif() + + string(REGEX MATCH ${check_file_match_expected_relocation_path} check_file_match_relocation_path ${check_file_content}) + + if(NOT check_file_match_relocation_path) + file(GLOB_RECURSE spec_file "${CPackComponentsForAll_BINARY_DIR}/${spec_regex}.spec") + + if(spec_file) + file(READ ${spec_file} spec_file_content) + endif() + + message(FATAL_ERROR "error: '${check_file}' rpm package relocation path does not match expected value - regex '${check_file_match_expected_relocation_path}'; RPM output: '${check_file_content}'; generated spec file: '${spec_file_content}'") endif() endforeach() elseif(${CPackComponentWay} STREQUAL "IgnoreGroup") diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index b5e41d9..15a24de 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -173,3 +173,7 @@ add_RunCMake_test(CommandLine) add_RunCMake_test(install) add_RunCMake_test(CPackInstallProperties) add_RunCMake_test(ExternalProject) + +if(RPMBUILD) + add_RunCMake_test(CPackRPM) +endif() diff --git a/Tests/RunCMake/CPackRPM/CMakeLists.txt b/Tests/RunCMake/CPackRPM/CMakeLists.txt new file mode 100644 index 0000000..b7d170b --- /dev/null +++ b/Tests/RunCMake/CPackRPM/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) + +set(CPACK_GENERATOR "RPM") +include(CPack) diff --git a/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt new file mode 100644 index 0000000..3b63d5b --- /dev/null +++ b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING-stderr.txt @@ -0,0 +1 @@ +CPackRPM:Warning: Path /not_relocatable/CMakeLists.txt is not on one of the.*relocatable paths! Package will be partially relocatable. diff --git a/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake new file mode 100644 index 0000000..3ace6a8 --- /dev/null +++ b/Tests/RunCMake/CPackRPM/CPackRPM_PARTIALLY_RELOCATABLE_WARNING.cmake @@ -0,0 +1,7 @@ +install(FILES CMakeLists.txt DESTINATION /not_relocatable COMPONENT static) +install(FILES CMakeLists.txt DESTINATION relocatable COMPONENT relocatable) + +set(CPACK_PACKAGE_RELOCATABLE TRUE) +set(CPACK_PACKAGING_INSTALL_PREFIX "/opt") + +set(CPACK_RPM_COMPONENT_INSTALL ON) diff --git a/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake b/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake new file mode 100644 index 0000000..1935e32 --- /dev/null +++ b/Tests/RunCMake/CPackRPM/RunCMakeTest.cmake @@ -0,0 +1,17 @@ +include(RunCMake) + +function(run_cpack_rpm_test TEST_NAME) + set(RunCMake_TEST_NO_CLEAN TRUE) + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${TEST_NAME}-build") + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + execute_process( + COMMAND "${CMAKE_COMMAND}" -D RunCMake_TEST=${TEST_NAME} "${RunCMake_SOURCE_DIR}" + WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}" + OUTPUT_QUIET + ERROR_QUIET + ) + run_cmake_command(${TEST_NAME} ${CMAKE_CPACK_COMMAND}) +endfunction() + +run_cpack_rpm_test(CPackRPM_PARTIALLY_RELOCATABLE_WARNING) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 11:40:24 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 11:40:24 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2466-gfcfce76 Message-ID: <20150129164024.76B4714E5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via fcfce76d09ba7d5337ed8e198b9998d7d2f6f5fc (commit) via 2596f95e7338ab22695fed24c26157de5ad76f2d (commit) from 8157b25c9bc92c415f486bb6107d8592571a4954 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fcfce76d09ba7d5337ed8e198b9998d7d2f6f5fc commit fcfce76d09ba7d5337ed8e198b9998d7d2f6f5fc Merge: 8157b25 2596f95 Author: Brad King AuthorDate: Thu Jan 29 11:40:23 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 11:40:23 2015 -0500 Merge topic 'ninja-msvc-only-C-and-CXX' into next 2596f95e Ninja: Use "deps = msvc" only for C and CXX http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2596f95e7338ab22695fed24c26157de5ad76f2d commit 2596f95e7338ab22695fed24c26157de5ad76f2d Author: Brad King AuthorDate: Thu Jan 29 11:02:06 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 11:39:22 2015 -0500 Ninja: Use "deps = msvc" only for C and CXX The "/showIncludes" flag is only available with MS C and C++ compilers, and on compilers that "simulate" them (like Intel for Windows). Fix our logic to choose this type only for MS tools with these languages. All other cases need to use "deps = gcc" and define DEP_FILE in the build rule. Reported-by: Brian Smith diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index ff41f6d..cfd8937 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -200,21 +200,21 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source, return flags; } - -bool cmNinjaTargetGenerator::needsDepFile(const std::string& lang) +bool cmNinjaTargetGenerator::NeedDepTypeMSVC(const std::string& lang) const { - cmMakefile* mf = this->GetMakefile(); - - const bool usingMSVC = std::string("MSVC") == - (mf->GetDefinition("CMAKE_C_COMPILER_ID") ? - mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") : - mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID")); - - return !usingMSVC || lang == "RC"; + if (lang == "C" || lang == "CXX") + { + cmMakefile* mf = this->GetMakefile(); + return ( + strcmp(mf->GetSafeDefinition("CMAKE_C_COMPILER_ID"), "MSVC") == 0 || + strcmp(mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID"), "MSVC") == 0 || + strcmp(mf->GetSafeDefinition("CMAKE_C_SIMULATE_ID"), "MSVC") == 0 || + strcmp(mf->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID"), "MSVC") == 0 + ); + } + return false; } - - // TODO: Refactor with // void cmMakefileTargetGenerator::WriteTargetLanguageFlags(). std::string @@ -391,22 +391,22 @@ cmNinjaTargetGenerator cmMakefile* mf = this->GetMakefile(); - const std::string cId = mf->GetDefinition("CMAKE_C_COMPILER_ID") - ? mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") - : mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID"); - const std::string sId = mf->GetDefinition("CMAKE_C_SIMULATE_ID") - ? mf->GetSafeDefinition("CMAKE_C_SIMULATE_ID") - : mf->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID"); - const bool usingMSVC = (cId == "MSVC" || sId == "MSVC"); - // Tell ninja dependency format so all deps can be loaded into a database std::string deptype; std::string depfile; std::string cldeps; std::string flags = "$FLAGS"; - if (usingMSVC) + if (this->NeedDepTypeMSVC(lang)) { - if (!mf->GetIsSourceFileTryCompile() && lang == "RC") + deptype = "msvc"; + depfile = ""; + flags += " /showIncludes"; + } + else if (lang == "RC" && this->NeedDepTypeMSVC("C")) + { + // For the MS resource compiler we need cmcldeps, but skip dependencies + // for source-file try_compile cases because they are always fresh. + if (!mf->GetIsSourceFileTryCompile()) { deptype = "gcc"; depfile = "$DEP_FILE"; @@ -419,12 +419,6 @@ cmNinjaTargetGenerator cldeps += mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDES_PREFIX"); cldeps += "\" \"" + cl + "\" "; } - else - { - deptype = "msvc"; - depfile = ""; - flags += " /showIncludes"; - } } else { @@ -636,7 +630,7 @@ cmNinjaTargetGenerator cmNinjaVars vars; vars["FLAGS"] = this->ComputeFlagsForObject(source, language); vars["DEFINES"] = this->ComputeDefines(source, language); - if (needsDepFile(language)) { + if (!this->NeedDepTypeMSVC(language)) { vars["DEP_FILE"] = cmGlobalNinjaGenerator::EncodeDepfileSpace(objectFileName + ".d"); } diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index 17cf517..5733fde 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -42,7 +42,7 @@ public: std::string GetTargetName() const; - bool needsDepFile(const std::string& lang); + bool NeedDepTypeMSVC(const std::string& lang) const; protected: ----------------------------------------------------------------------- Summary of changes: Source/cmNinjaTargetGenerator.cxx | 52 ++++++++++++++++--------------------- Source/cmNinjaTargetGenerator.h | 2 +- 2 files changed, 24 insertions(+), 30 deletions(-) hooks/post-receive -- CMake From bill.hoffman at kitware.com Thu Jan 29 12:32:30 2015 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Thu, 29 Jan 2015 12:32:30 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2468-gd9a5a1f Message-ID: <20150129173230.5A578AA230@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d9a5a1f7e5bdb5960d153a00595a237e4f69e97b (commit) via 1e10b57a9c49cdace423970d14514b3462ce61f4 (commit) from fcfce76d09ba7d5337ed8e198b9998d7d2f6f5fc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9a5a1f7e5bdb5960d153a00595a237e4f69e97b commit d9a5a1f7e5bdb5960d153a00595a237e4f69e97b Merge: fcfce76 1e10b57 Author: Bill Hoffman AuthorDate: Thu Jan 29 12:32:29 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 12:32:29 2015 -0500 Merge topic 'fix-cpack-symlink-create-dir' into next 1e10b57a Fix bug where symlink could not be created because directory did not exist. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e10b57a9c49cdace423970d14514b3462ce61f4 commit 1e10b57a9c49cdace423970d14514b3462ce61f4 Author: Bill Hoffman AuthorDate: Thu Jan 29 11:52:30 2015 -0500 Commit: Bill Hoffman CommitDate: Thu Jan 29 11:52:30 2015 -0500 Fix bug where symlink could not be created because directory did not exist. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index f21fcf6..9d3d9fd 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -435,8 +435,16 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( ++symlinkedIt) { cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: " - << symlinkedIt->second << "--> " - << symlinkedIt->first << std::endl); + << symlinkedIt->second << "--> " + << symlinkedIt->first << std::endl); + // make sure directory exists for symlink + std::string destDir = + cmSystemTools::GetFilenamePath(symlinkedIt->second); + if(!cmSystemTools::MakeDirectory(destDir)) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create dir: " + << destDir << std::endl); + } if (!cmSystemTools::CreateSymlink(symlinkedIt->first, symlinkedIt->second)) { ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From bill.hoffman at kitware.com Thu Jan 29 14:34:12 2015 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Thu, 29 Jan 2015 14:34:12 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2470-g9eaeba8 Message-ID: <20150129193412.6909DAABA3@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 9eaeba8f0bcff213de7a42eebe1c9a46ffe78e65 (commit) via f3f323044344e250f9235ed820f3b28c5b2b3dde (commit) from d9a5a1f7e5bdb5960d153a00595a237e4f69e97b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9eaeba8f0bcff213de7a42eebe1c9a46ffe78e65 commit 9eaeba8f0bcff213de7a42eebe1c9a46ffe78e65 Merge: d9a5a1f f3f3230 Author: Bill Hoffman AuthorDate: Thu Jan 29 14:34:11 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 14:34:11 2015 -0500 Merge topic 'fix-cpack-symlink-create-dir' into next f3f32304 Put a check in to make sure there is a directory to create. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3f323044344e250f9235ed820f3b28c5b2b3dde commit f3f323044344e250f9235ed820f3b28c5b2b3dde Author: Bill Hoffman AuthorDate: Thu Jan 29 14:22:43 2015 -0500 Commit: Bill Hoffman CommitDate: Thu Jan 29 14:22:43 2015 -0500 Put a check in to make sure there is a directory to create. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 9d3d9fd..9e33d23 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -440,10 +440,14 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( // make sure directory exists for symlink std::string destDir = cmSystemTools::GetFilenamePath(symlinkedIt->second); - if(!cmSystemTools::MakeDirectory(destDir)) + if(!destDir.empty() && !cmSystemTools::MakeDirectory(destDir)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create dir: " - << destDir << std::endl); + << destDir + << "\nTrying to create symlink: " + << symlinkedIt->second << "--> " + << symlinkedIt->first + << std::endl); } if (!cmSystemTools::CreateSymlink(symlinkedIt->first, symlinkedIt->second)) ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 14:56:34 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 14:56:34 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2473-g8a0fca5 Message-ID: <20150129195634.9A0C3AA174@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 8a0fca5f026b7c0a42564cc666a182784890b807 (commit) via 500794b0db3d7dfa121069f336b69923839bada1 (commit) via 4c5574a15d6458673c410622e501ba682a783781 (commit) from 9eaeba8f0bcff213de7a42eebe1c9a46ffe78e65 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a0fca5f026b7c0a42564cc666a182784890b807 commit 8a0fca5f026b7c0a42564cc666a182784890b807 Merge: 9eaeba8 500794b Author: Brad King AuthorDate: Thu Jan 29 14:56:33 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 14:56:33 2015 -0500 Merge topic 'vs-windows-store-default-language' into next 500794b0 VS: Set default language in generated Windows Phone and Store projects 4c5574a1 VS: Add missing newlines to .vcxproj generation http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=500794b0db3d7dfa121069f336b69923839bada1 commit 500794b0db3d7dfa121069f336b69923839bada1 Author: Robert Goulet AuthorDate: Thu Jan 29 13:38:52 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 14:30:29 2015 -0500 VS: Set default language in generated Windows Phone and Store projects Otherwise building such projects gives: warning APPX1901: The DefaultLanguage property is either missing from the project file or does not have a value diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index d6b87b8..a286049 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2762,6 +2762,8 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() this->WriteString("", 2); (*this->BuildFileStream) << cmVS10EscapeXML(v) << "\n"; + this->WriteString("en-US" + "\n", 2); if(v == "8.1") { // Visual Studio 12.0 is necessary for building 8.1 apps http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c5574a15d6458673c410622e501ba682a783781 commit 4c5574a15d6458673c410622e501ba682a783781 Author: Robert Goulet AuthorDate: Thu Jan 29 13:38:46 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 14:29:01 2015 -0500 VS: Add missing newlines to .vcxproj generation diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index d2f6ffd..d6b87b8 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2796,12 +2796,12 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() if(isAppContainer) { this->WriteString("true" - "", 2); + "\n", 2); } else if (this->Platform == "ARM") { this->WriteString("true" - "", 2); + "\n", 2); } } ----------------------------------------------------------------------- Summary of changes: Source/cmVisualStudio10TargetGenerator.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 15:05:32 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 15:05:32 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2476-gd283f43 Message-ID: <20150129200532.4C04AAA906@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d283f43620dc720d7fbac6095464f9b59c606911 (commit) via ddc640dc0c8be52607d79328ce68d13aa2625ecc (commit) via 3228fc5049e72e6d7584a6f3cec6055b8a726817 (commit) from 8a0fca5f026b7c0a42564cc666a182784890b807 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d283f43620dc720d7fbac6095464f9b59c606911 commit d283f43620dc720d7fbac6095464f9b59c606911 Merge: 8a0fca5 ddc640d Author: Brad King AuthorDate: Thu Jan 29 15:05:31 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 15:05:31 2015 -0500 Merge topic 'feature-record-msvc' into next ddc640dc Features: Record for MSVC 2010-2015 3228fc50 Features: Define meaning for no language standard default http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ddc640dc0c8be52607d79328ce68d13aa2625ecc commit ddc640dc0c8be52607d79328ce68d13aa2625ecc Author: Robert Maynard AuthorDate: Mon Jan 19 15:49:06 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 15:01:43 2015 -0500 Features: Record for MSVC 2010-2015 Also, in WCDH add MSVC Compatibility for cxx_align{of,as}. Co-Author: Stephen Kelly Co-Author: Brad King diff --git a/Help/release/dev/feature-record-msvc.rst b/Help/release/dev/feature-record-msvc.rst new file mode 100644 index 0000000..a8c9fd1 --- /dev/null +++ b/Help/release/dev/feature-record-msvc.rst @@ -0,0 +1,5 @@ +feature-record-msvc +------------------- + +* The :manual:`Compile Features ` functionality + is now aware of features supported by Microsoft Visual Studio (``MSVC``). diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..d69a7ef --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,102 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +# In theory decltype incomplete return types was added in 2012 +# but without support for decltype_auto and return type deduction this +# feature is unusable +set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2015}") +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported this +# they silently produced bad code, and are now marked as having partial +# support in previous versions. The footnote says the support will be complete +# in MSVC 2015, so support the feature for that version, assuming that is true. +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +# Microsoft now states they support contextual conversions in 2013 and above. +# See footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Support is documented, but possibly partly broken: +# https://msdn.microsoft.com/en-us/library/hh567368.aspx +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx + +# set(_cmake_feature_test_cxx_reference_qualified_functions ) +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# set(_cmake_feature_test_cxx_defaulted_move_initializers ) +# set(_cmake_feature_test_cxx_nonstatic_member_init ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_variable_templates ) + + +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake new file mode 100644 index 0000000..962aaeb --- /dev/null +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -0,0 +1,6 @@ +# MSVC has no specific language level or flags to change it. +set(CMAKE_CXX_STANDARD_DEFAULT "") + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index e81bc08..d18f47c 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC SunPro ) @@ -528,6 +529,8 @@ function(write_compiler_detection_header # define ${def_value} alignas(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __attribute__ ((__aligned__(X))) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __declspec(align(X)) # else # define ${def_value} # endif @@ -540,6 +543,8 @@ function(write_compiler_detection_header # define ${def_value} alignof(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __alignof__(X) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __alignof(X) # endif \n") endif() diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9ef8049..bb0dc0d 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -99,6 +99,15 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" cxx_return_type_deduction ) endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) + list(REMOVE_ITEM CXX_non_features + # The cxx_contextual_conversions feature happens to work + # (for *this* testcase) with VS 2010 and VS 2012, but + # they do not document support until VS 2013. + cxx_contextual_conversions + ) +endif() set(C_ext c) set(C_standard_flag 11) @@ -220,6 +229,29 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=0 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=0 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") add_definitions( -DEXPECT_OVERRIDE_CONTROL=1 diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 78c4a6a..e70a977 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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -67,6 +67,17 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) + else() + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) + endif() +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -84,7 +95,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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3228fc5049e72e6d7584a6f3cec6055b8a726817 commit 3228fc5049e72e6d7584a6f3cec6055b8a726817 Author: Brad King AuthorDate: Mon Jan 26 16:42:36 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 15:01:40 2015 -0500 Features: Define meaning for no language standard default Define an empty string in CMAKE__STANDARD_DEFAULT to mean that the toolchain has no notion of lanuage standard levels. In this case the _STANDARD[_REQUIRED] properties will have no effect. Update the RunCMake.CompileFeatures test to exclude the LinkImplementationFeatureCycle test when there is no standard default. It can never fail because no use of specific features will adjust the CXX_STANDARD level required for any target since the standard levels have no meaning in this case. diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index 65b3a72..e18250c 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -80,7 +80,9 @@ When adding the first supported feature to a particular CompilerId, it is necessary to list support for all features known to cmake (See :variable:`CMAKE_C_COMPILE_FEATURES` and :variable:`CMAKE_CXX_COMPILE_FEATURES` as appropriate), where available for -the compiler. +the compiler. Furthermore, set ``CMAKE__STANDARD_DEFAULT`` to the +default language standard level the compiler uses, or to the empty string +if the compiler has no notion of standard levels (such as ``MSVC``). It is sensible to record the features for the most recent version of a particular CompilerId first, and then work backwards. It is sensible to diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst index 6329e34..65b30ec 100644 --- a/Help/prop_tgt/CXX_STANDARD.rst +++ b/Help/prop_tgt/CXX_STANDARD.rst @@ -5,7 +5,8 @@ The C++ standard whose features are requested to build this target. This property specifies the C++ standard whose features are requested to build this target. For some compilers, this results in adding a -flag such as ``-std=gnu++11`` to the compile line. +flag such as ``-std=gnu++11`` to the compile line. For compilers that +have no notion of a standard level, such as MSVC, this has no effect. Supported values are ``98``, ``11`` and ``14``. diff --git a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst index ac103a4..4e24e5e 100644 --- a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst @@ -7,7 +7,8 @@ If this property is set to ``ON``, then the value of the :prop_tgt:`CXX_STANDARD` target property is treated as a requirement. If this property is ``OFF`` or unset, the :prop_tgt:`CXX_STANDARD` target property is treated as optional and may "decay" to a previous standard if the requested is -not available. +not available. For compilers that have no notion of a standard level, such as +MSVC, this has no effect. See the :manual:`cmake-compile-features(7)` manual for information on compile features. diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst index 88ca926..3aa74af 100644 --- a/Help/prop_tgt/C_STANDARD.rst +++ b/Help/prop_tgt/C_STANDARD.rst @@ -5,7 +5,8 @@ The C standard whose features are requested to build this target. This property specifies the C standard whose features are requested to build this target. For some compilers, this results in adding a -flag such as ``-std=gnu11`` to the compile line. +flag such as ``-std=gnu11`` to the compile line. For compilers that +have no notion of a standard level, such as MSVC, this has no effect. Supported values are ``90``, ``99`` and ``11``. diff --git a/Help/prop_tgt/C_STANDARD_REQUIRED.rst b/Help/prop_tgt/C_STANDARD_REQUIRED.rst index a7304f4..743d568 100644 --- a/Help/prop_tgt/C_STANDARD_REQUIRED.rst +++ b/Help/prop_tgt/C_STANDARD_REQUIRED.rst @@ -7,7 +7,8 @@ If this property is set to ``ON``, then the value of the :prop_tgt:`C_STANDARD` target property is treated as a requirement. If this property is ``OFF`` or unset, the :prop_tgt:`C_STANDARD` target property is treated as optional and may "decay" to a previous standard if the requested is -not available. +not available. For compilers that have no notion of a standard level, such as +MSVC, this has no effect. See the :manual:`cmake-compile-features(7)` manual for information on compile features. diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 5f246f9..6692a92 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -1370,6 +1370,8 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode { std::vector const& langAvailable = availableFeatures[lit->first]; + const char* standardDefault = context->Makefile + ->GetDefinition("CMAKE_" + lit->first + "_STANDARD_DEFAULT"); for (std::vector::const_iterator it = lit->second.begin(); it != lit->second.end(); ++it) { @@ -1378,6 +1380,12 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode { return "0"; } + if (standardDefault && !*standardDefault) + { + // This compiler has no notion of language standard levels. + // All features known for the language are always available. + continue; + } if (!context->Makefile->HaveStandardAvailable(target, lit->first, *it)) { @@ -1386,8 +1394,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode const char* l = target->GetProperty(lit->first + "_STANDARD"); if (!l) { - l = context->Makefile - ->GetDefinition("CMAKE_" + lit->first + "_STANDARD_DEFAULT"); + l = standardDefault; } assert(l); context->MaxLanguageStandard[target][lit->first] = l; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 834f705..af4c950 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2207,6 +2207,13 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, { return; } + const char* defaultStd + = this->Makefile->GetDefinition("CMAKE_" + lang + "_STANDARD_DEFAULT"); + if (defaultStd && !*defaultStd) + { + // This compiler has no notion of language standard levels. + return; + } std::string stdProp = lang + "_STANDARD"; const char *standardProp = target->GetProperty(stdProp); if (!standardProp) @@ -2269,8 +2276,6 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target, std::find(stds.begin(), stds.end(), standard); assert(stdIt != stds.end()); - const char* defaultStd - = this->Makefile->GetDefinition("CMAKE_" + lang + "_STANDARD_DEFAULT"); std::vector::const_iterator defaultStdIt; if (defaultStd) { diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 87e62d7..ba914e1 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -5253,6 +5253,27 @@ bool cmMakefile:: HaveCStandardAvailable(cmTarget const* target, const std::string& feature) const { + const char* defaultCStandard = + this->GetDefinition("CMAKE_C_STANDARD_DEFAULT"); + if (!defaultCStandard) + { + std::ostringstream e; + e << "CMAKE_C_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " + "not fully configured for this compiler."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + // Return true so the caller does not try to lookup the default standard. + return true; + } + if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), + cmStrCmp(defaultCStandard)) == cmArrayEnd(C_STANDARDS)) + { + std::ostringstream e; + e << "The CMAKE_C_STANDARD_DEFAULT variable contains an " + "invalid value: \"" << defaultCStandard << "\"."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + return false; + } + bool needC90 = false; bool needC99 = false; bool needC11 = false; @@ -5262,7 +5283,7 @@ HaveCStandardAvailable(cmTarget const* target, const char *existingCStandard = target->GetProperty("C_STANDARD"); if (!existingCStandard) { - existingCStandard = this->GetDefinition("CMAKE_C_STANDARD_DEFAULT"); + existingCStandard = defaultCStandard; } if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), @@ -5331,6 +5352,27 @@ bool cmMakefile::IsLaterStandard(std::string const& lang, bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const std::string& feature) const { + const char* defaultCxxStandard = + this->GetDefinition("CMAKE_CXX_STANDARD_DEFAULT"); + if (!defaultCxxStandard) + { + std::ostringstream e; + e << "CMAKE_CXX_STANDARD_DEFAULT is not set. COMPILE_FEATURES support " + "not fully configured for this compiler."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + // Return true so the caller does not try to lookup the default standard. + return true; + } + if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), + cmStrCmp(defaultCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) + { + std::ostringstream e; + e << "The CMAKE_CXX_STANDARD_DEFAULT variable contains an " + "invalid value: \"" << defaultCxxStandard << "\"."; + this->IssueMessage(cmake::INTERNAL_ERROR, e.str()); + return false; + } + bool needCxx98 = false; bool needCxx11 = false; bool needCxx14 = false; @@ -5339,7 +5381,7 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, const char *existingCxxStandard = target->GetProperty("CXX_STANDARD"); if (!existingCxxStandard) { - existingCxxStandard = this->GetDefinition("CMAKE_CXX_STANDARD_DEFAULT"); + existingCxxStandard = defaultCxxStandard; } if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index aacf4c1..9ef8049 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -128,26 +128,30 @@ foreach(lang CXX C) endforeach() if (CMAKE_C_COMPILE_FEATURES) - string(FIND "${CMAKE_C_FLAGS}" "-std=" std_flag_idx) - if (std_flag_idx EQUAL -1) - add_executable(default_dialect_C default_dialect.c) - target_compile_definitions(default_dialect_C PRIVATE - DEFAULT_C11=$ - DEFAULT_C99=$ - DEFAULT_C90=$ - ) + if (CMAKE_C_STANDARD_DEFAULT) + string(FIND "${CMAKE_C_FLAGS}" "-std=" std_flag_idx) + if (std_flag_idx EQUAL -1) + add_executable(default_dialect_C default_dialect.c) + target_compile_definitions(default_dialect_C PRIVATE + DEFAULT_C11=$ + DEFAULT_C99=$ + DEFAULT_C90=$ + ) + endif() endif() endif() if (CMAKE_CXX_COMPILE_FEATURES) - string(FIND "${CMAKE_CXX_FLAGS}" "-std=" std_flag_idx) - if (std_flag_idx EQUAL -1) - add_executable(default_dialect default_dialect.cpp) - target_compile_definitions(default_dialect PRIVATE - DEFAULT_CXX14=$ - DEFAULT_CXX11=$ - DEFAULT_CXX98=$ - ) + if (CMAKE_CXX_STANDARD_DEFAULT) + string(FIND "${CMAKE_CXX_FLAGS}" "-std=" std_flag_idx) + if (std_flag_idx EQUAL -1) + add_executable(default_dialect default_dialect.cpp) + target_compile_definitions(default_dialect PRIVATE + DEFAULT_CXX14=$ + DEFAULT_CXX11=$ + DEFAULT_CXX98=$ + ) + endif() endif() add_executable(CompileFeatures main.cpp) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 376f75a..833a315 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -17,6 +17,8 @@ file(READ "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx_features.txt" CXX_FEATURES ) +include("${RunCMake_BINARY_DIR}/generate_feature_list-build/c_standard_default.cmake") +include("${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx_standard_default.cmake") if (NOT C_FEATURES) run_cmake(NoSupportedCFeatures) @@ -27,7 +29,9 @@ if (NOT CXX_FEATURES) run_cmake(NoSupportedCxxFeatures) run_cmake(NoSupportedCxxFeaturesGenex) else() - run_cmake(LinkImplementationFeatureCycle) + if(CXX_STANDARD_DEFAULT) + run_cmake(LinkImplementationFeatureCycle) + endif() run_cmake(LinkImplementationFeatureCycleSolved) if (";${CXX_FEATURES};" MATCHES ";cxx_final;") @@ -38,17 +42,19 @@ else() unset(RunCMake_TEST_OPTIONS) endif() -foreach(standard 98 11) - file(READ - "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx${standard}_flag.txt" - CXX${standard}_FLAG - ) - if (CXX${standard}_FLAG STREQUAL NOTFOUND) - run_cmake(RequireCXX${standard}) - run_cmake(RequireCXX${standard}Variable) - endif() - if (CXX${standard}EXT_FLAG STREQUAL NOTFOUND) - run_cmake(RequireCXX${standard}Ext) - run_cmake(RequireCXX${standard}ExtVariable) - endif() -endforeach() +if(CXX_STANDARD_DEFAULT) + foreach(standard 98 11) + file(READ + "${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx${standard}_flag.txt" + CXX${standard}_FLAG + ) + if (CXX${standard}_FLAG STREQUAL NOTFOUND) + run_cmake(RequireCXX${standard}) + run_cmake(RequireCXX${standard}Variable) + endif() + if (CXX${standard}EXT_FLAG STREQUAL NOTFOUND) + run_cmake(RequireCXX${standard}Ext) + run_cmake(RequireCXX${standard}ExtVariable) + endif() + endforeach() +endif() diff --git a/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake index 09e17b1..5c58052 100644 --- a/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake +++ b/Tests/RunCMake/CompileFeatures/generate_feature_list.cmake @@ -9,6 +9,20 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_features.txt" "${CMAKE_CXX_COMPILE_FEATURES}" ) +if(DEFINED CMAKE_C_STANDARD_DEFAULT) + set(c_standard_default_code "set(C_STANDARD_DEFAULT \"${CMAKE_C_STANDARD_DEFAULT}\")\n") +else() + set(c_standard_default_code "unset(C_STANDARD_DEFAULT)\n") +endif() +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/c_standard_default.cmake" "${c_standard_default_code}") + +if(DEFINED CMAKE_CXX_STANDARD_DEFAULT) + set(cxx_standard_default_code "set(CXX_STANDARD_DEFAULT \"${CMAKE_CXX_STANDARD_DEFAULT}\")\n") +else() + set(cxx_standard_default_code "unset(CXX_STANDARD_DEFAULT)\n") +endif() +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cxx_standard_default.cmake" "${cxx_standard_default_code}") + foreach(standard 98 11) set(CXX${standard}_FLAG NOTFOUND) if (DEFINED CMAKE_CXX${standard}_STANDARD_COMPILE_OPTION) ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 15:36:50 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 15:36:50 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2478-g35165bd Message-ID: <20150129203650.E86BEAAA33@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 35165bdcdac5a6450b8123a9eaf925f94ad90448 (commit) via 8a93d3ea1806229460f16c447b3d5ebcc80ed29c (commit) from d283f43620dc720d7fbac6095464f9b59c606911 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=35165bdcdac5a6450b8123a9eaf925f94ad90448 commit 35165bdcdac5a6450b8123a9eaf925f94ad90448 Merge: d283f43 8a93d3e Author: Brad King AuthorDate: Thu Jan 29 15:36:50 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 15:36:50 2015 -0500 Merge topic 'ninja-msvc-only-C-and-CXX' into next 8a93d3ea Ninja: Use "deps = msvc" only for C and CXX (#15253) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8a93d3ea1806229460f16c447b3d5ebcc80ed29c commit 8a93d3ea1806229460f16c447b3d5ebcc80ed29c Author: Brad King AuthorDate: Thu Jan 29 11:02:06 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 15:34:24 2015 -0500 Ninja: Use "deps = msvc" only for C and CXX (#15253) The "/showIncludes" flag is only available with MS C and C++ compilers, and on compilers that "simulate" them (like Intel for Windows). Fix our logic to choose this type only for MS tools with these languages. All other cases need to use "deps = gcc" and define DEP_FILE in the build rule. diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index ff41f6d..cfd8937 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -200,21 +200,21 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source, return flags; } - -bool cmNinjaTargetGenerator::needsDepFile(const std::string& lang) +bool cmNinjaTargetGenerator::NeedDepTypeMSVC(const std::string& lang) const { - cmMakefile* mf = this->GetMakefile(); - - const bool usingMSVC = std::string("MSVC") == - (mf->GetDefinition("CMAKE_C_COMPILER_ID") ? - mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") : - mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID")); - - return !usingMSVC || lang == "RC"; + if (lang == "C" || lang == "CXX") + { + cmMakefile* mf = this->GetMakefile(); + return ( + strcmp(mf->GetSafeDefinition("CMAKE_C_COMPILER_ID"), "MSVC") == 0 || + strcmp(mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID"), "MSVC") == 0 || + strcmp(mf->GetSafeDefinition("CMAKE_C_SIMULATE_ID"), "MSVC") == 0 || + strcmp(mf->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID"), "MSVC") == 0 + ); + } + return false; } - - // TODO: Refactor with // void cmMakefileTargetGenerator::WriteTargetLanguageFlags(). std::string @@ -391,22 +391,22 @@ cmNinjaTargetGenerator cmMakefile* mf = this->GetMakefile(); - const std::string cId = mf->GetDefinition("CMAKE_C_COMPILER_ID") - ? mf->GetSafeDefinition("CMAKE_C_COMPILER_ID") - : mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID"); - const std::string sId = mf->GetDefinition("CMAKE_C_SIMULATE_ID") - ? mf->GetSafeDefinition("CMAKE_C_SIMULATE_ID") - : mf->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID"); - const bool usingMSVC = (cId == "MSVC" || sId == "MSVC"); - // Tell ninja dependency format so all deps can be loaded into a database std::string deptype; std::string depfile; std::string cldeps; std::string flags = "$FLAGS"; - if (usingMSVC) + if (this->NeedDepTypeMSVC(lang)) { - if (!mf->GetIsSourceFileTryCompile() && lang == "RC") + deptype = "msvc"; + depfile = ""; + flags += " /showIncludes"; + } + else if (lang == "RC" && this->NeedDepTypeMSVC("C")) + { + // For the MS resource compiler we need cmcldeps, but skip dependencies + // for source-file try_compile cases because they are always fresh. + if (!mf->GetIsSourceFileTryCompile()) { deptype = "gcc"; depfile = "$DEP_FILE"; @@ -419,12 +419,6 @@ cmNinjaTargetGenerator cldeps += mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDES_PREFIX"); cldeps += "\" \"" + cl + "\" "; } - else - { - deptype = "msvc"; - depfile = ""; - flags += " /showIncludes"; - } } else { @@ -636,7 +630,7 @@ cmNinjaTargetGenerator cmNinjaVars vars; vars["FLAGS"] = this->ComputeFlagsForObject(source, language); vars["DEFINES"] = this->ComputeDefines(source, language); - if (needsDepFile(language)) { + if (!this->NeedDepTypeMSVC(language)) { vars["DEP_FILE"] = cmGlobalNinjaGenerator::EncodeDepfileSpace(objectFileName + ".d"); } diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index 17cf517..5733fde 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -42,7 +42,7 @@ public: std::string GetTargetName() const; - bool needsDepFile(const std::string& lang); + bool NeedDepTypeMSVC(const std::string& lang) const; protected: ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From bill.hoffman at kitware.com Thu Jan 29 15:40:42 2015 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Thu, 29 Jan 2015 15:40:42 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2482-gfaeef84 Message-ID: <20150129204042.C99F9D5E@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via faeef8432b3bcf7623846de2b1715de3b2acdb13 (commit) via 8037aa78c90c3a356a15efe102b1ee7cfcba3d34 (commit) via fc681b4a0e88f65a7875f70a287511f402f307a0 (commit) via eada43bb220f5f3953874606eb97ba33217091e4 (commit) from 35165bdcdac5a6450b8123a9eaf925f94ad90448 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=faeef8432b3bcf7623846de2b1715de3b2acdb13 commit faeef8432b3bcf7623846de2b1715de3b2acdb13 Merge: 35165bd 8037aa7 Author: Bill Hoffman AuthorDate: Thu Jan 29 15:40:41 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 15:40:41 2015 -0500 Merge topic 'clean_up_cdash_upload_files' into next 8037aa78 Only clean up curl once in the cmCTestCurl object. fc681b4a Call curl_easy_escape on arguments sent to CDash upload. eada43bb Use the --files-from option to tar to handle lots of files, also add a test. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8037aa78c90c3a356a15efe102b1ee7cfcba3d34 commit 8037aa78c90c3a356a15efe102b1ee7cfcba3d34 Author: Bill Hoffman AuthorDate: Thu Jan 29 15:39:42 2015 -0500 Commit: Bill Hoffman CommitDate: Thu Jan 29 15:39:42 2015 -0500 Only clean up curl once in the cmCTestCurl object. diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index 1668edf..b4c0137 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -174,7 +174,6 @@ bool cmCTestCurl::UploadFile(std::string const& local_file, // Now run off and do what you've been told! ::curl_easy_perform(this->Curl); ::fclose(ftpfile); - ::curl_global_cleanup(); if ( responseData.size() > 0 ) { @@ -227,8 +226,6 @@ bool cmCTestCurl::HttpRequest(std::string const& url, CURLcode res = ::curl_easy_perform(this->Curl); - ::curl_easy_cleanup(this->Curl); - ::curl_global_cleanup(); if ( responseData.size() > 0 ) { response = std::string(responseData.begin(), responseData.end()); http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fc681b4a0e88f65a7875f70a287511f402f307a0 commit fc681b4a0e88f65a7875f70a287511f402f307a0 Author: Bill Hoffman AuthorDate: Thu Jan 29 14:42:44 2015 -0500 Commit: Bill Hoffman CommitDate: Thu Jan 29 14:42:44 2015 -0500 Call curl_easy_escape on arguments sent to CDash upload. diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index b0d26cc..1668edf 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -25,6 +25,21 @@ cmCTestCurl::cmCTestCurl(cmCTest* ctest) this->VerifyPeerOff = false; this->VerifyHostOff = false; this->TimeOutSeconds = 0; + this->Curl = curl_easy_init(); +} + +cmCTestCurl::~cmCTestCurl() +{ + ::curl_easy_cleanup(this->Curl); + ::curl_global_cleanup(); +} + +std::string cmCTestCurl::Escape(std::string const& source) +{ + char* data1 = curl_easy_escape(this->Curl, source.c_str(), 0); + std::string ret = data1; + curl_free(data1); + return ret; } namespace @@ -73,7 +88,6 @@ void cmCTestCurl::SetCurlOptions(std::vector const& args) bool cmCTestCurl::InitCurl() { - this->Curl = curl_easy_init(); if(!this->Curl) { return false; diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h index 5bb8b41..0737bb6 100644 --- a/Source/CTest/cmCTestCurl.h +++ b/Source/CTest/cmCTestCurl.h @@ -22,6 +22,7 @@ class cmCTestCurl { public: cmCTestCurl(cmCTest*); + ~cmCTestCurl(); bool UploadFile(std::string const& url, std::string const& file, std::string const& fields, @@ -34,6 +35,7 @@ public: void SetCurlOptions(std::vector const& args); void SetUseHttp10On() { this->UseHttp10 = true;} void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s;} + std::string Escape(std::string const& source); protected: void SetProxyType(); bool InitCurl(); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 3d9545f..5b52df7 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1128,21 +1128,24 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; str << "project=" - << this->CTest->GetCTestConfiguration("ProjectName") << "&"; + << curl.Escape(this->CTest->GetCTestConfiguration("ProjectName")) << "&"; if(subproject) { - str << "subproject=" << subproject << "&"; + str << "subproject=" << curl.Escape(subproject) << "&"; } - str << "stamp=" << this->CTest->GetCurrentTag() << "-" - << this->CTest->GetTestModelString() << "&" - << "model=" << this->CTest->GetTestModelString() << "&" - << "build=" << this->CTest->GetCTestConfiguration("BuildName") << "&" - << "site=" << this->CTest->GetCTestConfiguration("Site") << "&" - << "track=" << this->CTest->GetTestModelString() << "&" + str << "stamp=" << curl.Escape(this->CTest->GetCurrentTag()) << "-" + << curl.Escape(this->CTest->GetTestModelString()) << "&" + << "model=" << curl.Escape(this->CTest->GetTestModelString()) << "&" + << "build=" + << curl.Escape(this->CTest->GetCTestConfiguration("BuildName")) << "&" + << "site=" + << curl.Escape(this->CTest->GetCTestConfiguration("Site")) << "&" + << "track=" + << curl.Escape(this->CTest->GetTestModelString()) << "&" << "starttime=" << (int)cmSystemTools::GetTime() << "&" << "endtime=" << (int)cmSystemTools::GetTime() << "&" << "datafilesmd5[0]=" << md5sum << "&" - << "type=" << typeString; + << "type=" << curl.Escape(typeString); std::string fields = str.str(); cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:" << url << "\nfile: " << file << "\n"); @@ -1192,9 +1195,9 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, std::string upload_as = cmSystemTools::GetFilenameName(file); std::ostringstream fstr; - fstr << "type=" << typeString << "&" + fstr << "type=" << curl.Escape(typeString) << "&" << "md5=" << md5sum << "&" - << "filename=" << upload_as << "&" + << "filename=" << curl.Escape(upload_as) << "&" << "buildid=" << json["buildid"].asString(); if(!curl.UploadFile(file, url, fstr.str(), response)) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eada43bb220f5f3953874606eb97ba33217091e4 commit eada43bb220f5f3953874606eb97ba33217091e4 Author: Bill Hoffman AuthorDate: Wed Jan 28 17:08:41 2015 -0500 Commit: Bill Hoffman CommitDate: Wed Jan 28 17:08:41 2015 -0500 Use the --files-from option to tar to handle lots of files, also add a test. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index f6616e0..edb1466 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -39,6 +39,13 @@ # ``GCOV_COMMAND `` # Specify the full path to the ``gcov`` command on the machine. # Default is the value of :variable:`CTEST_COVERAGE_COMMAND`. +# +# ``GCOV_EXTRA_OPTIONS `` +# Specify extra options to be passed to gcov. By default +# gcov is run like this gcov -b -o ${gcov_dir} ${gcda_file_path} +# If GCOV_EXTRA_OPTIONS are specified, it will be run like this: +# ``gcov`` ${GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file_path} + #============================================================================= # Copyright 2014-2015 Kitware, Inc. @@ -56,7 +63,7 @@ include(CMakeParseArguments) function(ctest_coverage_collect_gcov) set(options "") set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) - set(multiValueArgs "") + set(multiValueArgs GCOV_EXTRA_OPTIONS) cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" "${multiValueArgs}" "" ${ARGN} ) if(NOT DEFINED GCOV_TARBALL) @@ -86,7 +93,7 @@ function(ctest_coverage_collect_gcov) # this will be faster and only look where the files will be file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) foreach(target_dir ${target_dirs}) - file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") + file(GLOB_RECURSE gfiles RELATIVE "${binary_dir}" ${target_dir}/*.gcda) list(LENGTH gfiles len) # if we have gcda files then also grab the labels file for that target if(${len} GREATER 0) @@ -113,11 +120,18 @@ function(ctest_coverage_collect_gcov) get_filename_component(gcov_dir ${gcda_file} DIRECTORY) # run gcov, this will produce the .gcov file in the current # working directory + if(NOT DEFINED GCOV_GCOV_EXTRA_OPTIONS) + set(GCOV_GCOV_EXTRA_OPTIONS -b -o) + endif() execute_process(COMMAND - ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + ${gcov_command} ${GCOV_GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file} OUTPUT_VARIABLE out + RESULT_VARIABLE res WORKING_DIRECTORY ${coverage_dir}) endforeach() + if(NOT "${res}" EQUAL 0) + message(STATUS "Error running gcov: ${res} ${out}") + endif() # create json file with project information file(WRITE ${coverage_dir}/data.json "{ @@ -130,9 +144,16 @@ function(ctest_coverage_collect_gcov) # tar up the coverage info with the same date so that the md5 # sum will be the same for the tar file independent of file time # stamps + string(REPLACE ";" "\n" gcov_files "${gcov_files}") + string(REPLACE ";" "\n" label_files "${label_files}") + file(WRITE "${coverage_dir}/coverage_file_list.txt" + "${gcov_files} +${coverage_dir}/data.json +${label_files} +") execute_process(COMMAND ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} - "--mtime=1970-01-01 0:0:0 UTC" ${gcov_files} - ${coverage_dir}/data.json ${label_files} + "--mtime=1970-01-01 0:0:0 UTC" + --files-from=${coverage_dir}/coverage_file_list.txt WORKING_DIRECTORY ${binary_dir}) endfunction() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 3aecd9b..1a79854 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2269,6 +2269,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release PASS_REGULAR_EXPRESSION "Upload\\.xml") configure_file( + "${CMake_SOURCE_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(CTestCoverageCollectGCOV ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" -VV + --output-log "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/testOut.log" + ) + set_tests_properties(CTestCoverageCollectGCOV PROPERTIES + PASS_REGULAR_EXPRESSION + "PASSED with correct output.*Testing/CoverageInfo/echoargs.gcov") + + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake" @ONLY ESCAPE_QUOTES) diff --git a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake new file mode 100644 index 0000000..e704f14 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake @@ -0,0 +1,8 @@ +foreach(I RANGE 0 ${CMAKE_ARGC}) + if("${CMAKE_ARGV${I}}" MATCHES ".*\\.gcda") + set(gcda_file "${CMAKE_ARGV${I}}") + endif() +endforeach() +get_filename_component(gcda_file ${gcda_file} NAME_WE) +file(WRITE "${CMAKE_SOURCE_DIR}/${gcda_file}.gcov" +"fake gcov file") diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in new file mode 100644 index 0000000..2560542 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 2.8.12) +set(CTEST_PROJECT_NAME "SmallAndFast") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +ctest_start(Experimental) +ctest_configure() +ctest_build() +ctest_test() + +file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeFiles/echoargs.dir/echoargs.gcda +"dummy +") + +include(CTestCoverageCollectGCOV) +set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tar) +ctest_coverage_collect_gcov( + TARBALL "${tar_file}" + SOURCE "${CTEST_SOURCE_DIRECTORY}" + BUILD "${CTEST_BINARY_DIRECTORY}" + GCOV_COMMAND "${CMAKE_COMMAND}" + GCOV_EXTRA_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake") + +execute_process(COMMAND + ${CMAKE_COMMAND} -E tar tf ${tar_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) + +set(expected_out +"Testing/CoverageInfo/echoargs.gcov +Testing/CoverageInfo/data.json +CMakeFiles/echoargs.dir/Labels.json +") + +if("${out}" STREQUAL "${expected_out}") + message("PASSED with correct output: ${out}") +else() + message(FATAL_ERROR "FAILED: expected:\n${expected_out}\nGot:\n${out}") +endif() ----------------------------------------------------------------------- Summary of changes: Modules/CTestCoverageCollectGCOV.cmake | 31 ++++++++++++++++---- Source/CTest/cmCTestCurl.cxx | 19 +++++++++--- Source/CTest/cmCTestCurl.h | 2 ++ Source/CTest/cmCTestSubmitHandler.cxx | 25 +++++++++------- Tests/CMakeLists.txt | 12 ++++++++ Tests/CTestCoverageCollectGCOV/fakegcov.cmake | 8 +++++ Tests/CTestCoverageCollectGCOV/test.cmake.in | 39 +++++++++++++++++++++++++ 7 files changed, 116 insertions(+), 20 deletions(-) create mode 100644 Tests/CTestCoverageCollectGCOV/fakegcov.cmake create mode 100644 Tests/CTestCoverageCollectGCOV/test.cmake.in hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 16:01:24 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 16:01:24 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2484-g2982298 Message-ID: <20150129210124.E27F8AA684@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 2982298c9ce6cbd7402cc7a189c3382b1743ea51 (commit) via 52b89b09713f03fcf81202a5065b2bf146e42cb2 (commit) from faeef8432b3bcf7623846de2b1715de3b2acdb13 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2982298c9ce6cbd7402cc7a189c3382b1743ea51 commit 2982298c9ce6cbd7402cc7a189c3382b1743ea51 Merge: faeef84 52b89b0 Author: Brad King AuthorDate: Thu Jan 29 16:01:24 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 16:01:24 2015 -0500 Merge topic 'feature-record-msvc' into next 52b89b09 fixup! Features: Record for MSVC 2010-2015 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52b89b09713f03fcf81202a5065b2bf146e42cb2 commit 52b89b09713f03fcf81202a5065b2bf146e42cb2 Author: Brad King AuthorDate: Thu Jan 29 15:26:16 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 15:59:53 2015 -0500 fixup! Features: Record for MSVC 2010-2015 diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake index d69a7ef..c770211 100644 --- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -12,18 +12,19 @@ set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") -# In theory decltype incomplete return types was added in 2012 -# but without support for decltype_auto and return type deduction this -# feature is unusable -set(_cmake_feature_test_cxx_decltype_incomplete_return_types "${MSVC_2015}") +# Digit separators are not available as of VS 2015 Preview, but a footnote +# says they will be available in the RTM. set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") # http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx -# Note 1. While previous version of VisualStudio said they supported this +# Note 1. While previous version of VisualStudio said they supported these # they silently produced bad code, and are now marked as having partial # support in previous versions. The footnote says the support will be complete # in MSVC 2015, so support the feature for that version, assuming that is true. set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2015}") +# Microsoft calls this 'rvalue references v3' +set(_cmake_feature_test_cxx_defaulted_move_initializers "${MSVC_2015}") set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") @@ -35,6 +36,13 @@ set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_reference_qualified_functions "${MSVC_2015}") +# "The copies and moves don't interact precisely like the Standard says they +# should. For example, deletion of moves is specified to also suppress +# copies, but Visual C++ in Visual Studio 2013 does not." +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# lists this as 'partial' in 2013 +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2015}") set(MSVC_2013 "_MSC_VER >= 1800") set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") @@ -45,9 +53,7 @@ set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}") set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") -set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2013}") set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") -set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2013}") set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") # Support is documented, but possibly partly broken: @@ -62,7 +68,6 @@ set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") set(MSVC_2010 "_MSC_VER >= 1600") -set(_cmake_feature_test_cxx_auto_function "${MSVC_2010}") set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") @@ -80,19 +85,18 @@ set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") # Currently unsupported: -# http://herbsutter.com/2013/11/18/visual-c-compiler-november-2013-ctp/ -# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx - -# set(_cmake_feature_test_cxx_reference_qualified_functions ) # set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) # set(_cmake_feature_test_cxx_attributes ) -# set(_cmake_feature_test_cxx_aggregate_default_initializers ) # set(_cmake_feature_test_cxx_attribute_deprecated ) -# set(_cmake_feature_test_cxx_defaulted_move_initializers ) -# set(_cmake_feature_test_cxx_nonstatic_member_init ) -# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# 'NSDMIs for aggregates' +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) # set(_cmake_feature_test_cxx_variable_templates ) +# In theory decltype incomplete return types was added in 2012 +# but without support for decltype_auto and return type deduction this +# feature is unusable. This remains so as of VS 2015 Preview. +# set(_cmake_feature_test_cxx_decltype_incomplete_return_types ) # Unset all the variables that we don't need exposed. # _cmake_oldestSupported is required by WriteCompilerDetectionHeader diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index bb0dc0d..38c44c8 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -99,14 +99,30 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" cxx_return_type_deduction ) endif() -if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" - AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) - list(REMOVE_ITEM CXX_non_features - # The cxx_contextual_conversions feature happens to work - # (for *this* testcase) with VS 2010 and VS 2012, but - # they do not document support until VS 2013. - cxx_contextual_conversions - ) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) + list(REMOVE_ITEM CXX_non_features + # The cxx_contextual_conversions feature happens to work + # (for *this* testcase) with VS 2010 and VS 2012, but + # they do not document support until VS 2013. + cxx_contextual_conversions + ) + elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + list(REMOVE_ITEM CXX_non_features + # The cxx_deleted_functions and cxx_nonstatic_member_init + # features happen to work (for *this* testcase) with VS 2013, + # but they do not document support until VS 2015. + cxx_deleted_functions + cxx_nonstatic_member_init + ) + else() + list(REMOVE_ITEM CXX_non_features + # The cxx_constexpr feature happens to work (for *this* testcase) + # with VS 2015, but they document only partial support. + cxx_constexpr + ) + endif() endif() set(C_ext c) ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 36 ++++++++++++++------------ Tests/CompileFeatures/CMakeLists.txt | 32 +++++++++++++++++------ 2 files changed, 44 insertions(+), 24 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 17:20:52 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 17:20:52 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2486-gecc6b91 Message-ID: <20150129222052.1FC34A82D1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via ecc6b91f96be110aed26e2030b599817639d2106 (commit) via 9f66c5ec71327920974cbb146459852343469e40 (commit) from 2982298c9ce6cbd7402cc7a189c3382b1743ea51 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ecc6b91f96be110aed26e2030b599817639d2106 commit ecc6b91f96be110aed26e2030b599817639d2106 Merge: 2982298 9f66c5e Author: Brad King AuthorDate: Thu Jan 29 17:20:51 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 17:20:51 2015 -0500 Merge topic 'clean_up_cdash_upload_files' into next 9f66c5ec fixup! Use the --files-from option to tar to handle lots of files http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9f66c5ec71327920974cbb146459852343469e40 commit 9f66c5ec71327920974cbb146459852343469e40 Author: Brad King AuthorDate: Thu Jan 29 17:17:28 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 17:17:28 2015 -0500 fixup! Use the --files-from option to tar to handle lots of files The test will not work in generators that have a different target support directory. We'll need to revise the approach. diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 1a79854..3aecd9b 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2269,18 +2269,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release PASS_REGULAR_EXPRESSION "Upload\\.xml") configure_file( - "${CMake_SOURCE_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake.in" - "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" - @ONLY ESCAPE_QUOTES) - add_test(CTestCoverageCollectGCOV ${CMAKE_CTEST_COMMAND} - -S "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" -VV - --output-log "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/testOut.log" - ) - set_tests_properties(CTestCoverageCollectGCOV PROPERTIES - PASS_REGULAR_EXPRESSION - "PASSED with correct output.*Testing/CoverageInfo/echoargs.gcov") - - configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake" @ONLY ESCAPE_QUOTES) diff --git a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake deleted file mode 100644 index e704f14..0000000 --- a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake +++ /dev/null @@ -1,8 +0,0 @@ -foreach(I RANGE 0 ${CMAKE_ARGC}) - if("${CMAKE_ARGV${I}}" MATCHES ".*\\.gcda") - set(gcda_file "${CMAKE_ARGV${I}}") - endif() -endforeach() -get_filename_component(gcda_file ${gcda_file} NAME_WE) -file(WRITE "${CMAKE_SOURCE_DIR}/${gcda_file}.gcov" -"fake gcov file") diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in deleted file mode 100644 index 2560542..0000000 --- a/Tests/CTestCoverageCollectGCOV/test.cmake.in +++ /dev/null @@ -1,39 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -set(CTEST_PROJECT_NAME "SmallAndFast") -set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast") -set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV") -set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -ctest_start(Experimental) -ctest_configure() -ctest_build() -ctest_test() - -file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeFiles/echoargs.dir/echoargs.gcda -"dummy -") - -include(CTestCoverageCollectGCOV) -set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tar) -ctest_coverage_collect_gcov( - TARBALL "${tar_file}" - SOURCE "${CTEST_SOURCE_DIRECTORY}" - BUILD "${CTEST_BINARY_DIRECTORY}" - GCOV_COMMAND "${CMAKE_COMMAND}" - GCOV_EXTRA_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake") - -execute_process(COMMAND - ${CMAKE_COMMAND} -E tar tf ${tar_file} - OUTPUT_VARIABLE out - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) - -set(expected_out -"Testing/CoverageInfo/echoargs.gcov -Testing/CoverageInfo/data.json -CMakeFiles/echoargs.dir/Labels.json -") - -if("${out}" STREQUAL "${expected_out}") - message("PASSED with correct output: ${out}") -else() - message(FATAL_ERROR "FAILED: expected:\n${expected_out}\nGot:\n${out}") -endif() ----------------------------------------------------------------------- Summary of changes: Tests/CMakeLists.txt | 12 -------- Tests/CTestCoverageCollectGCOV/fakegcov.cmake | 8 ----- Tests/CTestCoverageCollectGCOV/test.cmake.in | 39 ------------------------- 3 files changed, 59 deletions(-) delete mode 100644 Tests/CTestCoverageCollectGCOV/fakegcov.cmake delete mode 100644 Tests/CTestCoverageCollectGCOV/test.cmake.in hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 17:21:00 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 17:21:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2489-gb54ed1b Message-ID: <20150129222101.12D20A832F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b54ed1b543f429180945adaabebd5a9f35028391 (commit) via 9c0c1ad7924eb773671b605ae3df83b440d3dece (commit) via 83b9ceed00b610060a12818150cdf3b4be7c42c0 (commit) from ecc6b91f96be110aed26e2030b599817639d2106 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b54ed1b543f429180945adaabebd5a9f35028391 commit b54ed1b543f429180945adaabebd5a9f35028391 Merge: ecc6b91 9c0c1ad Author: Brad King AuthorDate: Thu Jan 29 17:20:59 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 17:20:59 2015 -0500 Merge topic 'clean_up_cdash_upload_files' into next 9c0c1ad7 ctest_submit: Escape URL components in CDASH_UPLOAD mode 83b9ceed Use the --files-from option to tar to handle lots of files, also add a test. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c0c1ad7924eb773671b605ae3df83b440d3dece commit 9c0c1ad7924eb773671b605ae3df83b440d3dece Author: Bill Hoffman AuthorDate: Thu Jan 29 14:42:44 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 17:18:25 2015 -0500 ctest_submit: Escape URL components in CDASH_UPLOAD mode Call curl_easy_escape on arguments sent to CDash upload. diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index b0d26cc..b4c0137 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -25,6 +25,21 @@ cmCTestCurl::cmCTestCurl(cmCTest* ctest) this->VerifyPeerOff = false; this->VerifyHostOff = false; this->TimeOutSeconds = 0; + this->Curl = curl_easy_init(); +} + +cmCTestCurl::~cmCTestCurl() +{ + ::curl_easy_cleanup(this->Curl); + ::curl_global_cleanup(); +} + +std::string cmCTestCurl::Escape(std::string const& source) +{ + char* data1 = curl_easy_escape(this->Curl, source.c_str(), 0); + std::string ret = data1; + curl_free(data1); + return ret; } namespace @@ -73,7 +88,6 @@ void cmCTestCurl::SetCurlOptions(std::vector const& args) bool cmCTestCurl::InitCurl() { - this->Curl = curl_easy_init(); if(!this->Curl) { return false; @@ -160,7 +174,6 @@ bool cmCTestCurl::UploadFile(std::string const& local_file, // Now run off and do what you've been told! ::curl_easy_perform(this->Curl); ::fclose(ftpfile); - ::curl_global_cleanup(); if ( responseData.size() > 0 ) { @@ -213,8 +226,6 @@ bool cmCTestCurl::HttpRequest(std::string const& url, CURLcode res = ::curl_easy_perform(this->Curl); - ::curl_easy_cleanup(this->Curl); - ::curl_global_cleanup(); if ( responseData.size() > 0 ) { response = std::string(responseData.begin(), responseData.end()); diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h index 5bb8b41..0737bb6 100644 --- a/Source/CTest/cmCTestCurl.h +++ b/Source/CTest/cmCTestCurl.h @@ -22,6 +22,7 @@ class cmCTestCurl { public: cmCTestCurl(cmCTest*); + ~cmCTestCurl(); bool UploadFile(std::string const& url, std::string const& file, std::string const& fields, @@ -34,6 +35,7 @@ public: void SetCurlOptions(std::vector const& args); void SetUseHttp10On() { this->UseHttp10 = true;} void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s;} + std::string Escape(std::string const& source); protected: void SetProxyType(); bool InitCurl(); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 3d9545f..5b52df7 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1128,21 +1128,24 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; str << "project=" - << this->CTest->GetCTestConfiguration("ProjectName") << "&"; + << curl.Escape(this->CTest->GetCTestConfiguration("ProjectName")) << "&"; if(subproject) { - str << "subproject=" << subproject << "&"; + str << "subproject=" << curl.Escape(subproject) << "&"; } - str << "stamp=" << this->CTest->GetCurrentTag() << "-" - << this->CTest->GetTestModelString() << "&" - << "model=" << this->CTest->GetTestModelString() << "&" - << "build=" << this->CTest->GetCTestConfiguration("BuildName") << "&" - << "site=" << this->CTest->GetCTestConfiguration("Site") << "&" - << "track=" << this->CTest->GetTestModelString() << "&" + str << "stamp=" << curl.Escape(this->CTest->GetCurrentTag()) << "-" + << curl.Escape(this->CTest->GetTestModelString()) << "&" + << "model=" << curl.Escape(this->CTest->GetTestModelString()) << "&" + << "build=" + << curl.Escape(this->CTest->GetCTestConfiguration("BuildName")) << "&" + << "site=" + << curl.Escape(this->CTest->GetCTestConfiguration("Site")) << "&" + << "track=" + << curl.Escape(this->CTest->GetTestModelString()) << "&" << "starttime=" << (int)cmSystemTools::GetTime() << "&" << "endtime=" << (int)cmSystemTools::GetTime() << "&" << "datafilesmd5[0]=" << md5sum << "&" - << "type=" << typeString; + << "type=" << curl.Escape(typeString); std::string fields = str.str(); cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:" << url << "\nfile: " << file << "\n"); @@ -1192,9 +1195,9 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, std::string upload_as = cmSystemTools::GetFilenameName(file); std::ostringstream fstr; - fstr << "type=" << typeString << "&" + fstr << "type=" << curl.Escape(typeString) << "&" << "md5=" << md5sum << "&" - << "filename=" << upload_as << "&" + << "filename=" << curl.Escape(upload_as) << "&" << "buildid=" << json["buildid"].asString(); if(!curl.UploadFile(file, url, fstr.str(), response)) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=83b9ceed00b610060a12818150cdf3b4be7c42c0 commit 83b9ceed00b610060a12818150cdf3b4be7c42c0 Author: Bill Hoffman AuthorDate: Wed Jan 28 17:08:41 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 17:18:24 2015 -0500 Use the --files-from option to tar to handle lots of files, also add a test. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index f6616e0..edb1466 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -39,6 +39,13 @@ # ``GCOV_COMMAND `` # Specify the full path to the ``gcov`` command on the machine. # Default is the value of :variable:`CTEST_COVERAGE_COMMAND`. +# +# ``GCOV_EXTRA_OPTIONS `` +# Specify extra options to be passed to gcov. By default +# gcov is run like this gcov -b -o ${gcov_dir} ${gcda_file_path} +# If GCOV_EXTRA_OPTIONS are specified, it will be run like this: +# ``gcov`` ${GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file_path} + #============================================================================= # Copyright 2014-2015 Kitware, Inc. @@ -56,7 +63,7 @@ include(CMakeParseArguments) function(ctest_coverage_collect_gcov) set(options "") set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) - set(multiValueArgs "") + set(multiValueArgs GCOV_EXTRA_OPTIONS) cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" "${multiValueArgs}" "" ${ARGN} ) if(NOT DEFINED GCOV_TARBALL) @@ -86,7 +93,7 @@ function(ctest_coverage_collect_gcov) # this will be faster and only look where the files will be file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) foreach(target_dir ${target_dirs}) - file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") + file(GLOB_RECURSE gfiles RELATIVE "${binary_dir}" ${target_dir}/*.gcda) list(LENGTH gfiles len) # if we have gcda files then also grab the labels file for that target if(${len} GREATER 0) @@ -113,11 +120,18 @@ function(ctest_coverage_collect_gcov) get_filename_component(gcov_dir ${gcda_file} DIRECTORY) # run gcov, this will produce the .gcov file in the current # working directory + if(NOT DEFINED GCOV_GCOV_EXTRA_OPTIONS) + set(GCOV_GCOV_EXTRA_OPTIONS -b -o) + endif() execute_process(COMMAND - ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + ${gcov_command} ${GCOV_GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file} OUTPUT_VARIABLE out + RESULT_VARIABLE res WORKING_DIRECTORY ${coverage_dir}) endforeach() + if(NOT "${res}" EQUAL 0) + message(STATUS "Error running gcov: ${res} ${out}") + endif() # create json file with project information file(WRITE ${coverage_dir}/data.json "{ @@ -130,9 +144,16 @@ function(ctest_coverage_collect_gcov) # tar up the coverage info with the same date so that the md5 # sum will be the same for the tar file independent of file time # stamps + string(REPLACE ";" "\n" gcov_files "${gcov_files}") + string(REPLACE ";" "\n" label_files "${label_files}") + file(WRITE "${coverage_dir}/coverage_file_list.txt" + "${gcov_files} +${coverage_dir}/data.json +${label_files} +") execute_process(COMMAND ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} - "--mtime=1970-01-01 0:0:0 UTC" ${gcov_files} - ${coverage_dir}/data.json ${label_files} + "--mtime=1970-01-01 0:0:0 UTC" + --files-from=${coverage_dir}/coverage_file_list.txt WORKING_DIRECTORY ${binary_dir}) endfunction() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 17:24:30 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 17:24:30 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2492-g3b12ad4 Message-ID: <20150129222430.CFAB8AA05D@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 3b12ad4612252eae973f1490328ef916b3cb1fc5 (commit) via 2d55dfd99c3613f0ba915fe958dac77e7b8b997b (commit) via f6c9f327a3903ec8f7f2b3e301cc97e012472d94 (commit) from b54ed1b543f429180945adaabebd5a9f35028391 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3b12ad4612252eae973f1490328ef916b3cb1fc5 commit 3b12ad4612252eae973f1490328ef916b3cb1fc5 Merge: b54ed1b 2d55dfd Author: Brad King AuthorDate: Thu Jan 29 17:24:30 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 17:24:30 2015 -0500 Merge topic 'clean_up_cdash_upload_files' into next 2d55dfd9 ctest_submit: Escape URL components in CDASH_UPLOAD mode f6c9f327 CTestCoverageCollectGCOV: Fix handling of large file counts http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2d55dfd99c3613f0ba915fe958dac77e7b8b997b commit 2d55dfd99c3613f0ba915fe958dac77e7b8b997b Author: Bill Hoffman AuthorDate: Thu Jan 29 14:42:44 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 17:23:27 2015 -0500 ctest_submit: Escape URL components in CDASH_UPLOAD mode Call curl_easy_escape on arguments sent to CDash upload. diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index b0d26cc..b4c0137 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -25,6 +25,21 @@ cmCTestCurl::cmCTestCurl(cmCTest* ctest) this->VerifyPeerOff = false; this->VerifyHostOff = false; this->TimeOutSeconds = 0; + this->Curl = curl_easy_init(); +} + +cmCTestCurl::~cmCTestCurl() +{ + ::curl_easy_cleanup(this->Curl); + ::curl_global_cleanup(); +} + +std::string cmCTestCurl::Escape(std::string const& source) +{ + char* data1 = curl_easy_escape(this->Curl, source.c_str(), 0); + std::string ret = data1; + curl_free(data1); + return ret; } namespace @@ -73,7 +88,6 @@ void cmCTestCurl::SetCurlOptions(std::vector const& args) bool cmCTestCurl::InitCurl() { - this->Curl = curl_easy_init(); if(!this->Curl) { return false; @@ -160,7 +174,6 @@ bool cmCTestCurl::UploadFile(std::string const& local_file, // Now run off and do what you've been told! ::curl_easy_perform(this->Curl); ::fclose(ftpfile); - ::curl_global_cleanup(); if ( responseData.size() > 0 ) { @@ -213,8 +226,6 @@ bool cmCTestCurl::HttpRequest(std::string const& url, CURLcode res = ::curl_easy_perform(this->Curl); - ::curl_easy_cleanup(this->Curl); - ::curl_global_cleanup(); if ( responseData.size() > 0 ) { response = std::string(responseData.begin(), responseData.end()); diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h index 5bb8b41..0737bb6 100644 --- a/Source/CTest/cmCTestCurl.h +++ b/Source/CTest/cmCTestCurl.h @@ -22,6 +22,7 @@ class cmCTestCurl { public: cmCTestCurl(cmCTest*); + ~cmCTestCurl(); bool UploadFile(std::string const& url, std::string const& file, std::string const& fields, @@ -34,6 +35,7 @@ public: void SetCurlOptions(std::vector const& args); void SetUseHttp10On() { this->UseHttp10 = true;} void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s;} + std::string Escape(std::string const& source); protected: void SetProxyType(); bool InitCurl(); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 3d9545f..5b52df7 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1128,21 +1128,24 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; str << "project=" - << this->CTest->GetCTestConfiguration("ProjectName") << "&"; + << curl.Escape(this->CTest->GetCTestConfiguration("ProjectName")) << "&"; if(subproject) { - str << "subproject=" << subproject << "&"; + str << "subproject=" << curl.Escape(subproject) << "&"; } - str << "stamp=" << this->CTest->GetCurrentTag() << "-" - << this->CTest->GetTestModelString() << "&" - << "model=" << this->CTest->GetTestModelString() << "&" - << "build=" << this->CTest->GetCTestConfiguration("BuildName") << "&" - << "site=" << this->CTest->GetCTestConfiguration("Site") << "&" - << "track=" << this->CTest->GetTestModelString() << "&" + str << "stamp=" << curl.Escape(this->CTest->GetCurrentTag()) << "-" + << curl.Escape(this->CTest->GetTestModelString()) << "&" + << "model=" << curl.Escape(this->CTest->GetTestModelString()) << "&" + << "build=" + << curl.Escape(this->CTest->GetCTestConfiguration("BuildName")) << "&" + << "site=" + << curl.Escape(this->CTest->GetCTestConfiguration("Site")) << "&" + << "track=" + << curl.Escape(this->CTest->GetTestModelString()) << "&" << "starttime=" << (int)cmSystemTools::GetTime() << "&" << "endtime=" << (int)cmSystemTools::GetTime() << "&" << "datafilesmd5[0]=" << md5sum << "&" - << "type=" << typeString; + << "type=" << curl.Escape(typeString); std::string fields = str.str(); cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:" << url << "\nfile: " << file << "\n"); @@ -1192,9 +1195,9 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, std::string upload_as = cmSystemTools::GetFilenameName(file); std::ostringstream fstr; - fstr << "type=" << typeString << "&" + fstr << "type=" << curl.Escape(typeString) << "&" << "md5=" << md5sum << "&" - << "filename=" << upload_as << "&" + << "filename=" << curl.Escape(upload_as) << "&" << "buildid=" << json["buildid"].asString(); if(!curl.UploadFile(file, url, fstr.str(), response)) { http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f6c9f327a3903ec8f7f2b3e301cc97e012472d94 commit f6c9f327a3903ec8f7f2b3e301cc97e012472d94 Author: Bill Hoffman AuthorDate: Wed Jan 28 17:08:41 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 17:22:29 2015 -0500 CTestCoverageCollectGCOV: Fix handling of large file counts Use the --files-from option to tar to handle lots of files. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index f6616e0..edb1466 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -39,6 +39,13 @@ # ``GCOV_COMMAND `` # Specify the full path to the ``gcov`` command on the machine. # Default is the value of :variable:`CTEST_COVERAGE_COMMAND`. +# +# ``GCOV_EXTRA_OPTIONS `` +# Specify extra options to be passed to gcov. By default +# gcov is run like this gcov -b -o ${gcov_dir} ${gcda_file_path} +# If GCOV_EXTRA_OPTIONS are specified, it will be run like this: +# ``gcov`` ${GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file_path} + #============================================================================= # Copyright 2014-2015 Kitware, Inc. @@ -56,7 +63,7 @@ include(CMakeParseArguments) function(ctest_coverage_collect_gcov) set(options "") set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) - set(multiValueArgs "") + set(multiValueArgs GCOV_EXTRA_OPTIONS) cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" "${multiValueArgs}" "" ${ARGN} ) if(NOT DEFINED GCOV_TARBALL) @@ -86,7 +93,7 @@ function(ctest_coverage_collect_gcov) # this will be faster and only look where the files will be file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) foreach(target_dir ${target_dirs}) - file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") + file(GLOB_RECURSE gfiles RELATIVE "${binary_dir}" ${target_dir}/*.gcda) list(LENGTH gfiles len) # if we have gcda files then also grab the labels file for that target if(${len} GREATER 0) @@ -113,11 +120,18 @@ function(ctest_coverage_collect_gcov) get_filename_component(gcov_dir ${gcda_file} DIRECTORY) # run gcov, this will produce the .gcov file in the current # working directory + if(NOT DEFINED GCOV_GCOV_EXTRA_OPTIONS) + set(GCOV_GCOV_EXTRA_OPTIONS -b -o) + endif() execute_process(COMMAND - ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + ${gcov_command} ${GCOV_GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file} OUTPUT_VARIABLE out + RESULT_VARIABLE res WORKING_DIRECTORY ${coverage_dir}) endforeach() + if(NOT "${res}" EQUAL 0) + message(STATUS "Error running gcov: ${res} ${out}") + endif() # create json file with project information file(WRITE ${coverage_dir}/data.json "{ @@ -130,9 +144,16 @@ function(ctest_coverage_collect_gcov) # tar up the coverage info with the same date so that the md5 # sum will be the same for the tar file independent of file time # stamps + string(REPLACE ";" "\n" gcov_files "${gcov_files}") + string(REPLACE ";" "\n" label_files "${label_files}") + file(WRITE "${coverage_dir}/coverage_file_list.txt" + "${gcov_files} +${coverage_dir}/data.json +${label_files} +") execute_process(COMMAND ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} - "--mtime=1970-01-01 0:0:0 UTC" ${gcov_files} - ${coverage_dir}/data.json ${label_files} + "--mtime=1970-01-01 0:0:0 UTC" + --files-from=${coverage_dir}/coverage_file_list.txt WORKING_DIRECTORY ${binary_dir}) endfunction() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Thu Jan 29 17:29:57 2015 From: brad.king at kitware.com (Brad King) Date: Thu, 29 Jan 2015 17:29:57 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2494-gdc6c46b Message-ID: <20150129222957.E23EDAA761@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via dc6c46b115f19ac02db22d072c07da2df423cd36 (commit) via a3892efa66657d873c3bf46ddb9fea0db287508a (commit) from 3b12ad4612252eae973f1490328ef916b3cb1fc5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc6c46b115f19ac02db22d072c07da2df423cd36 commit dc6c46b115f19ac02db22d072c07da2df423cd36 Merge: 3b12ad4 a3892ef Author: Brad King AuthorDate: Thu Jan 29 17:29:56 2015 -0500 Commit: CMake Topic Stage CommitDate: Thu Jan 29 17:29:56 2015 -0500 Merge topic 'clean_up_cdash_upload_files' into next a3892efa CTestCoverageCollectGCOV: Add test case http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a3892efa66657d873c3bf46ddb9fea0db287508a commit a3892efa66657d873c3bf46ddb9fea0db287508a Author: Bill Hoffman AuthorDate: Wed Jan 28 17:08:41 2015 -0500 Commit: Brad King CommitDate: Thu Jan 29 17:29:24 2015 -0500 CTestCoverageCollectGCOV: Add test case diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 3aecd9b..1a79854 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2269,6 +2269,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release PASS_REGULAR_EXPRESSION "Upload\\.xml") configure_file( + "${CMake_SOURCE_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(CTestCoverageCollectGCOV ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" -VV + --output-log "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/testOut.log" + ) + set_tests_properties(CTestCoverageCollectGCOV PROPERTIES + PASS_REGULAR_EXPRESSION + "PASSED with correct output.*Testing/CoverageInfo/echoargs.gcov") + + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake" @ONLY ESCAPE_QUOTES) diff --git a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake new file mode 100644 index 0000000..e704f14 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake @@ -0,0 +1,8 @@ +foreach(I RANGE 0 ${CMAKE_ARGC}) + if("${CMAKE_ARGV${I}}" MATCHES ".*\\.gcda") + set(gcda_file "${CMAKE_ARGV${I}}") + endif() +endforeach() +get_filename_component(gcda_file ${gcda_file} NAME_WE) +file(WRITE "${CMAKE_SOURCE_DIR}/${gcda_file}.gcov" +"fake gcov file") diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in new file mode 100644 index 0000000..2560542 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 2.8.12) +set(CTEST_PROJECT_NAME "SmallAndFast") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +ctest_start(Experimental) +ctest_configure() +ctest_build() +ctest_test() + +file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeFiles/echoargs.dir/echoargs.gcda +"dummy +") + +include(CTestCoverageCollectGCOV) +set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tar) +ctest_coverage_collect_gcov( + TARBALL "${tar_file}" + SOURCE "${CTEST_SOURCE_DIRECTORY}" + BUILD "${CTEST_BINARY_DIRECTORY}" + GCOV_COMMAND "${CMAKE_COMMAND}" + GCOV_EXTRA_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake") + +execute_process(COMMAND + ${CMAKE_COMMAND} -E tar tf ${tar_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) + +set(expected_out +"Testing/CoverageInfo/echoargs.gcov +Testing/CoverageInfo/data.json +CMakeFiles/echoargs.dir/Labels.json +") + +if("${out}" STREQUAL "${expected_out}") + message("PASSED with correct output: ${out}") +else() + message(FATAL_ERROR "FAILED: expected:\n${expected_out}\nGot:\n${out}") +endif() ----------------------------------------------------------------------- Summary of changes: Tests/CMakeLists.txt | 12 ++++++++ Tests/CTestCoverageCollectGCOV/fakegcov.cmake | 8 +++++ Tests/CTestCoverageCollectGCOV/test.cmake.in | 39 +++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 Tests/CTestCoverageCollectGCOV/fakegcov.cmake create mode 100644 Tests/CTestCoverageCollectGCOV/test.cmake.in hooks/post-receive -- CMake From kwrobot at kitware.com Fri Jan 30 00:01:13 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Fri, 30 Jan 2015 00:01:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-965-gdea1631 Message-ID: <20150130050113.46F81AA16A@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via dea1631a8f48bebc7402739de58841b8cdf97b8b (commit) from ea7ca139ea4c3c88e432e722c9cfe1dd86a4359f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dea1631a8f48bebc7402739de58841b8cdf97b8b commit dea1631a8f48bebc7402739de58841b8cdf97b8b Author: Kitware Robot AuthorDate: Fri Jan 30 00:01:10 2015 -0500 Commit: Kitware Robot CommitDate: Fri Jan 30 00:01:10 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ef49c4b..85ec73e 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 20150129) +set(CMake_VERSION_PATCH 20150130) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 09:59:17 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 09:59:17 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2496-g0a278be Message-ID: <20150130145917.197A0AABA5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 0a278bea71a2927874c95d44710424b87bf7a72d (commit) via d3489bdb0bc58b36f1e5ff2baa0aee8f4daea734 (commit) from dc6c46b115f19ac02db22d072c07da2df423cd36 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a278bea71a2927874c95d44710424b87bf7a72d commit 0a278bea71a2927874c95d44710424b87bf7a72d Merge: dc6c46b d3489bd Author: Brad King AuthorDate: Fri Jan 30 09:59:16 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 09:59:16 2015 -0500 Merge topic 'feature-record-msvc' into next d3489bdb Features: Record for MSVC 2010-2015 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3489bdb0bc58b36f1e5ff2baa0aee8f4daea734 commit d3489bdb0bc58b36f1e5ff2baa0aee8f4daea734 Author: Robert Maynard AuthorDate: Mon Jan 19 15:49:06 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 09:57:33 2015 -0500 Features: Record for MSVC 2010-2015 Also, in WCDH add MSVC Compatibility for cxx_align{of,as}. Co-Author: Stephen Kelly Co-Author: Brad King diff --git a/Help/release/dev/feature-record-msvc.rst b/Help/release/dev/feature-record-msvc.rst new file mode 100644 index 0000000..a8c9fd1 --- /dev/null +++ b/Help/release/dev/feature-record-msvc.rst @@ -0,0 +1,5 @@ +feature-record-msvc +------------------- + +* The :manual:`Compile Features ` functionality + is now aware of features supported by Microsoft Visual Studio (``MSVC``). diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake new file mode 100644 index 0000000..c770211 --- /dev/null +++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake @@ -0,0 +1,106 @@ + +# Reference: http://msdn.microsoft.com/en-us/library/vstudio/hh567368.aspx +# http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# http://www.visualstudio.com/en-us/news/vs2015-preview-vs.aspx + + +set(_cmake_oldestSupported "_MSC_VER >= 1600") + +set(MSVC_2015 "_MSC_VER >= 1900") +set(_cmake_feature_test_cxx_alignas "${MSVC_2015}") +set(_cmake_feature_test_cxx_alignof "${MSVC_2015}") +set(_cmake_feature_test_cxx_binary_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}") +# Digit separators are not available as of VS 2015 Preview, but a footnote +# says they will be available in the RTM. +set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}") +set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}") +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# Note 1. While previous version of VisualStudio said they supported these +# they silently produced bad code, and are now marked as having partial +# support in previous versions. The footnote says the support will be complete +# in MSVC 2015, so support the feature for that version, assuming that is true. +set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2015}") +# Microsoft calls this 'rvalue references v3' +set(_cmake_feature_test_cxx_defaulted_move_initializers "${MSVC_2015}") +set(_cmake_feature_test_cxx_generic_lambdas "${MSVC_2015}") +set(_cmake_feature_test_cxx_inheriting_constructors "${MSVC_2015}") +set(_cmake_feature_test_cxx_inline_namespaces "${MSVC_2015}") +set(_cmake_feature_test_cxx_lambda_init_captures "${MSVC_2015}") +set(_cmake_feature_test_cxx_noexcept "${MSVC_2015}") +set(_cmake_feature_test_cxx_return_type_deduction "${MSVC_2015}") +set(_cmake_feature_test_cxx_sizeof_member "${MSVC_2015}") +set(_cmake_feature_test_cxx_thread_local "${MSVC_2015}") +set(_cmake_feature_test_cxx_unicode_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_unrestricted_unions "${MSVC_2015}") +set(_cmake_feature_test_cxx_user_literals "${MSVC_2015}") +set(_cmake_feature_test_cxx_reference_qualified_functions "${MSVC_2015}") +# "The copies and moves don't interact precisely like the Standard says they +# should. For example, deletion of moves is specified to also suppress +# copies, but Visual C++ in Visual Studio 2013 does not." +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +# lists this as 'partial' in 2013 +set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2015}") + +set(MSVC_2013 "_MSC_VER >= 1800") +set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}") +# Microsoft now states they support contextual conversions in 2013 and above. +# See footnote 6 at: +# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx +set(_cmake_feature_test_cxx_contextual_conversions "${MSVC_2013}") +set(_cmake_feature_test_cxx_default_function_template_args "${MSVC_2013}") +set(_cmake_feature_test_cxx_defaulted_functions "${MSVC_2013}") +set(_cmake_feature_test_cxx_delegating_constructors "${MSVC_2013}") +set(_cmake_feature_test_cxx_explicit_conversions "${MSVC_2013}") +set(_cmake_feature_test_cxx_raw_string_literals "${MSVC_2013}") +set(_cmake_feature_test_cxx_uniform_initialization "${MSVC_2013}") +# Support is documented, but possibly partly broken: +# https://msdn.microsoft.com/en-us/library/hh567368.aspx +# http://thread.gmane.org/gmane.comp.lib.boost.devel/244986/focus=245333 +set(_cmake_feature_test_cxx_variadic_templates "${MSVC_2013}") + +set(MSVC_2012 "_MSC_VER >= 1700") +set(_cmake_feature_test_cxx_enum_forward_declarations "${MSVC_2012}") +set(_cmake_feature_test_cxx_final "${MSVC_2012}") +set(_cmake_feature_test_cxx_range_for "${MSVC_2012}") +set(_cmake_feature_test_cxx_strong_enums "${MSVC_2012}") + +set(MSVC_2010 "_MSC_VER >= 1600") +set(_cmake_feature_test_cxx_auto_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_decltype "${MSVC_2010}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${MSVC_2010}") +set(_cmake_feature_test_cxx_extern_templates "${MSVC_2010}") +set(_cmake_feature_test_cxx_lambdas "${MSVC_2010}") +set(_cmake_feature_test_cxx_local_type_template_args "${MSVC_2010}") +set(_cmake_feature_test_cxx_long_long_type "${MSVC_2010}") +set(_cmake_feature_test_cxx_nullptr "${MSVC_2010}") +set(_cmake_feature_test_cxx_override "${MSVC_2010}") +set(_cmake_feature_test_cxx_right_angle_brackets "${MSVC_2010}") +set(_cmake_feature_test_cxx_rvalue_references "${MSVC_2010}") +set(_cmake_feature_test_cxx_static_assert "${MSVC_2010}") +set(_cmake_feature_test_cxx_template_template_parameters "${MSVC_2010}") +set(_cmake_feature_test_cxx_trailing_return_types "${MSVC_2010}") +set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}") + +# Currently unsupported: +# set(_cmake_feature_test_cxx_constexpr ) +# set(_cmake_feature_test_cxx_relaxed_constexpr ) +# set(_cmake_feature_test_cxx_attributes ) +# set(_cmake_feature_test_cxx_attribute_deprecated ) +# 'NSDMIs for aggregates' +# set(_cmake_feature_test_cxx_aggregate_default_initializers ) +# set(_cmake_feature_test_cxx_variable_templates ) + +# In theory decltype incomplete return types was added in 2012 +# but without support for decltype_auto and return type deduction this +# feature is unusable. This remains so as of VS 2015 Preview. +# set(_cmake_feature_test_cxx_decltype_incomplete_return_types ) + +# Unset all the variables that we don't need exposed. +# _cmake_oldestSupported is required by WriteCompilerDetectionHeader +set(MSVC_2015) +set(MSVC_2013) +set(MSVC_2012) +set(MSVC_2010) diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake new file mode 100644 index 0000000..962aaeb --- /dev/null +++ b/Modules/Compiler/MSVC-CXX.cmake @@ -0,0 +1,6 @@ +# MSVC has no specific language level or flags to change it. +set(CMAKE_CXX_STANDARD_DEFAULT "") + +macro(cmake_record_cxx_compile_features) + record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES) +endmacro() diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index e81bc08..d18f47c 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -36,7 +36,7 @@ # PREFIX ClimbingStats # OUTPUT_FILES_VAR support_files # OUTPUT_DIR compilers -# COMPILERS GNU Clang +# COMPILERS GNU Clang MSVC # FEATURES cxx_variadic_templates # ) # install(FILES @@ -100,7 +100,7 @@ # write_compiler_detection_header( # FILE climbingstats_compiler_detection.h # PREFIX ClimbingStats -# COMPILERS GNU Clang AppleClang +# COMPILERS GNU Clang AppleClang MSVC # FEATURES cxx_variadic_templates # ) # @@ -321,6 +321,7 @@ function(write_compiler_detection_header GNU Clang AppleClang + MSVC SunPro ) @@ -528,6 +529,8 @@ function(write_compiler_detection_header # define ${def_value} alignas(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __attribute__ ((__aligned__(X))) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __declspec(align(X)) # else # define ${def_value} # endif @@ -540,6 +543,8 @@ function(write_compiler_detection_header # define ${def_value} alignof(X) # elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang # define ${def_value} __alignof__(X) +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __alignof(X) # endif \n") endif() diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index 9ef8049..38c44c8 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -100,6 +100,31 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0) + list(REMOVE_ITEM CXX_non_features + # The cxx_contextual_conversions feature happens to work + # (for *this* testcase) with VS 2010 and VS 2012, but + # they do not document support until VS 2013. + cxx_contextual_conversions + ) + elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + list(REMOVE_ITEM CXX_non_features + # The cxx_deleted_functions and cxx_nonstatic_member_init + # features happen to work (for *this* testcase) with VS 2013, + # but they do not document support until VS 2015. + cxx_deleted_functions + cxx_nonstatic_member_init + ) + else() + list(REMOVE_ITEM CXX_non_features + # The cxx_constexpr feature happens to work (for *this* testcase) + # with VS 2015, but they document only partial support. + cxx_constexpr + ) + endif() +endif() + set(C_ext c) set(C_standard_flag 11) set(CXX_ext cpp) @@ -220,6 +245,29 @@ if (CMAKE_CXX_COMPILE_FEATURES) -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 ) endif() + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=1 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=1 + ) + elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0) + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=1 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=1 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + else() + add_definitions( + -DEXPECT_OVERRIDE_CONTROL=0 + -DEXPECT_INHERITING_CONSTRUCTORS=0 + -DEXPECT_FINAL=0 + -DEXPECT_INHERITING_CONSTRUCTORS_AND_FINAL=0 + ) + endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") add_definitions( -DEXPECT_OVERRIDE_CONTROL=1 diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt index 78c4a6a..e70a977 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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 PROLOG "// something" EPILOG "// more" @@ -67,6 +67,17 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) endif() +# for msvc the compiler version determines which c++11 features are available. +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if(";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;") + list(APPEND true_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND true_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) + else() + list(APPEND false_defs EXPECTED_COMPILER_CXX_DELEGATING_CONSTRUCTORS) + list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES) + endif() +endif() + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") @@ -84,7 +95,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 SunPro + COMPILERS GNU Clang AppleClang MSVC SunPro VERSION 3.1 FEATURES ${cxx_known_features} ${c_known_features} ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 09:59:27 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 09:59:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2498-g1299255 Message-ID: <20150130145927.2D0B2AABAD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 12992551e8100fe99d47e71445af53c2cc06e445 (commit) via 3cec0c75f73cc3d5c68cbb9e03e94ed38d60d0a9 (commit) from 0a278bea71a2927874c95d44710424b87bf7a72d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12992551e8100fe99d47e71445af53c2cc06e445 commit 12992551e8100fe99d47e71445af53c2cc06e445 Merge: 0a278be 3cec0c7 Author: Brad King AuthorDate: Fri Jan 30 09:59:26 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 09:59:26 2015 -0500 Merge topic 'make-NOTPARALLEL-not-PHONY' into next 3cec0c75 Makefile: Generate .NOTPARALLEL without .PHONY (#14312) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3cec0c75f73cc3d5c68cbb9e03e94ed38d60d0a9 commit 3cec0c75f73cc3d5c68cbb9e03e94ed38d60d0a9 Author: Brad King AuthorDate: Fri Jan 30 09:50:09 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 09:50:09 2015 -0500 Makefile: Generate .NOTPARALLEL without .PHONY (#14312) In commit v3.0.0-rc1~222^2 (Makefile: Allow "gmake target1 target2 -j", 2013-12-18) we added generation of a .NOTPARALLEL rule and told the generator it is "symbolic" because the file will never be created. This causes ".PHONY" to be used. However, "clearmake" does not support parsing of .PHONY specifically for .NOTPARALLEL, so simply drop it. This should not affect the role of the .NOTPARALLEL rule for GNU make. diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index f825f5f..fbf2140 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1826,7 +1826,7 @@ void cmLocalUnixMakefileGenerator3 std::vector no_depends; this->WriteMakeRule(ruleFileStream, "Allow only one \"make -f Makefile2\" at a time, but pass parallelism.", - ".NOTPARALLEL", no_depends, no_commands, true); + ".NOTPARALLEL", no_depends, no_commands, false); } } ----------------------------------------------------------------------- Summary of changes: Source/cmLocalUnixMakefileGenerator3.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:05:09 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:05:09 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2500-ge19b6e6 Message-ID: <20150130150509.89E94AACAA@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e19b6e6bc235a94290eb574043488876197fce1a (commit) via 942da844ab9c47660a7353980a52932c37f40ac9 (commit) from 12992551e8100fe99d47e71445af53c2cc06e445 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e19b6e6bc235a94290eb574043488876197fce1a commit e19b6e6bc235a94290eb574043488876197fce1a Merge: 1299255 942da84 Author: Brad King AuthorDate: Fri Jan 30 10:05:08 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 10:05:08 2015 -0500 Merge topic 'fix-cpack-symlink-create-dir' into next 942da844 fixup! Fix bug where symlink could not be created http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=942da844ab9c47660a7353980a52932c37f40ac9 commit 942da844ab9c47660a7353980a52932c37f40ac9 Author: Brad King AuthorDate: Fri Jan 30 10:04:41 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:04:41 2015 -0500 fixup! Fix bug where symlink could not be created diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 9e33d23..1c670d2 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -435,8 +435,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( ++symlinkedIt) { cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: " - << symlinkedIt->second << "--> " - << symlinkedIt->first << std::endl); + << symlinkedIt->second << "--> " + << symlinkedIt->first << std::endl); // make sure directory exists for symlink std::string destDir = cmSystemTools::GetFilenamePath(symlinkedIt->second); ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:06:41 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:06:41 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2502-gaa26ab1 Message-ID: <20150130150641.0D6A3AACC6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via aa26ab1623e5b412167dbb7e45f065cf78cd148f (commit) via 81221b80e2d74d120bfb61c62e07e3f7f1b9929f (commit) from e19b6e6bc235a94290eb574043488876197fce1a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aa26ab1623e5b412167dbb7e45f065cf78cd148f commit aa26ab1623e5b412167dbb7e45f065cf78cd148f Merge: e19b6e6 81221b8 Author: Brad King AuthorDate: Fri Jan 30 10:06:40 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 10:06:40 2015 -0500 Merge topic 'fix-cpack-symlink-create-dir' into next 81221b80 CPack: Fix packaging of source tarballs with symbolic links http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=81221b80e2d74d120bfb61c62e07e3f7f1b9929f commit 81221b80e2d74d120bfb61c62e07e3f7f1b9929f Author: Bill Hoffman AuthorDate: Thu Jan 29 11:52:30 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:06:09 2015 -0500 CPack: Fix packaging of source tarballs with symbolic links When staging the package installation, if the first file in a directory happens to be a symbolic link, make sure we create the directory before trying to create the link. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index f21fcf6..1c670d2 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -437,6 +437,18 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: " << symlinkedIt->second << "--> " << symlinkedIt->first << std::endl); + // make sure directory exists for symlink + std::string destDir = + cmSystemTools::GetFilenamePath(symlinkedIt->second); + if(!destDir.empty() && !cmSystemTools::MakeDirectory(destDir)) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create dir: " + << destDir + << "\nTrying to create symlink: " + << symlinkedIt->second << "--> " + << symlinkedIt->first + << std::endl); + } if (!cmSystemTools::CreateSymlink(symlinkedIt->first, symlinkedIt->second)) { ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:10:48 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:10:48 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2505-gd23ac47 Message-ID: <20150130151048.1FD782270@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via d23ac474f4eecc9b2df70a6205299927253e42fe (commit) via 55e68bc99e62430ba2a94410992effd87bea7e33 (commit) via 4dc5acee634b3ac72f2e1c2f1ca0489526a86cf3 (commit) from aa26ab1623e5b412167dbb7e45f065cf78cd148f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d23ac474f4eecc9b2df70a6205299927253e42fe commit d23ac474f4eecc9b2df70a6205299927253e42fe Merge: aa26ab1 55e68bc Author: Brad King AuthorDate: Fri Jan 30 10:10:47 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 10:10:47 2015 -0500 Merge topic 'fix-cpack-symlink-create-dir' into next 55e68bc9 Merge branch 'backport-fix-cpack-symlink-create-dir' into fix-cpack-symlink-create-dir 4dc5acee CPack: Fix packaging of source tarballs with symbolic links http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=55e68bc99e62430ba2a94410992effd87bea7e33 commit 55e68bc99e62430ba2a94410992effd87bea7e33 Merge: 81221b8 4dc5ace Author: Brad King AuthorDate: Fri Jan 30 10:09:37 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:09:37 2015 -0500 Merge branch 'backport-fix-cpack-symlink-create-dir' into fix-cpack-symlink-create-dir Resolve conflict in Source/CPack/cmCPackGenerator.cxx with our side. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4dc5acee634b3ac72f2e1c2f1ca0489526a86cf3 commit 4dc5acee634b3ac72f2e1c2f1ca0489526a86cf3 Author: Bill Hoffman AuthorDate: Thu Jan 29 11:52:30 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:08:12 2015 -0500 CPack: Fix packaging of source tarballs with symbolic links When staging the package installation, if the first file in a directory happens to be a symbolic link, make sure we create the directory before trying to create the link. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 84e6482..8139d29 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -437,6 +437,18 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: " << symlinkedIt->second << "--> " << symlinkedIt->first << std::endl); + // make sure directory exists for symlink + std::string destDir = + cmSystemTools::GetFilenamePath(symlinkedIt->second); + if(!destDir.empty() && !cmSystemTools::MakeDirectory(destDir)) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create dir: " + << destDir + << "\nTrying to create symlink: " + << symlinkedIt->second << "--> " + << symlinkedIt->first + << std::endl); + } if (!cmSystemTools::CreateSymlink((symlinkedIt->first).c_str(), (symlinkedIt->second).c_str())) { ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:23:02 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:23:02 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-967-gfa5f566 Message-ID: <20150130152302.C1BB9AA3CD@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via fa5f5667763988d7856b98227b5cf74bb42a8203 (commit) via 3526daf5a2667d4bf8aee442d6e73f8b71ea6efc (commit) from dea1631a8f48bebc7402739de58841b8cdf97b8b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fa5f5667763988d7856b98227b5cf74bb42a8203 commit fa5f5667763988d7856b98227b5cf74bb42a8203 Merge: dea1631 3526daf Author: Brad King AuthorDate: Fri Jan 30 10:23:01 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 10:23:01 2015 -0500 Merge topic 'build-require-libarchive-3' 3526daf5 Require libarchive 3.0.0 or later ----------------------------------------------------------------------- Summary of changes: CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:23:04 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:23:04 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-970-ge62e04f Message-ID: <20150130152304.BE7A7AA410@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via e62e04f3bbad6c8bad7183c16c966d20f1aa66cb (commit) via 500794b0db3d7dfa121069f336b69923839bada1 (commit) via 4c5574a15d6458673c410622e501ba682a783781 (commit) from fa5f5667763988d7856b98227b5cf74bb42a8203 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e62e04f3bbad6c8bad7183c16c966d20f1aa66cb commit e62e04f3bbad6c8bad7183c16c966d20f1aa66cb Merge: fa5f566 500794b Author: Brad King AuthorDate: Fri Jan 30 10:23:03 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 10:23:03 2015 -0500 Merge topic 'vs-windows-store-default-language' 500794b0 VS: Set default language in generated Windows Phone and Store projects 4c5574a1 VS: Add missing newlines to .vcxproj generation ----------------------------------------------------------------------- Summary of changes: Source/cmVisualStudio10TargetGenerator.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:23:07 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:23:07 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-972-g85fe940 Message-ID: <20150130152307.1531AAA4A9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 85fe9400cd68805501d2cd98cf7375c8845492f6 (commit) via 8a93d3ea1806229460f16c447b3d5ebcc80ed29c (commit) from e62e04f3bbad6c8bad7183c16c966d20f1aa66cb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85fe9400cd68805501d2cd98cf7375c8845492f6 commit 85fe9400cd68805501d2cd98cf7375c8845492f6 Merge: e62e04f 8a93d3e Author: Brad King AuthorDate: Fri Jan 30 10:23:05 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 10:23:05 2015 -0500 Merge topic 'ninja-msvc-only-C-and-CXX' 8a93d3ea Ninja: Use "deps = msvc" only for C and CXX (#15253) ----------------------------------------------------------------------- Summary of changes: Source/cmNinjaTargetGenerator.cxx | 52 ++++++++++++++++--------------------- Source/cmNinjaTargetGenerator.h | 2 +- 2 files changed, 24 insertions(+), 30 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:23:09 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:23:09 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-976-gdb4b9fe Message-ID: <20150130152309.8DD2CAA4A9@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via db4b9fe25673c252a93c15040909d328dc83dde9 (commit) via 55e68bc99e62430ba2a94410992effd87bea7e33 (commit) via 4dc5acee634b3ac72f2e1c2f1ca0489526a86cf3 (commit) via 81221b80e2d74d120bfb61c62e07e3f7f1b9929f (commit) from 85fe9400cd68805501d2cd98cf7375c8845492f6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db4b9fe25673c252a93c15040909d328dc83dde9 commit db4b9fe25673c252a93c15040909d328dc83dde9 Merge: 85fe940 55e68bc Author: Brad King AuthorDate: Fri Jan 30 10:23:07 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 10:23:07 2015 -0500 Merge topic 'fix-cpack-symlink-create-dir' 55e68bc9 Merge branch 'backport-fix-cpack-symlink-create-dir' into fix-cpack-symlink-create-dir 4dc5acee CPack: Fix packaging of source tarballs with symbolic links 81221b80 CPack: Fix packaging of source tarballs with symbolic links ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:23:11 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:23:11 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-979-gedc9ff9 Message-ID: <20150130152312.0D7D2AA3B1@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via edc9ff9422b7730a11aaa9a36458f16a5800ec17 (commit) via d3489bdb0bc58b36f1e5ff2baa0aee8f4daea734 (commit) via 3228fc5049e72e6d7584a6f3cec6055b8a726817 (commit) from db4b9fe25673c252a93c15040909d328dc83dde9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=edc9ff9422b7730a11aaa9a36458f16a5800ec17 commit edc9ff9422b7730a11aaa9a36458f16a5800ec17 Merge: db4b9fe d3489bd Author: Brad King AuthorDate: Fri Jan 30 10:23:10 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 10:23:10 2015 -0500 Merge topic 'feature-record-msvc' d3489bdb Features: Record for MSVC 2010-2015 3228fc50 Features: Define meaning for no language standard default ----------------------------------------------------------------------- Summary of changes: Help/manual/cmake-developer.7.rst | 4 +- Help/prop_tgt/CXX_STANDARD.rst | 3 +- Help/prop_tgt/CXX_STANDARD_REQUIRED.rst | 3 +- Help/prop_tgt/C_STANDARD.rst | 3 +- Help/prop_tgt/C_STANDARD_REQUIRED.rst | 3 +- Help/release/dev/feature-record-msvc.rst | 5 + Modules/Compiler/MSVC-CXX-FeatureTests.cmake | 106 ++++++++++++++++++++ Modules/Compiler/MSVC-CXX.cmake | 6 ++ Modules/WriteCompilerDetectionHeader.cmake | 9 +- Source/cmGeneratorExpressionEvaluator.cxx | 11 +- Source/cmLocalGenerator.cxx | 9 +- Source/cmMakefile.cxx | 46 ++++++++- Tests/CompileFeatures/CMakeLists.txt | 84 +++++++++++++--- .../WriteCompilerDetectionHeader/CMakeLists.txt | 15 ++- Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake | 36 ++++--- .../CompileFeatures/generate_feature_list.cmake | 14 +++ 16 files changed, 311 insertions(+), 46 deletions(-) create mode 100644 Help/release/dev/feature-record-msvc.rst create mode 100644 Modules/Compiler/MSVC-CXX-FeatureTests.cmake create mode 100644 Modules/Compiler/MSVC-CXX.cmake hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:24:00 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:24:00 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2512-gb3362a2 Message-ID: <20150130152400.84481AA537@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via b3362a20f5eabd0f373154332612907e5aa1f48a (commit) via edc9ff9422b7730a11aaa9a36458f16a5800ec17 (commit) via db4b9fe25673c252a93c15040909d328dc83dde9 (commit) via 85fe9400cd68805501d2cd98cf7375c8845492f6 (commit) via e62e04f3bbad6c8bad7183c16c966d20f1aa66cb (commit) via fa5f5667763988d7856b98227b5cf74bb42a8203 (commit) via dea1631a8f48bebc7402739de58841b8cdf97b8b (commit) from d23ac474f4eecc9b2df70a6205299927253e42fe (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b3362a20f5eabd0f373154332612907e5aa1f48a commit b3362a20f5eabd0f373154332612907e5aa1f48a Merge: d23ac47 edc9ff9 Author: Brad King AuthorDate: Fri Jan 30 10:23:48 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:23:48 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:25:38 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:25:38 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-981-g36a1ef4 Message-ID: <20150130152538.3383CAA789@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 36a1ef43daad760136deeb8f9934266550764c58 (commit) via 37662ea4bf64087f2251e2f4a71a13623cfe047f (commit) from edc9ff9422b7730a11aaa9a36458f16a5800ec17 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:25:38 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:25:38 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2515-ge0ca5c2 Message-ID: <20150130152538.52CE1AA7DB@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e0ca5c27ed79a417523904c9571f199439a45b3b (commit) via 36a1ef43daad760136deeb8f9934266550764c58 (commit) via 37662ea4bf64087f2251e2f4a71a13623cfe047f (commit) from b3362a20f5eabd0f373154332612907e5aa1f48a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0ca5c27ed79a417523904c9571f199439a45b3b commit e0ca5c27ed79a417523904c9571f199439a45b3b Merge: b3362a2 36a1ef4 Author: Brad King AuthorDate: Fri Jan 30 10:25:06 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:25:06 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:25:38 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:25:38 -0500 (EST) Subject: [Cmake-commits] CMake branch, release, updated. v3.1.1-14-g37662ea Message-ID: <20150130152538.63309AA7E8@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, release has been updated via 37662ea4bf64087f2251e2f4a71a13623cfe047f (commit) via 4dc5acee634b3ac72f2e1c2f1ca0489526a86cf3 (commit) from 048fb8e3d0dd41f73f3a12f6ce3b13c80148ea3e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:36:54 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:36:54 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2519-g86c4b28 Message-ID: <20150130153654.20EFAAAD37@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 86c4b287dcaec066926c5a637a090857659f6f93 (commit) via b08ceba40b1c6e3276155c21aa6517f5934be688 (commit) via 5076bed36e119e91b303f328bf6f5e18d3957b8f (commit) via 18e3771ac7c74986a4f06221a72781ace54b1169 (commit) from e0ca5c27ed79a417523904c9571f199439a45b3b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=86c4b287dcaec066926c5a637a090857659f6f93 commit 86c4b287dcaec066926c5a637a090857659f6f93 Merge: e0ca5c2 b08ceba Author: Brad King AuthorDate: Fri Jan 30 10:36:53 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 10:36:53 2015 -0500 Merge topic 'clean_up_cdash_upload_files' into next b08ceba4 CTestCoverageCollectGCOV: Add test case 5076bed3 CTestCoverageCollectGCOV: Fix handling of large file counts 18e3771a ctest_submit: Escape URL components in CDASH_UPLOAD mode http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b08ceba40b1c6e3276155c21aa6517f5934be688 commit b08ceba40b1c6e3276155c21aa6517f5934be688 Author: Bill Hoffman AuthorDate: Wed Jan 28 17:08:41 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:36:39 2015 -0500 CTestCoverageCollectGCOV: Add test case diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 3aecd9b..1a79854 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2269,6 +2269,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release PASS_REGULAR_EXPRESSION "Upload\\.xml") configure_file( + "${CMake_SOURCE_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(CTestCoverageCollectGCOV ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" -VV + --output-log "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/testOut.log" + ) + set_tests_properties(CTestCoverageCollectGCOV PROPERTIES + PASS_REGULAR_EXPRESSION + "PASSED with correct output.*Testing/CoverageInfo/echoargs.gcov") + + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake" @ONLY ESCAPE_QUOTES) diff --git a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake new file mode 100644 index 0000000..e704f14 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake @@ -0,0 +1,8 @@ +foreach(I RANGE 0 ${CMAKE_ARGC}) + if("${CMAKE_ARGV${I}}" MATCHES ".*\\.gcda") + set(gcda_file "${CMAKE_ARGV${I}}") + endif() +endforeach() +get_filename_component(gcda_file ${gcda_file} NAME_WE) +file(WRITE "${CMAKE_SOURCE_DIR}/${gcda_file}.gcov" +"fake gcov file") diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in new file mode 100644 index 0000000..2560542 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 2.8.12) +set(CTEST_PROJECT_NAME "SmallAndFast") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +ctest_start(Experimental) +ctest_configure() +ctest_build() +ctest_test() + +file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeFiles/echoargs.dir/echoargs.gcda +"dummy +") + +include(CTestCoverageCollectGCOV) +set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tar) +ctest_coverage_collect_gcov( + TARBALL "${tar_file}" + SOURCE "${CTEST_SOURCE_DIRECTORY}" + BUILD "${CTEST_BINARY_DIRECTORY}" + GCOV_COMMAND "${CMAKE_COMMAND}" + GCOV_EXTRA_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake") + +execute_process(COMMAND + ${CMAKE_COMMAND} -E tar tf ${tar_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) + +set(expected_out +"Testing/CoverageInfo/echoargs.gcov +Testing/CoverageInfo/data.json +CMakeFiles/echoargs.dir/Labels.json +") + +if("${out}" STREQUAL "${expected_out}") + message("PASSED with correct output: ${out}") +else() + message(FATAL_ERROR "FAILED: expected:\n${expected_out}\nGot:\n${out}") +endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5076bed36e119e91b303f328bf6f5e18d3957b8f commit 5076bed36e119e91b303f328bf6f5e18d3957b8f Author: Bill Hoffman AuthorDate: Wed Jan 28 17:08:41 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:36:38 2015 -0500 CTestCoverageCollectGCOV: Fix handling of large file counts Use the --files-from option to tar to handle lots of files. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index f6616e0..edb1466 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -39,6 +39,13 @@ # ``GCOV_COMMAND `` # Specify the full path to the ``gcov`` command on the machine. # Default is the value of :variable:`CTEST_COVERAGE_COMMAND`. +# +# ``GCOV_EXTRA_OPTIONS `` +# Specify extra options to be passed to gcov. By default +# gcov is run like this gcov -b -o ${gcov_dir} ${gcda_file_path} +# If GCOV_EXTRA_OPTIONS are specified, it will be run like this: +# ``gcov`` ${GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file_path} + #============================================================================= # Copyright 2014-2015 Kitware, Inc. @@ -56,7 +63,7 @@ include(CMakeParseArguments) function(ctest_coverage_collect_gcov) set(options "") set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) - set(multiValueArgs "") + set(multiValueArgs GCOV_EXTRA_OPTIONS) cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" "${multiValueArgs}" "" ${ARGN} ) if(NOT DEFINED GCOV_TARBALL) @@ -86,7 +93,7 @@ function(ctest_coverage_collect_gcov) # this will be faster and only look where the files will be file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) foreach(target_dir ${target_dirs}) - file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") + file(GLOB_RECURSE gfiles RELATIVE "${binary_dir}" ${target_dir}/*.gcda) list(LENGTH gfiles len) # if we have gcda files then also grab the labels file for that target if(${len} GREATER 0) @@ -113,11 +120,18 @@ function(ctest_coverage_collect_gcov) get_filename_component(gcov_dir ${gcda_file} DIRECTORY) # run gcov, this will produce the .gcov file in the current # working directory + if(NOT DEFINED GCOV_GCOV_EXTRA_OPTIONS) + set(GCOV_GCOV_EXTRA_OPTIONS -b -o) + endif() execute_process(COMMAND - ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + ${gcov_command} ${GCOV_GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file} OUTPUT_VARIABLE out + RESULT_VARIABLE res WORKING_DIRECTORY ${coverage_dir}) endforeach() + if(NOT "${res}" EQUAL 0) + message(STATUS "Error running gcov: ${res} ${out}") + endif() # create json file with project information file(WRITE ${coverage_dir}/data.json "{ @@ -130,9 +144,16 @@ function(ctest_coverage_collect_gcov) # tar up the coverage info with the same date so that the md5 # sum will be the same for the tar file independent of file time # stamps + string(REPLACE ";" "\n" gcov_files "${gcov_files}") + string(REPLACE ";" "\n" label_files "${label_files}") + file(WRITE "${coverage_dir}/coverage_file_list.txt" + "${gcov_files} +${coverage_dir}/data.json +${label_files} +") execute_process(COMMAND ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} - "--mtime=1970-01-01 0:0:0 UTC" ${gcov_files} - ${coverage_dir}/data.json ${label_files} + "--mtime=1970-01-01 0:0:0 UTC" + --files-from=${coverage_dir}/coverage_file_list.txt WORKING_DIRECTORY ${binary_dir}) endfunction() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=18e3771ac7c74986a4f06221a72781ace54b1169 commit 18e3771ac7c74986a4f06221a72781ace54b1169 Author: Bill Hoffman AuthorDate: Thu Jan 29 14:42:44 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:36:38 2015 -0500 ctest_submit: Escape URL components in CDASH_UPLOAD mode Call curl_easy_escape on arguments sent to CDash upload. diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index b0d26cc..b4c0137 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -25,6 +25,21 @@ cmCTestCurl::cmCTestCurl(cmCTest* ctest) this->VerifyPeerOff = false; this->VerifyHostOff = false; this->TimeOutSeconds = 0; + this->Curl = curl_easy_init(); +} + +cmCTestCurl::~cmCTestCurl() +{ + ::curl_easy_cleanup(this->Curl); + ::curl_global_cleanup(); +} + +std::string cmCTestCurl::Escape(std::string const& source) +{ + char* data1 = curl_easy_escape(this->Curl, source.c_str(), 0); + std::string ret = data1; + curl_free(data1); + return ret; } namespace @@ -73,7 +88,6 @@ void cmCTestCurl::SetCurlOptions(std::vector const& args) bool cmCTestCurl::InitCurl() { - this->Curl = curl_easy_init(); if(!this->Curl) { return false; @@ -160,7 +174,6 @@ bool cmCTestCurl::UploadFile(std::string const& local_file, // Now run off and do what you've been told! ::curl_easy_perform(this->Curl); ::fclose(ftpfile); - ::curl_global_cleanup(); if ( responseData.size() > 0 ) { @@ -213,8 +226,6 @@ bool cmCTestCurl::HttpRequest(std::string const& url, CURLcode res = ::curl_easy_perform(this->Curl); - ::curl_easy_cleanup(this->Curl); - ::curl_global_cleanup(); if ( responseData.size() > 0 ) { response = std::string(responseData.begin(), responseData.end()); diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h index 5bb8b41..0737bb6 100644 --- a/Source/CTest/cmCTestCurl.h +++ b/Source/CTest/cmCTestCurl.h @@ -22,6 +22,7 @@ class cmCTestCurl { public: cmCTestCurl(cmCTest*); + ~cmCTestCurl(); bool UploadFile(std::string const& url, std::string const& file, std::string const& fields, @@ -34,6 +35,7 @@ public: void SetCurlOptions(std::vector const& args); void SetUseHttp10On() { this->UseHttp10 = true;} void SetTimeOutSeconds(int s) { this->TimeOutSeconds = s;} + std::string Escape(std::string const& source); protected: void SetProxyType(); bool InitCurl(); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 3d9545f..5b52df7 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1128,21 +1128,24 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, // TODO: Encode values for a URL instead of trusting caller. std::ostringstream str; str << "project=" - << this->CTest->GetCTestConfiguration("ProjectName") << "&"; + << curl.Escape(this->CTest->GetCTestConfiguration("ProjectName")) << "&"; if(subproject) { - str << "subproject=" << subproject << "&"; + str << "subproject=" << curl.Escape(subproject) << "&"; } - str << "stamp=" << this->CTest->GetCurrentTag() << "-" - << this->CTest->GetTestModelString() << "&" - << "model=" << this->CTest->GetTestModelString() << "&" - << "build=" << this->CTest->GetCTestConfiguration("BuildName") << "&" - << "site=" << this->CTest->GetCTestConfiguration("Site") << "&" - << "track=" << this->CTest->GetTestModelString() << "&" + str << "stamp=" << curl.Escape(this->CTest->GetCurrentTag()) << "-" + << curl.Escape(this->CTest->GetTestModelString()) << "&" + << "model=" << curl.Escape(this->CTest->GetTestModelString()) << "&" + << "build=" + << curl.Escape(this->CTest->GetCTestConfiguration("BuildName")) << "&" + << "site=" + << curl.Escape(this->CTest->GetCTestConfiguration("Site")) << "&" + << "track=" + << curl.Escape(this->CTest->GetTestModelString()) << "&" << "starttime=" << (int)cmSystemTools::GetTime() << "&" << "endtime=" << (int)cmSystemTools::GetTime() << "&" << "datafilesmd5[0]=" << md5sum << "&" - << "type=" << typeString; + << "type=" << curl.Escape(typeString); std::string fields = str.str(); cmCTestLog(this->CTest, DEBUG, "fields: " << fields << "\nurl:" << url << "\nfile: " << file << "\n"); @@ -1192,9 +1195,9 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, std::string upload_as = cmSystemTools::GetFilenameName(file); std::ostringstream fstr; - fstr << "type=" << typeString << "&" + fstr << "type=" << curl.Escape(typeString) << "&" << "md5=" << md5sum << "&" - << "filename=" << upload_as << "&" + << "filename=" << curl.Escape(upload_as) << "&" << "buildid=" << json["buildid"].asString(); if(!curl.UploadFile(file, url, fstr.str(), response)) { ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:39:13 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:39:13 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-983-ga01f81b Message-ID: <20150130153913.57A9D789@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via a01f81b9064a31760787bc6a2fb9305ef97117e7 (commit) via 18e3771ac7c74986a4f06221a72781ace54b1169 (commit) from 36a1ef43daad760136deeb8f9934266550764c58 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a01f81b9064a31760787bc6a2fb9305ef97117e7 commit a01f81b9064a31760787bc6a2fb9305ef97117e7 Merge: 36a1ef4 18e3771 Author: Brad King AuthorDate: Fri Jan 30 10:39:12 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 10:39:12 2015 -0500 Merge topic 'ctest_submmit-CDASH_UPLOAD-encode-url' 18e3771a ctest_submit: Escape URL components in CDASH_UPLOAD mode ----------------------------------------------------------------------- Summary of changes: Source/CTest/cmCTestCurl.cxx | 19 +++++++++++++++---- Source/CTest/cmCTestCurl.h | 2 ++ Source/CTest/cmCTestSubmitHandler.cxx | 25 ++++++++++++++----------- 3 files changed, 31 insertions(+), 15 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:39:30 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:39:30 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2521-gf52c5a4 Message-ID: <20150130153930.3D2E914E5@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via f52c5a45dd025d8c30c7505e36b03226e3e0a43a (commit) via a01f81b9064a31760787bc6a2fb9305ef97117e7 (commit) from 86c4b287dcaec066926c5a637a090857659f6f93 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f52c5a45dd025d8c30c7505e36b03226e3e0a43a commit f52c5a45dd025d8c30c7505e36b03226e3e0a43a Merge: 86c4b28 a01f81b Author: Brad King AuthorDate: Fri Jan 30 10:39:19 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:39:19 2015 -0500 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 10:47:58 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 10:47:58 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2524-g569a549 Message-ID: <20150130154758.E52AEAA762@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 569a549c79b6d8bd349727ad274881f15cdef7c2 (commit) via 95935743d9fbad24925ca9f96b5090786caa3cde (commit) via e2daec33c651b05933c1b2af000349a9c89e982c (commit) from f52c5a45dd025d8c30c7505e36b03226e3e0a43a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=569a549c79b6d8bd349727ad274881f15cdef7c2 commit 569a549c79b6d8bd349727ad274881f15cdef7c2 Merge: f52c5a4 9593574 Author: Brad King AuthorDate: Fri Jan 30 10:47:58 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 10:47:58 2015 -0500 Merge topic 'clean_up_cdash_upload_files' into next 95935743 CTestCoverageCollectGCOV: Add test case e2daec33 CTestCoverageCollectGCOV: Fix handling of large file counts http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95935743d9fbad24925ca9f96b5090786caa3cde commit 95935743d9fbad24925ca9f96b5090786caa3cde Author: Bill Hoffman AuthorDate: Wed Jan 28 17:08:41 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:47:27 2015 -0500 CTestCoverageCollectGCOV: Add test case diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index f8058cd..edb1466 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -39,6 +39,13 @@ # ``GCOV_COMMAND `` # Specify the full path to the ``gcov`` command on the machine. # Default is the value of :variable:`CTEST_COVERAGE_COMMAND`. +# +# ``GCOV_EXTRA_OPTIONS `` +# Specify extra options to be passed to gcov. By default +# gcov is run like this gcov -b -o ${gcov_dir} ${gcda_file_path} +# If GCOV_EXTRA_OPTIONS are specified, it will be run like this: +# ``gcov`` ${GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file_path} + #============================================================================= # Copyright 2014-2015 Kitware, Inc. @@ -56,7 +63,7 @@ include(CMakeParseArguments) function(ctest_coverage_collect_gcov) set(options "") set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) - set(multiValueArgs "") + set(multiValueArgs GCOV_EXTRA_OPTIONS) cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" "${multiValueArgs}" "" ${ARGN} ) if(NOT DEFINED GCOV_TARBALL) @@ -86,7 +93,7 @@ function(ctest_coverage_collect_gcov) # this will be faster and only look where the files will be file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) foreach(target_dir ${target_dirs}) - file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") + file(GLOB_RECURSE gfiles RELATIVE "${binary_dir}" ${target_dir}/*.gcda) list(LENGTH gfiles len) # if we have gcda files then also grab the labels file for that target if(${len} GREATER 0) @@ -113,11 +120,18 @@ function(ctest_coverage_collect_gcov) get_filename_component(gcov_dir ${gcda_file} DIRECTORY) # run gcov, this will produce the .gcov file in the current # working directory + if(NOT DEFINED GCOV_GCOV_EXTRA_OPTIONS) + set(GCOV_GCOV_EXTRA_OPTIONS -b -o) + endif() execute_process(COMMAND - ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + ${gcov_command} ${GCOV_GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file} OUTPUT_VARIABLE out + RESULT_VARIABLE res WORKING_DIRECTORY ${coverage_dir}) endforeach() + if(NOT "${res}" EQUAL 0) + message(STATUS "Error running gcov: ${res} ${out}") + endif() # create json file with project information file(WRITE ${coverage_dir}/data.json "{ diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 3aecd9b..1a79854 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2269,6 +2269,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release PASS_REGULAR_EXPRESSION "Upload\\.xml") configure_file( + "${CMake_SOURCE_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(CTestCoverageCollectGCOV ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" -VV + --output-log "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/testOut.log" + ) + set_tests_properties(CTestCoverageCollectGCOV PROPERTIES + PASS_REGULAR_EXPRESSION + "PASSED with correct output.*Testing/CoverageInfo/echoargs.gcov") + + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake" @ONLY ESCAPE_QUOTES) diff --git a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake new file mode 100644 index 0000000..e704f14 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake @@ -0,0 +1,8 @@ +foreach(I RANGE 0 ${CMAKE_ARGC}) + if("${CMAKE_ARGV${I}}" MATCHES ".*\\.gcda") + set(gcda_file "${CMAKE_ARGV${I}}") + endif() +endforeach() +get_filename_component(gcda_file ${gcda_file} NAME_WE) +file(WRITE "${CMAKE_SOURCE_DIR}/${gcda_file}.gcov" +"fake gcov file") diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in new file mode 100644 index 0000000..2560542 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 2.8.12) +set(CTEST_PROJECT_NAME "SmallAndFast") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +ctest_start(Experimental) +ctest_configure() +ctest_build() +ctest_test() + +file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeFiles/echoargs.dir/echoargs.gcda +"dummy +") + +include(CTestCoverageCollectGCOV) +set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tar) +ctest_coverage_collect_gcov( + TARBALL "${tar_file}" + SOURCE "${CTEST_SOURCE_DIRECTORY}" + BUILD "${CTEST_BINARY_DIRECTORY}" + GCOV_COMMAND "${CMAKE_COMMAND}" + GCOV_EXTRA_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake") + +execute_process(COMMAND + ${CMAKE_COMMAND} -E tar tf ${tar_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) + +set(expected_out +"Testing/CoverageInfo/echoargs.gcov +Testing/CoverageInfo/data.json +CMakeFiles/echoargs.dir/Labels.json +") + +if("${out}" STREQUAL "${expected_out}") + message("PASSED with correct output: ${out}") +else() + message(FATAL_ERROR "FAILED: expected:\n${expected_out}\nGot:\n${out}") +endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e2daec33c651b05933c1b2af000349a9c89e982c commit e2daec33c651b05933c1b2af000349a9c89e982c Author: Bill Hoffman AuthorDate: Wed Jan 28 17:08:41 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 10:46:42 2015 -0500 CTestCoverageCollectGCOV: Fix handling of large file counts Use the --files-from option to tar to handle lots of files. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index f6616e0..f8058cd 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -130,9 +130,16 @@ function(ctest_coverage_collect_gcov) # tar up the coverage info with the same date so that the md5 # sum will be the same for the tar file independent of file time # stamps + string(REPLACE ";" "\n" gcov_files "${gcov_files}") + string(REPLACE ";" "\n" label_files "${label_files}") + file(WRITE "${coverage_dir}/coverage_file_list.txt" + "${gcov_files} +${coverage_dir}/data.json +${label_files} +") execute_process(COMMAND ${CMAKE_COMMAND} -E tar cvfj ${GCOV_TARBALL} - "--mtime=1970-01-01 0:0:0 UTC" ${gcov_files} - ${coverage_dir}/data.json ${label_files} + "--mtime=1970-01-01 0:0:0 UTC" + --files-from=${coverage_dir}/coverage_file_list.txt WORKING_DIRECTORY ${binary_dir}) endfunction() ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From bill.hoffman at kitware.com Fri Jan 30 11:37:52 2015 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Fri, 30 Jan 2015 11:37:52 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2526-g01cd4d7 Message-ID: <20150130163752.988F3AAD87@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 01cd4d7da617553f3f0322c1ab6bb2304e652855 (commit) via dd8fccdc0f0e64c45f7098da497262454678721f (commit) from 569a549c79b6d8bd349727ad274881f15cdef7c2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=01cd4d7da617553f3f0322c1ab6bb2304e652855 commit 01cd4d7da617553f3f0322c1ab6bb2304e652855 Merge: 569a549 dd8fccd Author: Bill Hoffman AuthorDate: Fri Jan 30 11:37:51 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 11:37:51 2015 -0500 Merge topic 'clean_up_cdash_upload_files' into next dd8fccdc Make CTest GCOV_EXTRA_OPTIONS work like CoverageExtraFlags. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd8fccdc0f0e64c45f7098da497262454678721f commit dd8fccdc0f0e64c45f7098da497262454678721f Author: Bill Hoffman AuthorDate: Fri Jan 30 11:34:16 2015 -0500 Commit: Bill Hoffman CommitDate: Fri Jan 30 11:34:16 2015 -0500 Make CTest GCOV_EXTRA_OPTIONS work like CoverageExtraFlags. In the existing gcov code, if you set CTEST_COVERAGE_EXTRA_FLAGS, they get put on the command line before the -o. In this case we remove the -b and replace it with GCOV_EXTRA_OPTIONS. All other arguments remain the same. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index edb1466..08f0805 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -44,7 +44,7 @@ # Specify extra options to be passed to gcov. By default # gcov is run like this gcov -b -o ${gcov_dir} ${gcda_file_path} # If GCOV_EXTRA_OPTIONS are specified, it will be run like this: -# ``gcov`` ${GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file_path} +# ``gcov`` ${GCOV_EXTRA_OPTIONS} -o ${gcov_dir} ${gcda_file_path} #============================================================================= @@ -121,10 +121,10 @@ function(ctest_coverage_collect_gcov) # run gcov, this will produce the .gcov file in the current # working directory if(NOT DEFINED GCOV_GCOV_EXTRA_OPTIONS) - set(GCOV_GCOV_EXTRA_OPTIONS -b -o) + set(GCOV_GCOV_EXTRA_OPTIONS -b) endif() execute_process(COMMAND - ${gcov_command} ${GCOV_GCOV_EXTRA_OPTIONS} ${gcov_dir} ${gcda_file} + ${gcov_command} ${GCOV_GCOV_EXTRA_OPTIONS} -o ${gcov_dir} ${gcda_file} OUTPUT_VARIABLE out RESULT_VARIABLE res WORKING_DIRECTORY ${coverage_dir}) ----------------------------------------------------------------------- Summary of changes: Modules/CTestCoverageCollectGCOV.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 12:53:21 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 12:53:21 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2528-ge53a624 Message-ID: <20150130175321.86C35AAB2F@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via e53a6242b570d8dbaeef136a5683f2138860f213 (commit) via d4e0eee7698f4edda7f91bb7a8d0f5589feea7fd (commit) from 01cd4d7da617553f3f0322c1ab6bb2304e652855 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e53a6242b570d8dbaeef136a5683f2138860f213 commit e53a6242b570d8dbaeef136a5683f2138860f213 Merge: 01cd4d7 d4e0eee Author: Brad King AuthorDate: Fri Jan 30 12:53:20 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 12:53:20 2015 -0500 Merge topic 'clean_up_cdash_upload_files' into next d4e0eee7 fixup! Make CTest GCOV_EXTRA_OPTIONS work like CoverageExtraFlags. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4e0eee7698f4edda7f91bb7a8d0f5589feea7fd commit d4e0eee7698f4edda7f91bb7a8d0f5589feea7fd Author: Brad King AuthorDate: Fri Jan 30 12:47:02 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 12:47:02 2015 -0500 fixup! Make CTest GCOV_EXTRA_OPTIONS work like CoverageExtraFlags. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index 08f0805..037d3bc 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -19,6 +19,7 @@ # ctest_coverage_collect_gcov(TARBALL # [SOURCE ][BUILD ] # [GCOV_COMMAND ] +# [GCOV_EXTRA_OPTIONS ...] # ) # # Run gcov and package a tar file for CDash. The options are: @@ -40,11 +41,11 @@ # Specify the full path to the ``gcov`` command on the machine. # Default is the value of :variable:`CTEST_COVERAGE_COMMAND`. # -# ``GCOV_EXTRA_OPTIONS `` +# ``GCOV_EXTRA_OPTIONS ...`` # Specify extra options to be passed to gcov. By default -# gcov is run like this gcov -b -o ${gcov_dir} ${gcda_file_path} -# If GCOV_EXTRA_OPTIONS are specified, it will be run like this: -# ``gcov`` ${GCOV_EXTRA_OPTIONS} -o ${gcov_dir} ${gcda_file_path} +# gcov is run as ``gcov -b -o .gcda``. +# If GCOV_EXTRA_OPTIONS is specified, gcov will be run as +# ``gcov ... -o .gcda``. #============================================================================= @@ -93,7 +94,7 @@ function(ctest_coverage_collect_gcov) # this will be faster and only look where the files will be file(STRINGS "${binary_dir}/CMakeFiles/TargetDirectories.txt" target_dirs) foreach(target_dir ${target_dirs}) - file(GLOB_RECURSE gfiles RELATIVE "${binary_dir}" ${target_dir}/*.gcda) + file(GLOB_RECURSE gfiles RELATIVE ${binary_dir} "${target_dir}/*.gcda") list(LENGTH gfiles len) # if we have gcda files then also grab the labels file for that target if(${len} GREATER 0) ----------------------------------------------------------------------- Summary of changes: Modules/CTestCoverageCollectGCOV.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) hooks/post-receive -- CMake From brad.king at kitware.com Fri Jan 30 12:53:27 2015 From: brad.king at kitware.com (Brad King) Date: Fri, 30 Jan 2015 12:53:27 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2531-g143e6f7 Message-ID: <20150130175327.C4D1BAAB36@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 143e6f73a66c7d942c428269c39b6b994d67aa3b (commit) via 4da6ab0834bac654df245e87ff832afafe8d29f2 (commit) via 59a2f4390a0866d719c9c5a03aba28089cfd6d37 (commit) from e53a6242b570d8dbaeef136a5683f2138860f213 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=143e6f73a66c7d942c428269c39b6b994d67aa3b commit 143e6f73a66c7d942c428269c39b6b994d67aa3b Merge: e53a624 4da6ab0 Author: Brad King AuthorDate: Fri Jan 30 12:53:27 2015 -0500 Commit: CMake Topic Stage CommitDate: Fri Jan 30 12:53:27 2015 -0500 Merge topic 'clean_up_cdash_upload_files' into next 4da6ab08 CTestCoverageCollectGCOV: Add test case 59a2f439 CTestCoverageCollectGCOV: Allow custom flags to gcov http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4da6ab0834bac654df245e87ff832afafe8d29f2 commit 4da6ab0834bac654df245e87ff832afafe8d29f2 Author: Bill Hoffman AuthorDate: Wed Jan 28 17:08:41 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 12:51:12 2015 -0500 CTestCoverageCollectGCOV: Add test case diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 3aecd9b..1a79854 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2269,6 +2269,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release PASS_REGULAR_EXPRESSION "Upload\\.xml") configure_file( + "${CMake_SOURCE_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(CTestCoverageCollectGCOV ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" -VV + --output-log "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/testOut.log" + ) + set_tests_properties(CTestCoverageCollectGCOV PROPERTIES + PASS_REGULAR_EXPRESSION + "PASSED with correct output.*Testing/CoverageInfo/echoargs.gcov") + + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestEmptyBinaryDirectory/test.cmake" @ONLY ESCAPE_QUOTES) diff --git a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake new file mode 100644 index 0000000..e704f14 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake @@ -0,0 +1,8 @@ +foreach(I RANGE 0 ${CMAKE_ARGC}) + if("${CMAKE_ARGV${I}}" MATCHES ".*\\.gcda") + set(gcda_file "${CMAKE_ARGV${I}}") + endif() +endforeach() +get_filename_component(gcda_file ${gcda_file} NAME_WE) +file(WRITE "${CMAKE_SOURCE_DIR}/${gcda_file}.gcov" +"fake gcov file") diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in new file mode 100644 index 0000000..2560542 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -0,0 +1,39 @@ +cmake_minimum_required(VERSION 2.8.12) +set(CTEST_PROJECT_NAME "SmallAndFast") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +ctest_start(Experimental) +ctest_configure() +ctest_build() +ctest_test() + +file(WRITE ${CTEST_BINARY_DIRECTORY}/CMakeFiles/echoargs.dir/echoargs.gcda +"dummy +") + +include(CTestCoverageCollectGCOV) +set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tar) +ctest_coverage_collect_gcov( + TARBALL "${tar_file}" + SOURCE "${CTEST_SOURCE_DIRECTORY}" + BUILD "${CTEST_BINARY_DIRECTORY}" + GCOV_COMMAND "${CMAKE_COMMAND}" + GCOV_EXTRA_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake") + +execute_process(COMMAND + ${CMAKE_COMMAND} -E tar tf ${tar_file} + OUTPUT_VARIABLE out + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) + +set(expected_out +"Testing/CoverageInfo/echoargs.gcov +Testing/CoverageInfo/data.json +CMakeFiles/echoargs.dir/Labels.json +") + +if("${out}" STREQUAL "${expected_out}") + message("PASSED with correct output: ${out}") +else() + message(FATAL_ERROR "FAILED: expected:\n${expected_out}\nGot:\n${out}") +endif() http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59a2f4390a0866d719c9c5a03aba28089cfd6d37 commit 59a2f4390a0866d719c9c5a03aba28089cfd6d37 Author: Bill Hoffman AuthorDate: Wed Jan 28 17:08:41 2015 -0500 Commit: Brad King CommitDate: Fri Jan 30 12:50:33 2015 -0500 CTestCoverageCollectGCOV: Allow custom flags to gcov Add GCOV_EXTRA_OPTIONS option to allow specification of custom flags. In ctest_coverage gcov support, if you set CTEST_COVERAGE_EXTRA_FLAGS, they get put on the command line before the -o. In this case we remove the -b and replace it with GCOV_EXTRA_OPTIONS. All other arguments remain the same. diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake index f8058cd..037d3bc 100644 --- a/Modules/CTestCoverageCollectGCOV.cmake +++ b/Modules/CTestCoverageCollectGCOV.cmake @@ -19,6 +19,7 @@ # ctest_coverage_collect_gcov(TARBALL # [SOURCE ][BUILD ] # [GCOV_COMMAND ] +# [GCOV_EXTRA_OPTIONS ...] # ) # # Run gcov and package a tar file for CDash. The options are: @@ -39,6 +40,13 @@ # ``GCOV_COMMAND `` # Specify the full path to the ``gcov`` command on the machine. # Default is the value of :variable:`CTEST_COVERAGE_COMMAND`. +# +# ``GCOV_EXTRA_OPTIONS ...`` +# Specify extra options to be passed to gcov. By default +# gcov is run as ``gcov -b -o .gcda``. +# If GCOV_EXTRA_OPTIONS is specified, gcov will be run as +# ``gcov ... -o .gcda``. + #============================================================================= # Copyright 2014-2015 Kitware, Inc. @@ -56,7 +64,7 @@ include(CMakeParseArguments) function(ctest_coverage_collect_gcov) set(options "") set(oneValueArgs TARBALL SOURCE BUILD GCOV_COMMAND) - set(multiValueArgs "") + set(multiValueArgs GCOV_EXTRA_OPTIONS) cmake_parse_arguments(GCOV "${options}" "${oneValueArgs}" "${multiValueArgs}" "" ${ARGN} ) if(NOT DEFINED GCOV_TARBALL) @@ -113,11 +121,18 @@ function(ctest_coverage_collect_gcov) get_filename_component(gcov_dir ${gcda_file} DIRECTORY) # run gcov, this will produce the .gcov file in the current # working directory + if(NOT DEFINED GCOV_GCOV_EXTRA_OPTIONS) + set(GCOV_GCOV_EXTRA_OPTIONS -b) + endif() execute_process(COMMAND - ${gcov_command} -b -o ${gcov_dir} ${gcda_file} + ${gcov_command} ${GCOV_GCOV_EXTRA_OPTIONS} -o ${gcov_dir} ${gcda_file} OUTPUT_VARIABLE out + RESULT_VARIABLE res WORKING_DIRECTORY ${coverage_dir}) endforeach() + if(NOT "${res}" EQUAL 0) + message(STATUS "Error running gcov: ${res} ${out}") + endif() # create json file with project information file(WRITE ${coverage_dir}/data.json "{ ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake From kwrobot at kitware.com Sat Jan 31 00:01:18 2015 From: kwrobot at kitware.com (Kitware Robot) Date: Sat, 31 Jan 2015 00:01:18 -0500 (EST) Subject: [Cmake-commits] CMake branch, master, updated. v3.1.1-984-g83ae27d Message-ID: <20150131050118.A4CF9AA9F6@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, master has been updated via 83ae27dcd18a746af35434bede9e3a7ee0aeef9b (commit) from a01f81b9064a31760787bc6a2fb9305ef97117e7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=83ae27dcd18a746af35434bede9e3a7ee0aeef9b commit 83ae27dcd18a746af35434bede9e3a7ee0aeef9b Author: Kitware Robot AuthorDate: Sat Jan 31 00:01:16 2015 -0500 Commit: Kitware Robot CommitDate: Sat Jan 31 00:01:16 2015 -0500 CMake Nightly Date Stamp diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 85ec73e..34d59bb 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 20150130) +set(CMake_VERSION_PATCH 20150131) #set(CMake_VERSION_RC 1) ----------------------------------------------------------------------- Summary of changes: Source/CMakeVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- CMake From steveire at gmail.com Sat Jan 31 15:20:36 2015 From: steveire at gmail.com (Stephen Kelly) Date: Sat, 31 Jan 2015 15:20:36 -0500 (EST) Subject: [Cmake-commits] CMake branch, next, updated. v3.1.1-2533-g951b4a3 Message-ID: <20150131202036.77901AAA16@public.kitware.com> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake". The branch, next has been updated via 951b4a382df85ca097859fdfb81bb3a6b886a0b9 (commit) via 68b5b23b3bd948ec15f2ebed2154db8ab50f66e9 (commit) from 143e6f73a66c7d942c428269c39b6b994d67aa3b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=951b4a382df85ca097859fdfb81bb3a6b886a0b9 commit 951b4a382df85ca097859fdfb81bb3a6b886a0b9 Merge: 143e6f7 68b5b23 Author: Stephen Kelly AuthorDate: Sat Jan 31 15:20:35 2015 -0500 Commit: CMake Topic Stage CommitDate: Sat Jan 31 15:20:35 2015 -0500 Merge topic 'GNU-5-CXX14' into next 68b5b23b Features: Update GNU 5.0 C++14 features. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=68b5b23b3bd948ec15f2ebed2154db8ab50f66e9 commit 68b5b23b3bd948ec15f2ebed2154db8ab50f66e9 Author: Stephen Kelly AuthorDate: Sat Jan 31 21:16:12 2015 +0100 Commit: Stephen Kelly CommitDate: Sat Jan 31 21:16:12 2015 +0100 Features: Update GNU 5.0 C++14 features. Trunk already has these features and they are listed in the status page. Also confirmed manually by running trunk. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 5fc3deb..d18adaf 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -6,6 +6,8 @@ set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404") set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L") set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}") +set(_cmake_feature_test_cxx_relaxed_constexpr "${GNU50_CXX14}") +set(_cmake_feature_test_cxx_aggregate_default_initializers "${GNU50_CXX14}") # GNU 4.9 in c++14 mode sets __cplusplus to 201300L, so don't test for the # correct value of it below. ----------------------------------------------------------------------- Summary of changes: Modules/Compiler/GNU-CXX-FeatureTests.cmake | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- CMake